cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: "pull" aspect of multi interface not quite working properly

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 3 Jul 2007 23:25:23 +0200 (CEST)

On Mon, 2 Jul 2007, Allen Pulsifer wrote:

>> Thanks, but this patch doesn't address the return codes from curl_multi_*
>> functions
>
> It does. That is in the two lines:

[...]

> I might not have done it right, but it does address it.

Oh, indeed. Sorry about that. I'm sloppier than normal now when I'm on
vacation! ;-O

>> nor my concerns about the extra recv() calls this approach will cause when
>> doing SSH-based uploads (due to data_pending() working like it does).
>
> I have no understanding what this concern is about. I can't see how the
> modification could possibly cause extra recv calls because the code is no
> different in that respect.

Yes it is. Previously it would only check that (call the underlying function)
when it had already done some reading, now it calls the underlying function as
part of the actual check, and that is potentially done quite a lot of times
before it really has something to deliver.

> it still executes the same loop body whenever data_pending() is true.

Yes, but it calls data_pending() many times more often if there's no download
to do (yet) but only an upload.

data_pending() itself may lead to a recv() call when there's nothing to
download, and in the existing code before your patch, it is only called
_after_ data has already been read so there aren't that very many extra recv()
calls.

Of course, another way to avoid the recv() call would be if libssh2 had a
function for us to call to let us know if it has more data or not, as that
could let us avoid the recv() call "in vain" like this.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-07-03