[evolution-data-server/gnome-3-6] imapx_command_start: Improve handling of write-to-stream error.



commit eb808f333600ffcc952ee7d7deb9b28b5b55188d
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Oct 28 07:38:10 2012 -0400

    imapx_command_start: Improve handling of write-to-stream error.
    
    For some reason we were calling camel_stream_write_string() without
    passing a GError, and on failure setting a very generic error message
    and losing potentially useful information about the actual error.
    
    (cherry picked from commit 3ea35694702692ad17895e5751146127606e591d)

 camel/camel-imapx-server.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/camel/camel-imapx-server.c b/camel/camel-imapx-server.c
index 8a97e7e..887e8ee 100644
--- a/camel/camel-imapx-server.c
+++ b/camel/camel-imapx-server.c
@@ -800,15 +800,11 @@ imapx_command_start (CamelIMAPXServer *is,
 	string = g_strdup_printf (
 		"%c%05u %s\r\n", is->tagprefix, ic->tag, cp->data);
 	retval = camel_stream_write_string (
-		CAMEL_STREAM (stream), string, cancellable, NULL);
+		CAMEL_STREAM (stream), string, cancellable, error);
 	g_free (string);
 
-	if (retval == -1) {
-		g_set_error (
-			error, CAMEL_IMAPX_ERROR, 1,
-			"Failed to issue the command");
+	if (retval == -1)
 		goto err;
-	}
 
 	while (is->literal == ic && cp_literal_plus) {
 		/* Sent LITERAL+ continuation immediately */



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