** Fix for bug #569700
authorMilan Crha <mcrha@redhat.com>
Fri, 27 Mar 2009 15:47:24 +0000 (15:47 +0000)
committerMilan Crha <mcrha@src.gnome.org>
Fri, 27 Mar 2009 15:47:24 +0000 (15:47 +0000)
2009-03-27  Milan Crha  <mcrha@redhat.com>

** Fix for bug #569700

* camel-http-stream.c: (stream_read):
Disconnect properly on a failure.

svn path=/trunk/; revision=10193

camel/ChangeLog
camel/camel-http-stream.c

index 37e3279..e7e75cd 100644 (file)
@@ -1,3 +1,10 @@
+2009-03-27  Milan Crha  <mcrha@redhat.com>
+
+       ** Fix for bug #569700
+
+       * camel-http-stream.c: (stream_read):
+       Disconnect properly on a failure.
+
 2009-03-12  Matthew Barnes  <mbarnes@redhat.com>
 
        * camel-db.c:
index 0261b66..2eb8aa6 100644 (file)
@@ -425,14 +425,20 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
                if (http_connect (http, http->proxy ? http->proxy : http->url) == NULL)
                        return -1;
                
-               if (http_method_invoke (http) == -1)
+               if (http_method_invoke (http) == -1) {
+                       http_disconnect(http);
                        return -1;
+               }
                
-               if (http_get_statuscode (http) == -1)
+               if (http_get_statuscode (http) == -1) {
+                       http_disconnect(http);
                        return -1;
+               }
                
-               if (http_get_headers (http) == -1)
+               if (http_get_headers (http) == -1) {
+                       http_disconnect(http);
                        return -1;
+               }
                
                switch (http->statuscode) {
                case 200: