curl-users
[ curl-Bugs-732841 ] EAGAIN/EINTR not checked after on recv in Transfer.c
Date: Mon, 05 May 2003 11:25:49 -0700
Bugs item #732841, was opened at 2003-05-05 11:25
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=732841&group_id=976
Category: libcurl
Group: wrong behaviour
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Daniel Stenberg (bagder)
Summary: EAGAIN/EINTR not checked after on recv in Transfer.c
Initial Comment:
occurs on hpux 11+
line 373: - this was not fixed (should check for EAGAIN)
========================
#endif
#ifdef KRB4
if(conn->sec_complete)
nread = Curl_sec_read(conn, sockfd, buf, buffersize);
else
#endif
nread = sread (sockfd, buf, buffersize);
if(-1 == nread) {
#ifdef WIN32
if(WSAEWOULDBLOCK == GetLastError())
#else
if(EWOULDBLOCK == errno)
#endif
return -1;
}
line 260: - this was fixed (see EAGAIN)
========================
#ifdef KRB4
if(conn->sec_complete) {
bytes_written = Curl_sec_write(conn, sockfd, mem,
len);
}
else
#endif /* KRB4 */
{
bytes_written = swrite(sockfd, mem, len);
}
if(-1 == bytes_written) {
#ifdef WIN32
if(WSAEWOULDBLOCK == GetLastError())
#else
/* As pointed out by Christophe Demory on March
11 2003, errno
may be EWOULDBLOCK or on some systems
EAGAIN when it returned
due to its inability to send off data without
blocking. We
therefor treat both error codes the same here */
if((EWOULDBLOCK == errno) || (EAGAIN == errno))
#endif
{
/* this is just a case of EWOULDBLOCK */
*written=0;
return CURLE_OK;
}
}
Furthermore, both should check for EINTR and handle it
the same way...
this will result in an 'Empty Reply' if EAGAIN is raised.
Thanks,
Kevin Delafield
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=732841&group_id=976
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-05-05