EAGAIN error in socket_send()[mod_fastcgi-2.4.6] call

Santosh Mankar <[email protected]> Tue, 25 Sep 2012 11:34:27 +0530
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <CAFGhAspDd5WFRpj5wOvzbxq6MisLwKAwC1g5ghgdWOczNhJxXw@mail.gmail.com>
--===============2554898498815406094==
Content-Type: multipart/alternative; boundary=f46d0401fba39135ba04ca807a5e

--f46d0401fba39135ba04ca807a5e
Content-Type: text/plain; charset=ISO-8859-1

Hi All,

I am using httpd-2.2.22/mod_fastcgi-2.4.6/fcgi-2.4.0 on Solaris10 OS.
some times I am getting EAGAIN error in socket_send() call present in
mod_fastcgi-2.4.6 and file name is fcgi_buf.c.

code for socket_send() function is as follows:

static int socket_send(int fd, char * buf, int len)
{
    int bytes_sent;
    do {
        bytes_sent = write(fd, buf, len);
        if (bytes_sent < 0)
        {
#ifdef EWOULDBLOCK
            ASSERT(errno != EWOULDBLOCK);
#endif
#ifdef EAGAIN
            ASSERT(errno != EAGAIN);
#endif
        }
    }
    while (bytes_sent == -1 && errno == EINTR);
    return bytes_sent;
}

I dont want to abort sending data if EAGAIN error pops up.
Can we handle EAGAIN/EWOULDBLOCK error and continue with the loop?
same case present for sock_recv() call also.

Thanks,
Santosh

--f46d0401fba39135ba04ca807a5e
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>Hi All,</div>
<div>=A0</div>
<div>I am using httpd-2.2.22/mod_fastcgi-2.4.6/fcgi-2.4.0 on Solaris10 OS.<=
/div>
<div>some times I am getting EAGAIN error in socket_send() call present in =
mod_fastcgi-2.4.6 and file name is fcgi_buf.c.</div>
<div>=A0</div>
<div>code for socket_send() function is as follows:</div>
<div>=A0</div>
<div>static int socket_send(int fd, char * buf, int len)<br>{<br>=A0=A0=A0 =
int bytes_sent;</div>
<div>=A0=A0=A0 do {<br>=A0=A0=A0=A0=A0=A0=A0 bytes_sent =3D write(fd, buf, =
len);</div>
<div>=A0=A0=A0=A0=A0=A0=A0 if (bytes_sent &lt; 0)<br>=A0=A0=A0=A0=A0=A0=A0 =
{<br>#ifdef EWOULDBLOCK<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ASSERT(errno !=
=3D EWOULDBLOCK);<br>#endif<br>#ifdef EAGAIN<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0 ASSERT(errno !=3D EAGAIN);<br>#endif<br>=A0=A0=A0=A0=A0=A0=A0 }<br>=
=A0=A0=A0 }<br>=A0=A0=A0 while (bytes_sent =3D=3D -1 &amp;&amp; errno =3D=
=3D EINTR);</div>

<div>=A0=A0=A0 return bytes_sent;<br>}</div>
<div>=A0</div>
<div>I dont want to abort sending data if EAGAIN error pops up. </div>
<div>Can we handle EAGAIN/EWOULDBLOCK error and continue with the loop?</di=
v>
<div>same case present for sock_recv() call also.</div>
<div>=A0</div>
<div>Thanks,</div>
<div>Santosh</div>

--f46d0401fba39135ba04ca807a5e--

--===============2554898498815406094==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
FastCGI-developers mailing list
FastCGI-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org
http://mailman.fastcgi.com/mailman/listinfo/fastcgi-developers

--===============2554898498815406094==--