Skip to content

fix dumb-http fetch with alternates

Jeff King git 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3http: factor out curl result code normalizationhttp.c http.h+21 -60 replies
2/3http: normalize curl results for dumb loose and alternates fetcheshttp-walker.c t/t5550-http-fetch-dumb.sh+24 -00 replies
3/3http: use normalize_curl_result() instead of manual conversionhttp-walker.c+2 -110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] fix dumb-http fetch with alternates
Quoted 14 lines · Jeff King
Quoted 11 lines · Eric Wong
Quoted 4 lines

Weird. I had set http.maxrequests to "1" to give more readable output from GIT_CURL_VERBOSE, etc. It fails with that setting, but not with the default of 5. Which certainly seems like a bug, but one that has been there for a while (at least since v2.9.x, which I tested).

I couldn't reproduce an error after porting your patch to master (commit 041f5ea1cf987a40 "The third batch"):
https://80x24.org/spew/[email protected]/raw

So you might've hit an ephemeral error (bad connection, HTTP server restarting, etc).

Quoted 7 lines

No, it was quite reproducible. Curious, I decided to bisect. The problem started in ad75ebe5b3 (http: maintain curl sessions, 2009-11-27), but was later fixed by your 2abc848d54 (http: always remove curl easy from curlm session on release, 2016-09-13).

So trying to build the fix directly on 17966c0a63d (which is in between those) will run into this unrelated bug. But forward-porting does work.

Here's the patch, forward-ported on top of the current master, with actual commit messages, a test, and a few subtle tweaks around the curl_errorstr handling.

[1/3]: http: factor out curl result code normalization
[2/3]: http: normalize curl results for dumb loose and alternates fetches [3/3]: http: use normalize_curl_result() instead of manual conversion

 http-walker.c              | 21 ++++++++++-----------
 http.c                     | 18 ++++++++++++------
 http.h                     |  9 +++++++++
 t/t5550-http-fetch-dumb.sh | 16 ++++++++++++++++
 4 files changed, 47 insertions(+), 17 deletions(-)