From 96eda53a6e77133369c117f2133495ee23d4619a Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 3 Apr 2009 14:31:44 +0000 Subject: [PATCH] =?utf8?q?=09Bug=20577386=20=E2=80=93=20Fails=20to=20handl?= =?utf8?q?e=20HTTPS=20redirect=20from=20a=20certain=20site.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * 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 | 9 +++++++++ libsoup/soup-gnutls.c | 13 +++++++++++++ 2 files changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog index f40fdcc..77d4742 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2009-04-03 Dan Winship + 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 + Bug 577360 – handle cookies with same name but different path * libsoup/soup-cookie-jar.c (soup_cookie_jar_add_cookie): check diff --git a/libsoup/soup-gnutls.c b/libsoup/soup-gnutls.c index 3ca9de5..41f075d 100644 --- a/libsoup/soup-gnutls.c +++ b/libsoup/soup-gnutls.c @@ -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, -- 2.7.4