mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-23 02:25:40 +08:00
correct IPv6 parsing where hostname is expected
This commit is contained in:
parent
0d713dacc1
commit
624c3e6ae1
@ -293,7 +293,10 @@ int parsehostname(char *hostname, struct clientparam *param, unsigned short port
|
||||
|
||||
if(!hostname || !*hostname)return 2;
|
||||
if(*hostname == '[') se=strchr(hostname, ']');
|
||||
if ( (sp = strchr(se?se:hostname, ':')) && !strchr(sp+1, ':')) *sp = 0;
|
||||
if (sp = strchr(se?se:hostname, ':')) {
|
||||
if(strchr(sp+1, ':'))sp = NULL;
|
||||
else *sp = 0;
|
||||
}
|
||||
if(se){
|
||||
*se = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user