[libsoup] session: never try to reuse a connection in IN_USE state in http/1.x
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] session: never try to reuse a connection in IN_USE state in http/1.x
- Date: Sat, 22 May 2021 16:58:49 +0000 (UTC)
commit 180069c57977f86e06d16ea453488158fea5b793
Author: Carlos Garcia Campos <cgarcia igalia com>
Date: Sat May 22 18:57:12 2021 +0200
session: never try to reuse a connection in IN_USE state in http/1.x
libsoup/soup-session.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index 32d3ec04..68d7a026 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -1794,16 +1794,18 @@ get_connection_for_host (SoupSession *session,
force_http1 = TRUE;
for (conns = host->connections; conns; conns = conns->next) {
+ SoupHTTPVersion http_version;
+
conn = conns->data;
- if (force_http1 && soup_connection_get_negotiated_protocol (conn) > SOUP_HTTP_1_1)
+ http_version = soup_connection_get_negotiated_protocol (conn);
+ if (force_http1 && http_version > SOUP_HTTP_1_1)
continue;
switch (soup_connection_get_state (conn)) {
case SOUP_CONNECTION_IN_USE:
- if (!need_new_connection && soup_connection_is_reusable (conn)) {
+ if (!need_new_connection && http_version == SOUP_HTTP_2_0 &&
soup_connection_is_reusable (conn))
return conn;
- }
break;
case SOUP_CONNECTION_IDLE:
if (!need_new_connection && soup_connection_is_idle_open (conn))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]