SoupHTTPInputStream: change handling of error responses
authorDan Winship <danw@gnome.org>
Sun, 23 Oct 2011 17:51:13 +0000 (13:51 -0400)
committerDan Winship <danw@gnome.org>
Thu, 1 Dec 2011 10:35:48 +0000 (11:35 +0100)
commit3b11e881fcf4cb7026604aac9d93b6497e48d0ed
tree71b11e41f2adf6c50d85fc365032e82ee9b31d6f
parentc524540f1eb7c1d68597227ab677b47345bc54b5
SoupHTTPInputStream: change handling of error responses

Old behavior:

  - If the (initial) response status code is 3xx/401/407, and the
    message is successfully restarted, then just throw away the
    initial response.

  - If the (final) response status code is 2xx, then stream the body.

  - Otherwise, return a GError from soup_http_input_stream_send*(),
    and don't stream the body.

This worked OK for gvfs, which never cared about the bodies of 4xx
responses, but was problematic for WebKitGTK, which ended up needing
three separate (but interwoven) codepaths to handle all the cases.
(And still ended up handling 407 wrong.)

New behavior:

  - If the (initial) response status code is 3xx/401/407, and the
    message is successfully restarted, then just throw away the
    initial response.

  - The body of the (final) response is always streamed to the caller.

  - A GError is only returned on transport errors, not on 4xx/5xx
    responses

(This is an API break, but SoupHTTPInputStream is not API-stable.)

https://bugzilla.gnome.org/show_bug.cgi?id=663451
libsoup/soup-http-input-stream.c