git: 9front

Download patch

ref: 523533844475875c757faf2fd68ac0e66855b3c9
parent: 69656c6216ed5cfe3a1531a43a34c7c16e19c12e
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Thu Dec 20 17:15:52 EST 2012

hproxy: fix ipv6 url parsing

--- a/sys/src/cmd/ip/hproxy.c
+++ b/sys/src/cmd/ip/hproxy.c
@@ -51,14 +51,17 @@
 		*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);
 
--