cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Connection killed right after connect, Expire Cleared / Curl Error 56

From: m0n0 <ole_at_monochrom.net>
Date: Sat, 09 Oct 2010 01:35:48 +0200

Am Freitag, den 08.10.2010, 22:37 +0200 schrieb Daniel Stenberg
<daniel_at_haxx.se>:

> For non-blocking connections, the POSIX rule is that when that socket
> turns writable, the connection is complete. That's just how things
> work and we have to abide to those rules.

OK, than this is an bug within the kernel.

>
>> 4. I assume that curl verifies the connection by checking if sending data to > the socket would block.
>
> Not exactly. After doing a non-blocking connect and the socket turned
> writable, the lib/connect.c:verifyconnect() function is called and
> that will query the TCP/IP stack by asking for the SO_ERROR variable
> from the SOL_SOCKET using getsockopt() just to make sure there was no
> error signalled.

But just because the connection setup isn't complete, it doesn't mean
getsockopt() has to return an error, right? At least with FreeMiNT there
is no error returned during connection setup.

>
> Before that, recv() will not be called since the connection isn't
> completed yet and it wouldn't make sense. But OTOH, doing recv() on
> the non-blocking non-connected socket wouldn't return anything either.

On freemint it returns ENOTCONN.

>
> If that is truly what happens, then I claim it is a socket API bug.

Okay, just wanted to make that sure before anything gets changed.

Thanks for the reply & greets,
m
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-10-09