From: Dan Winship Date: Thu, 18 Dec 2003 21:36:01 +0000 (+0000) Subject: Actually disconnect the socket rather than just unreffing it, since the IO X-Git-Tag: LIBSOUP_2_1_3~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=654248bcf1cf2fc71d7df3e21cb7c551964b8a08;p=platform%2Fupstream%2Flibsoup.git Actually disconnect the socket rather than just unreffing it, since the IO * libsoup/soup-connection.c (soup_connection_disconnect): Actually disconnect the socket rather than just unreffing it, since the IO code may be holding an extra ref on it. (send_request): connect to the "restarted" signal too (request_restarted): Deal with "Connection: close" * libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): Make this not go into an infinite loop if the server only supports Basic. --- diff --git a/ChangeLog b/ChangeLog index 243e07e..594aced 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2003-12-18 Dan Winship + + * libsoup/soup-connection.c (soup_connection_disconnect): Actually + disconnect the socket rather than just unreffing it, since the IO + code may be holding an extra ref on it. + (send_request): connect to the "restarted" signal too + (request_restarted): Deal with "Connection: close" + + * libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): Make this + not go into an infinite loop if the server only supports Basic. + 2003-12-17 Rodrigo Moya * libsoup/Makefile.am: install soup-message-queue.h with the rest diff --git a/libsoup/soup-connection-ntlm.c b/libsoup/soup-connection-ntlm.c index 6724343..6872dbd 100644 --- a/libsoup/soup-connection-ntlm.c +++ b/libsoup/soup-connection-ntlm.c @@ -99,6 +99,7 @@ ntlm_authorize_pre (SoupMessage *msg, gpointer user_data) val = headers->data; if (!strncmp (val, "NTLM ", 5)) break; + headers = headers->next; } if (!headers) return; diff --git a/libsoup/soup-connection.c b/libsoup/soup-connection.c index 67bbfca..7c1535a 100644 --- a/libsoup/soup-connection.c +++ b/libsoup/soup-connection.c @@ -462,6 +462,7 @@ soup_connection_disconnect (SoupConnection *conn) g_signal_handlers_disconnect_by_func (conn->priv->socket, socket_disconnected, conn); + soup_socket_disconnect (conn->priv->socket); g_object_unref (conn->priv->socket); conn->priv->socket = NULL; g_signal_emit (conn, signals[DISCONNECTED], 0); @@ -497,6 +498,13 @@ soup_connection_last_used (SoupConnection *conn) } static void +request_restarted (SoupMessage *req, gpointer conn) +{ + if (!soup_message_is_keepalive (req)) + soup_connection_disconnect (conn); +} + +static void request_done (SoupMessage *req, gpointer user_data) { SoupConnection *conn = user_data; @@ -507,10 +515,11 @@ request_done (SoupMessage *req, gpointer user_data) conn->priv->last_used = time (NULL); conn->priv->in_use = FALSE; - g_signal_handlers_disconnect_by_func (req, request_done, conn); - if (!soup_message_is_keepalive (req)) soup_connection_disconnect (conn); + + g_signal_handlers_disconnect_by_func (req, request_done, conn); + g_signal_handlers_disconnect_by_func (req, request_restarted, conn); } static void @@ -523,6 +532,8 @@ send_request (SoupConnection *conn, SoupMessage *req) g_object_add_weak_pointer (G_OBJECT (req), (gpointer *)conn->priv->cur_req); + g_signal_connect (req, "restarted", + G_CALLBACK (request_restarted), conn); g_signal_connect (req, "finished", G_CALLBACK (request_done), conn); }