[libsoup/wip/remove-deprecations: 45/77] Remove deprecated SoupSession APIs




commit 569d9356068c6b97240d9e1ef17d610d3fec9d9c
Author: Patrick Griffis <pgriffis igalia com>
Date:   Wed Feb 12 14:13:31 2020 -0800

    Remove deprecated SoupSession APIs

 docs/reference/libsoup-2.4-sections.txt |   2 -
 libsoup/soup-session.c                  | 202 ++------------------------------
 libsoup/soup-session.h                  |   9 --
 tests/context-test.c                    |   7 +-
 tests/no-ssl-test.c                     |  35 ------
 tests/proxy-test.c                      |  25 ++--
 tests/ssl-test.c                        |  63 +---------
 7 files changed, 25 insertions(+), 318 deletions(-)
---
diff --git a/docs/reference/libsoup-2.4-sections.txt b/docs/reference/libsoup-2.4-sections.txt
index 65f4138f..aa97b0c1 100644
--- a/docs/reference/libsoup-2.4-sections.txt
+++ b/docs/reference/libsoup-2.4-sections.txt
@@ -440,7 +440,6 @@ soup_session_websocket_connect_async
 soup_session_websocket_connect_finish
 <SUBSECTION>
 soup_session_prefetch_dns
-soup_session_prepare_for_uri
 soup_session_abort
 <SUBSECTION>
 soup_session_would_redirect
@@ -472,7 +471,6 @@ SOUP_SESSION_MAX_CONNS
 SOUP_SESSION_MAX_CONNS_PER_HOST
 SOUP_SESSION_TLS_DATABASE
 SOUP_SESSION_SSL_USE_SYSTEM_CA_FILE
