cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: No callbacks during POST

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 6 Jul 2007 23:34:04 +0200 (CEST)

On Wed, 4 Jul 2007, Raf Nulens wrote:

> using libcurl version 7.16.0 (win32) we are experiencing following problem:
> when uploading binary data using POST the upload stops after having sent a
> few bytes (without having received a read- or socket-callback). So we
> repeaditly have to call curl_multi_socket_all to send the next part of the
> buffer.

So if you can get it to continue sending, what exactly does it mean when you
say "the upload stops" ?

> We have investigated this problem and it seems there is something wrong in
> transfer.c function CURLcode Curl_readwrite(struct connectdata *conn, bool
> *done) on line 1358 -> bool writedone=TRUE; It seems that writedone is
> initialized on true, and the only value writedone gets assigned is true...
> So the while loop (line 1369 to 1513 -> while(!writedone); ) can only be
> executed once.

That is, in fact, on purpose.

> Purpose of the while loop is to keep sending data until the buffer is empty
> or an EWOULDBLOCK is returned from the socket. In our case in the first
> (and only) iteration there is some data sent from the buffer to the socket,
> but not enough to get an EWOULDBLOCK back.

The (original) purpose of the loop was that, yes. But having it present
introduced problems, especially if you'd upload to somewhere that was fast
enough so that this loop more or less never blocked...

So I made it never loop and only execute once, and we've been happy with that
since ages ago. The question is rather why you feel a need to change this now
all of a sudden!?

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-07-06