cURL / Mailing Lists / curl-library / Single Mail

curl-library

a non-blocking IPv6 connect problem

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 2 Oct 2001 13:57:23 +0200 (MET DST)

Hi ho

I'm in need of assistance!

I'm currently doing some rewrites/cleanups of the libcurl TCP connect code.
It now does non-blocking connects and it tries all known IP addresses of any
given hostname. CVS repository adicts have noticed a new source file and
somewhat biggish changes.

However, I'm experiencing some problems with my IPv6 support for non-blocking
connects. The problem is that when I attempt a connect() to a non-listening
(IPv4-) port and get -1 returned, I would assume that I'd get ECONNREFUSED in
errno, but I don't!

Instead, I get EINPROGRESS which serves as an indication that a connection is
being made (asynchronously). I even get a positive return from select()
afterwards (it indicates that the socket becomes writable) as an indication
of a successful connection...!

The same flow works fine for my test machines that don't have IPv6 enabled.
It also works fine if I don't set the socket non-blocking...

The code showing this behaviour is in the CVS right now.

Could this be because of my very old glibc version? I believe I have 2.1.2
(whatever that came with Redhat 6.1 anyway)

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-10-02