gvfs r1212 - in trunk: . daemon



Author: alexl
Date: Thu Jan 31 15:25:22 2008
New Revision: 1212
URL: http://svn.gnome.org/viewvc/gvfs?rev=1212&view=rev

Log:
2008-01-31  Alexander Larsson  <alexl redhat com>

	* daemon/soup-input-stream.c:
	Handle errors in send_finish.



Modified:
   trunk/ChangeLog
   trunk/daemon/soup-input-stream.c

Modified: trunk/daemon/soup-input-stream.c
==============================================================================
--- trunk/daemon/soup-input-stream.c	(original)
+++ trunk/daemon/soup-input-stream.c	Thu Jan 31 15:25:22 2008
@@ -574,6 +574,10 @@
 {
   SoupInputStreamPrivate *priv = SOUP_INPUT_STREAM_GET_PRIVATE (stream);
   GSimpleAsyncResult *result;
+  GError *error = NULL;
+
+  if (!g_cancellable_set_error_if_cancelled (priv->cancellable, &error))
+    set_error_if_http_failed (priv->msg, &error);
 
   priv->got_headers_cb = NULL;
   priv->finished_cb = NULL;
@@ -581,7 +585,13 @@
 
   result = priv->result;
   priv->result = NULL;
-  g_simple_async_result_set_op_res_gboolean (result, SOUP_STATUS_IS_SUCCESSFUL (priv->msg->status_code));
+
+  g_simple_async_result_set_op_res_gboolean (result, error == NULL);
+  if (error)
+    {
+      g_simple_async_result_set_from_error (result, error);
+      g_error_free (error);
+    }
   g_simple_async_result_complete (result);
 }
 
@@ -677,8 +687,12 @@
 
   g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), FALSE);
   simple = G_SIMPLE_ASYNC_RESULT (result);
+
   g_return_val_if_fail (g_simple_async_result_get_source_tag (simple) == soup_input_stream_send_async, FALSE);
 
+  if (g_simple_async_result_propagate_error (simple, error))
+    return FALSE;
+
   return g_simple_async_result_get_op_res_gboolean (simple);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]