http_proxy: only loop on 407 + close if we have credentials

... to fix the retry-loop.

Add test 718 to verify.

Reported-by: Daniel Kurečka
Fixes #6828
Closes #6850
This commit is contained in:
Daniel Stenberg 2021-04-05 12:11:30 +02:00
parent 00b89ec641
commit 605aa03ac1
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 62 additions and 1 deletions

View file

@ -358,7 +358,8 @@ static CURLcode CONNECT(struct Curl_easy *data,
break;
}
else if(gotbytes <= 0) {
if(data->set.proxyauth && data->state.authproxy.avail) {
if(data->set.proxyauth && data->state.authproxy.avail &&
data->state.aptr.proxyuserpwd) {
/* proxy auth was requested and there was proxy auth available,
then deem this as "mere" proxy disconnect */
conn->bits.proxy_connect_closed = TRUE;