hproxy: fix ipv6 url parsing
This commit is contained in:
parent
e2d6bba40d
commit
2c1c1e4005
|
@ -51,14 +51,17 @@ main(void)
|
|||
*p++ = 0;
|
||||
path = p;
|
||||
}
|
||||
if(*host == '[')
|
||||
if(*host == '['){
|
||||
host++;
|
||||
if(p = strrchr(host, ':')){
|
||||
if(p = strrchr(host, ']')){
|
||||
*p++ = 0;
|
||||
if(p = strrchr(p, ':'))
|
||||
port = ++p;
|
||||
}
|
||||
} else if(p = strrchr(host, ':')){
|
||||
*p++ = 0;
|
||||
port = p;
|
||||
}
|
||||
if(p = strrchr(host, ']'))
|
||||
*p = 0;
|
||||
|
||||
snprint(addr, sizeof(addr), "tcp!%s!%s", host, port);
|
||||
|
||||
|
|
Loading…
Reference in a new issue