From 88b0290b0b64714bb583d213e35f0689ab2051fa Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 3 Feb 2004 21:37:22 +0000 Subject: [PATCH] Call soup_message_io_stop so we don't get a callback on the io after it's * 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 | 8 ++++++++ libsoup/soup-message-io.c | 3 ++- libsoup/soup-session.c | 3 +-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 494a326..dac65f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2004-02-03 Dan Winship + * 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, diff --git a/libsoup/soup-message-io.c b/libsoup/soup-message-io.c index dc6e30a..a772ad0 100644 --- a/libsoup/soup-message-io.c +++ b/libsoup/soup-message-io.c @@ -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); diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c index ab1ec7a..b6b4127 100644 --- a/libsoup/soup-session.c +++ b/libsoup/soup-session.c @@ -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); } -- 2.7.4