[evolution-data-server] Bug 729172 - [IMAPx] Cannot retrieve certain messages
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug 729172 - [IMAPx] Cannot retrieve certain messages
- Date: Wed, 2 Jul 2014 08:51:01 +0000 (UTC)
commit d3999fe0e8f15fa673a4ef393d26e342b4745a40
Author: Ian Campbell <ijc hellion org uk>
Date: Wed Jul 2 10:50:27 2014 +0200
Bug 729172 - [IMAPx] Cannot retrieve certain messages
camel/providers/imapx/camel-imapx-server.c | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 73d0f90..2d14ee3 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -2179,7 +2179,6 @@ imapx_untagged_fetch (CamelIMAPXServer *is,
GOutputStream *output_stream;
gconstpointer body_data;
gsize body_size;
- gboolean success;
if (data->use_multi_fetch) {
data->body_offset = finfo->offset;
@@ -2194,15 +2193,18 @@ imapx_untagged_fetch (CamelIMAPXServer *is,
body_data = g_bytes_get_data (finfo->body, &body_size);
- success = g_output_stream_write_all (
- output_stream, body_data, body_size,
- NULL, cancellable, error);
-
- if (!success) {
- g_prefix_error (
- error, "%s: ",
- _("Error writing to cache stream"));
- return FALSE;
+ /* Sometimes the server, like Microsoft Exchange, reports larger message
+ size than it actually is, which results in no data being read from
+ the server for that particular offset. */
+ if (body_size) {
+ if (!g_output_stream_write_all (
+ output_stream, body_data, body_size,
+ NULL, cancellable, error)) {
+ g_prefix_error (
+ error, "%s: ",
+ _("Error writing to cache stream"));
+ return FALSE;
+ }
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]