Skip to content

Commit

Permalink
CONNECT: close proxy connections that fail to CONNECT
Browse files Browse the repository at this point in the history
This is usually due to failed auth. There's no point in us keeping such
a connection alive since it shouldn't be re-used anyway.

Bug: http://curl.haxx.se/bug/view.cgi?id=1381
Reported-by: Marcel Raad
  • Loading branch information
bagder committed Aug 25, 2014
1 parent 2603618 commit 36a7638
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/http_proxy.c
Expand Up @@ -554,10 +554,16 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
conn->bits.proxy_connect_closed = TRUE;
infof(data, "Connect me again please\n");
}
else if(data->req.newurl) {
/* this won't be used anymore for the CONNECT so free it now */
free(data->req.newurl);
data->req.newurl = NULL;
else {
if(data->req.newurl) {
/* this won't be used anymore for the CONNECT so free it now */
free(data->req.newurl);
data->req.newurl = NULL;
}
/* failure, close this connection to avoid re-use */
connclose(conn, "proxy CONNECT failure");
Curl_closesocket(conn, conn->sock[sockindex]);
conn->sock[sockindex] = CURL_SOCKET_BAD;
}

/* to back to init state */
Expand Down

0 comments on commit 36a7638

Please sign in to comment.