• Jeff King's avatar
    http: factor out curl result code normalization · a3722bcb
    Jeff King authored
    We make some requests with CURLOPT_FAILONERROR and some without, and
    then handle_curl_result() normalizes any failures to a uniform CURLcode.
    
    There are some other code paths in the dumb-http walker which don't use
    handle_curl_result(); let's pull the normalization into its own function
    so it can be reused.
    
    Arguably those code paths would benefit from the rest of
    handle_curl_result(), notably the auth handling. But retro-fitting it
    now would be a lot of work, and in practice it doesn't matter too much
    (whatever authentication we needed to make the initial contact with the
    server is generally sufficient for the rest of the dumb-http requests).
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    a3722bcb
http.h 7.09 KB