diff options
author | Conny Seifert <conny.martin@t-systems.com> | 2021-01-18 15:01:05 +0000 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2021-04-11 14:05:28 +0300 |
commit | c9675185b64e4d97c8c83eb775b79dd86b36120a (patch) | |
tree | 23b7e40bb44021e74796042b975cbb4990f97221 | |
parent | 2840bb37178fe0b15a33213a75c6c3afc4b56a36 (diff) | |
download | apk-tools-c9675185b64e4d97c8c83eb775b79dd86b36120a.tar.gz apk-tools-c9675185b64e4d97c8c83eb775b79dd86b36120a.tar.bz2 apk-tools-c9675185b64e4d97c8c83eb775b79dd86b36120a.tar.xz apk-tools-c9675185b64e4d97c8c83eb775b79dd86b36120a.zip |
libfetch: fix parsing of proxy response to CONNECT requests
Instead of skipping just one line, properly parse the response headers.
[TT: reworded commit message]
(cherry picked from commit b1935a1e79854b332b04916a2829b0c09d1b26c9)
-rw-r--r-- | libfetch/http.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/libfetch/http.c b/libfetch/http.c index 7141b98..95c57f6 100644 --- a/libfetch/http.c +++ b/libfetch/http.c @@ -725,11 +725,6 @@ http_connect(struct url *URL, struct url *purl, const char *flags, int *cached) http_seterr(conn->err); goto ouch; } - /* Read and discard the rest of the proxy response */ - if (fetch_getln(conn) < 0) { - fetch_syserr(); - goto ouch; - } do { switch ((h = http_next_header(conn, &p))) { case hdr_syserror: @@ -741,7 +736,7 @@ http_connect(struct url *URL, struct url *purl, const char *flags, int *cached) default: /* ignore */ ; } - } while (h < hdr_end); + } while (h > hdr_end); } if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && fetch_ssl(conn, URL, verbose) == -1) { |