This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Query: issue with cygwin-curl 7.15.0 - cannot close some connections


Soh Kam Yung wrote:

> Brian,

Please send all questions about using the Cygwin curl packages to the
cygwin (at) cygwin.com mailing list, which I follow.  Please do not
email me personally.

> I have been using curl under cygwin and noticed an issue with closing
> of connections with some websites and ftp sites.
> ...
> > curl --verbose ftp://ftp.kernel.org/
> ...
> < 150 Here comes the directory listing.
> drwxrwx---    2 536      528          4096 May 21  2001 for_mirrors_only
> drwx------    2 0        0           16384 Oct 02 09:20 lost+found
> drwxrwsr-x    9 536      536          4096 Sep 26 22:48 pub
> lrwxrwxrwx    1 0        0               1 Oct 03 04:41 usr -> .
> lrwxrwxrwx    1 0        0              10 Oct 03 04:41 welcome.msg ->
> pub/README
> 
> At this point, curl waits and waits and doesn't close the connection
> 
> I have noticed this happening with ftp sites and some websites that
> provide chunked data after doing a login using data provided by curl.
> 
> Do you have any ideas what might be happening?

I was able to reproduce this.  What's happening is that curl goes into
an endless loop where it calls poll() repeatedly, thinking that there is
more data to read, trying to read it, finding nothing, and repeating --
you can observe the curl process taking all the CPU during the hang.

The reason that it apparently did not realize that the connection had
been terminated was that the Cygwin poll() was returning 1 with the 
POLLHUP bit set in 'revents'.  But curl was not aware of this bit and
only looked for POLLIN, so it got confused, which caused the infinite
loop.

This was changed several weeks ago in Cygwin by this:
<http://cygwin.com/ml/cygwin-cvs/2005-q4/msg00077.html> which means that
if you use a recent snapshot (and presumably the forthcoming 1.5.19
release) you should not experience the problem.

I'm debating whether it would be a good idea to put out an updated curl
that checks for POLLHUP to get things working again with older cygwins.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]