summaryrefslogtreecommitdiff
path: root/tests/connection-test.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2012-11-06 10:37:54 -0500
committerDan Winship <danw@gnome.org>2013-12-11 10:38:22 +0100
commitd834e1e5d8e41f7fa1c082a7ab1ab9ce0335daed (patch)
treefc78810f7722534d568833e0c03ec457651fdf27 /tests/connection-test.c
parentdd3e2f4d9be661a5fae96c81618fb25c438916da (diff)
downloadlibsoup-wip/server.tar.gz
SoupServer: add exciting new APIs, deprecate musty old oneswip/server
FIXME: server-howto
Diffstat (limited to 'tests/connection-test.c')
-rw-r--r--tests/connection-test.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/connection-test.c b/tests/connection-test.c
index fd7179f2..d9c38a28 100644
--- a/tests/connection-test.c
+++ b/tests/connection-test.c
@@ -51,10 +51,12 @@ timeout_request_started (SoupServer *server, SoupMessage *msg,
SoupClientContext *client, gpointer user_data)
{
SoupSocket *sock;
- GMainContext *context = soup_server_get_async_context (server);
+ GMainContext *context = g_main_context_get_thread_default ();
guint readable;
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
sock = soup_client_context_get_socket (client);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
readable = g_signal_connect (sock, "readable",
G_CALLBACK (timeout_socket), NULL);
while (soup_socket_is_connected (sock))
@@ -130,7 +132,9 @@ server_callback (SoupServer *server, SoupMessage *msg,
* the declared Content-Length. Instead, we
* forcibly close the socket at that point.
*/
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
sock = soup_client_context_get_socket (context);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
g_signal_connect (msg, "wrote-chunk",
G_CALLBACK (close_socket), sock);
} else if (no_close) {
@@ -148,7 +152,9 @@ server_callback (SoupServer *server, SoupMessage *msg,
if (!strcmp (path, "/timeout-persistent")) {
SoupSocket *sock;
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
sock = soup_client_context_get_socket (context);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
setup_timeout_persistent (server, sock);
}
@@ -956,10 +962,9 @@ main (int argc, char **argv)
apache_init ();
#endif
- server = soup_test_server_new (TRUE);
+ server = soup_test_server_new (SOUP_TEST_SERVER_IN_THREAD);
soup_server_add_handler (server, NULL, server_callback, "http", NULL);
- base_uri = soup_uri_new ("http://127.0.0.1/");
- soup_uri_set_port (base_uri, soup_server_get_port (server));
+ base_uri = soup_test_server_get_uri (server, "http", NULL);
do_content_length_framing_test ();
do_persistent_connection_timeout_test ();