unref the old read_tag before changing/clearing it.
authorDan Winship <danw@src.gnome.org>
Mon, 23 Jun 2003 15:52:34 +0000 (15:52 +0000)
committerDan Winship <danw@src.gnome.org>
Mon, 23 Jun 2003 15:52:34 +0000 (15:52 +0000)
        * libsoup/soup-queue.c (soup_queue_read_done_cb): unref the
        old read_tag before changing/clearing it.
        (soup_queue_write_done_cb): Likewise with the write_tag.

        * libsoup/soup-transfer.c (issue_final_callback): ref the reader
        around the stop+callback.
        (soup_transfer_write_cb): Likewise.

ChangeLog
libsoup/soup-queue.c
libsoup/soup-transfer.c

index 44449e0..2a8ac7b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2003-06-19  Dan Winship  <danw@ximian.com>
+
+       * libsoup/soup-queue.c (soup_queue_read_done_cb): unref the
+       old read_tag before changing/clearing it.
+       (soup_queue_write_done_cb): Likewise with the write_tag.
+
+       * libsoup/soup-transfer.c (issue_final_callback): ref the reader
+       around the stop+callback.
+       (soup_transfer_write_cb): Likewise.
+
 2003-06-12  Dan Winship  <danw@ximian.com>
 
        * libsoup/soup-transfer.c (SoupReader, SoupWriter): add a
index 74baaef..7695583 100644 (file)
@@ -258,6 +258,8 @@ soup_queue_read_done_cb (const SoupDataBuffer *data,
        req->response.length = data->length;
        req->response.body = data->body;
 
+       soup_transfer_read_unref (req->priv->read_tag);
+
        if (req->errorclass == SOUP_ERROR_CLASS_INFORMATIONAL) {
                GIOChannel *channel;
                gboolean overwrt;
@@ -278,7 +280,7 @@ soup_queue_read_done_cb (const SoupDataBuffer *data,
        } 
        else {
                req->status = SOUP_STATUS_FINISHED;
-               req->priv->read_tag = 0;
+               req->priv->read_tag = NULL;
        }
 
        soup_message_run_handlers (req, SOUP_HANDLER_POST_BODY);
@@ -462,7 +464,8 @@ soup_queue_write_done_cb (gpointer user_data)
 {
        SoupMessage *req = user_data;
 
-       req->priv->write_tag = 0;
+       soup_transfer_write_unref (req->priv->write_tag);
+       req->priv->write_tag = NULL;
        req->status = SOUP_STATUS_READING_RESPONSE;
 }
 
index 625e02f..19ec04d 100644 (file)
@@ -186,9 +186,11 @@ issue_final_callback (SoupReader *r)
 
        r->callback_issued = TRUE;
 
+       soup_transfer_read_ref (r);
        soup_transfer_read_stop (r);
 
        (*r->read_done_cb) (&buf, r->user_data);
+       soup_transfer_read_unref (r);
 }
 
 static gboolean
@@ -775,8 +777,10 @@ soup_transfer_write_cb (GIOChannel* iochannel,
                goto WRITE_AGAIN;
        }
 
+       soup_transfer_write_ref (w);
        soup_transfer_write_stop (w);
        (*w->write_done_cb) (w->user_data);
+       soup_transfer_write_unref (w);
        return FALSE;
 }