cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HP-UX Bug Fix

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 14 Mar 2003 09:52:41 +0100 (CET)

On Thu, 13 Mar 2003, Rick Jones wrote:

> I would have thought that if non-blocking was being used, that a function
> that would be trying to write data to a socket would only be called if
> something like select or poll stated that the socket was writeable, in
> which case I would expect at least one byte to be written.

That is the general idea, yes.

> However, looking at the code swrite is part of Curl_write, and there are at
> least some places where Curl_write will be called in a loop until all is
> written, but there appears to be no intervening select/poll call.

[snipped out source code]

> If the socket buffer is full, this would simply sit and spin for however
> long it took to get the socket buffer empty. Doubleplusungood. (Unless I'm
> missing something about the conditions in which Curl_sendf is called?)

You're right, this is a task still left to fix. It is mentioned in the TODO:

 * Make sure we don't ever loop because of non-blocking sockets return
   EWOULDBLOCK or similar. This FTP command sending, the SSL connection etc.

I am in a slow progress of removing these loops one by one, but it'll take
time until all of them are gone. Help is appreciated.

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
Received on 2003-03-14