From 6fdbb011948cc9fd2cadff04b230427cf02dbd7d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 23 Feb 2006 12:20:48 +0000 Subject: Lots of work and analysis by "xbx___" in bug #1431750 (http://curl.haxx.se/bug/view.cgi?id=1431750) helped me identify and fix two different but related bugs: 1) Removing an easy handle from a multi handle before the transfer is done could leave a connection in the connection cache for that handle that is in a state that isn't suitable for re-use. A subsequent re-use could then read from a NULL pointer and segfault. 2) When an easy handle was removed from the multi handle, there could be an outstanding c-ares DNS name resolve request. When the response arrived, it caused havoc since the connection struct it "belonged" to could've been freed already. Now Curl_done() is called when an easy handle is removed from a multi handle pre-maturely (that is, before the transfer was complteted). Curl_done() also makes sure to cancel all (if any) outstanding c-ares requests. --- lib/hostip.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/hostip.h') diff --git a/lib/hostip.h b/lib/hostip.h index 3baf8284b..62c6721e1 100644 --- a/lib/hostip.h +++ b/lib/hostip.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -82,6 +82,7 @@ #define CURL_ASYNC_SUCCESS ARES_SUCCESS #else #define CURL_ASYNC_SUCCESS CURLE_OK +#define ares_cancel(x) #endif /* -- cgit v1.2.1