Bug 577386 – Fails to handle HTTPS redirect from a certain site.
authorDan Winship <danw@src.gnome.org>
Fri, 3 Apr 2009 14:31:44 +0000 (14:31 +0000)
committerDan Winship <danw@src.gnome.org>
Fri, 3 Apr 2009 14:31:44 +0000 (14:31 +0000)
* libsoup/soup-gnutls.c (soup_gnutls_read): Treat abnormal
EOFs as though they were normal, rather than as errors. Shrug.

Reported by Diego Escalante Urrelo.

svn path=/trunk/; revision=1263

ChangeLog
libsoup/soup-gnutls.c

index f40fdcc..77d4742 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2009-04-03  Dan Winship  <danw@gnome.org>
 
+       Bug 577386 – Fails to handle HTTPS redirect from a certain site.
+
+       * libsoup/soup-gnutls.c (soup_gnutls_read): Treat abnormal
+       EOFs as though they were normal, rather than as errors. Shrug.
+
+       Reported by Diego Escalante Urrelo.
+
+2009-04-03  Dan Winship  <danw@gnome.org>
+
        Bug 577360 – handle cookies with same name but different path
 
        * libsoup/soup-cookie-jar.c (soup_cookie_jar_add_cookie): check
index 3ca9de5..41f075d 100644 (file)
@@ -206,6 +206,19 @@ again:
                        goto again;
        }
 
+       if (result == GNUTLS_E_UNEXPECTED_PACKET_LENGTH) {
+               /* This means the connection was either corrupted or
+                * interrupted. One particular thing that it can mean
+                * is that the remote end closed the connection
+                * abruptly without doing a proper TLS Close. There
+                * are security reasons why it's bad to treat this as
+                * not-an-error, but for compatibility reasons (eg,
+                * bug 577386) we kinda have to. And it's not like
+                * we're very secure anyway.
+                */
+               return G_IO_STATUS_EOF;
+       }
+
        if (result < 0) {
                g_set_error (err, G_IO_CHANNEL_ERROR,
                             G_IO_CHANNEL_ERROR_FAILED,