? docs/reference/client-howto.xml
? docs/reference/server-howto.xml
Index: libsoup/soup-message-io.c
===================================================================
RCS file: /cvs/gnome/libsoup/libsoup/soup-message-io.c,v
retrieving revision 1.26
diff -u -p -r1.26 soup-message-io.c
--- libsoup/soup-message-io.c	10 Apr 2006 18:09:01 -0000	1.26
+++ libsoup/soup-message-io.c	24 May 2006 17:52:59 -0000
@@ -66,8 +66,8 @@ typedef struct {
  */
 #define dummy_to_make_emacs_happy {
 #define SOUP_MESSAGE_IO_PREPARE_FOR_CALLBACK { gboolean cancelled; g_object_ref (msg);
-#define SOUP_MESSAGE_IO_RETURN_IF_CANCELLED_OR_PAUSED cancelled = (priv->io_data != io); g_object_unref (msg); if (cancelled || !io->read_tag || !io->write_tag) return; }
-#define SOUP_MESSAGE_IO_RETURN_VAL_IF_CANCELLED_OR_PAUSED(val) cancelled = (priv->io_data != io); g_object_unref (msg); if (cancelled || !io->read_tag || !io->write_tag) return val; }
+#define SOUP_MESSAGE_IO_RETURN_IF_CANCELLED_OR_PAUSED cancelled = (priv->io_data != io); g_object_unref (msg); if (cancelled || (!io->read_tag && !io->write_tag)) return; }
+#define SOUP_MESSAGE_IO_RETURN_VAL_IF_CANCELLED_OR_PAUSED(val) cancelled = (priv->io_data != io); g_object_unref (msg); if (cancelled || (!io->read_tag && !io->write_tag)) return val; }
 
 #define RESPONSE_BLOCK_SIZE 8192
 
@@ -529,6 +529,11 @@ io_write (SoupSocket *sock, SoupMessage 
 
 
 	case SOUP_MESSAGE_IO_STATE_DONE:
+		if (io->write_tag) {
+			g_signal_handler_disconnect (io->sock, io->write_tag);
+			io->write_tag = 0;
+		}
+
 		if (io->mode == SOUP_MESSAGE_IO_CLIENT) {
 			io->read_state = SOUP_MESSAGE_IO_STATE_HEADERS;
 			io_read (sock, msg);
@@ -694,6 +699,11 @@ io_read (SoupSocket *sock, SoupMessage *
 
 
 	case SOUP_MESSAGE_IO_STATE_DONE:
+		if (io->read_tag) {
+			g_signal_handler_disconnect (io->sock, io->read_tag);
+			io->read_tag = 0;
+		}
+
 		if (io->mode == SOUP_MESSAGE_IO_SERVER) {
 			io->write_state = SOUP_MESSAGE_IO_STATE_HEADERS;
 			io_write (sock, msg);
