+ if (!strncmp(w->hostport, "http://", 7))
+ {
+ port = "80";
+ strncpy(host, w->hostport + 7, sizeof(host)-1);
+ }
+ else if (!strncmp(w->hostport, "https://", 8))
+ {
+ port = "443";
+ strncpy(host, w->hostport + 8, sizeof(host)-1);
+ }
+ else
+ {
+ strncpy(host, w->hostport, sizeof(host)-1);
+ }