[libsoup/carlosgc/default-proxy-http] connection: always handle http proxies




commit 2696fc8ddfd9237f8844452c6f8a12f6a612b97a
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Tue Aug 23 12:21:26 2022 +0200

    connection: always handle http proxies
    
    We don't want glib to handle http proxy connections for us, so also set
    the http application proxy for socket client when using the default
    proxy configuration.
    
    Fixes #294

 libsoup/soup-connection.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/libsoup/soup-connection.c b/libsoup/soup-connection.c
index 39be6b08..5deb3d35 100644
--- a/libsoup/soup-connection.c
+++ b/libsoup/soup-connection.c
@@ -527,13 +527,14 @@ new_socket_client (SoupConnection *conn)
                                  G_CALLBACK (re_emit_socket_event),
                                  conn, 0);
 
-       if (!props->proxy_use_default) {
-               if (props->proxy_resolver) {
-                       g_socket_client_set_proxy_resolver (client, props->proxy_resolver);
-                       g_socket_client_add_application_proxy (client, "http");
-               } else
-                       g_socket_client_set_enable_proxy (client, FALSE);
-       }
+        if (!props->proxy_use_default && !props->proxy_resolver) {
+                g_socket_client_set_enable_proxy (client, FALSE);
+        } else {
+                if (props->proxy_resolver)
+                        g_socket_client_set_proxy_resolver (client, props->proxy_resolver);
+                g_socket_client_add_application_proxy (client, "http");
+        }
+
         if (props->io_timeout)
                 g_socket_client_set_timeout (client, props->io_timeout);
         if (props->local_addr)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]