git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG?] git http connection reuse

From
Daniel Stenberg <daniel@haxx.se>
Date
Feb 18, 2014, 07:13 UTC
Message-ID
<alpine.DEB.2.00.1402180806070.15465@tvnag.unkk.fr>
In-Reply-To
<20140217235625.GB20499@sigill.intra.peff.net>
On Mon, 17 Feb 2014, Jeff King wrote:
> Right; I'd expect multiple connections for parallel requests, but in this 
> case we are completing the first and removing the handle before starting the 
> second. Digging further, I was able to reproduce the behavior with a simple 
> program:

Yeah, given your description I had no problems to repeat it either. Turns out we had no decent test case that checked for this so in our eagerness to fix a security problem involving "over-reuse" we broke this simpler reuse case. Two steps forward, one step backward... :-/

Show 7 quoted lines
> The manpage for curl_multi_add_handle does say:
>
>  When an easy handle has been added to a multi stack, you can not
>  and you must not use curl_easy_perform(3) on that handle!
>
> Does that apply to the handle after it has finished its transaction and been 
> removed from the multi object (in which case git is Doing It Wrong)?

No it doesn't. The man page should probably be clarified to express that slightly better. It just means that _while_ a handle is added to a multi handle it cannot be used with curl_easy_perform().

So yes, you can remove indeed it from the handle and then do curl_easy_perform(). It works just fine!

Several internal caches are kept in the multi handle when that's used though, so when getting the easy handle out after having used it with the multi interface and then using it with the easy interface may cause libcurl to do a little more work than if you would be able to re-add it to the same multi handle do to the operation with that...

-- 
  / daniel.haxx.se
Previous: Jeff KingNext: Jeff King
Message 7 of 11 in “[BUG?] git http connection reuse”
  1. Jeff KingFeb 16, 2014
  2. Kyle J. McKayFeb 16, 2014
  3. Daniel StenbergFeb 16, 2014
  4. Daniel StenbergFeb 16, 2014
  5. Jeff KingFeb 17, 2014
  6. Jeff KingFeb 17, 2014
  7. Daniel StenbergFeb 18, 2014
  8. Jeff KingFeb 18, 2014
  9. Daniel StenbergFeb 18, 2014
  10. Daniel StenbergFeb 18, 2014
  11. http: never use curl_easy_performJeff King, Feb 18, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.