From 524e6999e3945dd0831797ea2f6ac2065e2549b9 Mon Sep 17 00:00:00 2001 From: Duncaen Date: Mon, 8 Apr 2019 13:47:03 +0200 Subject: [PATCH] xbps: add https proxy patch --- srcpkgs/xbps/patches/fix-https-proxy.patch | 52 ++++++++++++++++++++++ srcpkgs/xbps/template | 2 +- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/xbps/patches/fix-https-proxy.patch diff --git a/srcpkgs/xbps/patches/fix-https-proxy.patch b/srcpkgs/xbps/patches/fix-https-proxy.patch new file mode 100644 index 0000000000..860c245b3a --- /dev/null +++ b/srcpkgs/xbps/patches/fix-https-proxy.patch @@ -0,0 +1,52 @@ +From 07ec982b078f8672c8cdbb42bf2e861c969ab40b Mon Sep 17 00:00:00 2001 +From: Duncaen +Date: Mon, 8 Apr 2019 13:16:53 +0200 +Subject: [PATCH] lib/fetch/http.c: ignore headers after CONNECT response + +--- + lib/fetch/http.c | 19 ++++++++++++++++++- + 1 file changed, 18 insertions(+), 1 deletion(-) + +diff --git lib/fetch/http.c lib/fetch/http.c +index dcc7bf7d..cb27905e 100644 +--- lib/fetch/http.c ++++ lib/fetch/http.c +@@ -721,6 +721,8 @@ http_connect(struct url *URL, struct url *purl, const char *flags, int *cached) + { + struct url *curl; + conn_t *conn; ++ const char *p; ++ hdr_t h; + int af, verbose; + #ifdef TCP_NOPUSH + int val; +@@ -759,10 +761,25 @@ http_connect(struct url *URL, struct url *purl, const char *flags, int *cached) + http_cmd(conn, "\r\n"); + + if (http_get_reply(conn) != HTTP_OK) { ++ http_seterr(conn->err); + fetch_close(conn); + return (NULL); + } +- http_get_reply(conn); ++ /* Read and discard the rest of the proxy response */ ++ do { ++ switch ((h = http_next_header(conn, &p))) { ++ case hdr_syserror: ++ fetch_syserr(); ++ fetch_close(conn); ++ return (NULL); ++ case hdr_error: ++ http_seterr(HTTP_PROTOCOL_ERROR); ++ fetch_close(conn); ++ return (NULL); ++ default: ++ /* ignore */ ; ++ } ++ } while (h > hdr_end); + } + if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && + fetch_ssl(conn, URL, verbose) == -1) { +-- +2.21.0 + diff --git a/srcpkgs/xbps/template b/srcpkgs/xbps/template index 11c4fc940a..645ea39e14 100644 --- a/srcpkgs/xbps/template +++ b/srcpkgs/xbps/template @@ -1,7 +1,7 @@ # Template file for 'xbps' pkgname=xbps version=0.53 -revision=8 +revision=9 bootstrap=yes build_style=configure short_desc="The XBPS package system utilities"