cURL / Mailing Lists / curl-library / Single Mail


Re: php curl_exec won't return any data, libcurl-, php 5.3.4, WampServer2.1d-x64.exe

From: Daniel Stenberg <>
Date: Fri, 11 Feb 2011 09:32:01 +0100 (CET)

On Fri, 11 Feb 2011, Tolas Anon wrote:

>> (Yes, curl should warn if such an option is used without it having an
>> effect but it doesn't...)
> well, i respectfully disagree.

I welcome dicussions and arguments to prove me wrong. Or whatever that helps
to improve our code or project.

> curl and libcurl on windows should support this option in a way that works,
> by default.

We've discussed that in the past and we've decided not to. Keep-alive is not
only a feature, it also changes the behavior in ways TCP isn't necessarily
meant to work. TCP handles a broken and repaired connection just fine without

It is also very easy for an application to enable the options as I've shown.

The flaky support in various operating systems of course makes it
"interesting" too.

> as it stands, i'm left completely in the dark for something that i don't
> consider an unreasonable use-case.

Perhaps, but that's not libcurl's fault I claim.

> i'm open to any solution you can think of, aside from switching to linux,
> because that doesn't support my 3-monitor setup..

I already suggested a way. Although I'm not sure what control Windows allows
on the TCP keep-alive timers etc.

But then I've not seen you actually having verified that our suspicions are
the real reasons for the no data case.

> and how come i can send a byte back on the text/html level every 25
> seconds, yet curl and libcurl
> a) just ignore them until the connection is completely closed

That's not what libcurl does. If that was indeed what you tried to do, then I
believe your test was flawed. libcurl simply reads the data that arrives over
the TCP connection as soon as it arrives.

> b) don't see them as keep-alive traffic on the shortests of real internet
> paths?

libcurl doesn't see anything as "keep-alive traffic", that's not libcurl's
business to care about.

If something is killing your idle connections it is not libcurl so it's not
libcurl you have to convince the connection is still alive.

> please don't take my criticism as an insult

I don't. I see it as a failed understanding from your behalf on what
keep-alive is and which role libcurl has in all this. Possibly because you've
taken a shortcut and you discuss this with us libcurl hackers directly when
you're in fact using PHP/CURL which is (at least) one layer on top of libcurl.

> i have good respect for free-software builders. i put out some free software
> of my own too and know about frustrating edge-cases for what seems finished
> software.

Software is never finished. It can be more or less mature, but it never gets
bugfree or feature-complete as long as there are users and developers around.

I've never claimed libcurl is finished, bugfree or feature-complete and I
don't think anyone else can claim so either. Our docs KNOWN_BUGS, TODO and
more should help out to make the picture clear.

> i'm just growing more desperate by the mail here, because i'm left without
> any way to do big media imports into my cms, on a flexible infrastructure,
> or even at all it seems now.

I can sympathize with your problem, but I think you can do a lot better to
actually proceed. By for example figuring out exactly what's happening and by
trying to address the keep-alive issue in the correct place.

List admin:
Received on 2011-02-11