cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: hangs up of application above libcurl

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 3 Dec 2008 16:51:31 +0100 (CET)

On Wed, 3 Dec 2008, Igor Novoseltsev wrote:

Please don't top-post.

> But before that I would like to get your opinion regarding the phenomena
> itself:
>
> On READ event libcurl neither reads from the socket nor registers for the
> READ event again. Is it legal flow?

It doesn't sound like that, no. When libcurl is waiting for a read event, it
should have called the app using the socket callback saying so, so that the
app will wait for a READ event and properly call libcurl when such an event
arrives.

> In the attached log you can see, that the Curl_read() (look for "Curl_read")
> was not called after the last READ (look for "events=0x1") event.

When curl_multi_socket_action() is called with the READ action bit set,
lib/multi.c:multi_runsingle() will be called and if the handle is then in the
PERFORM state it will call Curl_readwrite() that will act according to the
bits you passed to curl_multi_socket_action().

> I suspect that the READ event that was ignored stands for the received
> response.

What is curl_multi_socket_action() doing then when you call it with the READ
action bit set? In what state is the multi handle at that point?

-- 
  / daniel.haxx.se
Received on 2008-12-03