cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: CURL loops infinitely when cable is pulled out.

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 24 Apr 2007 22:50:14 +0200 (CEST)

On Mon, 23 Apr 2007, Sonia Subramanian wrote:

> I think everywhere else resume from is converted to range even if range was
> not specified.
>
> The ConnectionExists executes after that

The problem is thus that when Curl_disconnect() is called, it frees some of
that range data. I can't see how that can be right, even though I added the
code and the comment makes it sounds as if it is right. Closing a single
connection should not mess up the easy-specific data that can be used by other
connections.

I propose the following change for your problem instead of yours:

diff -u -r1.612 url.c
--- lib/url.c 24 Apr 2007 10:18:06 -0000 1.612
+++ lib/url.c 24 Apr 2007 20:49:26 -0000
@@ -1830,16 +1830,6 @@
    Curl_expire(data, 0); /* shut off timers */
    Curl_hostcache_prune(data); /* kill old DNS cache entries */

- /*
- * The range string is usually freed in curl_done(), but we might
- * get here *instead* if we fail prematurely. Thus we need to be able
- * to free this resource here as well.
- */
- if(data->reqdata.rangestringalloc) {
- free(data->reqdata.range);
- data->reqdata.rangestringalloc = FALSE;
- }
-
    if((conn->ntlm.state != NTLMSTATE_NONE) ||
       (conn->proxyntlm.state != NTLMSTATE_NONE)) {
      /* Authentication data is a mix of connection-related and sessionhandle-

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