aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-08-11 02:11:03 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-08-11 02:11:03 +0800
commit45f6b55148a6e393fa349c11e5c01efa1093c5ac (patch)
tree4a17c0217d4191c9d7388d45317e1c7003b85e7f /camel/providers
parent04b7488ac8b8ce75a55892adafa309f96be7ef7d (diff)
downloadgsoc2013-evolution-45f6b55148a6e393fa349c11e5c01efa1093c5ac.tar.gz
gsoc2013-evolution-45f6b55148a6e393fa349c11e5c01efa1093c5ac.tar.zst
gsoc2013-evolution-45f6b55148a6e393fa349c11e5c01efa1093c5ac.zip
Set the total bytes expected to 0 if the response is empty too.
2001-08-10 Jeffrey Stedfast <fejj@ximian.com> * providers/pop3/camel-pop3-folder.c (pop3_get_message_stream): Set the total bytes expected to 0 if the response is empty too. svn path=/trunk/; revision=11885
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/pop3/camel-pop3-folder.c2
-rw-r--r--camel/providers/pop3/camel-pop3-store.c14
2 files changed, 8 insertions, 8 deletions
diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c
index c8dc315ac3..8258114585 100644
--- a/camel/providers/pop3/camel-pop3-folder.c
+++ b/camel/providers/pop3/camel-pop3-folder.c
@@ -336,7 +336,7 @@ pop3_get_message_stream (CamelFolder *folder, int id, gboolean headers_only, Cam
return NULL;
}
- if (result && sscanf (result, "%d", &total) != 1)
+ if (!result || (result && sscanf (result, "%d", &total) != 1))
total = 0;
g_free (result);
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
index 5c94c13fce..fecfd0ba77 100644
--- a/camel/providers/pop3/camel-pop3-store.c
+++ b/camel/providers/pop3/camel-pop3-store.c
@@ -528,11 +528,11 @@ camel_pop3_command (CamelPop3Store *store, char **ret, CamelException *ex, char
{
char *cmdbuf;
va_list ap;
-
+
va_start (ap, fmt);
cmdbuf = g_strdup_vprintf (fmt, ap);
va_end (ap);
-
+
/* Send the command */
if (camel_remote_store_send_string (CAMEL_REMOTE_STORE (store), ex, "%s\r\n", cmdbuf) < 0) {
g_free (cmdbuf);
@@ -541,7 +541,7 @@ camel_pop3_command (CamelPop3Store *store, char **ret, CamelException *ex, char
return CAMEL_POP3_FAIL;
}
g_free (cmdbuf);
-
+
return pop3_get_response (store, ret, ex);
}
@@ -550,20 +550,20 @@ pop3_get_response (CamelPop3Store *store, char **ret, CamelException *ex)
{
char *respbuf;
int status;
-
+
if (camel_remote_store_recv_line (CAMEL_REMOTE_STORE (store), &respbuf, ex) < 0) {
if (ret)
*ret = NULL;
return CAMEL_POP3_FAIL;
}
-
+
if (!strncmp (respbuf, "+OK", 3))
status = CAMEL_POP3_OK;
else if (!strncmp (respbuf, "-ERR", 4))
status = CAMEL_POP3_ERR;
else
status = CAMEL_POP3_FAIL;
-
+
if (ret) {
if (status != CAMEL_POP3_FAIL) {
*ret = strchr (respbuf, ' ');
@@ -573,7 +573,7 @@ pop3_get_response (CamelPop3Store *store, char **ret, CamelException *ex)
*ret = NULL;
}
g_free (respbuf);
-
+
return status;
}