aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-01-31 01:05:17 +0800
committerMilan Crha <mcrha@redhat.com>2012-01-31 01:06:03 +0800
commitcd1d443439e3131d4cb27175345424702c38ac8a (patch)
tree618e527d29500e8b7e032ab391761a00ea2167e7 /mail
parent8fb84dda1293997250313223fb106cf845b09626 (diff)
downloadgsoc2013-evolution-cd1d443439e3131d4cb27175345424702c38ac8a.tar
gsoc2013-evolution-cd1d443439e3131d4cb27175345424702c38ac8a.tar.gz
gsoc2013-evolution-cd1d443439e3131d4cb27175345424702c38ac8a.tar.bz2
gsoc2013-evolution-cd1d443439e3131d4cb27175345424702c38ac8a.tar.lz
gsoc2013-evolution-cd1d443439e3131d4cb27175345424702c38ac8a.tar.xz
gsoc2013-evolution-cd1d443439e3131d4cb27175345424702c38ac8a.tar.zst
gsoc2013-evolution-cd1d443439e3131d4cb27175345424702c38ac8a.zip
Bug #669005 - Partial hang with unresponsive HTML email image source
Diffstat (limited to 'mail')
-rw-r--r--mail/em-format-html.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index 107c2ce267..5406223f10 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -1595,7 +1595,6 @@ emfh_gethttp (struct _EMFormatHTMLJob *job,
{
CamelStream *cistream = NULL, *costream = NULL, *instream = NULL;
CamelURL *url;
- CamelContentType *content_type;
CamelHttpStream *tmp_stream;
gssize n, total = 0, pc_complete = 0, nread = 0;
gchar buffer[1500];
@@ -1636,12 +1635,16 @@ emfh_gethttp (struct _EMFormatHTMLJob *job,
camel_operation_push_message (
cancellable, _("Retrieving '%s'"), job->u.uri);
tmp_stream = (CamelHttpStream *) instream;
- content_type = camel_http_stream_get_content_type (tmp_stream);
- length = camel_header_raw_find(&tmp_stream->headers, "Content-Length", NULL);
- d(printf(" Content-Length: %s\n", length));
- if (length != NULL)
- total = atoi (length);
- camel_content_type_unref (content_type);
+ if (camel_stream_read (CAMEL_STREAM (instream), NULL, 0, cancellable, NULL) == 0) {
+ CamelContentType *content_type;
+
+ content_type = camel_http_stream_get_content_type (tmp_stream);
+ length = camel_header_raw_find(&tmp_stream->headers, "Content-Length", NULL);
+ d(printf(" Content-Length: %s\n", length));
+ if (length != NULL)
+ total = atoi (length);
+ camel_content_type_unref (content_type);
+ }
} else
camel_operation_push_message (
cancellable, _("Retrieving '%s'"), job->u.uri);