summaryrefslogtreecommitdiff
path: root/tests/context-test.c
AgeCommit message (Collapse)AuthorFilesLines
2019-12-09Imported Upstream version 2.62.2upstream/2.62.2Seonah Moon1-8/+11
Change-Id: Id151dafaa6ac9f569d76f08282b5c9e4c3b19621
2014-11-04Imported Upstream version 2.46.0upstream/2.46.0Zhang zhengguang1-61/+29
2012-07-13Clean up includesDan Winship1-18/+0
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).
2011-12-01Require glib 2.31 and update to new thread APIsDan Winship1-18/+12
2011-11-12context-test: fix cleanup code to avoid a crashDan Winship1-4/+5
2011-11-08Add SoupSession:use-thread-contextDan Winship1-24/+156
Add a SoupSession flag telling it to use g_main_context_get_thread_default() on a per-message basis, rather than using a single GMainContext for everything. In the simple case, this is just more glib-like API. In the more complicated case, it allows synchronously sending one or more messages on a SoupSessionAsync without running the main GMainLoop. https://bugs.webkit.org/show_bug.cgi?id=68238
2010-06-11Allow calling soup_test_server_new() multiple times in test programsDan Winship1-0/+1
2009-03-27 Bug 576583 - Tests fail if "localhost" resolves to ::1Dan Winship1-1/+1
* tests/*.c: Use "127.0.0.1" in URIs rather than "localhost", since the default SoupServer config only listen on IPv4 (qv bug 522519), and tests/httpd.conf.in only configures apache to listen on IPv4, and we don't handle multiple IP addresses (qv bug 526321) but the machine might be configured to return "::1" rather than "127.0.0.1" first for "localhost". Patch from Andreas Rottmann. svn path=/trunk/; revision=1257
2008-09-30store the GSource in priv, don't ref the session. Otherwise the sessionDan Winship1-4/+2
* libsoup/soup-session-async.c (do_idle_run_queue): store the GSource in priv, don't ref the session. Otherwise the session won't get destroyed if you abort it and then don't return to its main loop. (addendum to #498509, Arnout Vandecappelle) (finalize): Destroy the idle_run_queue source when finalizing. (run_queue, got_connection): Ref the session when calling soup_connection_connect_async(), and do a do_idle_run_queue()+unref in got_connection, to ensure correct handling regardless of what the application does with its own ref on the session. (final_finished): Likewise, ref/do_idle_run_queue/unref rather than calling run_queue directly and playing with weak pointers. * libsoup/soup-session.c (connect_result): ref the session around the cancel-if-error loop Fixes #533473, crash in seahorse when connecting to a non-responsive key server. * tests/misc-test.c (do_callback_unref_test): Add a test for the bug in #533473. * tests/test-utils.c (soup_test_session_abort_unref): abort and unref a SoupSession, and consider it an error if the session still exists afterward. Suggested by Arnout Vandecappelle. (test_server_shutdown): Likewise, consider it an error if the server is leaked. * tests/*.c: Use soup_test_session_abort_unref(). svn path=/trunk/; revision=1168
2008-04-05 Misc fixes noticed by "sparse" or by running gcc with additionalDan Winship1-3/+3
-W flags * libsoup/soup-auth-manager-ntlm.c (ntlm_authorize_post): fix a potentially uninitialized variable. (Grumble. gcc needs -Wdo-optimization-so-you-can-generate-code-flow-related-warnings- but-then-emit-unoptimized-code-for-ease-of-debugging) * libsoup/soup-gnutls.c (soup_gnutls_channel_funcs): make this static * libsoup/soup-uri.c (uri_decoded_copy, uri_normalized_copy): add "static". (This doesn't change the generated code; the prototype was already declared static and so gcc was treating the function as static even though the main declaration *wasn't* declared static. I'm not sure if this is a bug in gcc or an oddity of the spec, but it's confusing, so...) * libsoup/soup-xmlrpc.c (soup_xmlrpc_build_method_response): s/FALSE/NULL/ * libsoup/soup-xmlrpc.h: add G_GNUC_PRINTF to soup_xmlrpc_build_format * tests/*.c: misc minor fixes, mostly involving missing "const"s and "static"s to get better warnings, and then remove some unused variables. * tests/continue-test.c (do_message): fix a crash when the test fails * tests/test-utils.h (debug_printf): add G_GNUC_PRINTF to prototype svn path=/trunk/; revision=1123
2008-01-15Merge libsoup-2.4 branch to trunkDan Winship1-151/+63
* Merge libsoup-2.4 branch to trunk svn path=/trunk/; revision=1041
2007-11-21don't leak the async_contextDan Winship1-0/+366
* libsoup/soup-message-io.c (soup_message_io_unpause): don't leak the async_context * libsoup/soup-server.c (soup_server_quit): disconnect the "new_connection" handler. (soup_server_get_async_context): Convenience method to return the server's async_context. * libsoup/soup-server-message.c: don't circularly ref the server, there's no need anyway. * libsoup/soup-session.c (soup_session_get_async_context): Convenience method to return the session's async_context. * libsoup/soup-session-async.c (queue_message): call run_queue in the session's async_context, not the main context. (send_message): don't leak the async_context * libsoup/soup-session-sync.c (queue_message_thread): don't leak the async_context * tests/context-test.c: test that SOUP_SESSION_ASYNC_CONTEXT works and doesn't leak svn path=/trunk/; revision=954