[libsoup] Add SoupMessage::starting signal
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] Add SoupMessage::starting signal
- Date: Mon, 2 Mar 2015 08:43:12 +0000 (UTC)
commit 29a976932f1e991794f9c1efe8c346328902fc68
Author: Carlos Garcia Campos <cgarcia igalia com>
Date: Wed Feb 18 14:38:09 2015 +0100
Add SoupMessage::starting signal
It's similar to the SoupSession::request-started signal, but it's also
emitted for cached resources.
https://bugzilla.gnome.org/show_bug.cgi?id=731153
docs/reference/libsoup-2.4-sections.txt | 1 +
libsoup/libsoup-2.4.sym | 1 +
libsoup/soup-auth-manager.c | 52 +++++++--------
libsoup/soup-cache.c | 17 ++++-
libsoup/soup-cookie-jar.c | 32 +++++-----
libsoup/soup-logger.c | 105 +++++++++++++++++++------------
libsoup/soup-message.c | 24 +++++++
libsoup/soup-message.h | 6 ++-
libsoup/soup-session-feature.c | 2 +-
libsoup/soup-session.c | 3 +
tests/cache-test.c | 20 ++++--
tests/misc-test.c | 22 +++++--
12 files changed, 183 insertions(+), 102 deletions(-)
---
diff --git a/docs/reference/libsoup-2.4-sections.txt b/docs/reference/libsoup-2.4-sections.txt
index 92a3563..306fa6f 100644
--- a/docs/reference/libsoup-2.4-sections.txt
+++ b/docs/reference/libsoup-2.4-sections.txt
@@ -80,6 +80,7 @@ soup_message_got_chunk
soup_message_got_body
soup_message_finished
soup_message_restarted
+soup_message_starting
</SECTION>
<SECTION>
diff --git a/libsoup/libsoup-2.4.sym b/libsoup/libsoup-2.4.sym
index 69d46ef..e881b7f 100644
--- a/libsoup/libsoup-2.4.sym
+++ b/libsoup/libsoup-2.4.sym
@@ -317,6 +317,7 @@ soup_message_set_response
soup_message_set_status
soup_message_set_status_full
soup_message_set_uri
+soup_message_starting
soup_message_wrote_body
soup_message_wrote_body_data
soup_message_wrote_chunk
diff --git a/libsoup/soup-auth-manager.c b/libsoup/soup-auth-manager.c
index f40a928..21e2065 100644
--- a/libsoup/soup-auth-manager.c
+++ b/libsoup/soup-auth-manager.c
@@ -647,33 +647,9 @@ proxy_auth_got_body (SoupMessage *msg, gpointer manager)
}
static void
-soup_auth_manager_request_queued (SoupSessionFeature *manager,
- SoupSession *session,
- SoupMessage *msg)
-{
- soup_message_add_status_code_handler (
- msg, "got_headers", SOUP_STATUS_UNAUTHORIZED,
- G_CALLBACK (auth_got_headers), manager);
- soup_message_add_status_code_handler (
- msg, "got_body", SOUP_STATUS_UNAUTHORIZED,
- G_CALLBACK (auth_got_body), manager);
-
- soup_message_add_status_code_handler (
- msg, "got_headers", SOUP_STATUS_PROXY_UNAUTHORIZED,
- G_CALLBACK (proxy_auth_got_headers), manager);
- soup_message_add_status_code_handler (
- msg, "got_body", SOUP_STATUS_PROXY_UNAUTHORIZED,
- G_CALLBACK (proxy_auth_got_body), manager);
-}
-
-static void
-soup_auth_manager_request_started (SoupSessionFeature *feature,
- SoupSession *session,
- SoupMessage *msg,
- SoupSocket *socket)
+auth_msg_starting (SoupMessage *msg, gpointer manager)
{
- SoupAuthManager *manager = SOUP_AUTH_MANAGER (feature);
- SoupAuthManagerPrivate *priv = manager->priv;
+ SoupAuthManagerPrivate *priv = SOUP_AUTH_MANAGER (manager)->priv;
SoupAuth *auth;
g_mutex_lock (&priv->lock);
@@ -700,6 +676,29 @@ soup_auth_manager_request_started (SoupSessionFeature *feature,
}
static void
+soup_auth_manager_request_queued (SoupSessionFeature *manager,
+ SoupSession *session,
+ SoupMessage *msg)
+{
+ g_signal_connect (msg, "starting",
+ G_CALLBACK (auth_msg_starting), manager);
+
+ soup_message_add_status_code_handler (
+ msg, "got_headers", SOUP_STATUS_UNAUTHORIZED,
+ G_CALLBACK (auth_got_headers), manager);
+ soup_message_add_status_code_handler (
+ msg, "got_body", SOUP_STATUS_UNAUTHORIZED,
+ G_CALLBACK (auth_got_body), manager);
+
+ soup_message_add_status_code_handler (
+ msg, "got_headers", SOUP_STATUS_PROXY_UNAUTHORIZED,
+ G_CALLBACK (proxy_auth_got_headers), manager);
+ soup_message_add_status_code_handler (
+ msg, "got_body", SOUP_STATUS_PROXY_UNAUTHORIZED,
+ G_CALLBACK (proxy_auth_got_body), manager);
+}
+
+static void
soup_auth_manager_request_unqueued (SoupSessionFeature *manager,
SoupSession *session,
SoupMessage *msg)
@@ -747,7 +746,6 @@ soup_auth_manager_session_feature_init (SoupSessionFeatureInterface *feature_int
feature_interface->attach = soup_auth_manager_attach;
feature_interface->request_queued = soup_auth_manager_request_queued;
- feature_interface->request_started = soup_auth_manager_request_started;
feature_interface->request_unqueued = soup_auth_manager_request_unqueued;
feature_interface->add_feature = soup_auth_manager_add_feature;
feature_interface->remove_feature = soup_auth_manager_remove_feature;
diff --git a/libsoup/soup-cache.c b/libsoup/soup-cache.c
index 3cc4844..fe1ed89 100644
--- a/libsoup/soup-cache.c
+++ b/libsoup/soup-cache.c
@@ -698,6 +698,9 @@ soup_cache_send_response (SoupCache *cache, SoupMessage *msg)
in course is over by now */
entry->being_validated = FALSE;
+ /* Message starting */
+ soup_message_starting (msg);
+
/* Status */
soup_message_set_status (msg, entry->status_code);
@@ -722,11 +725,17 @@ msg_got_headers_cb (SoupMessage *msg, gpointer user_data)
}
static void
-request_started (SoupSessionFeature *feature, SoupSession *session,
- SoupMessage *msg, SoupSocket *socket)
+msg_starting_cb (SoupMessage *msg, gpointer user_data)
{
g_object_set_data (G_OBJECT (msg), "request-time", GINT_TO_POINTER (time (NULL)));
- g_signal_connect (msg, "got-headers", G_CALLBACK (msg_got_headers_cb), NULL);
+ g_signal_connect (msg, "got-headers", G_CALLBACK (msg_got_headers_cb), user_data);
+ g_signal_handlers_disconnect_by_func (msg, msg_starting_cb, user_data);
+}
+
+static void
+request_queued (SoupSessionFeature *feature, SoupSession *session, SoupMessage *msg)
+{
+ g_signal_connect (msg, "starting", G_CALLBACK (msg_starting_cb), feature);
}
static void
@@ -746,7 +755,7 @@ soup_cache_session_feature_init (SoupSessionFeatureInterface *feature_interface,
g_type_default_interface_peek (SOUP_TYPE_SESSION_FEATURE);
feature_interface->attach = attach;
- feature_interface->request_started = request_started;
+ feature_interface->request_queued = request_queued;
}
typedef struct {
diff --git a/libsoup/soup-cookie-jar.c b/libsoup/soup-cookie-jar.c
index cd5f30e..d12bc85 100644
--- a/libsoup/soup-cookie-jar.c
+++ b/libsoup/soup-cookie-jar.c
@@ -655,21 +655,7 @@ process_set_cookie_header (SoupMessage *msg, gpointer user_data)
}
static void
-soup_cookie_jar_request_queued (SoupSessionFeature *feature,
- SoupSession *session,
- SoupMessage *msg)
-{
- soup_message_add_header_handler (msg, "got-headers",
- "Set-Cookie",
- G_CALLBACK (process_set_cookie_header),
- feature);
-}
-
-static void
-soup_cookie_jar_request_started (SoupSessionFeature *feature,
- SoupSession *session,
- SoupMessage *msg,
- SoupSocket *socket)
+msg_starting_cb (SoupMessage *msg, gpointer feature)
{
SoupCookieJar *jar = SOUP_COOKIE_JAR (feature);
char *cookies;
@@ -684,6 +670,21 @@ soup_cookie_jar_request_started (SoupSessionFeature *feature,
}
static void
+soup_cookie_jar_request_queued (SoupSessionFeature *feature,
+ SoupSession *session,
+ SoupMessage *msg)
+{
+ g_signal_connect (msg, "starting",
+ G_CALLBACK (msg_starting_cb),
+ feature);
+
+ soup_message_add_header_handler (msg, "got-headers",
+ "Set-Cookie",
+ G_CALLBACK (process_set_cookie_header),
+ feature);
+}
+
+static void
soup_cookie_jar_request_unqueued (SoupSessionFeature *feature,
SoupSession *session,
SoupMessage *msg)
@@ -696,7 +697,6 @@ soup_cookie_jar_session_feature_init (SoupSessionFeatureInterface *feature_inter
gpointer interface_data)
{
feature_interface->request_queued = soup_cookie_jar_request_queued;
- feature_interface->request_started = soup_cookie_jar_request_started;
feature_interface->request_unqueued = soup_cookie_jar_request_unqueued;
}
diff --git a/libsoup/soup-logger.c b/libsoup/soup-logger.c
index 34a5576..87e8a0a 100644
--- a/libsoup/soup-logger.c
+++ b/libsoup/soup-logger.c
@@ -15,6 +15,8 @@
#include <string.h>
#include "soup-logger.h"
+#include "soup-connection.h"
+#include "soup-message-private.h"
#include "soup.h"
/**
@@ -67,7 +69,7 @@
*
* Currently, the request half of the message is logged just before
* the first byte of the request gets written to the network (from the
- * #SoupSession::request_started signal), which means that if you have
+ * #SoupMessage::starting signal), which means that if you have
* not made the complete request body available at that point, it will
* not be logged.
*
@@ -86,6 +88,7 @@
* event of the #SoupMessage::finished signal.
**/
+static SoupSessionFeatureInterface *soup_logger_default_feature_interface;
static void soup_logger_session_feature_init (SoupSessionFeatureInterface *feature_interface, gpointer
interface_data);
G_DEFINE_TYPE_WITH_CODE (SoupLogger, soup_logger, G_TYPE_OBJECT,
@@ -101,6 +104,7 @@ typedef struct {
GQuark tag;
GHashTable *ids;
+ SoupSession *session;
SoupLoggerLogLevel level;
int max_body_size;
@@ -443,13 +447,13 @@ soup_logger_print_basic_auth (SoupLogger *logger, const char *value)
static void
print_request (SoupLogger *logger, SoupMessage *msg,
- SoupSession *session, SoupSocket *socket,
- gboolean restarted)
+ SoupSocket *socket, gboolean restarted)
{
SoupLoggerPrivate *priv = SOUP_LOGGER_GET_PRIVATE (logger);
SoupLoggerLogLevel log_level;
SoupMessageHeadersIter iter;
const char *name, *value;
+ char *socket_dbg;
SoupURI *uri;
if (priv->request_filter) {
@@ -479,15 +483,22 @@ print_request (SoupLogger *logger, SoupMessage *msg,
soup_logger_print (logger, SOUP_LOGGER_LOG_MINIMAL, '>',
"Soup-Debug-Timestamp: %lu",
(unsigned long)time (0));
+
+ socket_dbg = socket ?
+ g_strdup_printf ("%s %u (%p)",
+ g_type_name_from_instance ((GTypeInstance *)socket),
+ soup_logger_get_id (logger, socket), socket)
+ : NULL;
+
soup_logger_print (logger, SOUP_LOGGER_LOG_MINIMAL, '>',
- "Soup-Debug: %s %u (%p), %s %u (%p), %s %u (%p)%s",
- g_type_name_from_instance ((GTypeInstance *)session),
- soup_logger_get_id (logger, session), session,
+ "Soup-Debug: %s %u (%p), %s %u (%p), %s%s",
+ g_type_name_from_instance ((GTypeInstance *)priv->session),
+ soup_logger_get_id (logger, priv->session), priv->session,
g_type_name_from_instance ((GTypeInstance *)msg),
soup_logger_get_id (logger, msg), msg,
- g_type_name_from_instance ((GTypeInstance *)socket),
- soup_logger_get_id (logger, socket), socket,
+ socket_dbg ? socket_dbg : "cached",
restarted ? ", restarted" : "");
+ g_free (socket_dbg);
if (log_level == SOUP_LOGGER_LOG_MINIMAL)
return;
@@ -650,36 +661,14 @@ got_body (SoupMessage *msg, gpointer user_data)
}
static void
-soup_logger_request_queued (SoupSessionFeature *logger,
- SoupSession *session,
- SoupMessage *msg)
-{
- g_return_if_fail (SOUP_IS_MESSAGE (msg));
-
- g_signal_connect (msg, "got-informational",
- G_CALLBACK (got_informational),
- logger);
- g_signal_connect (msg, "got-body",
- G_CALLBACK (got_body),
- logger);
- g_signal_connect (msg, "finished",
- G_CALLBACK (finished),
- logger);
-}
-
-static void
-soup_logger_request_started (SoupSessionFeature *feature,
- SoupSession *session,
- SoupMessage *msg,
- SoupSocket *socket)
+starting (SoupMessage *msg, gpointer user_data)
{
- SoupLogger *logger = SOUP_LOGGER (feature);
+ SoupLogger *logger = SOUP_LOGGER (user_data);
+ SoupLoggerPrivate *priv = SOUP_LOGGER_GET_PRIVATE (logger);
gboolean restarted;
guint msg_id;
-
- g_return_if_fail (SOUP_IS_SESSION (session));
- g_return_if_fail (SOUP_IS_MESSAGE (msg));
- g_return_if_fail (SOUP_IS_SOCKET (socket));
+ SoupConnection *conn;
+ SoupSocket *socket;
msg_id = soup_logger_get_id (logger, msg);
if (msg_id)
@@ -689,33 +678,69 @@ soup_logger_request_started (SoupSessionFeature *feature,
restarted = FALSE;
}
- if (!soup_logger_get_id (logger, session))
- soup_logger_set_id (logger, session);
+ if (!soup_logger_get_id (logger, priv->session))
+ soup_logger_set_id (logger, priv->session);
- if (!soup_logger_get_id (logger, socket))
+ conn = soup_message_get_connection (msg);
+ socket = conn ? soup_connection_get_socket (conn) : NULL;
+ if (socket && !soup_logger_get_id (logger, socket))
soup_logger_set_id (logger, socket);
- print_request (logger, msg, session, socket, restarted);
+ print_request (logger, msg, socket, restarted);
soup_logger_print (logger, SOUP_LOGGER_LOG_MINIMAL, ' ', "");
}
static void
+soup_logger_request_queued (SoupSessionFeature *logger,
+ SoupSession *session,
+ SoupMessage *msg)
+{
+ g_return_if_fail (SOUP_IS_MESSAGE (msg));
+
+ g_signal_connect (msg, "starting",
+ G_CALLBACK (starting),
+ logger);
+ g_signal_connect (msg, "got-informational",
+ G_CALLBACK (got_informational),
+ logger);
+ g_signal_connect (msg, "got-body",
+ G_CALLBACK (got_body),
+ logger);
+ g_signal_connect (msg, "finished",
+ G_CALLBACK (finished),
+ logger);
+}
+
+static void
soup_logger_request_unqueued (SoupSessionFeature *logger,
SoupSession *session,
SoupMessage *msg)
{
g_return_if_fail (SOUP_IS_MESSAGE (msg));
+ g_signal_handlers_disconnect_by_func (msg, starting, logger);
g_signal_handlers_disconnect_by_func (msg, got_informational, logger);
g_signal_handlers_disconnect_by_func (msg, got_body, logger);
g_signal_handlers_disconnect_by_func (msg, finished, logger);
}
static void
+soup_logger_feature_attach (SoupSessionFeature *feature,
+ SoupSession *session)
+{
+ SOUP_LOGGER_GET_PRIVATE (feature)->session = session;
+
+ soup_logger_default_feature_interface->attach (feature, session);
+}
+
+static void
soup_logger_session_feature_init (SoupSessionFeatureInterface *feature_interface,
gpointer interface_data)
{
+ soup_logger_default_feature_interface =
+ g_type_default_interface_peek (SOUP_TYPE_SESSION_FEATURE);
+
+ feature_interface->attach = soup_logger_feature_attach;
feature_interface->request_queued = soup_logger_request_queued;
- feature_interface->request_started = soup_logger_request_started;
feature_interface->request_unqueued = soup_logger_request_unqueued;
}
diff --git a/libsoup/soup-message.c b/libsoup/soup-message.c
index 07bcea6..e28ce7f 100644
--- a/libsoup/soup-message.c
+++ b/libsoup/soup-message.c
@@ -109,6 +109,7 @@ enum {
GOT_BODY,
CONTENT_SNIFFED,
+ STARTING,
RESTARTED,
FINISHED,
@@ -599,6 +600,23 @@ soup_message_class_init (SoupMessageClass *message_class)
G_TYPE_HASH_TABLE);
/**
+ * SoupMessage::starting:
+ * @msg: the message
+ *
+ * Emitted just before a message is sent.
+ *
+ * Since: 2.50
+ */
+ signals[STARTING] =
+ g_signal_new ("starting",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (SoupMessageClass, starting),
+ NULL, NULL,
+ NULL,
+ G_TYPE_NONE, 0);
+
+ /**
* SoupMessage::restarted:
* @msg: the message
*
@@ -1125,6 +1143,12 @@ soup_message_content_sniffed (SoupMessage *msg, const char *content_type, GHashT
}
void
+soup_message_starting (SoupMessage *msg)
+{
+ g_signal_emit (msg, signals[STARTING], 0);
+}
+
+void
soup_message_restarted (SoupMessage *msg)
{
SoupMessagePrivate *priv = SOUP_MESSAGE_GET_PRIVATE (msg);
diff --git a/libsoup/soup-message.h b/libsoup/soup-message.h
index b02d293..7926113 100644
--- a/libsoup/soup-message.h
+++ b/libsoup/soup-message.h
@@ -50,12 +50,12 @@ typedef struct {
void (*got_body) (SoupMessage *msg);
void (*restarted) (SoupMessage *msg);
void (*finished) (SoupMessage *msg);
+ void (*starting) (SoupMessage *msg);
/* Padding for future expansion */
void (*_libsoup_reserved1) (void);
void (*_libsoup_reserved2) (void);
void (*_libsoup_reserved3) (void);
- void (*_libsoup_reserved4) (void);
} SoupMessageClass;
GType soup_message_get_type (void);
@@ -216,6 +216,10 @@ void soup_message_got_headers (SoupMessage *msg);
void soup_message_got_chunk (SoupMessage *msg, SoupBuffer *chunk);
void soup_message_got_body (SoupMessage *msg);
void soup_message_content_sniffed (SoupMessage *msg, const char *content_type, GHashTable *params);
+
+SOUP_AVAILABLE_IN_2_50
+void soup_message_starting (SoupMessage *msg);
+
void soup_message_restarted (SoupMessage *msg);
void soup_message_finished (SoupMessage *msg);
diff --git a/libsoup/soup-session-feature.c b/libsoup/soup-session-feature.c
index 272367a..f23376f 100644
--- a/libsoup/soup-session-feature.c
+++ b/libsoup/soup-session-feature.c
@@ -41,7 +41,7 @@
* @attach: Perform setup when a feature is added to a session
* @detach: Perform cleanup when a feature is removed from a session
* @request_queued: Proxies the session's #SoupSession::request_queued signal
- * @request_started: Proxies the session's #SoupSession::request_started signal
+ * @request_started: Proxies the session's #SoupSession::request_started signal. Deprecated 2.50. Use
#SoupMessage::starting instead.
* @request_unqueued: Proxies the session's #SoupSession::request_unqueued signal
* @add_feature: adds a sub-feature to the main feature
* @remove_feature: removes a sub-feature from the main feature
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index bc08c9c..4ef2b68 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -1347,6 +1347,7 @@ soup_session_send_queue_item (SoupSession *session,
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);
}
@@ -3057,6 +3058,8 @@ soup_session_class_init (SoupSessionClass *session_class)
* 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",
diff --git a/tests/cache-test.c b/tests/cache-test.c
index f332a3f..7ee1a6d 100644
--- a/tests/cache-test.c
+++ b/tests/cache-test.c
@@ -242,8 +242,7 @@ do_request_with_cancel (SoupSession *session,
}
static void
-request_started (SoupSession *session, SoupMessage *msg,
- SoupSocket *socket)
+message_starting (SoupMessage *msg, gpointer data)
{
if (soup_message_headers_get_one (msg->request_headers,
"If-Modified-Since") ||
@@ -256,6 +255,15 @@ request_started (SoupSession *session, SoupMessage *msg,
}
static void
+request_queued (SoupSession *session, SoupMessage *msg,
+ gpointer data)
+{
+ g_signal_connect (msg, "starting",
+ G_CALLBACK (message_starting),
+ data);
+}
+
+static void
request_unqueued (SoupSession *session, SoupMessage *msg,
gpointer data)
{
@@ -279,8 +287,8 @@ do_basics_test (gconstpointer data)
SOUP_SESSION_USE_THREAD_CONTEXT, TRUE,
SOUP_SESSION_ADD_FEATURE, cache,
NULL);
- g_signal_connect (session, "request-started",
- G_CALLBACK (request_started), NULL);
+ g_signal_connect (session, "request-queued",
+ G_CALLBACK (request_queued), NULL);
debug_printf (2, " Initial requests\n");
body1 = do_request (session, base_uri, "GET", "/1", NULL,
@@ -596,8 +604,8 @@ do_headers_test (gconstpointer data)
SOUP_SESSION_ADD_FEATURE, cache,
NULL);
- g_signal_connect (session, "request-started",
- G_CALLBACK (request_started), NULL);
+ g_signal_connect (session, "request-queued",
+ G_CALLBACK (request_queued), NULL);
debug_printf (2, " Initial requests\n");
body1 = do_request (session, base_uri, "GET", "/1", NULL,
diff --git a/tests/misc-test.c b/tests/misc-test.c
index f9b0c6e..4dab6fe 100644
--- a/tests/misc-test.c
+++ b/tests/misc-test.c
@@ -404,7 +404,7 @@ ea_connection_created (SoupSession *session, GObject *conn, gpointer user_data)
}
static void
-ea_request_started (SoupSession *session, SoupMessage *msg, SoupSocket *socket, gpointer user_data)
+ea_message_starting (SoupMessage *msg, SoupSession *session)
{
soup_session_cancel_message (session, msg, SOUP_STATUS_CANCELLED);
}
@@ -455,8 +455,8 @@ do_early_abort_test (void)
session = soup_test_session_new (SOUP_TYPE_SESSION_ASYNC, NULL);
msg = soup_message_new_from_uri ("GET", base_uri);
- g_signal_connect (session, "request-started",
- G_CALLBACK (ea_request_started), NULL);
+ g_signal_connect (msg, "starting",
+ G_CALLBACK (ea_message_starting), session);
soup_session_send_message (session, msg);
debug_printf (2, " Message 3 completed\n");
@@ -507,13 +507,21 @@ ear_three_completed (GObject *source, GAsyncResult *result, gpointer loop)
}
static void
-ear_request_started (SoupSession *session, SoupMessage *msg,
- SoupSocket *socket, gpointer cancellable)
+ear_message_starting (SoupMessage *msg, gpointer cancellable)
{
g_cancellable_cancel (cancellable);
}
static void
+ear_request_queued (SoupSession *session, SoupMessage *msg,
+ gpointer cancellable)
+{
+ g_signal_connect (msg, "starting",
+ G_CALLBACK (ear_message_starting),
+ cancellable);
+}
+
+static void
do_early_abort_req_test (void)
{
SoupSession *session;
@@ -560,8 +568,8 @@ do_early_abort_req_test (void)
req = soup_session_request_uri (session, base_uri, NULL);
cancellable = g_cancellable_new ();
- g_signal_connect (session, "request-started",
- G_CALLBACK (ear_request_started), cancellable);
+ g_signal_connect (session, "request-queued",
+ G_CALLBACK (ear_request_queued), cancellable);
soup_request_send_async (req, cancellable, ear_three_completed, loop);
g_main_loop_run (loop);
g_object_unref (req);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]