]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Stop parsing the URL at the parameters
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Sat, 2 Jul 2011 19:49:23 +0000 (19:49 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Sat, 2 Jul 2011 19:49:23 +0000 (19:49 +0000)
The end of a host name is marked by a / for a path or a ? for
parameters. Both must end the host name.

url.c
util.c

diff --git a/url.c b/url.c
index 5545cccaca393c1ddb716dddacea8a193e790db4..3d7ada5fae9a2464d7fe6bd0397f7a1a41783d52 100644 (file)
--- a/url.c
+++ b/url.c
@@ -595,8 +595,8 @@ const char *process_url(char *url,bool full_url)
 
        start=url;
        if (!full_url) {
-               for (str=url ; *str && *str!='/' ; str++);
-               if (*str=='/') *str='\0';
+               for (str=url ; *str && *str!='/' && *str!='?' ; str++);
+               *str='\0';
                type=extract_address_mask(url,&address,ipv4,ipv6,NULL,&next);
                if (type==1) {
                        if (FirstAliasName)
diff --git a/util.c b/util.c
index 6b52b03e8d19340ddda30711ae34df81c7a195e7..b5cb4b53fb181e1a934b8cc112f64e5b9496f1d3 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1814,7 +1814,7 @@ int extract_address_mask(char *buf,char **text,unsigned char *ipv4,unsigned shor
        addr_len=0;
        nibble6_len=0;
        pad_pos=-1;
-       for (i=0 ; (unsigned char)buf[i]>' ' && buf[i]!='/' && (!bracket || buf[i]!=']') && ip_size ; i++) {
+       for (i=0 ; (unsigned char)buf[i]>' ' && buf[i]!='/' && buf[i]!='?' && (!bracket || buf[i]!=']') && ip_size ; i++) {
                if (ip_size & 0x04) {
                        if (isdigit(buf[i])) {
                                value4=value4*10+(buf[i]-'0');