host[len] = '\0';
}
+#ifdef NT_NET_IPV6
+ if(nt_is_ipv6_addr(host, &cptr)){
+ if(!ssl){
+ *cptr = '\0';
+ cptr++;
+ memmove(host, host+1, cptr - host);
+ }else{
+ cptr++;
+ }
+ if(*cptr == ':'){
+ port = atoi(cptr+1);
+ port = (port == 0) ? -1 : port;
+ *cptr = '\0';
+ }
+ port = atoi(cptr);
+ port = (port == 0) ? -1 : port;
+ }else{
+ cptr = strchr(host, ':');
+ if(cptr != NULL && strlen(cptr+1) > 0){
+ port = atoi(cptr+1);
+ port = (port == 0) ? -1 : port;
+ *cptr = '\0';
+ }
+ }
+#else
cptr = strrchr(host, ':');
if(cptr != NULL && strlen(cptr) > 0){
port = atoi(cptr);
port = (port == 0) ? -1 : port;
*cptr = '\0';
}
-
+#endif
headerp = calloc(1, sizeof(nt_http_header_t));
if(headerp == NULL){
free(host);