#
-# $Id: cf.data.pre,v 1.485 2007/10/31 10:34:36 amosjeffries Exp $
+# $Id: cf.data.pre,v 1.486 2007/11/06 21:19:30 wessels Exp $
#
# SQUID Web Proxy Cache http://www.squid-cache.org/
# ----------------------------------------------------------
For each requested URL rewriter will receive on line with the format
- URL <SP> client_ip "/" fqdn <SP> user <SP> method <NL>
+ URL <SP> client_ip "/" fqdn <SP> user <SP> method [<SP> kvpairs]<NL>
+
+ In the future, the rewriter interface will be extended with
+ key=value pairs ("kvpairs" shown above). Rewriter programs
+ should be prepared to receive and possibly ignore additional
+ whitespace-separated tokens on each input line.
And the rewriter may return a rewritten URL. The other components of
the request line does not need to be returned (ignored if they are).
/*
- * $Id: redirect.cc,v 1.121 2007/09/27 23:58:06 amosjeffries Exp $
+ * $Id: redirect.cc,v 1.122 2007/11/06 21:19:31 wessels Exp $
*
* DEBUG: section 61 Redirector
* AUTHOR: Duane Wessels
redirectStateData *r = NULL;
const char *fqdn;
char buf[8192];
+ char claddr[20];
+ char myaddr[20];
assert(http);
assert(handler);
debugs(61, 5, "redirectStart: '" << http->uri << "'");
if ((fqdn = fqdncache_gethostbyaddr(r->client_addr, 0)) == NULL)
fqdn = dash_str;
- snprintf(buf, 8192, "%s %s/%s %s %s\n",
+ xstrncpy(claddr, inet_ntoa(r->client_addr), 20);
+ xstrncpy(myaddr, inet_ntoa(http->request->my_addr), 20);
+ snprintf(buf, 8192, "%s %s/%s %s %s myip=%s myport=%d\n",
r->orig_url,
- inet_ntoa(r->client_addr),
+ claddr,
fqdn,
r->client_ident[0] ? rfc1738_escape(r->client_ident) : dash_str,
- r->method_s);
+ r->method_s,
+ myaddr,
+ http->request->my_port);
helperSubmit(redirectors, buf, redirectHandleReply, r);
}