You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by se...@apache.org on 2008/03/05 21:48:05 UTC
svn commit: r634023 - /webservices/axis2/trunk/c/util/src/url.c
Author: senaka
Date: Wed Mar 5 12:48:03 2008
New Revision: 634023
URL: http://svn.apache.org/viewvc?rev=634023&view=rev
Log:
Fixing JIRA Issue AXIS2C-1030
Modified:
webservices/axis2/trunk/c/util/src/url.c
Modified: webservices/axis2/trunk/c/util/src/url.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/url.c?rev=634023&r1=634022&r2=634023&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/url.c (original)
+++ webservices/axis2/trunk/c/util/src/url.c Wed Mar 5 12:48:03 2008
@@ -43,6 +43,13 @@
AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, protocol, NULL);
+ if (!protocol || !*protocol ||
+ strstr(protocol, "://") ||
+ strchr(server, '/'))
+ {
+ return NULL;
+ }
+
url = (axutil_url_t *) AXIS2_MALLOC(env->allocator, sizeof(axutil_url_t));
if (!url)
@@ -68,15 +75,27 @@
*/
if (path)
{
+ axis2_char_t *params = NULL;
+ axis2_char_t *temp = NULL;
if (path[0] == '/')
{
- url->path = (axis2_char_t *) axutil_strdup(env, path);
+ temp = (axis2_char_t *) axutil_strdup(env, path);
}
else
{
- url->path = axutil_stracat(env, "/", path);
+ temp = axutil_stracat(env, "/", path);
}
-
+ params = strchr(temp, '?');
+ if (!params)
+ {
+ params = strchr(temp, '#');
+ }
+ if (params)
+ {
+ *params = '\0';
+ }
+ url->path = (axis2_char_t *) axutil_strdup(env, temp);
+ AXIS2_FREE(env->allocator, temp);
}
return url;
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org