Call soup_message_io_stop so we don't get a callback on the io after it's
authorDan Winship <danw@src.gnome.org>
Tue, 3 Feb 2004 21:37:22 +0000 (21:37 +0000)
committerDan Winship <danw@src.gnome.org>
Tue, 3 Feb 2004 21:37:22 +0000 (21:37 +0000)
        * libsoup/soup-message-io.c (io_cleanup): Call
        soup_message_io_stop so we don't get a callback on the io after
        it's been cleaned up.

        * libsoup/soup-session.c (add_auth): Only remove the Authorization
        header if we have another one to add. (Otherwise it messes up
        SoupConnectionNTLM.)

ChangeLog
libsoup/soup-message-io.c
libsoup/soup-session.c

index 494a326..dac65f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2004-02-03  Dan Winship  <danw@ximian.com>
 
+       * libsoup/soup-message-io.c (io_cleanup): Call
+       soup_message_io_stop so we don't get a callback on the io after
+       it's been cleaned up.
+
+       * libsoup/soup-session.c (add_auth): Only remove the Authorization
+       header if we have another one to add. (Otherwise it messes up
+       SoupConnectionNTLM.)
+
        * libsoup/soup-socket.c (read_from_buf): Use memmove rather than
        memcpy here, since the source and destination will overlap if
        *nread is small and read_buf->len is large. (Noticed by valgrind,
index dc6e30a..a772ad0 100644 (file)
@@ -76,6 +76,8 @@ io_cleanup (SoupMessage *msg)
        if (!io)
                return;
 
+       soup_message_io_stop (msg);
+
        if (io->sock)
                g_object_unref (io->sock);
 
@@ -123,7 +125,6 @@ static void
 soup_message_io_finished (SoupMessage *msg)
 {
        g_object_ref (msg);
-       soup_message_io_stop (msg);
        io_cleanup (msg);
        if (SOUP_MESSAGE_IS_STARTING (msg))
                soup_message_restarted (msg);
index ab1ec7a..b6b4127 100644 (file)
@@ -800,8 +800,6 @@ add_auth (SoupSession *session, SoupMessage *msg, gboolean proxy)
        SoupAuth *auth;
        char *token;
 
-       soup_message_remove_header (msg->request_headers, header);
-
        auth = lookup_auth (session, msg, proxy);
        if (!auth)
                return;
@@ -811,6 +809,7 @@ add_auth (SoupSession *session, SoupMessage *msg, gboolean proxy)
 
        token = soup_auth_get_authorization (auth, msg);
        if (token) {
+               soup_message_remove_header (msg->request_headers, header);
                soup_message_add_header (msg->request_headers, header, token);
                g_free (token);
        }