# [PATCH] http-fetch: Disable use of curl multi support for libcurl < 7.16.

3 messages from 2007-05-02 to 2007-05-02. Participants: Alexandre Julliard, Junio C Hamano.
Thread: https://gitlist.dev/t/7946

## Alexandre Julliard, 2007-05-02 12:53

Subject: [PATCH] http-fetch: Disable use of curl multi support for libcurl < 7.16.
Message-ID: <87slafs7y4.fsf@wine.dyndns.org>
URL: https://gitlist.dev/e/87slafs7y4.fsf%40wine.dyndns.org

```
curl_multi_remove_handle() is broken in libcurl < 7.16, in that it
doesn't correctly update the active handles count when a request is
aborted. This causes the transfer to hang forever waiting for the
handle count to become less than the number of active requests.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
 http.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/http.h b/http.h
index 324fcf4..69b6b66 100644
--- a/http.h
+++ b/http.h
@@ -6,7 +6,7 @@
 #include <curl/curl.h>
 #include <curl/easy.h>
 
-#if LIBCURL_VERSION_NUM >= 0x070908
+#if LIBCURL_VERSION_NUM >= 0x071000
 #define USE_CURL_MULTI
 #define DEFAULT_MAX_REQUESTS 5
 #endif
-- 
1.5.2.rc1.4.g8c87-dirty

-- 
Alexandre Julliard
julliard@winehq.org

```

## Junio C Hamano, 2007-05-02 18:42

Subject: Re: [PATCH] http-fetch: Disable use of curl multi support for libcurl < 7.16.
Message-ID: <7vfy6f3w3w.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vfy6f3w3w.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <87slafs7y4.fsf@wine.dyndns.org>

```
Alexandre Julliard <julliard@winehq.org> writes:

> curl_multi_remove_handle() is broken in libcurl < 7.16, in that it
> doesn't correctly update the active handles count when a request is
> aborted. This causes the transfer to hang forever waiting for the
> handle count to become less than the number of active requests.

Is there a changelog entry for release 7.16 that you can point
at in your commit log message?

It's not that I do not believe you, but I'd feel happier to see
independent success stories/confirmation, as I do not know if we
have broken non-multi codepath lately.  How many people still use
the non-multi codepath I wonder?

List?

```

## Alexandre Julliard, 2007-05-02 19:47

Subject: Re: [PATCH] http-fetch: Disable use of curl multi support for libcurl < 7.16.
Message-ID: <87647bros8.fsf@wine.dyndns.org>
URL: https://gitlist.dev/e/87647bros8.fsf%40wine.dyndns.org
In-Reply-To: <7vfy6f3w3w.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano <junkio@cox.net> writes:

> Alexandre Julliard <julliard@winehq.org> writes:
>
>> curl_multi_remove_handle() is broken in libcurl < 7.16, in that it
>> doesn't correctly update the active handles count when a request is
>> aborted. This causes the transfer to hang forever waiting for the
>> handle count to become less than the number of active requests.
>
> Is there a changelog entry for release 7.16 that you can point
> at in your commit log message?

The changelog for curl 7.16.0 contains this under Bugfixes:

* the 'running_handles' counter wasn't always updated properly when
  curl_multi_remove_handle() was used

The corresponding fix in the curl CVS is in lib/multi.c rev 1.97:

----------------------------
revision 1.97
date: 2006-08-25 15:53:22 +0200;  author: bagder;  state: Exp;  lines: +5 -1;  commitid: owXRUkUb5VvSmeKr;
Armel Asselin reported that the 'running_handles' counter wasn't updated
properly if you removed a "live" handle from a multi handle with
curl_multi_remove_handle().
----------------------------

The problem is relatively easy to reproduce (though it's not
systematic, depends on network timings) by cloning the Wine repository
at http://source.winehq.org/git/wine.git. The symptoms are that it
hangs after printing 'walk 4eea356e2d39f1a958afb4d8f5b54381e8972ecf'.

It was reported by a Wine developer who couldn't clone the tree with
http; he confirmed that upgrading to curl 7.16 fixed it for him. I'm
also able to clone it successfully with a http-fetch built without
multi support.

-- 
Alexandre Julliard
julliard@winehq.org

```
