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 --- libsoup/soup-server-tcp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'libsoup/soup-server-tcp.c') diff --git a/libsoup/soup-server-tcp.c b/libsoup/soup-server-tcp.c index 7bec72be..93085504 100644 --- a/libsoup/soup-server-tcp.c +++ b/libsoup/soup-server-tcp.c @@ -202,7 +202,7 @@ read_headers_cb (const GString *headers, { SoupServerTCPConnection *sconn = user_data; SoupMessage *msg = sconn->msg; - SoupContext *ctx; + SoupUri *uri; char *req_path = NULL; const char *length, *enc; @@ -239,10 +239,10 @@ read_headers_cb (const GString *headers, /* Generate correct context for request */ if (*req_path != '/') { - /* Should be an absolute URI. (If not, soup_context_get + /* Should be an absolute URI. (If not, soup_uri_new * will fail and return NULL. */ - ctx = soup_context_get (req_path); + uri = soup_uri_new (req_path); } else { SoupServerTCP *tcp = SOUP_SERVER_TCP (sconn->serv); const char *req_host; @@ -261,14 +261,14 @@ read_headers_cb (const GString *headers, req_host, tcp->priv->port, req_path); - ctx = soup_context_get (url); + uri = soup_uri_new (url); g_free (url); } - if (!ctx) + if (!uri) goto THROW_MALFORMED_HEADER; - soup_message_set_context (msg, ctx); - soup_context_unref (ctx); + soup_message_set_uri (msg, uri); + soup_uri_free (uri); g_free (req_path); -- cgit v1.2.1