curl-users
Re: make test hanging on Cygwin
Date: Thu, 10 Nov 2005 00:05:08 +0100 (CET)
On Wed, 9 Nov 2005, Eugene Kotlyarov wrote:
> 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
Does this change make the tests work?
If so, how come curl works fine on cygwin in general use without this fix?
Further, to discover that the connection is closed, we must read from the
connection. Why would we read from it if 'select_res' hasn't signalled that
there is data to read?
We need further details and research before we can do a wild patch like that.
-- Commercial curl and libcurl Technical Support: http://haxx.se/curl.htmlReceived on 2005-11-10