This is convenient API to send a message and read its body into a
GBytes. This should replace the basic APIs since it covers the same use
case, but using a SoupMessage instead of a URI and with ore flexibility.
Add the files in resources/ to soup-test.gresource, and add
soup_test_load_resource() to get the contents of one of them, and then
use this in places that were previously reading them by hand.
Except forms-test, which needs to pass a filename to curl, so have it
use index.txt instead of one of the resource files.
Now none of the tests access the resources/ directory at runtime.
Also add soup_test_get_index() to read index.txt rather than
reimplementing it in multiple test programs.
The function gets a new parametter used to enable request cancellation for
both sync and async sessions. The cancellation could be performed by either
using the GCancellable or by directly cancelling the SoupMessage.
Also the GMainContext used to simulate sync operations with async ones will
now try to execute all its pending events before quiting the main loop.
https://bugzilla.gnome.org/show_bug.cgi?id=692310
SoupMessage isn't being deprecated, and mirroring its API onto
SoupRequestHTTP is just going to result in always having to add every
new API twice. Also, it turns out to be less useful than originally
expected anyway, since you end up having to cast between SoupRequest
and SoupRequestHTTP frequently anyway.
This reverts commit d711732940 and most of
commit 53c270d0e2.
Add soup_session_request() and soup_session_request_uri(),
implementing basically the same behavior as soup_requester_request()
and soup_requester_request_uri() (but without requiring a separate
SoupSessionFeature), and remove the unstable-api ifdefs from
soup-request*.h.
SoupRequester still exists, but it is still guarded by the
unstable-api ifdefs, and is just a dummy wrapper around the
functionality that is now in SoupSession.
If a server sends an empty response but includes a Content-Encoding
header (in particular, in a HEAD or 304 response), suppress the
PARTIAL_INPUT error from the GZlibDecompressor and just return 0.
https://bugzilla.gnome.org/show_bug.cgi?id=679527 (?)
Especially, include soup.h rather than individually including a bunch
of other public soup-*.h files.
Remove unnecessary system includes (many are leftovers from code that
has moved down into glib).
When a content-encoded response has trailing junk,
SoupConverterWrapper needs to make sure that all of that junk gets
read before returning G_CONVERTER_FINISHED, or else it will end up
becoming the start of the next response on that connection.
coding-test wasn't hitting this, because the trailing junk was always
small enough that it would have been read into GConverterInputStream's
internal buffer already at the point when the GZlibDecompresser
returned FINISHED. Switching coding-test to use chunked encoding
caused it to reliably hit the bug though, because the final 0-length
chunk (including its header) will always still be unread at that
point. So update it to use that.
Also add a SoupRequest-based test to coding-test, though it turns out
to not have been relevant to this bug, which affected the SoupMessage
API too.
https://bugzilla.gnome.org/show_bug.cgi?id=676477
Refactored the original code. A couple of utility functions perform now all
the checks.
Content compressed with deflate algorithm (with or without zlib headers) is
also supported and checked.
When sending a .gz file, Apache will (by default) incorrectly claim
"Content-Encoding: gzip", causing us to do the wrong thing with it.
Work around this bug in the same way Firefox does.
https://bugzilla.gnome.org/show_bug.cgi?id=613361
Adds SoupContentDecoder, which provides support for decoding "gzip"
Content-Encoding. For now other types are not supported and can't be
added. The SoupCoding interface is private because it will eventually
be replaced with something GConverter-based.
https://bugzilla.gnome.org/show_bug.cgi?id=522772