[libsoup/wip/http2] Make force http flag private
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/wip/http2] Make force http flag private
- Date: Mon, 17 May 2021 15:40:28 +0000 (UTC)
commit e457c6dfe3568a9a0ca1a930e0e5e96b5e585aad
Author: Patrick Griffis <pgriffis igalia com>
Date: Mon May 17 10:40:20 2021 -0500
Make force http flag private
libsoup/soup-message-private.h | 4 ++++
libsoup/soup-message.c | 19 ++++++++++++++++++-
libsoup/soup-message.h | 3 +--
libsoup/soup-session.c | 4 ++--
4 files changed, 25 insertions(+), 5 deletions(-)
---
diff --git a/libsoup/soup-message-private.h b/libsoup/soup-message-private.h
index ce7fcb46..37b8905f 100644
--- a/libsoup/soup-message-private.h
+++ b/libsoup/soup-message-private.h
@@ -141,4 +141,8 @@ void soup_message_update_request_host_if_needed (SoupMessage *msg);
void soup_message_force_keep_alive_if_needed (SoupMessage *msg);
+void soup_message_set_force_http1 (SoupMessage *msg,
+ gboolean force_http1);
+
+gboolean soup_message_get_force_http1 (SoupMessage *msg);
#endif /* __SOUP_MESSAGE_PRIVATE_H__ */
diff --git a/libsoup/soup-message.c b/libsoup/soup-message.c
index 63c38aa3..46805b50 100644
--- a/libsoup/soup-message.c
+++ b/libsoup/soup-message.c
@@ -93,6 +93,7 @@ typedef struct {
gboolean is_top_level_navigation;
gboolean is_options_ping;
+ gboolean force_http1;
guint last_connection_id;
GSocketAddress *remote_address;
@@ -1501,7 +1502,6 @@ soup_message_cleanup_response (SoupMessage *msg)
* be emitted, if you want to disable authentication for a message use
* soup_message_disable_feature() passing #SOUP_TYPE_AUTH_MANAGER instead.
* @SOUP_MESSAGE_COLLECT_METRICS: Metrics will be collected for this message.
- * @SOUP_MESSAGE_FORCE_HTTP1: Require an HTTP/1.x connection.
*
* Various flags that can be set on a #SoupMessage to alter its
* behavior.
@@ -2694,3 +2694,20 @@ soup_message_force_keep_alive_if_needed (SoupMessage *msg)
soup_message_headers_append (priv->request_headers, "Connection", "Keep-Alive");
}
}
+
+void
+soup_message_set_force_http1 (SoupMessage *msg,
+ gboolean force_http1)
+{
+ SoupMessagePrivate *priv = soup_message_get_instance_private (msg);
+
+ priv->force_http1 = force_http1;
+}
+
+gboolean
+soup_message_get_force_http1 (SoupMessage *msg)
+{
+ SoupMessagePrivate *priv = soup_message_get_instance_private (msg);
+
+ return priv->force_http1;
+}
diff --git a/libsoup/soup-message.h b/libsoup/soup-message.h
index e11ec2d8..93fd9af0 100644
--- a/libsoup/soup-message.h
+++ b/libsoup/soup-message.h
@@ -78,8 +78,7 @@ typedef enum {
SOUP_MESSAGE_NEW_CONNECTION = (1 << 2),
SOUP_MESSAGE_IDEMPOTENT = (1 << 3),
SOUP_MESSAGE_DO_NOT_USE_AUTH_CACHE = (1 << 4),
- SOUP_MESSAGE_COLLECT_METRICS = (1 << 5),
- SOUP_MESSAGE_FORCE_HTTP1 = (1 << 6)
+ SOUP_MESSAGE_COLLECT_METRICS = (1 << 5)
} SoupMessageFlags;
SOUP_AVAILABLE_IN_ALL
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index abfec76a..80a1bb0a 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -1788,7 +1788,7 @@ get_connection_for_host (SoupSession *session,
return conn;
}
- force_http1 = soup_message_query_flags (item->msg, SOUP_MESSAGE_FORCE_HTTP1);
+ force_http1 = soup_message_get_force_http1 (item->msg);
if (g_getenv ("SOUP_FORCE_HTTP1"))
force_http1 = TRUE;
@@ -3823,7 +3823,7 @@ soup_session_websocket_connect_async (SoupSession *session,
/* WebSocket negotiation over HTTP/2 is not currently supported
* and in practice all websocket servers support HTTP1.x with
* HTTP/2 not providing a tangible benefit */
- soup_message_add_flags (msg, SOUP_MESSAGE_FORCE_HTTP1);
+ soup_message_set_force_http1 (msg, TRUE);
item = soup_session_append_queue_item (session, msg, TRUE, cancellable);
item->io_priority = io_priority;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]