cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: very slow input from stdin

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 23 Apr 2003 19:41:56 +0200 (CEST)

On Wed, 23 Apr 2003 Bryan_Kemp_at_Dell.com wrote:

> I don't know how much of a difference it makes but the command line should
> have been (me and my fat fingers....)
> echo -en 1 | curl -T - http://someserver/directory/filex.txt -H
> "Content-length: 1"
>
> We use this to update a status on a web server.

Why do you set the custom header for this command? curl will automaticly
enable chunked transfer-encoding for this operation, since the size of the
data is not known when it comes from stdin, and then the Content-length
header makes the request very strange (and not http-compliant).

Another approach to circumvent this whole problem would be to make the
command like this instead:

 echo -en 1 > /tmp/done && curl -T /tmp/done \
http://someserver/directory/filex.txt && rm /tmp/done

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-04-23