cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: connection not resuming

From: Mads Martin Joergensen <mmj_at_mmj.dk>
Date: Tue, 4 Mar 2008 19:03:39 +0100

* Daniel Stenberg <daniel_at_haxx.se> [Mar 04. 2008 16:42]:
> >>> it's been waiting n seconds on a server reply?
> >>
> >> A suitable libcurl option is CURLOPT_CONNECTTIMEOUT.
> >
> > But when reading the manual it says:
> >
> > The number of seconds to wait whilst trying to connect. Use 0 to wait
> > indefinitely.
> >
> > And my netstat shows my connections in ESTABLISHED. Wouldn't that render
> > the CURLOPT_CONNECTTIMEOUT wrong, since the cmd-line manual says:
>
> Oh, right. I didn't read your question properly it seems. You're right, that
> timeout will not be what you want. But libcurl provides no particular timeout
> for the "connected but not yet provided any data" state.

ACK. We might provide some kind of timer ourselves if needed.

> > We're contemplating a combination of --speed-time and --speed-limit,
> > but we're wondering if it only reports the speed if it recieves
> > data, or it does all the time.
>
> Those values don't "report" speeds at all, but I figure you mean to ask if
> they will take effect immediately or at a certain point, and the answer is
> (I think) that they start working immediately after the connection is
> established.

We would set --speed-limit to 1 kb/sec and --speed-time to a low time,
and that way have curl give up. Because if there's no data flowing, the
speed will be 0 kb/sec for some time.

Or do I misunderstand the way those works?

-- 
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
 and totally illogical, with just a little bit more effort?"
                                 -- A. P. J.
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-03-04