cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: resuming a paused multi session

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 30 Dec 2010 23:21:46 +0100 (CET)

On Wed, 29 Dec 2010, Steve Roskowski wrote:

> When data is available, I do a curl_easy_pause(handle, CURLPAUSE_CONT).
> This correctly changes the session keepon state back to running, but does
> not cause a new socket_callback to add the sending fd back into the poll
> loop.

Hm, that does seem like a bug to me. Any chance you can produce a small app
for us to repeat this problem with to help us debug and fix this problem?

> A solution that works is to do a curl_multi_socket_all(), which forces a
> handle rescan and the resulting socket_callback, but it is deprecated. I do
> not link handles to sockets (the poll loop works only on sockets, the curl
> logic only on handles), and I don't know an easy way of making the
> relationship anyway... so I cannot use curl_multi_socket_action without the
> socket.

> Am I missing something?

I don't think so. I think we should "just work" with this use-case, and your
work-around is indeed great as in that it is a good thing that you can make it
work with the existing code.

curl_multi_socket_all() is an enormous overhead if you have 10000 connections
and only unpause one of them so it's really not a long-term solution for this.

> Alternatively, is there an easy way to get the socket out of the handle (int
> sock =-1; curl_easy_getinfo(handle, CURLINFO_LASTSOCKET, &sock) leaves sock
> at -1) as it allow me to use socket_action with the specific socket.

No, your callback is supposed to get all existing used sockets so there should
be no reason for your app to query for it.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-12-30