[libsoup/wip/hadess/reverse-http: 3/3] all: Add source tags for all the GTasks



commit d352f6e681ab6510da4657f0e066c75ed60b86ba
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Sep 28 18:20:20 2015 +0200

    all: Add source tags for all the GTasks
    
    This might make it easier to debug async tasks, when necessary.

 libsoup/soup-address.c                | 1 +
 libsoup/soup-client-input-stream.c    | 1 +
 libsoup/soup-connection.c             | 2 ++
 libsoup/soup-io-stream.c              | 1 +
 libsoup/soup-multipart-input-stream.c | 1 +
 libsoup/soup-proxy-resolver-wrapper.c | 1 +
 libsoup/soup-request-file.c           | 1 +
 libsoup/soup-request-http.c           | 1 +
 libsoup/soup-request.c                | 1 +
 libsoup/soup-session.c                | 3 +++
 libsoup/soup-socket.c                 | 2 ++
 11 files changed, 15 insertions(+)
---
diff --git a/libsoup/soup-address.c b/libsoup/soup-address.c
index 53d3b61d..09f9cda4 100644
--- a/libsoup/soup-address.c
+++ b/libsoup/soup-address.c
@@ -1203,6 +1203,7 @@ soup_address_address_enumerator_next_async (GSocketAddressEnumerator  *enumerato
        GTask *task;
 
        task = g_task_new (enumerator, cancellable, callback, user_data);
+       g_task_set_source_tag (task, soup_address_address_enumerator_next_async);
        if (!priv->sockaddr) {
                soup_address_resolve_async (addr_enum->addr,
                                            g_main_context_get_thread_default (),
diff --git a/libsoup/soup-client-input-stream.c b/libsoup/soup-client-input-stream.c
index c305dd84..cecea675 100644
--- a/libsoup/soup-client-input-stream.c
+++ b/libsoup/soup-client-input-stream.c
@@ -189,6 +189,7 @@ soup_client_input_stream_close_async (GInputStream        *stream,
        GSource *source;
 
        task = g_task_new (stream, cancellable, callback, user_data);
+       g_task_set_source_tag (task, soup_client_input_stream_close_async);
        g_task_set_priority (task, priority);
 
        if (close_async_ready (cistream->priv->msg, task) == G_SOURCE_CONTINUE) {
diff --git a/libsoup/soup-connection.c b/libsoup/soup-connection.c
index 5fb4d78c..bead61d5 100644
--- a/libsoup/soup-connection.c
+++ b/libsoup/soup-connection.c
@@ -414,6 +414,7 @@ soup_connection_connect_async (SoupConnection      *conn,
 
        soup_socket_properties_push_async_context (priv->socket_props);
        task = g_task_new (conn, cancellable, callback, user_data);
+       g_task_set_source_tag (task, soup_connection_connect_async);
 
        soup_socket_connect_async_internal (priv->socket, cancellable,
                                            socket_connect_complete, task);
@@ -542,6 +543,7 @@ soup_connection_start_ssl_async (SoupConnection      *conn,
 
        soup_socket_properties_push_async_context (priv->socket_props);
        task = g_task_new (conn, cancellable, callback, user_data);
+       g_task_set_source_tag (task, soup_connection_start_ssl_async);
 
        soup_socket_handshake_async (priv->socket, priv->remote_uri->host,
                                     cancellable, start_ssl_completed, task);
diff --git a/libsoup/soup-io-stream.c b/libsoup/soup-io-stream.c
index 9c77b267..dded540f 100644
--- a/libsoup/soup-io-stream.c
+++ b/libsoup/soup-io-stream.c
@@ -160,6 +160,7 @@ soup_io_stream_close_async (GIOStream           *stream,
        GTask *task;
 
        task = g_task_new (stream, cancellable, callback, user_data);
+       g_task_set_source_tag (task, soup_io_stream_close_async);
        g_io_stream_close_async (SOUP_IO_STREAM (stream)->priv->base_iostream,
                                 io_priority, cancellable,
                                 close_async_complete, task);
diff --git a/libsoup/soup-multipart-input-stream.c b/libsoup/soup-multipart-input-stream.c
index d44991cb..cde7dadd 100644
--- a/libsoup/soup-multipart-input-stream.c
+++ b/libsoup/soup-multipart-input-stream.c
@@ -527,6 +527,7 @@ soup_multipart_input_stream_next_part_async (SoupMultipartInputStream *multipart
        g_return_if_fail (SOUP_IS_MULTIPART_INPUT_STREAM (multipart));
 
        task = g_task_new (multipart, cancellable, callback, data);
+       g_task_set_source_tag (task, soup_multipart_input_stream_next_part_async);
        g_task_set_priority (task, io_priority);
 
        if (!g_input_stream_set_pending (stream, &error)) {
diff --git a/libsoup/soup-proxy-resolver-wrapper.c b/libsoup/soup-proxy-resolver-wrapper.c
index e07664ca..e787ff09 100644
--- a/libsoup/soup-proxy-resolver-wrapper.c
+++ b/libsoup/soup-proxy-resolver-wrapper.c
@@ -92,6 +92,7 @@ soup_proxy_resolver_wrapper_lookup_async (GProxyResolver       *resolver,
        SoupURI *source_uri;
 
        task = g_task_new (resolver, cancellable, callback, user_data);
+       g_task_set_source_tag (task, soup_proxy_resolver_wrapper_lookup_async);
        source_uri = soup_uri_new (uri);
        g_task_set_task_data (task, source_uri, (GDestroyNotify) soup_uri_free);
 
diff --git a/libsoup/soup-request-file.c b/libsoup/soup-request-file.c
index 61fc712d..7d97bd22 100644
--- a/libsoup/soup-request-file.c
+++ b/libsoup/soup-request-file.c
@@ -223,6 +223,7 @@ soup_request_file_send_async (SoupRequest          *request,
        GTask *task;
 
        task = g_task_new (request, cancellable, callback, user_data);
+       g_task_set_source_tag (task, soup_request_file_send_async);
        g_task_run_in_thread (task, soup_request_file_send_async_thread);
        g_object_unref (task);
 }
diff --git a/libsoup/soup-request-http.c b/libsoup/soup-request-http.c
index 285f59d7..a608d3a2 100644
--- a/libsoup/soup-request-http.c
+++ b/libsoup/soup-request-http.c
@@ -140,6 +140,7 @@ soup_request_http_send_async (SoupRequest          *request,
        g_return_if_fail (!SOUP_IS_SESSION_SYNC (session));
 
        task = g_task_new (request, cancellable, callback, user_data);
+       g_task_set_source_tag (task, soup_request_http_send_async);
        soup_session_send_async (session, http->priv->msg, cancellable,
                                 http_input_stream_ready_cb, task);
 }
diff --git a/libsoup/soup-request.c b/libsoup/soup-request.c
index 72fc844b..99512e9e 100644
--- a/libsoup/soup-request.c
+++ b/libsoup/soup-request.c
@@ -177,6 +177,7 @@ soup_request_default_send_async (SoupRequest          *request,
        GError *error = NULL;
 
        task = g_task_new (request, cancellable, callback, user_data);
+       g_task_set_source_tag (task, soup_request_default_send_async);
 
        stream = soup_request_send (request, cancellable, &error);
        if (stream)
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index 388204a1..dca094ac 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -4303,6 +4303,7 @@ soup_session_send_async (SoupSession         *session,
 
        item->new_api = TRUE;
        item->task = g_task_new (session, item->cancellable, callback, user_data);
+       g_task_set_source_tag (item->task, soup_session_send_async);
        g_task_set_task_data (item->task, item, (GDestroyNotify) soup_message_queue_item_unref);
 
        /* Do not check for cancellations as we do not want to
@@ -4872,6 +4873,7 @@ soup_session_websocket_connect_async (SoupSession          *session,
        soup_websocket_client_prepare_handshake (msg, origin, protocols);
 
        task = g_task_new (session, cancellable, callback, user_data);
+       g_task_set_source_tag (task, soup_session_websocket_connect_async);
        item = soup_session_append_queue_item (session, msg, TRUE, FALSE,
                                               websocket_connect_async_complete, task);
        g_task_set_task_data (task, item, (GDestroyNotify) soup_message_queue_item_unref);
@@ -5233,6 +5235,7 @@ soup_session_reverse_http_connect_async (SoupSession          *session,
        soup_message_headers_append (msg->request_headers, "Connection", "Upgrade");
 
        task = g_task_new (session, cancellable, callback, user_data);
+       g_task_set_source_tag (task, soup_session_reverse_http_connect_async);
        item = soup_session_append_queue_item (session, msg, TRUE, FALSE,
                                               reverse_http_connect_async_complete, task);
        g_task_set_task_data (task, item, (GDestroyNotify) soup_message_queue_item_unref);
diff --git a/libsoup/soup-socket.c b/libsoup/soup-socket.c
index 311c627c..ed4ccecb 100644
--- a/libsoup/soup-socket.c
+++ b/libsoup/soup-socket.c
@@ -952,6 +952,7 @@ soup_socket_connect_async_internal (SoupSocket          *sock,
 
        priv->connect_cancel = cancellable ? g_object_ref (cancellable) : g_cancellable_new ();
        task = g_task_new (sock, priv->connect_cancel, callback, user_data);
+       g_task_set_source_tag (task, soup_socket_connect_async_internal);
 
        client = new_socket_client (sock);
        g_socket_client_connect_async (client,
@@ -1529,6 +1530,7 @@ soup_socket_handshake_async (SoupSocket          *sock,
        GError *error = NULL;
 
        task = g_task_new (sock, cancellable, callback, user_data);
+       g_task_set_source_tag (task, soup_socket_handshake_async);
 
        if (!soup_socket_setup_ssl (sock, ssl_host, cancellable, &error)) {
                g_task_return_error (task, error);


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