From 0c5f03a037b5dd4d6761b86e4e4160421f056aac Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 3 Jun 2003 20:38:38 +0000 Subject: Push SoupContext into the background in preparation for its eventual removal. * libsoup/soup-message.c (soup_message_new, soup_message_new_full): Take a SoupUri instead of a SoupContext (soup_message_set_uri): instead of set_context (redirect_handler): Use soup_message_set_uri (soup_message_get_context): gone * libsoup/soup-context.c (struct _SoupContext): Move this here. No one else needs to know. (soup_context_get): Gone (soup_context_from_uri): constify uri (get_proxy): moved here from soup-misc.c and made to return a SoupUri. (try_create_connection): Update for that. * libsoup/soup-private.h: Remove struct _SoupContext def * libsoup/soup-connection.c (soup_connection_new): constify uri * libsoup/soup-proxy-connection.c (soup_proxy_connection_new): constify uri arguments, remove SoupContext references * libsoup/soup-misc.c (soup_get_proxy): Gone * libsoup/soup-server-cgi.c (run_async): Use soup_message_set_uri, etc * libsoup/soup-server-tcp.c (read_headers_cb): Likewise * tests/*: update soup_message_new() calls --- tests/auth-test.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'tests/auth-test.c') diff --git a/tests/auth-test.c b/tests/auth-test.c index e0d18fd9..b184397e 100644 --- a/tests/auth-test.c +++ b/tests/auth-test.c @@ -174,7 +174,7 @@ handler (SoupMessage *msg, gpointer data) int main (int argc, char **argv) { - SoupContext *ctx; + SoupUri *uri; SoupMessage *msg; char *expected; int i; @@ -185,13 +185,13 @@ main (int argc, char **argv) printf ("Test %d: %s\n", i + 1, tests[i].explanation); printf (" GET %s\n", tests[i].url); - ctx = soup_context_get (tests[i].url); - if (!ctx) { + uri = soup_uri_new (tests[i].url); + if (!uri) { fprintf (stderr, "auth-test: Could not parse URI\n"); exit (1); } - msg = soup_message_new (ctx, SOUP_METHOD_GET); + msg = soup_message_new (uri, SOUP_METHOD_GET); expected = g_strdup (tests[i].expected); soup_message_add_error_code_handler ( @@ -222,10 +222,9 @@ main (int argc, char **argv) printf ("\n"); - g_object_unref (msg); - /* We don't free ctx because if we did, we'd end up - * discarding the cached auth info at the end of each - * test. + /* We don't free msg because if we did, we'd end up + * freeing its SoupContext and therefore the SoupContext's + * SoupAuthContext. */ } -- cgit v1.2.1