cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: unpausing an upload

From: Justin Karneges <justin_at_fanout.io>
Date: Mon, 22 Jul 2013 14:27:10 -0700

On Mon, Jul 22, 2013 at 1:38 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Mon, 22 Jul 2013, Justin Karneges wrote:
>
> In examining the source to libcurl, it appears that curl_easy_pause()
>> only sets some internal data and returns. That is, it does not actually run
>> the curl engine.
>>
>
> Hm, yes I think you're right. But libcurl doesn't know what "engine" that
> should be run as the unpausing is done the same way no matter which API
> you're using so it can't know what to do...
>
>
> So, I think I must call some other method immediately after
>> curl_easy_pause() to get things moving again. Any ideas?
>>
>> For the moment I've tried curl_multi_socket_action() with
>> CURL_SOCKET_TIMEOUT which seems to be working, but it feels wrongish.
>>
>
> I think that's perhaps the best way to proceed, and that the best way for
> us is to ducument this as how to do it when using the multi_socket API.
>
> How would you think a way that wouldn't feel "wrongish" would look like or
> work?
>

Well the important thing is to have a method that works at all. When I use
CURL_SOCKET_TIMEOUT, I wonder if curl will only do processing related to
timeouts? But if this method will also process socket activity then maybe
it is fine?

The above approach is a little awkward in that it requires kicking the
entire "multi" engine (which would check all running sessions) just to
unpause a single "easy". I also think it would be ideal if unpausing worked
without having to reference the CURLM at all. In a multi_socket-based app,
this seems to be the only instance where a CURL needs to know about its
owning CURLM. But I guess this relationship needs to be known somewhere,
and if curl itself does not have awareness of this then maybe the app has
no choice.

So I'd say it would be ideal if curl_easy_pause() to "just worked". Failing
that, maybe some curl_multi_socket_proceed(CURLM *, CURL *) method.

-- 
Justin Karneges
Fanout, Inc.
530-220-7222

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-07-22