aboutsummaryrefslogtreecommitdiff
path: root/lib/http_proxy.c
diff options
context:
space:
mode:
authorZachary Seguin <zachary@zacharyseguin.ca>2017-12-05 22:15:31 -0500
committerDaniel Stenberg <daniel@haxx.se>2017-12-07 09:48:33 +0100
commit55e609890f4b1eb6e909a46f1b56b61e91727fa4 (patch)
tree6394a8d835cfb6f009bdcaec3ad7be09c98a0acf /lib/http_proxy.c
parentc103cac3c82dd4484b375b0a940c22aac6f9be74 (diff)
CONNECT: keep close connection flag in http_connect_state struct
Fixes #2088 Closes #2157
Diffstat (limited to 'lib/http_proxy.c')
-rw-r--r--lib/http_proxy.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/http_proxy.c b/lib/http_proxy.c
index 0283c1f3f..7f5040543 100644
--- a/lib/http_proxy.c
+++ b/lib/http_proxy.c
@@ -167,6 +167,7 @@ static CURLcode connect_init(struct connectdata *conn, bool reinit)
s->line_start = s->connect_buffer;
s->ptr = s->line_start;
s->cl = 0;
+ s->close_connection = FALSE;
return CURLE_OK;
}
@@ -187,7 +188,6 @@ static CURLcode CONNECT(struct connectdata *conn,
struct SingleRequest *k = &data->req;
CURLcode result;
curl_socket_t tunnelsocket = conn->sock[sockindex];
- bool closeConnection = FALSE;
timediff_t check;
struct http_connect_state *s = conn->connect_state;
@@ -529,7 +529,7 @@ static CURLcode CONNECT(struct connectdata *conn,
}
}
else if(Curl_compareheader(s->line_start, "Connection:", "close"))
- closeConnection = TRUE;
+ s->close_connection = TRUE;
else if(checkprefix("Transfer-Encoding:", s->line_start)) {
if(k->httpcode/100 == 2) {
/* A client MUST ignore any Content-Length or Transfer-Encoding
@@ -548,7 +548,7 @@ static CURLcode CONNECT(struct connectdata *conn,
}
else if(Curl_compareheader(s->line_start,
"Proxy-Connection:", "close"))
- closeConnection = TRUE;
+ s->close_connection = TRUE;
else if(2 == sscanf(s->line_start, "HTTP/1.%d %d",
&subversion,
&k->httpcode)) {
@@ -578,10 +578,10 @@ static CURLcode CONNECT(struct connectdata *conn,
/* the connection has been marked for closure, most likely in the
Curl_http_auth_act() function and thus we can kill it at once
below */
- closeConnection = TRUE;
+ s->close_connection = TRUE;
}
- if(closeConnection && data->req.newurl) {
+ if(s->close_connection && data->req.newurl) {
/* Connection closed by server. Don't use it anymore */
Curl_closesocket(conn, conn->sock[sockindex]);
conn->sock[sockindex] = CURL_SOCKET_BAD;
@@ -599,7 +599,7 @@ static CURLcode CONNECT(struct connectdata *conn,
} while(data->req.newurl);
if(data->info.httpproxycode/100 != 2) {
- if(closeConnection && data->req.newurl) {
+ if(s->close_connection && data->req.newurl) {
conn->bits.proxy_connect_closed = TRUE;
infof(data, "Connect me again please\n");
connect_done(conn);