From 700340cb901be6c8dbd0aec06f739f96ab8dd558 Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Mon, 17 May 2021 10:50:25 -0500 Subject: Add SOUP_ENABLE_HTTP2 env var HTTP2 will be disabled by default and can be opt-in by setting this env var to any value. --- libsoup/soup-session.c | 5 +++-- tests/http2-test.c | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c index 80a1bb0a..f2ac9876 100644 --- a/libsoup/soup-session.c +++ b/libsoup/soup-session.c @@ -1788,8 +1788,9 @@ get_connection_for_host (SoupSession *session, return conn; } - force_http1 = soup_message_get_force_http1 (item->msg); - if (g_getenv ("SOUP_FORCE_HTTP1")) + if (g_getenv ("SOUP_ENABLE_HTTP2")) + force_http1 = soup_message_get_force_http1 (item->msg); + else force_http1 = TRUE; for (conns = host->connections; conns; conns = conns->next) { diff --git a/tests/http2-test.c b/tests/http2-test.c index f7828bfc..d5c75c43 100644 --- a/tests/http2-test.c +++ b/tests/http2-test.c @@ -561,6 +561,8 @@ main (int argc, char **argv) return 1; } + g_setenv ("SOUP_ENABLE_HTTP2", "1", TRUE); + g_test_add ("/http2/basic/async", Test, NULL, setup_session, do_basic_async_test, -- cgit v1.2.1