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



commit 3ea35694702692ad17895e5751146127606e591d
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.

 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 c15e53f..8845d90 100644
--- a/camel/camel-imapx-server.c
+++ b/camel/camel-imapx-server.c
@@ -804,15 +804,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]