cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: speeding up curl

From: Jared Ingersoll <jared_at_cswv.com>
Date: Fri, 1 Aug 2003 09:29:46 -0400

Great feedback. I pulled the content length out and got a response in less
than 3 seconds. Thanks for the help.

jared

-----Original Message-----
From: Daniel Stenberg [mailto:daniel_at_haxx.se]
Sent: Friday, August 01, 2003 9:14 AM
To: Curl Mailinglist
Subject: RE: speeding up curl

On Fri, 1 Aug 2003, Jared Ingersoll wrote:

> I don't think it's network related. I've done a trace as suggested, and it
> looks like the hang-up is around the authentication header.

I disagree. I think it looks as if the server is delaying its reponse.

> /usr/local/bin/curl --trace tracefile.txt -d @data.txt -H "Host:
> www.xyz.com" -H "Authorization: Basic (authstring)" -H "Accept: */*" -H
> "Content-Type: text/plain" -H "Content-Length: 453"
> https://www.xyz.com/csw/servlet/xmlrequest

Three comments on this command line.

Why do you modify the Content-Length header? That just makes it more
error-prone in case you set it to a size that doesn't match the actual
contents you send. This may very well be the reason why you see this delay.

The Authorization: header is much easily set with the --user option, imho.

The Host: header is not doing anything useful in this case, as curl will add
such a Host: header by itself.

> Here's the trace dump:

[Full POST request cut off]

> Here's where the process hangs for 25 seconds, then the rest of the data
is
> transfered in less than 2 seconds:

The fact that the entire request was sent off fine is why I think this looks
like one of two possible reasons:

1. You've ruined the request with a bad content-length header so that the
server is still awaiting more data even though curl is done.

2. The server doesn't like something else in this request and doesn't
respond
swiftly because of this.

> Any ideas? Is there something going on with the authentication header in
> curl? Is there a way to make it one header and not 5?

The "authentication header" ? That is just one line, and you've provided it
using the -H "Authorization" option. What other 5 headers are you referring
to?

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-08-01