[evolution-data-server] Bug #511283 - Some Images Do not Display in Evolution Mail Reader



commit fc1dfcd293b245ef1309371ea39eee512ddb994b
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jul 27 16:30:52 2009 +0200

    Bug #511283 - Some Images Do not Display in Evolution Mail Reader
    
    Parameters of the URL wasn't passed to the host when not used with
    a proxy, thus the server didn't return originally requested image.

 camel/camel-http-stream.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/camel/camel-http-stream.c b/camel/camel-http-stream.c
index 1d3ca6a..3d2d5e9 100644
--- a/camel/camel-http-stream.c
+++ b/camel/camel-http-stream.c
@@ -350,7 +350,7 @@ http_get_headers (CamelHttpStream *http)
 static gint
 http_method_invoke (CamelHttpStream *http)
 {
-	const gchar *method = NULL;
+	const gchar *method = NULL, *use_url;
 	gchar *url;
 
 	switch (http->method) {
@@ -365,14 +365,23 @@ http_method_invoke (CamelHttpStream *http)
 	}
 
 	url = camel_url_to_string (http->url, 0);
+
+	if (http->proxy) {
+		use_url = url;
+	} else if (http->url->host && *http->url->host) {
+		use_url = strstr (url, http->url->host) + strlen (http->url->host);
+	} else {
+		use_url = http->url->path;
+	}
+
 	d(printf("HTTP Stream Sending: %s %s HTTP/1.0\r\nUser-Agent: %s\r\nHost: %s\r\n",
 		 method,
-		 http->proxy ? url : http->url->path,
+		 use_url,
 		 http->user_agent ? http->user_agent : "CamelHttpStream/1.0",
 		 http->url->host));
 	if (camel_stream_printf (http->raw, "%s %s HTTP/1.0\r\nUser-Agent: %s\r\nHost: %s\r\n",
 				 method,
-				 http->proxy ? url : http->url->path,
+				 use_url,
 				 http->user_agent ? http->user_agent : "CamelHttpStream/1.0",
 				 http->url->host) == -1) {
 		http_disconnect(http);



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