[libsoup/hsts: 23/25] Hook the default interface's functions



commit a70526bf6bdc2caa2442480f66095967028b6824
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Tue Sep 25 10:52:05 2018 +0300

    Hook the default interface's functions

 libsoup/soup-hsts-enforcer.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/libsoup/soup-hsts-enforcer.c b/libsoup/soup-hsts-enforcer.c
index 8a4dd6e8..34b2102e 100644
--- a/libsoup/soup-hsts-enforcer.c
+++ b/libsoup/soup-hsts-enforcer.c
@@ -43,6 +43,7 @@
  *
  **/
 
+static SoupSessionFeatureInterface *soup_hsts_enforcer_default_feature_interface;
 static void soup_hsts_enforcer_session_feature_init (SoupSessionFeatureInterface *feature_interface, 
gpointer interface_data);
 
 enum {
@@ -516,6 +517,9 @@ soup_hsts_enforcer_request_queued (SoupSessionFeature *feature,
 {
        g_signal_connect (msg, "restarted", G_CALLBACK (message_restarted_cb), feature);
        preprocess_request (SOUP_HSTS_ENFORCER (feature), msg);
+
+       if (soup_hsts_enforcer_default_feature_interface->request_queued)
+               soup_hsts_enforcer_default_feature_interface->request_queued (feature, session, msg);
 }
 
 static void
@@ -525,12 +529,18 @@ soup_hsts_enforcer_request_unqueued (SoupSessionFeature *feature,
 {
        g_signal_handlers_disconnect_by_func (msg, message_restarted_cb, feature);
        g_signal_handlers_disconnect_by_func (msg, got_sts_header_cb, feature);
+
+       if (soup_hsts_enforcer_default_feature_interface->request_queued)
+               soup_hsts_enforcer_default_feature_interface->request_unqueued (feature, session, msg);
 }
 
 static void
 soup_hsts_enforcer_session_feature_init (SoupSessionFeatureInterface *feature_interface,
                                         gpointer interface_data)
 {
+       soup_hsts_enforcer_default_feature_interface =
+               g_type_default_interface_peek (SOUP_TYPE_SESSION_FEATURE);
+
        feature_interface->request_queued = soup_hsts_enforcer_request_queued;
        feature_interface->request_unqueued = soup_hsts_enforcer_request_unqueued;
 }


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