]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
add Forwarded: request header
authorwessels <>
Fri, 12 Apr 1996 10:33:48 +0000 (10:33 +0000)
committerwessels <>
Fri, 12 Apr 1996 10:33:48 +0000 (10:33 +0000)
src/http.cc

index 28cc0b1c6c94e5d9ca4b4cf56364b72ff2f384b6..f3db3ed0b83aeb57249ff0c19b0cd5b8d4e74bfc 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: http.cc,v 1.38 1996/04/11 22:52:28 wessels Exp $ */
+/* $Id: http.cc,v 1.39 1996/04/12 04:33:48 wessels Exp $ */
 
 /*
  * DEBUG: Section 11          http: HTTP
@@ -6,7 +6,6 @@
 
 #include "squid.h"
 
-#define HTTP_PORT         80
 #define HTTP_DELETE_GAP   (64*1024)
 #define READBUFSIZ     4096
 
@@ -69,7 +68,7 @@ static int http_url_parser(url, host, port, request)
        strcpy(request, "/");
     }
     if (sscanf(hostbuf, "%[^:]:%d", host, port) < 2)
-       (*port) = HTTP_PORT;
+       (*port) = urlDefaultPort(PROTO_HTTP);
     return 0;
 }
 
@@ -461,6 +460,16 @@ static void httpSendRequest(fd, data)
            ybuf = NULL;
        }
     }
+
+    /* Add Forwarded: header */
+    ybuf = get_free_4k_page(__FILE__,__LINE__);
+    sprintf(ybuf, "Forwarded: by http://%s:%d/\r\n",
+       getMyHostname(), getAsciiPortNum());
+    strcat(buf, ybuf);
+    len += strlen(ybuf);
+    put_free_4k_page(ybuf, __FILE__, __LINE__);
+    ybuf = NULL;
+
     strcat(buf, crlf);
     len += 2;
     if (post_buf) {