cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: CURL loops infinitely when cable is pulled out.

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

Hi,

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
either.

Thanks again,

Regards,
Sonia.

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] 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
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