cURL / Mailing Lists / curl-library / Single Mail

curl-library

question on HTTP PUT with unknown data size

From: <RBramante_at_on.com>
Date: Wed, 6 Nov 2002 12:53:11 -0500

I have several cases where the amount of data I am putting to the server is
from a compression stream so I do not know the total amount of data to be
written beforehand. In this case, I call curl_easy_setopt(curl_handle,
CURLOPT_INFILESIZE, 0) before the curl_easy_perform(). This does work,
however I notice a delay of approx 60 seconds between my
CURLOPT_READFUNCTION handler returning 0 to signal end-of-file to curl, and
the return of curl_easy_perform().

Obviously, when I set CURLOPT_INFILESIZE to a valid size when known there
is no such delay.

I tried to take a quick peek at Curl_readwrite() but admittedly got lost
stepping through it.

Any ideas of why the delay or shall I dig back into Curl_readwrite() and
have another look? I assumed the behavior of curl would be the same when
the handler returned 0 vs. reading up to a provided CURLOPT_INFILESIZE but
that doesn't seem to be the case. I guess the question is how does the
client signal the server of eof when there is no Content-Length? via
shutdown() on the socket?

P.S. This is with 7.9.8

-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
Received on 2002-11-06