soup-message-io: fix wrong-Content-Length logic
authorDan Winship <danw@gnome.org>
Sat, 31 Jul 2010 08:32:51 +0000 (10:32 +0200)
committerDan Winship <danw@gnome.org>
Sat, 31 Jul 2010 13:30:04 +0000 (15:30 +0200)
commit74e253068cfa2a9d13c8d06f96ea42ad0069a657
tree5d7f46cefc0b41209af8a58db2f22f6bd1bb0342
parentdff6d6d79d6aa2c53ab1d2f9bc1fc7a38c0df3bf
soup-message-io: fix wrong-Content-Length logic

Previously we just ignored Content-Length if the server specified
"Connection: close", which does the right thing if the specified
Content-Length is too large, but fails if the Content-Length is
correct but the server "forgets" to close the connection. Fix this so
that we always stop reading once we get to the expected
Content-Length, but we also cope with the connection closing before
that point.

https://bugzilla.gnome.org/show_bug.cgi?id=611481
libsoup/soup-message-client-io.c
libsoup/soup-message-io.c
tests/misc-test.c