cURL / Mailing Lists / curl-library / Single Mail

curl-library

one second delay in HTTP PUT

From: Gary Lawrence Murphy <garym_at_teledyn.com>
Date: Mon, 22 Sep 2008 10:44:03 -0400

This is a repost that I had mistakenly sent to the main curl-users
list; Dan suggested I move the thread here.

The issue is a one-second delay seen before the body transfer; the
remote server does respond with 100-continue and receives an ACK very
quickly after that, but then pauses one second before sending the
body. This is observed (using tcpdump) on all PUT transfers, using
Debian libcurl3 7.15.5-1etch1

I've tried building a new debian-etch package from source tarballs,
but I'm not very expert at this and I am having troubles with the
buildpackage dying on "lib/ldap.c:428: undefined reference to
`ber_free'" -- I am naively using the default dh_make scripts building
a "library" package.

Unfortunately I do not have a dev environment for the target
production machines, so a pre-built package is highly desireable.
Does anyone have more recent debian binary lib packages that I can
try?

On Sun, Sep 21, 2008 at 1:59 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> Are you saying curl gets a 100-continue back but are still waiting the
> 1000ms until it continues? I've not seen that happen myself.

yes, that is exactly what I am seeing in the packet dumps. From my original
 email:

> 3. 18:05:34.976442: client sends an HTTP response which contains
> "(HTTP/1.1 100 Continue"
>
> 4. 18:05:35.065209: client receives ACK from libcurl server
>
> 5. 18:05:36.065523: client receives the HTTP body from libcurl

notice that 5 is nearly exactly one second AFTER libcurl has ACK'd the
100-continue message.

> Here's the sequence of curl library calls:
>
> curl = curl_easy_init();
> if (!curl) return NULL;
>
> curl_easy_setopt(curl, CURLOPT_DNS_CACHE_TIMEOUT, 150);
> curl_easy_setopt(curl, CURLOPT_TIMEOUT, RESTIMEOUT);
> curl_easy_setopt(curl, CURLOPT_MAXCONNECTS, 1);
> curl_easy_setopt(curl, CURLOPT_FRESH_CONNECT, TRUE);
>
> curl_easy_setopt(curl, CURLOPT_READDATA, mem_buffer);
> curl_easy_setopt(curl, CURLOPT_URL, target);
> curl_easy_setopt(curl, CURLOPT_UPLOAD, TRUE) ;
>
> curl_easy_setopt(curl, CURLOPT_FORBID_REUSE, TRUE);
> sprintf( string, "Content-Type: text/xml; charset=\"%s\"", charset);
> slist = curl_slist_append(slist, string );
> curl_easy_setopt(curl, CURLOPT_HTTPHEADER, slist);
> curl_easy_setopt(curl, CURLOPT_INFILESIZE, file_size);
> res = curl_easy_perform(curl);

if you were wondering, yes, this is a closed-circuit setting, hence no auth ;)
Received on 2008-09-22