summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libsoup/soup-message-queue.c11
-rw-r--r--libsoup/soup-message-queue.h2
-rw-r--r--libsoup/soup-session.c33
3 files changed, 14 insertions, 32 deletions
diff --git a/libsoup/soup-message-queue.c b/libsoup/soup-message-queue.c
index ac00f163..c7661d8c 100644
--- a/libsoup/soup-message-queue.c
+++ b/libsoup/soup-message-queue.c
@@ -58,15 +58,6 @@ queue_message_restarted (SoupMessage *msg, gpointer user_data)
{
SoupMessageQueueItem *item = user_data;
- if (item->proxy_addr) {
- g_object_unref (item->proxy_addr);
- item->proxy_addr = NULL;
- }
- if (item->proxy_uri) {
- soup_uri_free (item->proxy_uri);
- item->proxy_uri = NULL;
- }
-
g_cancellable_reset (item->cancellable);
}
@@ -171,8 +162,6 @@ soup_message_queue_item_unref (SoupMessageQueueItem *item)
g_object_unref (item->session);
g_object_unref (item->msg);
g_object_unref (item->cancellable);
- g_clear_object (&item->proxy_addr);
- g_clear_pointer (&item->proxy_uri, soup_uri_free);
g_clear_object (&item->task);
if (item->io_source) {
g_source_destroy (item->io_source);
diff --git a/libsoup/soup-message-queue.h b/libsoup/soup-message-queue.h
index 490f9a29..848ecd02 100644
--- a/libsoup/soup-message-queue.h
+++ b/libsoup/soup-message-queue.h
@@ -38,8 +38,6 @@ struct _SoupMessageQueueItem {
GMainContext *async_context;
GCancellable *cancellable;
- SoupAddress *proxy_addr;
- SoupURI *proxy_uri;
SoupConnection *conn;
GTask *task;
GSource *io_source;
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index 009b6bed..ab13ca9e 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -1451,45 +1451,40 @@ soup_session_set_item_status (SoupSession *session,
SoupMessageQueueItem *item,
guint status_code)
{
- SoupURI *uri;
- char *msg;
+ SoupURI *uri = NULL;
switch (status_code) {
case SOUP_STATUS_CANT_RESOLVE:
case SOUP_STATUS_CANT_CONNECT:
uri = soup_message_get_uri (item->msg);
- msg = g_strdup_printf ("%s (%s)",
- soup_status_get_phrase (status_code),
- uri->host);
- soup_message_set_status_full (item->msg, status_code, msg);
- g_free (msg);
break;
case SOUP_STATUS_CANT_RESOLVE_PROXY:
case SOUP_STATUS_CANT_CONNECT_PROXY:
- if (item->proxy_uri && item->proxy_uri->host) {
- msg = g_strdup_printf ("%s (%s)",
- soup_status_get_phrase (status_code),
- item->proxy_uri->host);
- soup_message_set_status_full (item->msg, status_code, msg);
- g_free (msg);
- break;
- }
- soup_message_set_status (item->msg, status_code);
+ if (item->conn)
+ uri = soup_connection_get_proxy_uri (item->conn);
break;
case SOUP_STATUS_SSL_FAILED:
if (!g_tls_backend_supports_tls (g_tls_backend_get_default ())) {
soup_message_set_status_full (item->msg, status_code,
"TLS/SSL support not available; install glib-networking");
- } else
- soup_message_set_status (item->msg, status_code);
+ return;
+ }
break;
default:
- soup_message_set_status (item->msg, status_code);
break;
}
+
+ if (uri && uri->host) {
+ char *msg = g_strdup_printf ("%s (%s)",
+ soup_status_get_phrase (status_code),
+ uri->host);
+ soup_message_set_status_full (item->msg, status_code, msg);
+ g_free (msg);
+ } else
+ soup_message_set_status (item->msg, status_code);
}