[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 02/219: multi: improved HTTP_1_1_REQUIRED handling
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 02/219: multi: improved HTTP_1_1_REQUIRED handling |
Date: |
Wed, 22 May 2019 19:15:41 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit dbce1bd86f58468a59df8c2d678a6f9c506d1804
Author: Daniel Stenberg <address@hidden>
AuthorDate: Wed Mar 27 23:28:13 2019 +0100
multi: improved HTTP_1_1_REQUIRED handling
Make sure to downgrade to 1.1 even when we get this HTTP/2 stream error
on first flight.
Reported-by: niner on github
Fixes #3696
Closes #3707
---
lib/multi.c | 37 +++++++++++++++++++------------------
1 file changed, 19 insertions(+), 18 deletions(-)
diff --git a/lib/multi.c b/lib/multi.c
index cc16924a3..22d79b5d2 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -1881,23 +1881,25 @@ static CURLMcode multi_runsingle(struct Curl_multi
*multi,
}
}
else if((CURLE_HTTP2_STREAM == result) &&
- Curl_h2_http_1_1_error(data->conn)) {
+ Curl_h2_http_1_1_error(data->conn)) {
CURLcode ret = Curl_retry_request(data->conn, &newurl);
- infof(data, "Forcing HTTP/1.1 for NTLM");
- data->set.httpversion = CURL_HTTP_VERSION_1_1;
-
- if(!ret)
- retry = (newurl)?TRUE:FALSE;
- else
- result = ret;
-
- if(retry) {
- /* if we are to retry, set the result to OK and consider the
- request as done */
+ if(!ret) {
+ infof(data, "Downgrades to HTTP/1.1!\n");
+ data->set.httpversion = CURL_HTTP_VERSION_1_1;
+ /* clear the error message bit too as we ignore the one we got */
+ data->state.errorbuf = FALSE;
+ if(!newurl)
+ /* typically for HTTP_1_1_REQUIRED error on first flight */
+ newurl = strdup(data->change.url);
+ /* if we are to retry, set the result to OK and consider the request
+ as done */
+ retry = TRUE;
result = CURLE_OK;
done = TRUE;
}
+ else
+ result = ret;
}
if(result) {
@@ -1942,13 +1944,12 @@ static CURLMcode multi_runsingle(struct Curl_multi
*multi,
}
else
follow = FOLLOW_RETRY;
- result = multi_done(data, CURLE_OK, FALSE);
+ (void)multi_done(data, CURLE_OK, FALSE);
+ /* multi_done() might return CURLE_GOT_NOTHING */
+ result = Curl_follow(data, newurl, follow);
if(!result) {
- result = Curl_follow(data, newurl, follow);
- if(!result) {
- multistate(data, CURLM_STATE_CONNECT);
- rc = CURLM_CALL_MULTI_PERFORM;
- }
+ multistate(data, CURLM_STATE_CONNECT);
+ rc = CURLM_CALL_MULTI_PERFORM;
}
free(newurl);
}
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [gnurl] 02/219: multi: improved HTTP_1_1_REQUIRED handling,
gnunet <=