diff options
author | Dan Winship <danw@src.gnome.org> | 2003-09-02 16:15:19 +0000 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2003-09-02 16:15:19 +0000 |
commit | 1cc11d717a29e5835d03eb244f3a05e8bd6c039c (patch) | |
tree | 219e0b9ecdef463b1c370dd8cd41a5446c03dcef /tests/auth-test.c | |
parent | 1468fddca1027399c84834b968ccf2208394af26 (diff) | |
download | libsoup-1cc11d717a29e5835d03eb244f3a05e8bd6c039c.tar.gz libsoup-1cc11d717a29e5835d03eb244f3a05e8bd6c039c.tar.bz2 libsoup-1cc11d717a29e5835d03eb244f3a05e8bd6c039c.zip |
First draft at the new object to maintain formerly-global state. (Not yet
* libsoup/soup-session.c: First draft at the new object to
maintain formerly-global state. (Not yet complete; still need to
get rid of SoupContext).
* libsoup/soup-message-queue.c: Data structure used by SoupSession
* libsoup/soup-queue.c: Gone. Mostly moved into soup-session, but
some bits went into soup-connection.
* libsoup/soup-connection.c (soup_connection_send_request): New,
to send a request on a connection. The connection updates its
internal state and then hands off to soup_message_send_request.
(request_done): Callback set up by soup_connection_send_request.
Marks the connection as no-longer-in-use, and disconnects it if
the message says to.
(soup_connection_set_in_use, soup_connection_mark_old): No longer
needed; the connection takes care of this itself now.
(soup_connection_new_proxy): New, to create a new connection that
is explicitly marked as being through an HTTP proxy.
(soup_connection_new_tunnel): New, to create a new HTTPS
connection through a proxy. (Includes the code to send the
CONNECT.)
* libsoup/soup-context.c (try_existing_connections): Don't need to
call soup_connection_set_in_use.
(try_create_connection): Use soup_connection_new,
soup_connection_new_proxy, or soup_connection_new_tunnel as
appropriate.
* libsoup/soup-message.c (soup_message_prepare): Replaces
queue_message.
(soup_message_queue, soup_message_requeue, soup_message_prepare):
Gone. This must be done via a SoupSession now.
(soup_message_set_connection): don't need to mark in_use/not
in_use. Also, msg->priv->socket is gone now.
(soup_message_get_socket): Gone.
* libsoup/soup-message-handlers.c (soup_message_run_handlers):
Remove references to global handlers.
(redirect_handler, authorize_handler): Moved to soup-session.c.
* libsoup/soup-misc.c (soup_shutdown): Gone; just unref the
session to shut down now.
* libsoup/soup.h: add soup-session.h
* libsoup/Makefile.am: updates
* tests/auth-test.c, tests/get.c, tests/simple-proxy.c: Use
SoupSession.
Diffstat (limited to 'tests/auth-test.c')
-rw-r--r-- | tests/auth-test.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/auth-test.c b/tests/auth-test.c index 6628af7c..b0562275 100644 --- a/tests/auth-test.c +++ b/tests/auth-test.c @@ -6,6 +6,7 @@ #include "libsoup/soup-auth.h" #include "libsoup/soup-private.h" #include "libsoup/soup-message-private.h" +#include "libsoup/soup-session.h" int errors = 0; @@ -216,11 +217,13 @@ handler (SoupMessage *msg, gpointer data) int main (int argc, char **argv) { - SoupMessage *msg; + SoupSession *session; + SoupMessage *msg; char *expected; int i; g_type_init (); + session = soup_session_new (); for (i = 0; i < ntests; i++) { printf ("Test %d: %s\n", i + 1, tests[i].explanation); @@ -240,7 +243,7 @@ main (int argc, char **argv) soup_message_add_error_code_handler ( msg, SOUP_ERROR_OK, SOUP_HANDLER_PRE_BODY, handler, expected); - soup_message_send (msg); + soup_session_send_message (session, msg); if (msg->errorcode != SOUP_ERROR_UNAUTHORIZED && msg->errorcode != SOUP_ERROR_OK) { printf (" %d %s !\n", msg->errorcode, @@ -262,12 +265,11 @@ main (int argc, char **argv) printf ("\n"); - /* We don't free the message, because if we did, we'd - * end up freeing the context and discarding the - * cached auth info at the end of each test. - */ + g_object_unref (msg); } + g_object_unref (session); + printf ("\nauth-test: %d errors\n", errors); return errors; } |