-SOUP_SESSION_SSL_CA_FILE
 SOUP_SESSION_SSL_STRICT
 SOUP_SESSION_TLS_INTERACTION
 SOUP_SESSION_ASYNC_CONTEXT
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index 6d68c9fb..cfd54fbb 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -98,7 +98,6 @@ typedef struct {
 
        GTlsDatabase *tlsdb;
        GTlsInteraction *tls_interaction;
-       char *ssl_ca_file;
        gboolean ssl_strict;
        gboolean tlsdb_use_default;
 
@@ -173,7 +172,6 @@ G_DEFINE_TYPE_WITH_PRIVATE (SoupSession, soup_session, G_TYPE_OBJECT)
 
 enum {
        REQUEST_QUEUED,
-       REQUEST_STARTED,
        REQUEST_UNQUEUED,
        AUTHENTICATE,
        CONNECTION_CREATED,
@@ -190,8 +188,6 @@ enum {
        PROP_PROXY_RESOLVER,
        PROP_MAX_CONNS,
        PROP_MAX_CONNS_PER_HOST,
-       PROP_USE_NTLM,
-       PROP_SSL_CA_FILE,
        PROP_SSL_USE_SYSTEM_CA_FILE,
        PROP_TLS_DATABASE,
        PROP_SSL_STRICT,
@@ -336,7 +332,6 @@ soup_session_finalize (GObject *object)
 
        g_clear_object (&priv->tlsdb);
        g_clear_object (&priv->tls_interaction);
-       g_free (priv->ssl_ca_file);
 
        g_clear_pointer (&priv->async_context, g_main_context_unref);
        g_clear_object (&priv->local_addr);
@@ -490,12 +485,6 @@ set_tlsdb (SoupSession *session, GTlsDatabase *tlsdb)
                g_object_unref (system_default);
        }
 
-       if (priv->ssl_ca_file) {
-               g_free (priv->ssl_ca_file);
-               priv->ssl_ca_file = NULL;
-               g_object_notify (G_OBJECT (session), "ssl-ca-file");
-       }
-
        if (priv->tlsdb)
                g_object_unref (priv->tlsdb);
        priv->tlsdb = tlsdb;
@@ -524,55 +513,6 @@ set_use_system_ca_file (SoupSession *session, gboolean use_system_ca_file)
        g_clear_object (&system_default);
 }
 
-static void
-set_ssl_ca_file (SoupSession *session, const char *ssl_ca_file)
-{
-       SoupSessionPrivate *priv = soup_session_get_instance_private (session);
-       GTlsDatabase *tlsdb;
-       GError *error = NULL;
-
-       priv->tlsdb_use_default = FALSE;
-       if (!g_strcmp0 (priv->ssl_ca_file, ssl_ca_file))
-               return;
-
-       g_object_freeze_notify (G_OBJECT (session));
-
-       if (g_path_is_absolute (ssl_ca_file))
-               tlsdb = g_tls_file_database_new (ssl_ca_file, &error);
-       else {
-               char *path, *cwd;
-
-               cwd = g_get_current_dir ();
-               path = g_build_filename (cwd, ssl_ca_file, NULL);
-               tlsdb = g_tls_file_database_new (path, &error);
-               g_free (path);
-               g_free (cwd);
-       }
-
-       if (error) {
-               if (!g_error_matches (error, G_TLS_ERROR, G_TLS_ERROR_UNAVAILABLE)) {
-                       g_warning ("Could not set SSL credentials from '%s': %s",
-                                  ssl_ca_file, error->message);
-
-                       tlsdb = g_tls_file_database_new ("/dev/null", NULL);
-               }
-               g_error_free (error);
-       }
-
-       set_tlsdb (session, tlsdb);
-       if (tlsdb) {
-               g_object_unref (tlsdb);
-
-               priv->ssl_ca_file = g_strdup (ssl_ca_file);
-               g_object_notify (G_OBJECT (session), "ssl-ca-file");
-       } else if (priv->ssl_ca_file) {
-               g_clear_pointer (&priv->ssl_ca_file, g_free);
-               g_object_notify (G_OBJECT (session), "ssl-ca-file");
-       }
-
-       g_object_thaw_notify (G_OBJECT (session));
-}
-
 /* priv->http_aliases and priv->https_aliases are stored as arrays of
  * *interned* strings, so we can't just use g_strdupv() to set them.
  */
@@ -635,7 +575,6 @@ soup_session_set_property (GObject *object, guint prop_id,
        SoupSession *session = SOUP_SESSION (object);
        SoupSessionPrivate *priv = soup_session_get_instance_private (session);
        const char *user_agent;
-       SoupSessionFeature *feature;
        GMainContext *async_context;
        gboolean socket_props_changed = FALSE;
 
@@ -661,21 +600,6 @@ soup_session_set_property (GObject *object, guint prop_id,
        case PROP_MAX_CONNS_PER_HOST:
                priv->max_conns_per_host = g_value_get_int (value);
                break;
-       case PROP_USE_NTLM:
-               g_return_if_fail (!SOUP_IS_PLAIN_SESSION (session));
-               feature = soup_session_get_feature (session, SOUP_TYPE_AUTH_MANAGER);
-               if (feature) {
-                       if (g_value_get_boolean (value))
-                               soup_session_feature_add_feature (feature, SOUP_TYPE_AUTH_NTLM);
-                       else
-                               soup_session_feature_remove_feature (feature, SOUP_TYPE_AUTH_NTLM);
-               } else
-                       g_warning ("Trying to set use-ntlm on session with no auth-manager");
-               break;
-       case PROP_SSL_CA_FILE:
-               set_ssl_ca_file (session, g_value_get_string (value));
-               socket_props_changed = TRUE;
-               break;
        case PROP_SSL_USE_SYSTEM_CA_FILE:
                set_use_system_ca_file (session, g_value_get_boolean (value));
                socket_props_changed = TRUE;
@@ -789,7 +713,6 @@ soup_session_get_property (GObject *object, guint prop_id,
 {
        SoupSession *session = SOUP_SESSION (object);
        SoupSessionPrivate *priv = soup_session_get_instance_private (session);
-       SoupSessionFeature *feature;
        GTlsDatabase *tlsdb;
 
        switch (prop_id) {
@@ -811,16 +734,6 @@ soup_session_get_property (GObject *object, guint prop_id,
        case PROP_MAX_CONNS_PER_HOST:
                g_value_set_int (value, priv->max_conns_per_host);
                break;
-       case PROP_USE_NTLM:
-               feature = soup_session_get_feature (session, SOUP_TYPE_AUTH_MANAGER);
-               if (feature)
-                       g_value_set_boolean (value, soup_session_feature_has_feature (feature, 
SOUP_TYPE_AUTH_NTLM));
-               else
-                       g_value_set_boolean (value, FALSE);
-               break;
-       case PROP_SSL_CA_FILE:
-               g_value_set_string (value, priv->ssl_ca_file);
-               break;
        case PROP_SSL_USE_SYSTEM_CA_FILE:
                tlsdb = g_tls_backend_get_default_database (g_tls_backend_get_default ());
                g_mutex_lock (&priv->conn_lock);
@@ -1334,8 +1247,6 @@ soup_session_send_queue_item (SoupSession *session,
                                             "Connection", "Keep-Alive");
        }
 
-       g_signal_emit (session, signals[REQUEST_STARTED], 0,
-                      item->msg, soup_connection_get_socket (item->conn));
        soup_message_starting (item->msg);
        if (item->state == SOUP_MESSAGE_RUNNING)
                soup_connection_send_request (item->conn, item, completion_cb, item);
@@ -2598,32 +2509,6 @@ prefetch_uri (SoupSession *session, SoupURI *uri,
        g_object_unref (addr);
 }
 
-/**
- * soup_session_prepare_for_uri:
- * @session: a #SoupSession
- * @uri: a #SoupURI which may be required
- *
- * Tells @session that @uri may be requested shortly, and so the
- * session can try to prepare (resolving the domain name, obtaining
- * proxy address, etc.) in order to work more quickly once the URI is
- * actually requested.
- *
- * Since: 2.30
- *
- * Deprecated: 2.38: use soup_session_prefetch_dns() instead
- **/
-void
-soup_session_prepare_for_uri (SoupSession *session, SoupURI *uri)
-{
-       g_return_if_fail (SOUP_IS_SESSION (session));
-       g_return_if_fail (uri != NULL);
-
-       if (!uri->host)
-               return;
-
-       prefetch_uri (session, uri, NULL, NULL, NULL);
-}
-
 /**
 * soup_session_prefetch_dns:
 * @session: a #SoupSession
@@ -3043,12 +2928,10 @@ soup_session_class_init (SoupSessionClass *session_class)
         * is emitted, indicating that the session has become aware of
         * the request.
         *
-        * Once a connection is available to send the request on, the
-        * session emits #SoupSession::request_started. Then, various
+        * After a connection is available to send the request various
         * #SoupMessage signals are emitted as the message is
         * processed. If the message is requeued, it will emit
-        * #SoupMessage::restarted, which will then be followed by
-        * another #SoupSession::request_started and another set of
+        * #SoupMessage::restarted, which will then be followed by other
         * #SoupMessage signals when the message is re-sent.
         *
         * Eventually, the message will emit #SoupMessage::finished.
@@ -3056,8 +2939,7 @@ soup_session_class_init (SoupSessionClass *session_class)
         * processing. However, it is possible that the application
         * will requeue the message from the "finished" handler (or
         * equivalently, from the soup_session_queue_message()
-        * callback). In that case, the process will loop back to
-        * #SoupSession::request_started.
+        * callback). In that case the process will loop back.
         *
         * Eventually, a message will reach "finished" and not be
         * requeued. At that point, the session will emit
@@ -3066,9 +2948,9 @@ soup_session_class_init (SoupSessionClass *session_class)
         *
         * To sum up: #SoupSession::request_queued and
         * #SoupSession::request_unqueued are guaranteed to be emitted
-        * exactly once, but #SoupSession::request_started and
-        * #SoupMessage::finished (and all of the other #SoupMessage
-        * signals) may be invoked multiple times for a given message.
+        * exactly once, but #SoupMessage::finished (and all of the
+        * other #SoupMessage signals) may be invoked multiple times
+        * for a given message.
         *
         * Since: 2.24
         **/
@@ -3082,29 +2964,6 @@ soup_session_class_init (SoupSessionClass *session_class)
                              G_TYPE_NONE, 1,
                              SOUP_TYPE_MESSAGE);
 
-       /**
-        * SoupSession::request-started:
-        * @session: the session
-        * @msg: the request being sent
-        * @socket: the socket the request is being sent on
-        *
-        * Emitted just before a request is sent. See
-        * #SoupSession::request_queued for a detailed description of
-        * the message lifecycle within a session.
-        *
-        * Deprecated: 2.50. Use #SoupMessage::starting instead.
-        **/
-       signals[REQUEST_STARTED] =
-               g_signal_new ("request-started",
-                             G_OBJECT_CLASS_TYPE (object_class),
-                             G_SIGNAL_RUN_FIRST,
-                             G_STRUCT_OFFSET (SoupSessionClass, request_started),
-                             NULL, NULL,
-                             NULL,
-                             G_TYPE_NONE, 2,
-                             SOUP_TYPE_MESSAGE,
-                             SOUP_TYPE_SOCKET);
-
        /**
         * SoupSession::request-unqueued:
         * @session: the session
@@ -3342,54 +3201,7 @@ soup_session_class_init (SoupSessionClass *session_class)
                                   0, G_MAXUINT, 60,
                                   G_PARAM_READWRITE |
                                   G_PARAM_STATIC_STRINGS));
-       /**
-        * SoupSession:use-ntlm:
-        *
-        * Whether or not to use NTLM authentication.
-        *
-        * Deprecated: use soup_session_add_feature_by_type() with
-        * #SOUP_TYPE_AUTH_NTLM.
-        **/
-       /**
-        * SOUP_SESSION_USE_NTLM:
-        *
-        * Alias for the #SoupSession:use-ntlm property, qv.
-        **/
-       g_object_class_install_property (
-               object_class, PROP_USE_NTLM,
-               g_param_spec_boolean (SOUP_SESSION_USE_NTLM,
-                                     "Use NTLM",
-                                     "Whether or not to use NTLM authentication",
-                                     FALSE,
-                                     G_PARAM_READWRITE | G_PARAM_DEPRECATED |
-                                     G_PARAM_STATIC_STRINGS));
-       /**
-        * SoupSession:ssl-ca-file:
-        *
-        * File containing SSL CA certificates.
-        *
-        * If the specified file does not exist or cannot be read,
-        * then libsoup will print a warning, and then behave as
-        * though it had read in a empty CA file, meaning that all SSL
-        * certificates will be considered invalid.
-        *
-        * Deprecated: use #SoupSession:ssl-use-system-ca-file, or
-        * else #SoupSession:tls-database with a #GTlsFileDatabase
-        * (which allows you to do explicit error handling).
-        **/
-       /**
-        * SOUP_SESSION_SSL_CA_FILE:
-        *
-        * Alias for the #SoupSession:ssl-ca-file property, qv.
-        **/
-       g_object_class_install_property (
-               object_class, PROP_SSL_CA_FILE,
-               g_param_spec_string (SOUP_SESSION_SSL_CA_FILE,
-                                    "SSL CA file",
-                                    "File containing SSL CA certificates",
-                                    NULL,
-                                    G_PARAM_READWRITE | G_PARAM_DEPRECATED |
-                                    G_PARAM_STATIC_STRINGS));
+
        /**
         * SOUP_SESSION_SSL_USE_SYSTEM_CA_FILE:
         *
diff --git a/libsoup/soup-session.h b/libsoup/soup-session.h
index 46e4e154..92d9ede2 100644
--- a/libsoup/soup-session.h
+++ b/libsoup/soup-session.h
@@ -67,8 +67,6 @@ GType soup_session_get_type (void);
 #define SOUP_SESSION_PROXY_RESOLVER         "proxy-resolver"
 #define SOUP_SESSION_MAX_CONNS              "max-conns"
 #define SOUP_SESSION_MAX_CONNS_PER_HOST     "max-conns-per-host"
-#define SOUP_SESSION_USE_NTLM               "use-ntlm"
-#define SOUP_SESSION_SSL_CA_FILE            "ssl-ca-file"
 #define SOUP_SESSION_SSL_USE_SYSTEM_CA_FILE "ssl-use-system-ca-file"
 #define SOUP_SESSION_TLS_DATABASE           "tls-database"
 #define SOUP_SESSION_SSL_STRICT             "ssl-strict"
@@ -139,13 +137,6 @@ GInputStream   *soup_session_send             (SoupSession           *session,
                                               GCancellable          *cancellable,
                                               GError               **error);
 
-#ifndef SOUP_DISABLE_DEPRECATED
-SOUP_AVAILABLE_IN_2_30
-SOUP_DEPRECATED_IN_2_38_FOR (soup_session_prefetch_dns)
-void            soup_session_prepare_for_uri  (SoupSession           *session,
-                                              SoupURI               *uri);
-#endif
-
 SOUP_AVAILABLE_IN_2_38
 void            soup_session_prefetch_dns     (SoupSession           *session,
                                               const char            *hostname,
diff --git a/tests/context-test.c b/tests/context-test.c
index 567512fe..e1347557 100644
--- a/tests/context-test.c
+++ b/tests/context-test.c
@@ -233,8 +233,7 @@ idle_test2_fail (gpointer user_data)
 }
 
 static void
-multi_request_started (SoupSession *session, SoupMessage *msg,
-                      SoupSocket *socket, gpointer user_data)
+request_started (SoupMessage *msg, gpointer user_data)
 {
        g_object_set_data (G_OBJECT (msg), "started", GUINT_TO_POINTER (TRUE));
 }
@@ -267,8 +266,6 @@ do_multicontext_test (void)
        session = soup_test_session_new (SOUP_TYPE_SESSION_ASYNC,
                                         SOUP_SESSION_USE_THREAD_CONTEXT, TRUE,
                                         NULL);
-       g_signal_connect (session, "request-started",
-                         G_CALLBACK (multi_request_started), NULL);
 
        context1 = g_main_context_new ();
        loop1 = g_main_loop_new (context1, FALSE);
@@ -278,6 +275,7 @@ do_multicontext_test (void)
        g_main_context_push_thread_default (context1);
        msg1 = soup_message_new ("GET", base_uri);
        g_object_ref (msg1);
+       g_signal_connect (msg1, "starting", G_CALLBACK (request_started), NULL);
        soup_session_queue_message (session, msg1, multi_msg_finished, loop1);
        g_signal_connect (msg1, "got-headers",
                          G_CALLBACK (msg1_got_headers), loop1);
@@ -287,6 +285,7 @@ do_multicontext_test (void)
        g_main_context_push_thread_default (context2);
        msg2 = soup_message_new ("GET", base_uri);
        g_object_ref (msg2);
+       g_signal_connect (msg2, "starting", G_CALLBACK (request_started), NULL);
        soup_session_queue_message (session, msg2, multi_msg_finished, loop2);
        g_main_context_pop_thread_default (context2);
 
diff --git a/tests/no-ssl-test.c b/tests/no-ssl-test.c
index c9d9bcad..e67d5250 100644
--- a/tests/no-ssl-test.c
+++ b/tests/no-ssl-test.c
@@ -52,9 +52,7 @@ do_session_property_tests (void)
 {
        gboolean use_system;
        GTlsDatabase *tlsdb;
-       char *ca_file;
        SoupSession *session;
-       GParamSpec *pspec;
 
        g_test_bug ("700518");
 
@@ -62,40 +60,12 @@ do_session_property_tests (void)
        session = soup_session_async_new ();
        G_GNUC_END_IGNORE_DEPRECATIONS;
 
-       /* Temporarily undeprecate SOUP_SESSION_SSL_CA_FILE to avoid warnings. */
-       pspec = g_object_class_find_property (g_type_class_peek (SOUP_TYPE_SESSION),
-                                             SOUP_SESSION_SSL_CA_FILE);
-       pspec->flags &= ~G_PARAM_DEPRECATED;
-
        g_object_get (G_OBJECT (session),
                      "ssl-use-system-ca-file", &use_system,
                      "tls-database", &tlsdb,
-                     "ssl-ca-file", &ca_file,
                      NULL);
        soup_test_assert (!use_system, "ssl-use-system-ca-file defaults to TRUE");
        soup_test_assert (tlsdb == NULL, "tls-database set by default");
-       soup_test_assert (ca_file == NULL, "ca-file set by default");
-
-       g_object_set (G_OBJECT (session),
-                     "ssl-use-system-ca-file", TRUE,
-                     NULL);
-       g_object_get (G_OBJECT (session),
-                     "ssl-ca-file", &ca_file,
-                     NULL);
-       soup_test_assert (ca_file == NULL, "setting ssl-use-system-ca-file set ssl-ca-file");
-
-       g_object_set (G_OBJECT (session),
-                     "ssl-ca-file",
-                     g_test_get_filename (G_TEST_DIST, "test-cert.pem", NULL),
-                     NULL);
-       g_object_get (G_OBJECT (session),
-                     "ssl-use-system-ca-file", &use_system,
-                     "tls-database", &tlsdb,
-                     "ssl-ca-file", &ca_file,
-                     NULL);
-       soup_test_assert (ca_file == NULL, "setting ssl-ca-file did not fail");
-       soup_test_assert (!use_system, "setting ssl-ca-file set ssl-use-system-ca-file");
-       soup_test_assert (tlsdb == NULL, "setting ssl-ca-file set tls-database");
 
        g_object_set (G_OBJECT (session),
                      "tls-database", NULL,
@@ -103,16 +73,11 @@ do_session_property_tests (void)
        g_object_get (G_OBJECT (session),
                      "ssl-use-system-ca-file", &use_system,
                      "tls-database", &tlsdb,
-                     "ssl-ca-file", &ca_file,
                      NULL);
        soup_test_assert (tlsdb == NULL, "setting tls-database NULL failed");
        soup_test_assert (!use_system, "setting tls-database NULL set ssl-use-system-ca-file");
-       soup_test_assert (ca_file == NULL, "setting tls-database NULL set ssl-ca-file");
 
        soup_test_session_abort_unref (session);
-
-       /* Re-deprecate SOUP_SESSION_SSL_CA_FILE */
-       pspec->flags |= G_PARAM_DEPRECATED;
 }
 
 static void
diff --git a/tests/proxy-test.c b/tests/proxy-test.c
index 1d68aa05..c9be7894 100644
--- a/tests/proxy-test.c
+++ b/tests/proxy-test.c
@@ -61,8 +61,8 @@ authenticate (SoupSession *session, SoupMessage *msg,
 }
 
 static void
-set_close_on_connect (SoupSession *session, SoupMessage *msg,
-                     SoupSocket *sock, gpointer user_data)
+set_close_on_connect (SoupMessage *msg,
+                      gpointer user_data)
 {
        /* This is used to test that we can handle the server closing
         * the connection when returning a 407 in response to a
@@ -74,7 +74,6 @@ set_close_on_connect (SoupSession *session, SoupMessage *msg,
        }
 }
 
-
 static void
 test_url (const char *url, int proxy, guint expected,
          gboolean sync, gboolean close)
@@ -101,11 +100,6 @@ test_url (const char *url, int proxy, guint expected,
                                         NULL);
        g_signal_connect (session, "authenticate",
                          G_CALLBACK (authenticate), NULL);
-       if (close) {
-               /* FIXME g_test_bug ("611663") */
-               g_signal_connect (session, "request-started",
-                                 G_CALLBACK (set_close_on_connect), NULL);
-       }
 
        msg = soup_message_new (SOUP_METHOD_GET, url);
        if (!msg) {
@@ -113,6 +107,12 @@ test_url (const char *url, int proxy, guint expected,
                exit (1);
        }
 
+       if (close) {
+               /* FIXME g_test_bug ("611663") */
+               g_signal_connect (msg, "starting",
+                                 G_CALLBACK (set_close_on_connect), NULL);
+       }
+
        soup_session_send_message (session, msg);
 
        debug_printf (1, "  %d %s\n", msg->status_code, msg->reason_phrase);
@@ -153,15 +153,16 @@ test_url_new_api (const char *url, int proxy, guint expected,
 
        g_signal_connect (session, "authenticate",
                          G_CALLBACK (authenticate), NULL);
+
+       request = soup_session_request (session, url, NULL);
+       msg = soup_request_http_get_message (SOUP_REQUEST_HTTP (request));
+
        if (close) {
                /* FIXME g_test_bug ("611663") */
-               g_signal_connect (session, "request-started",
+               g_signal_connect (msg, "starting",
                                  G_CALLBACK (set_close_on_connect), NULL);
        }
 
-       request = soup_session_request (session, url, NULL);
-       msg = soup_request_http_get_message (SOUP_REQUEST_HTTP (request));
-
        stream = soup_test_request_send (request, NULL, 0, &error);
        g_assert_no_error (error);
        g_clear_error (&error);
diff --git a/tests/ssl-test.c b/tests/ssl-test.c
index 735ba416..2ebad7a9 100644
--- a/tests/ssl-test.c
+++ b/tests/ssl-test.c
@@ -143,12 +143,10 @@ property_changed (GObject *object, GParamSpec *param, gpointer user_data)
 static void
 do_session_property_tests (void)
 {
-       gboolean use_system_changed, tlsdb_changed, ca_file_changed;
+       gboolean use_system_changed, tlsdb_changed;
        gboolean use_system;
        GTlsDatabase *tlsdb;
-       char *ca_file;
        SoupSession *session;
-       GParamSpec *pspec;
 
        g_test_bug ("673678");
 
@@ -158,38 +156,27 @@ do_session_property_tests (void)
        session = soup_session_async_new ();
        G_GNUC_END_IGNORE_DEPRECATIONS;
 
-       /* Temporarily undeprecate SOUP_SESSION_SSL_CA_FILE to avoid warnings. */
-       pspec = g_object_class_find_property (g_type_class_peek (SOUP_TYPE_SESSION),
-                                             SOUP_SESSION_SSL_CA_FILE);
-       pspec->flags &= ~G_PARAM_DEPRECATED;
-
        g_signal_connect (session, "notify::ssl-use-system-ca-file",
                          G_CALLBACK (property_changed), &use_system_changed);
        g_signal_connect (session, "notify::tls-database",
                          G_CALLBACK (property_changed), &tlsdb_changed);
-       g_signal_connect (session, "notify::ssl-ca-file",
-                         G_CALLBACK (property_changed), &ca_file_changed);
 
        g_object_get (G_OBJECT (session),
                      "ssl-use-system-ca-file", &use_system,
                      "tls-database", &tlsdb,
-                     "ssl-ca-file", &ca_file,
                      NULL);
        soup_test_assert (!use_system,
                          "ssl-use-system-ca-file defaults to TRUE");
        soup_test_assert (tlsdb == NULL,
                          "tls-database set by default");
-       soup_test_assert (ca_file == NULL,
-                         "ca-file set by default");
 
-       use_system_changed = tlsdb_changed = ca_file_changed = FALSE;
+       use_system_changed = tlsdb_changed = FALSE;
        g_object_set (G_OBJECT (session),
                      "ssl-use-system-ca-file", TRUE,
                      NULL);
        g_object_get (G_OBJECT (session),
                      "ssl-use-system-ca-file", &use_system,
                      "tls-database", &tlsdb,
-                     "ssl-ca-file", &ca_file,
                      NULL);
        soup_test_assert (use_system,
                          "setting ssl-use-system-ca-file failed");
@@ -198,54 +185,8 @@ do_session_property_tests (void)
                          "setting ssl-use-system-ca-file didn't set tls-database");
        g_assert_true (tlsdb_changed);
        g_clear_object (&tlsdb);
-       soup_test_assert (ca_file == NULL,
-                         "setting ssl-use-system-ca-file set ssl-ca-file");
-       g_assert_false (ca_file_changed);
-
-       use_system_changed = tlsdb_changed = ca_file_changed = FALSE;
-       g_object_set (G_OBJECT (session),
-                     "ssl-ca-file", g_test_get_filename (G_TEST_DIST, "/test-cert.pem", NULL),
-                     NULL);
-       g_object_get (G_OBJECT (session),
-                     "ssl-use-system-ca-file", &use_system,
-                     "tls-database", &tlsdb,
-                     "ssl-ca-file", &ca_file,
-                     NULL);
-       soup_test_assert (!use_system,
-                         "setting ssl-ca-file left ssl-use-system-ca-file set");
-       g_assert_true (use_system_changed);
-       soup_test_assert (tlsdb != NULL,
-                         "setting ssl-ca-file didn't set tls-database");
-       g_assert_true (tlsdb_changed);
-       g_clear_object (&tlsdb);
-       soup_test_assert (ca_file != NULL,
-                         "setting ssl-ca-file failed");
-       g_assert_true (ca_file_changed);
-       g_free (ca_file);
-
-       use_system_changed = tlsdb_changed = ca_file_changed = FALSE;
-       g_object_set (G_OBJECT (session),
-                     "tls-database", NULL,
-                     NULL);
-       g_object_get (G_OBJECT (session),
-                     "ssl-use-system-ca-file", &use_system,
-                     "tls-database", &tlsdb,
-                     "ssl-ca-file", &ca_file,
-                     NULL);
-       soup_test_assert (!use_system,
-                         "setting tls-database NULL left ssl-use-system-ca-file set");
-       g_assert_false (use_system_changed);
-       soup_test_assert (tlsdb == NULL,
-                         "setting tls-database NULL failed");
-       g_assert_true (tlsdb_changed);
-       soup_test_assert (ca_file == NULL,
-                         "setting tls-database didn't clear ssl-ca-file");
-       g_assert_true (ca_file_changed);
 
        soup_test_session_abort_unref (session);
-
-       /* Re-deprecate SOUP_SESSION_SSL_CA_FILE */
-       pspec->flags |= G_PARAM_DEPRECATED;
 }
 
 /* GTlsInteraction subclass for do_interaction_test */


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