cURL / Mailing Lists / curl-library / Single Mail


Re: Multi handle and boost asio, wont finish

From: Daniel Stenberg <>
Date: Tue, 25 Feb 2014 22:59:42 +0100 (CET)

On Tue, 25 Feb 2014, stuxxn wrote:

Please stop the top-posting, I get a head ache just trying to read this

I also didn't see what libcurl version you're using.

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

It *blocks* ? Sorry but I don't see how that can happen. I assume you mean
that there's a handle in there that doesn't seem to complete?

> 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
> 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

So you never get any event for the new socket that curl created for the TCP
connection? Then libcurl won't know the connect failed! Or am I missing

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

A slow server is not a problem, it is perfectly permissable by both TCP and

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

I don't understand. Who is 'I' here that write to the socket? Aren't you using
libcurl so it will write to the socket by itself? How does asio affect that?
And libcurl won't write to the socket until after it has connected anyway!

List admin:
Received on 2014-02-25