cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How bad is "Empty reply from server" ?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 14 Feb 2008 22:32:11 +0100 (CET)

On Thu, 14 Feb 2008, jérôme Muffat-Méridol wrote:

> If one of my objects is destroyed while downloading, it attempts to
> cancel it by calling:
> - curl_multi_remove_handle (which seems to do the actual cancelling)
> - curl_easy_cleanup
>
> This works well, except in one case : if I cancel a request between
> the time it was sent to the HTTP server and the time we have received
> something back.
>
> I'm getting a failf(data, "Empty reply from server");
> in Curl_http_done (because readbytecount==0, headerbytecount==0 and
> deductheadercount==0)
> coming from the call "conn->handler->done" in Curl_done
> coming from curl_multi_remove_handle

When this is done, the argument 'premature' is set TRUE isn't it?

I really think a correct fix is to not do the do "Empty reply"-check if this
is done prematurely, since it makes little sense warning for no content when
the transport was deliberately cancelled.

IOW, please tell us if this patch fixes the problem for you!

--- lib/http.c 31 Jan 2008 12:04:33 -0000 1.360
+++ lib/http.c 14 Feb 2008 21:31:30 -0000
@@ -1832,7 +1832,8 @@
    if(status != CURLE_OK)
      return (status);

- if(!conn->bits.retry &&
+ if(!premature &&
+ !conn->bits.retry &&
       ((http->readbytecount +
         data->req.headerbytecount -
         data->req.deductheadercount)) <= 0) {

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2008-02-14