]> git.ipfire.org Git - thirdparty/git.git/commit - http.c
http: factor out curl result code normalization
authorJeff King <peff@peff.net>
Sun, 24 Mar 2019 12:08:38 +0000 (08:08 -0400)
committerJunio C Hamano <gitster@pobox.com>
Sun, 24 Mar 2019 12:22:40 +0000 (21:22 +0900)
commita3722bcbbd850bf02aea19d58de112ef513cb2f1
tree16f7cba4769ea47f38bea6cefb729bcfb7ceb5c2
parent041f5ea1cf987a4068ef5f39ba0a09be85952064
http: factor out curl result code normalization

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: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http.c
http.h