oops, I apparently didn't run "make check" after the tls changes...
authorDan Winship <danw@gnome.org>
Thu, 20 Oct 2011 21:56:12 +0000 (17:56 -0400)
committerDan Winship <danw@gnome.org>
Thu, 20 Oct 2011 21:56:12 +0000 (17:56 -0400)
libsoup/soup-message.c
libsoup/soup-session-async.c
libsoup/soup-session-sync.c
tests/ssl-test.c

index a8d8ba3..82f39de 100644 (file)
@@ -1403,12 +1403,6 @@ soup_message_cleanup_response (SoupMessage *req)
        }
        priv->http_version = priv->orig_http_version;
 
-       if (priv->tls_certificate) {
-               g_object_unref (priv->tls_certificate);
-               priv->tls_certificate = NULL;
-       }
-       priv->tls_errors = 0;
-
        g_object_notify (G_OBJECT (req), SOUP_MESSAGE_STATUS_CODE);
        g_object_notify (G_OBJECT (req), SOUP_MESSAGE_REASON_PHRASE);
        g_object_notify (G_OBJECT (req), SOUP_MESSAGE_HTTP_VERSION);
@@ -1884,8 +1878,9 @@ soup_message_set_first_party (SoupMessage *msg,
 void
 soup_message_set_https_status (SoupMessage *msg, SoupConnection *conn)
 {
-       SoupSocket *sock = soup_connection_get_socket (conn);
+       SoupSocket *sock;
 
+       sock = conn ? soup_connection_get_socket (conn) : NULL;
        if (sock && soup_socket_is_ssl (sock)) {
                GTlsCertificate *certificate;
                GTlsCertificateFlags errors;
index 33bf202..c813931 100644 (file)
@@ -234,6 +234,8 @@ tunnel_complete (SoupMessageQueueItem *item)
        soup_message_finished (item->msg);
        if (item->related->msg->status_code)
                item->related->state = SOUP_MESSAGE_FINISHING;
+       else
+               soup_message_set_https_status (item->related->msg, item->conn);
 
        do_idle_run_queue (session);
        soup_message_queue_item_unref (item->related);
index b6494d0..42612b6 100644 (file)
@@ -171,7 +171,7 @@ tunnel_connect (SoupSession *session, SoupMessageQueueItem *related)
        if (SOUP_STATUS_IS_SUCCESSFUL (status)) {
                if (!soup_connection_start_ssl_sync (conn, related->cancellable))
                        status = SOUP_STATUS_SSL_FAILED;
-               soup_message_set_https_status (item->msg, conn);
+               soup_message_set_https_status (related->msg, conn);
        }
 
        if (!SOUP_STATUS_IS_SUCCESSFUL (status))
@@ -214,6 +214,8 @@ try_again:
                goto try_again;
        }
 
+       soup_message_set_https_status (msg, item->conn);
+
        if (!SOUP_STATUS_IS_SUCCESSFUL (status)) {
                if (!msg->status_code)
                        soup_session_set_item_status (session, item, status);
index bdc8ae8..37e746e 100644 (file)
@@ -91,6 +91,12 @@ do_one_strict_test (SoupSession *session, char *uri,
                              msg->status_code, msg->reason_phrase,
                              expected_status,
                              soup_status_get_phrase (expected_status));
+               if (msg->status_code == SOUP_STATUS_SSL_FAILED) {
+                       GTlsCertificateFlags flags = 0;
+
+                       soup_message_get_https_status (msg, NULL, &flags);
+                       debug_printf (1, "              tls error flags: 0x%x\n", flags);
+               }
                errors++;
        }
        g_object_unref (msg);