summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog9
-rw-r--r--camel/camel-http-stream.c4
2 files changed, 11 insertions, 2 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 4ea359b16..dc7bde755 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,12 @@
+2007-11-22 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #376425
+
+ * camel-http-stream.c: (camel_http_stream_get_content_type):
+ Use proxy if user uses it.
+ * camel-http-stream.c: (camel_http_stream_set_proxy):
+ Do not crash if have proxy without name and password.
+
2007-11-11 Matthew Barnes <mbarnes@redhat.com>
* camel-tcp-stream-ssl.c (enable_ssl):
diff --git a/camel/camel-http-stream.c b/camel/camel-http-stream.c
index 5cd7c9763..aff9e46e1 100644
--- a/camel/camel-http-stream.c
+++ b/camel/camel-http-stream.c
@@ -540,7 +540,7 @@ camel_http_stream_get_content_type (CamelHttpStream *http_stream)
g_return_val_if_fail (CAMEL_IS_HTTP_STREAM (http_stream), NULL);
if (!http_stream->content_type && !http_stream->raw) {
- if (http_connect (http_stream, http_stream->url) == NULL)
+ if (http_connect (http_stream, http_stream->proxy ? http_stream->proxy : http_stream->url) == NULL)
return NULL;
if (http_method_invoke (http_stream) == -1)
@@ -578,7 +578,7 @@ camel_http_stream_set_proxy (CamelHttpStream *http_stream, const char *proxy_url
else
http_stream->proxy = camel_url_new (proxy_url, NULL);
- if (http_stream->proxy) {
+ if (http_stream->proxy && ((http_stream->proxy->user && *http_stream->proxy->user) || (http_stream->proxy->passwd && *http_stream->proxy->passwd))) {
char *basic, *basic64;
basic = g_strdup_printf("%s:%s", http_stream->proxy->user?http_stream->proxy->user:"",