curl-users
RE: speeding up curl
Date: Fri, 1 Aug 2003 15:14:16 +0200 (CEST)
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/01Received on 2003-08-01