cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: make test hanging on Cygwin

From: Eugene Kotlyarov <ekot_at_narod.ru>
Date: Wed, 09 Nov 2005 23:42:07 +0300

Daniel Stenberg wrote:
>> I've attached all files from tests/log directory for the second test.
>> Any ideas why this happen and how to fix it?
>
> It seems the server considers the response sent but curl never gets
> anything.
Yes, I've found out that it fails only on tests that have swsclose command.

I've tracked it down to Curl_readwrite function, here we have following lines:
     /* If we still have reading to do, we check if we have a readable
        socket. */
     if((k->keepon & KEEP_READ) && (select_res & CSELECT_IN)) {

When server closes connection (select_res & CSELECT_IN) condition becomes
false so it does no further reading from socket but also does not quit. If
comment this condition then on next read from socket curl gets 0 bytes and
understands that it should quit.
Maybe make it conditional like this
#ifdef __CYGWIN__
     if((k->keepon & KEEP_READ)) {
#else
     if((k->keepon & KEEP_READ) && (select_res & CSELECT_IN)) {
#endif
Received on 2005-11-09