37 Commits
Author SHA1 Message Date
Carlos Garcia Campos 2329dc8168 metrics: add support for size metrics 2021-04-14 11:45:03 +02:00
Carlos Garcia Campos a94a3a9a6b Stop using emacs indent-tabs-mode
We prefer spaces now instead of tabs.
2021-03-18 14:00:35 +01:00
Carlos Garcia Campos 7033879bcf session: add soup_session_send_and_read APIs
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.
2021-03-03 15:31:28 +01:00
Patrick Griffis 737eef099c Replace SoupURI with GUri 2020-11-14 19:07:24 +00:00
Carlos Garcia Campos dc66f1d3ab message: remove SOUP_MESSAGE_CONTENT_DECODED flag
Flags are expected to be set by the user to modify the behavior of a
message, not by libsoup to notify the user.
2020-11-07 19:34:02 +00:00
Patrick Griffis 92a4873ecd Remove type argument from soup_test_session_new() 2020-11-06 15:17:03 -06:00
Patrick Griffis 0120f183ca Make SoupMessage a private and final type 2020-10-28 12:52:49 -05:00
Carlos Garcia Campos 7ab4f3f36b tests: stop using SoupRequest API in tests 2020-10-26 11:53:43 +01:00
Carlos Garcia Campos 99c19cc27a Split SoupMessage into client and server parts
Add SoupServerMessage and move there all the server only functionality.
2020-10-19 14:02:25 +02:00
Carlos Garcia Campos c61e2615f4 tests: stop using soup_session_send_message in tests
Except for a few tests that seem to be testing the old API that we will
remove once the old api is gone.
2020-09-30 07:17:27 +02:00
Patrick Griffis 4b43e15879 Replace SoupBuffer with GBytes 2020-09-19 15:41:25 -07:00
Patrick Griffis 423572c6ee Remove SoupSessionAsync 2020-09-19 15:41:24 -07:00
Patrick Griffis 728ea63a5e tests: More removal of deprecated async session 2020-09-19 15:41:24 -07:00
Dan Winship 96b890dc8a tests: port old tests to new SoupServer APIs, add some new tests 2014-05-02 09:13:14 -04:00
Dan Winship a1591e15bf tests: use g_test_bug() to annotate test cases 2014-03-15 20:00:56 -04:00
Dan Winship 8e24026518 tests: remove debug_printf()s that are redundant with test names 2014-03-15 15:15:50 -04:00
Dan Winship 8224b826bd tests: split up some test programs into more tests 2014-03-15 15:13:01 -04:00
Dan Winship 094eee8d1e tests: Add resources/* to soup-test.gresource, add utility functions
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.
2014-02-08 13:20:21 +01:00
Dan Winship 64e667bda5 tests: initial port to the gtestutils framework
Some programs need to be split up into more tests, and the debug
output is mostly not updated for the new format.
2014-02-08 13:20:21 +01:00
Ryan Lortie c2c2ecbf7d fix up non-literal format string issues
Fix up a couple of errors picked up by -Werror=format-nonliteral on
clang.

https://bugzilla.gnome.org/show_bug.cgi?id=720082
2013-12-09 11:29:09 -05:00
Sergio Villar Senin b980d54cb2 test-utils: add cancellation support to soup_test_request_send
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
2013-02-12 10:15:51 +01:00
Dan Winship 2357f35017 Revert the mirroring of SoupMessage API onto SoupRequestHTTP.
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.
2012-12-28 11:26:46 -05:00
Dan Winship 17499abfc0 SoupSession: add soup_session_request_http() and _request_http_uri()
Add SoupSession helpers to return SoupRequestHTTP directly and allow
overriding the request method.
2012-12-10 17:14:57 +01:00
Dan Winship e00cf24232 Move SoupRequester API into SoupSession, declare SoupRequest stable
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.
2012-12-10 17:14:57 +01:00
Dan Winship 61b86e0724 valgrindage 2012-08-11 20:03:44 -04:00
Dan Winship 6cddb7cdd3 test-utils: simplify the SoupRequest test utils a bit 2012-07-25 08:54:11 -04:00
Dan Winship 97d2b4dc9c SoupConverterWrapper: handle empty "compressed" responses
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 (?)
2012-07-17 17:22:15 -04:00
Dan Winship ce65958b63 Add some test-utils helpers for async SoupRequest usage 2012-07-13 16:26:55 -04:00
Dan Winship d9db0727ff Clean up includes
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).
2012-07-13 14:18:36 -04:00
Dan Winship cdddef93f1 Fix the handling of trailing junk with Content-Encoding
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
2012-05-24 16:15:32 -04:00
Sergio Villar Senin dbcd20621c coding-test.c: refactored and added deflate support.
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.
2011-11-17 19:08:56 +01:00
Dan Winship aa8327f9f3 SoupContentDecoder: deal with broken apache Content-Encoding
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
2011-05-22 10:03:26 -04:00
Dan Winship 8d77fee770 Remove SoupCoding, SoupCodingGZip, use GZlibDecompressor
also add a new test to coding-test for handling content that
doesn't decode correctly
2010-12-10 12:49:39 +01:00
Dan Winship 02752ac195 Allow calling soup_test_server_new() multiple times in test programs 2010-06-11 15:26:53 -04:00
Dan Winship d08ed91a7d Fix leaks found by valgrind
Also, simply the suppressions file by using the "..." syntax, which I
think didn't exist (or at least wasn't documented) when I first
created it.
2010-03-13 11:57:09 -05:00
Dan Winship f9181c7ad0 [SoupCodingGzip] discard trailing junk after decoding, for compatibility
https://bugzilla.gnome.org/show_bug.cgi?id=606352
2010-01-23 10:40:22 -05:00
Dan Winship 04e927a174 Content-Encoding support
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
2009-12-16 14:45:40 +01:00