cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Multi handle and boost asio, wont finish

From: stuxxn <stuxxn_at_gmail.com>
Date: Tue, 25 Feb 2014 16:39:51 +0100

Hey guys,

downloading pages from exisiting servers works just fine now.
But if i try to connnect to host that refuses the connection
like: "http://127.0.0.1/" the multi handle blocks again.

this is what its doing:

add easy to multi stack
curl::mulit - onCurlTimer: set new timer -> 1 ms
finished add easy to multi stack
new request easy handle: 00529128
timer called by asio
Hostname was NOT found in DNS cache
open socket (by curl): 144
   Trying 127.0.0.1...
Adding handle: conn: 0x533688
Adding handle: send: 0
Adding handle: recv: 0
Curl_addHandleToPipeline: length: 1
- Conn 0 (0x533688) send_pipe: 1, recv_pipe: 0
start async: action 2
curl::mulit - onCurlTimer: set new timer -> 224 ms
timer called by asio
timeout_ms <= 0
timer called by asio

my async_write wont get fired because im not connected nor does a
timeout gets triggered.
I also tried the "curl-asio" library and its example you mentiond. It
has the same bug.

Same problems occures if i connection to a host that dont write anything.
like "ncat -l -p 80"

Is this asios fault because i wont report an error if i try to write to
an unconnected socket?

Greetings
stuxxn

On 2/25/2014 12:54 PM, Bram de Jong wrote:
> This might also be interesting...
>
> https://github.com/mologie/curl-asio
>
> - bram
>
> On 2/25/2014 12:37 PM, Thomas Sanchez wrote:
>> http://curl.haxx.se/mail/lib-2014-02/0232.html :)
>>
>> 2014-02-25 10:12 GMT+01:00 stuxxn <stuxxn_at_gmail.com>:
>>> Hi,
>>>
>>> at the monent i try to use the mulit handle with boost asio.
>>> I followed the example "asiohiper" and it works with with about 1 or
>>> 2 urls
>>> at the same time. But if i add about 10 urls to one multi handle and
>>> call
>>> ioService.run() it wont finish.
>>>
>>> I logged all the calls it does and there is one strange thing:
>>>
>>> A normal flow looks in the log like this:
>>>
>>> Line 140: new request easy handle: 00B30068
>>> Line 174: is socket ready? (by curl):
>>> (easy|sock|acction):00B30068 -
>>> 428 - 2
>>> Line 246: is socket ready? (by curl):
>>> (easy|sock|acction):00B30068 -
>>> 428 - 1
>>> Line 356: is socket ready? (by curl):
>>> (easy|sock|acction):00B30068 -
>>> 428 - 4
>>> Line 359: curl::multi - checkMultiInfo: handle finished:
>>> 00B30068 -
>>> 0
>>> Line 361: removing easy handle reqeust: 00B30068
>>>
>>> And the one that doesnt finish:
>>>
>>> Line 147: new request easy handle: 00B39080
>>> Line 171: is socket ready? (by curl):
>>> (easy|sock|acction):00B39080 -
>>> 424 - 2
>>> Line 236: is socket ready? (by curl):
>>> (easy|sock|acction):00B39080 -
>>> 424 - 1
>>>
>>>
>>> Line 170: open socket (by curl): 424
>>> Line 171: is socket ready? (by curl):
>>> (easy|sock|acction):00B39080 -
>>> 424 - 2
>>> Line 172: start async: 424
>>> Line 234: end async: 424 - 2
>>> Line 235: sock action available: 424 - 2
>>> Line 236: is socket ready? (by curl):
>>> (easy|sock|acction):00B39080 -
>>> 424 - 1
>>> Line 237: start async: 424
>>> Line 343: end async: 424 - 1
>>> Line 344: sock action available: 424 - 1
>>>
>>> It looks like curl cant read the whole page with one read but wont
>>> ask me to
>>> test for another read readiness.
>>>
>>> I also enabled verbose on the easy handles and only thing i can see
>>> there is
>>> that the unfinished easy handle doesnt write the whole page.
>>>
>>> Does someone know why it wont ask for read readiness again if i cant
>>> read
>>> the whole page?
>>>
>>> Greetings
>>> -------------------------------------------------------------------
>>> List admin: http://cool.haxx.se/list/listinfo/curl-library
>>> Etiquette: http://curl.haxx.se/mail/etiquette.html
>>
>>
>>
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-02-25