cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Odd Pause During HTTPS POST

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 5 Mar 2003 17:57:12 +0100 (CET)

On Wed, 5 Mar 2003, Seth Ladd wrote:

> > When no more data comes it will consider the upload done. Of course, if
> > you then initiates a second transfer the stream of data on the stdin has
> > stopped and then libcurl will hang in the fread() waiting for more data
> > to arrive.
>
> Hmm... well, since I'm not using stdin, could it be related. Before the
> above curl_easy_setopt calls, I fopen the file. At the end of that, I
> fclose it, then unlink it.

Right, sorry for my confusing matters. You're right.

> All of that, however, is in a function that is called over and over. Could
> it be that curl's internal fread (from transfer.c) isn't setting its
> counters correctly? It's probably waiting for more data instead of
> starting back at the beginning for every call of perform.

It just calls the libc's fread(), and it uses the handle you've passed to it.
libcurl doesn't affect that at all so if you see a "hang" here, it is because
fread() hangs... I don't understand why.

To be honest, it looks more as if there is a bug in your program that
overwrites some memory or something that causes this. I can't be sure of this
of course.

> I'll see if I can whittle down the existing code. I would image that the
> above code, w/ the fopen and fclose all placed in a loop, then that loop
> called quickly would do it.

Well, can you write up such a little test app and see if it does and if so
post the source here?

> Oh, even if I make my own function that I give to CURL_READDATA, I get same
> results. This makes sense, though, because my READDATA function just calls
> fread exactly how transfer.c does.

Correct.

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.com
Received on 2003-03-05