cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: can't connect to server when linked with pthreads

From: Marshall Crocker <marshall_at_iconux.org>
Date: Tue, 01 Aug 2006 14:27:22 -0500

>> Have you tried disabling features in libcurl to see if you can get a
>> stripped-down version working? I found I needed to configure with
>> --disable-ipv6 --disable-shared --disable-largefile to get my uClibc
>> builds working (see the autobuilds page) but that's without pthreads.

> Did you have to do that to get curl to work at all? Curl works fine for
> me with the options I have configured, just not with pthreads. It may
> be helpful to try and disable some of those options anyway though....
>

Disabling ipv6 and largefile didn't help. I have straced my app though
and found where the problem is. I don't know why I'm seeing this
behavior though:

[pid 18072] connect(6, {sa_family=AF_INET, sin_port=htons(80),
sin_addr=inet_addr("X.X.X.X")}, 16) = -1 EINPROGRESS (Operation now in
progress)
[pid 18072] getsockopt(6, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
[pid 18072] close(6) = 0
[pid 18072] gettimeofday({315612625, 807595}, NULL) = 0
[pid 18072] time([315612625]) = 315612625
[pid 18072] rt_sigaction(SIGPIPE, {SIG_DFL}, {SIG_IGN}, 8) = 0
[pid 18072] gettimeofday({315612625, 846259}, NULL) = 0
[pid 18072] rt_sigprocmask(SIG_BLOCK, [CHLD], [RTMIN], 8) = 0
[pid 18072] rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0
[pid 18072] rt_sigprocmask(SIG_SETMASK, [RTMIN], NULL, 8) = 0
[pid 18072] nanosleep({20, 0}, <unfinished ...>

As you can see, immediately after the getsockopt, close is called. When
I don't have pthreads linked, I see a poll on 6, getsockopt, and then
send(6, "POST"...). So something is closing the socket before the send.
Any ideas? This is driving me crazy.

Marshall
Received on 2006-08-01