cURL / Mailing Lists / curl-library / Single Mail


RE: CURL loops infinitely when cable is pulled out.

From: Sonia Subramanian <>
Date: Tue, 24 Apr 2007 14:08:05 -0700


Thanks. I was not sure what other implications there might be and
thought mine was safer. I was not sure why it should be freed there

Thanks again,


-----Original Message-----
[] On Behalf Of Daniel Stenberg
Sent: Tuesday, April 24, 2007 1:50 PM
To: libcurl development
Cc: Charlotte Chang; Robert Spath; Shalu Jain
Subject: RE: CURL loops infinitely when cable is pulled out.

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
that range data. I can't see how that can be right, even though I added
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

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

  Commercial curl and libcurl Technical Support:
Received on 2007-04-24