--------------------- PatchSet 1376 Date: 2005/05/15 14:22:46 Author: rmartinez Branch: squid3-ipv6 Tag: (none) Log: Added support for IPv6 brackets. Module ready unless error Members: src/http.cc:1.43.4.3->1.43.4.4 Index: squid3/src/http.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/http.cc,v retrieving revision 1.43.4.3 retrieving revision 1.43.4.4 diff -u -r1.43.4.3 -r1.43.4.4 --- squid3/src/http.cc 25 Apr 2005 13:39:13 -0000 1.43.4.3 +++ squid3/src/http.cc 15 May 2005 14:22:46 -0000 1.43.4.4 @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.43.4.3 2005/04/25 13:39:13 rmartinez Exp $ + * $Id: http.cc,v 1.43.4.4 2005/05/15 14:22:46 rmartinez Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -1328,8 +1328,11 @@ /* use port# only if not default */ httpHeaderPutStr(hdr_out, HDR_HOST, orig_request->host); } else { - httpHeaderPutStrf(hdr_out, HDR_HOST, "%s:%d", - orig_request->host, (int) orig_request->port); + httpHeaderPutStrf(hdr_out, HDR_HOST, "%s%s%s:%d", + NEEDS_BRACKETS(orig_request->host) ? "[": null_string, + orig_request->host, + NEEDS_BRACKETS(orig_request->host) ? "]": null_string, + (int) orig_request->port); } } @@ -1524,8 +1527,11 @@ if (orig_request->port == urlDefaultPort(orig_request->protocol)) { httpHeaderPutStr(hdr_out, HDR_HOST, orig_request->host); } else { - httpHeaderPutStrf(hdr_out, HDR_HOST, "%s:%d", - orig_request->host, (int) orig_request->port); + httpHeaderPutStrf(hdr_out, HDR_HOST, "%s%s%s:%d", + NEEDS_BRACKETS(orig_request->host) ? "[" : null_string , + orig_request->host, + NEEDS_BRACKETS(orig_request->host) ? "]" : null_string , + (int) orig_request->port); } }