*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);
default:
dup(fd, 1);
if(!con)
- print("%s /%s %s\r\n%s", f[0], path, f[2], e);
+ print("%s /%s %s\r\nConnection: close\r\n%s", f[0], path, f[2], e);
}
while((r = read(0, buf, sizeof(buf))) > 0)