summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/http_proxy.c
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2023-03-22 14:58:20 +0300
committerdartraiden <wowemuh@gmail.com>2023-03-22 15:00:13 +0300
commit95538ee3e112abd86c963c246d994a533d2b366d (patch)
tree03bca2a3cac1da684e43d95aab0fffd9236cbcf9 /libs/libcurl/src/http_proxy.c
parent7c3c13800855033b8d5c5ffe08b3586456fa0b7b (diff)
libcurl: update to 8.0.1
Diffstat (limited to 'libs/libcurl/src/http_proxy.c')
-rw-r--r--libs/libcurl/src/http_proxy.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libs/libcurl/src/http_proxy.c b/libs/libcurl/src/http_proxy.c
index b10429e6a9..6d2435feaf 100644
--- a/libs/libcurl/src/http_proxy.c
+++ b/libs/libcurl/src/http_proxy.c
@@ -403,7 +403,6 @@ static CURLcode on_resp_header(struct Curl_cfilter *cf,
{
CURLcode result = CURLE_OK;
struct SingleRequest *k = &data->req;
- int subversion = 0;
(void)cf;
if((checkprefix("WWW-Authenticate:", header) &&
@@ -461,11 +460,14 @@ static CURLcode on_resp_header(struct Curl_cfilter *cf,
STRCONST("Proxy-Connection:"),
STRCONST("close")))
ts->close_connection = TRUE;
- else if(2 == sscanf(header, "HTTP/1.%d %d",
- &subversion,
- &k->httpcode)) {
+ else if(!strncmp(header, "HTTP/1.", 7) &&
+ ((header[7] == '0') || (header[7] == '1')) &&
+ (header[8] == ' ') &&
+ ISDIGIT(header[9]) && ISDIGIT(header[10]) && ISDIGIT(header[11]) &&
+ !ISDIGIT(header[12])) {
/* store the HTTP code from the proxy */
- data->info.httpproxycode = k->httpcode;
+ data->info.httpproxycode = k->httpcode = (header[9] - '0') * 100 +
+ (header[10] - '0') * 10 + (header[11] - '0');
}
return result;
}