From e88d0d8a2592c5d91935d00410ac8e73a81cd3fd Mon Sep 17 00:00:00 2001 From: Alex Graveley Date: Tue, 13 Mar 2001 04:01:53 +0000 Subject: [PATCH] avoid leading and trailing quotes. If an exact match is not found, lookup 2001-03-12 Alex Graveley * src/soup-core/soup-server.c (soup_server_get_handler): avoid leading and trailing quotes. If an exact match is not found, lookup based only on methodname not uri#methodnmae. * src/soup-core/soup-apache.c (soup_apache_handler): compile without warnings. * configure.in (AC_OUTPUT): chmod +x soup_apacheConf.sh --- ChangeLog | 11 +++++++++++ configure.in | 2 +- libsoup/soup-server.c | 28 ++++++++++++++++++++++++++-- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 68ce741..017ac80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2001-03-12 Alex Graveley + + * src/soup-core/soup-server.c (soup_server_get_handler): avoid + leading and trailing quotes. If an exact match is not found, + lookup based only on methodname not uri#methodnmae. + + * src/soup-core/soup-apache.c (soup_apache_handler): compile + without warnings. + + * configure.in (AC_OUTPUT): chmod +x soup_apacheConf.sh + 2001-03-09 Alex Graveley * src/soup-wsdl/wsdl-parse.c (wsdl_parse): set definitions = NULL diff --git a/configure.in b/configure.in index 7393248..5da5898 100644 --- a/configure.in +++ b/configure.in @@ -245,7 +245,7 @@ AC_OUTPUT([ src/soup-wsdl/Makefile tests/Makefile ], - [chmod +x soup-config soupConf.sh]) + [chmod +x soup-config soupConf.sh soup_apacheConf.sh]) echo " diff --git a/libsoup/soup-server.c b/libsoup/soup-server.c index d97edb3..32d0494 100644 --- a/libsoup/soup-server.c +++ b/libsoup/soup-server.c @@ -26,15 +26,39 @@ static gint soup_server_global_auth_allowed_types = 0; SoupServerHandler * soup_server_get_handler (const gchar *methodname) { - GSList *iter = soup_server_handlers; + GSList *iter; + gchar *name; + gint len; g_return_val_if_fail (methodname != NULL, NULL); + name = g_strdup (methodname); + g_strstrip (name); + len = strlen (name); + + /* Strip quotes */ + if (name [0] == '"' && name [len] == '"') { + name [len--] = '\0'; + name++; + } + + RETRY_MATCH: for (iter = soup_server_handlers; iter; iter = iter->next) { SoupServerHandler *hand = iter->data; - if (!strcmp (hand->methodname, methodname)) + if (!strcmp (hand->methodname, name)) { + g_free (name); return hand; + } } + + /* Try again without the URI */ + methodname = strchr (name, '#'); + if (methodname && strlen (name) > 1) { + name++; + goto RETRY_MATCH; + } + + g_free (name); return NULL; } -- 2.7.4