diff options
author | Christian Kellner <gicmo@gnome.org> | 2008-01-16 12:24:53 +0000 |
---|---|---|
committer | Christian Kellner <gicmo@src.gnome.org> | 2008-01-16 12:24:53 +0000 |
commit | fa303f6d74b292bcd241b58dc155b230f37030fd (patch) | |
tree | 2f955a9a90eaa4e8274f4e358b2aa1810eaeb7f4 /daemon/soup-output-stream.c | |
parent | e46cf6983c520c19c875125a1537254ef68694e1 (diff) | |
download | gvfs-fa303f6d74b292bcd241b58dc155b230f37030fd.tar.gz |
Port to libsoup-2.4.
2008-01-16 Christian Kellner <gicmo@gnome.org>
* daemon/gvfsbackenddav.c:
* daemon/gvfsbackendhttp.c:
* daemon/gvfsbackendhttp.h:
* daemon/soup-input-stream.c:
* daemon/soup-output-stream.c:
Port to libsoup-2.4.
* configure.ac:
* daemon/Makefile.am:
Make building of http optional (and depend on wether
libsoup is found or not)
svn path=/trunk/; revision=1139
Diffstat (limited to 'daemon/soup-output-stream.c')
-rw-r--r-- | daemon/soup-output-stream.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/daemon/soup-output-stream.c b/daemon/soup-output-stream.c index 7a83ce58..0bca29bb 100644 --- a/daemon/soup-output-stream.c +++ b/daemon/soup-output-stream.c @@ -38,6 +38,7 @@ typedef struct { SoupSession *session; GMainContext *async_context; SoupMessage *msg; + gboolean finished; goffset size, offset; GByteArray *ba; @@ -184,7 +185,7 @@ soup_output_stream_cancelled (GIOChannel *chan, GIOCondition condition, priv->cancel_watch = NULL; - soup_message_io_pause (priv->msg); + soup_session_pause_message (priv->session, priv->msg); if (priv->cancelled_cb) priv->cancelled_cb (stream); @@ -198,9 +199,8 @@ soup_output_stream_prepare_for_io (GOutputStream *stream, GCancellable *cancella int cancel_fd; /* Move the buffer to the SoupMessage */ - priv->msg->request.body = (char *)priv->ba->data; - priv->msg->request.length = priv->ba->len; - priv->msg->request.owner = SOUP_BUFFER_SYSTEM_OWNED; + soup_message_body_append (priv->msg->request_body, SOUP_MEMORY_TAKE, + priv->ba->data, priv->ba->len); g_byte_array_free (priv->ba, FALSE); priv->ba = NULL; @@ -281,8 +281,7 @@ soup_output_stream_close (GOutputStream *stream, } soup_output_stream_prepare_for_io (stream, cancellable); - while (priv->msg->status != SOUP_MESSAGE_STATUS_FINISHED && - !g_cancellable_is_cancelled (cancellable)) + while (!priv->finished && !g_cancellable_is_cancelled (cancellable)) g_main_context_iteration (priv->async_context, TRUE); soup_output_stream_done_io (stream); @@ -370,6 +369,8 @@ soup_output_stream_finished (SoupMessage *msg, gpointer stream) { SoupOutputStreamPrivate *priv = SOUP_OUTPUT_STREAM_GET_PRIVATE (stream); + priv->finished = TRUE; + g_signal_handlers_disconnect_by_func (priv->msg, G_CALLBACK (soup_output_stream_finished), stream); close_async_done (stream); } |