diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auth-test.c | 15 | ||||
-rw-r--r-- | tests/get.c | 12 |
2 files changed, 13 insertions, 14 deletions
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. */ } diff --git a/tests/get.c b/tests/get.c index 5ea864df..e4760144 100644 --- a/tests/get.c +++ b/tests/get.c @@ -147,7 +147,7 @@ static void get_url (const char *url) { char *url_to_get, *slash, *name; - SoupContext *ctx; + SoupUri *uri; SoupMessage *msg; int fd; @@ -176,14 +176,14 @@ get_url (const char *url) close (fd); } - ctx = soup_context_get (url_to_get); - msg = soup_message_new (ctx, SOUP_METHOD_GET); + uri = soup_uri_new (url_to_get); + g_free (url_to_get); + + msg = soup_message_new (uri, SOUP_METHOD_GET); soup_message_set_flags (msg, SOUP_MESSAGE_NO_REDIRECT); pending++; - soup_message_queue (msg, got_url, soup_uri_new (url)); - soup_context_unref (ctx); - g_free (url_to_get); + soup_message_queue (msg, got_url, uri); } static void |