cURL / Mailing Lists / curl-library / Single Mail


Re: Help w/ HTTP file upload [bug?]

From: Ryan M. Lederman <>
Date: Tue, 15 Dec 2009 15:24:30 -0700

> Please don't top-post! (see the etiquette link)
> After doing some debugging, it seems like even defining
>> USE_BLOCKING_SOCKETS is not causing a synchronous call to send() to occur.
> That's just some old rubbish remainders from past experiments. You can't do
> anything in libcurl with blocking sockets, but then I also don't see how
> that is a concern of yours. That's not where your problem lies.
> If I do some debug output when doing HTTP form-based uploading, my
>> callback gets called all the way from 0% to 100% in about 2msec. It THEN is
>> called at one second intervals *at 100% every time.*
> The times aren't very interesting, but the sizes are. The question is why.
> Can you produce an example code for us that repeats this problem?
> --
> /

Daniel, if you take a look at Screenie, you can see the problem in action.
The progress callback simply does not work for HTTP form-based uploads; I
mean, I could write an example app but all you have to do is observe the
output of mine...

I don't see how you don't think the times are interesting. Since you call
the progress callback each time you call send() (and it's non-blocking), the
receiving callback thinks the whole file was uploaded in a matter of a few
milliseconds (no matter the size), then is called erroneously @ 100% several
times while the buffer is actually sent out on the wire.

For now I will use a spinning progress meter or something, as I cannot
really afford to spend time becoming familiar enough with libcurl to fix it.

Thanks for the otherwise awesome lib though! Saved me a lot of time.

"Liberty can not be preserved without a general knowledge among the people."
- John Adams
-- Ryan M. Lederman

List admin:
Received on 2009-12-15