|
current parsers.c,1.116,1.117: msg#00006web.privoxy.cvs
Update of /cvsroot/ijbswa/current In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv14666 Modified Files: parsers.c Log Message: Garbage-collect the code to add a X-Forwarded-For header as it seems to be mostly used by accident. Index: parsers.c =================================================================== RCS file: /cvsroot/ijbswa/current/parsers.c,v retrieving revision 1.116 retrieving revision 1.117 diff -u -d -r1.116 -r1.117 --- parsers.c 1 Dec 2007 13:04:22 -0000 1.116 +++ parsers.c 6 Dec 2007 18:11:50 -0000 1.117 @@ -44,6 +44,10 @@ * * Revisions : * $Log$ + * Revision 1.117 2007/12/06 18:11:50 fabiankeil + * Garbage-collect the code to add a X-Forwarded-For + * header as it seems to be mostly used by accident. + * * Revision 1.116 2007/12/01 13:04:22 fabiankeil * Fix a crash on mingw32 with some Last Modified times in the future. * @@ -829,7 +833,6 @@ static jb_err client_host_adder (struct client_state *csp); static jb_err client_cookie_adder (struct client_state *csp); static jb_err client_xtra_adder (struct client_state *csp); -static jb_err client_x_forwarded_adder(struct client_state *csp); static jb_err connection_close_adder (struct client_state *csp); static jb_err create_forged_referrer(char **header, const char *hostport); @@ -890,7 +893,6 @@ const add_header_func_ptr add_client_headers[] = { client_host_adder, client_cookie_adder, - client_x_forwarded_adder, client_xtra_adder, /* Temporarily disabled: client_accept_encoding_adder, */ connection_close_adder, @@ -3088,19 +3090,7 @@ *********************************************************************/ jb_err client_x_forwarded(struct client_state *csp, char **header) { - if ((csp->action->flags & ACTION_HIDE_FORWARDED) == 0) - { - /* Save it so we can re-add it later */ - freez(csp->x_forwarded); - csp->x_forwarded = *header; - - /* - * Always set *header = NULL, since this information - * will be sent at the end of the header. - */ - *header = NULL; - } - else + if ((csp->action->flags & ACTION_HIDE_FORWARDED) != 0) { freez(*header); log_error(LOG_LEVEL_HEADER, "crunched x-forwarded-for!"); @@ -3653,53 +3643,6 @@ /********************************************************************* * - * Function : client_x_forwarded_adder - * - * Description : Used in the add_client_headers list. Called from `sed'. - * - * Parameters : - * 1 : csp = Current client state (buffers, headers, etc...) - * - * Returns : JB_ERR_OK on success, or - * JB_ERR_MEMORY on out-of-memory error. - * - *********************************************************************/ -static jb_err client_x_forwarded_adder(struct client_state *csp) -{ - char *p = NULL; - jb_err err; - - if ((csp->action->flags & ACTION_HIDE_FORWARDED) != 0) - { - return JB_ERR_OK; - } - - if (csp->x_forwarded) - { - p = strdup(csp->x_forwarded); - string_append(&p, ", "); - } - else - { - p = strdup("X-Forwarded-For: "); - } - string_append(&p, csp->ip_addr_str); - - if (p == NULL) - { - return JB_ERR_MEMORY; - } - - log_error(LOG_LEVEL_HEADER, "addh: %s", p); - err = enlist(csp->headers, p); - free(p); - - return err; -} - - -/********************************************************************* - * * Function : connection_close_adder * * Description : "Temporary" fix for the needed but missing HTTP/1.1 ------------------------------------------------------------------------- SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | current jcc.c,1.161,1.162: 00006, noreply |
|---|---|
| Next by Date: | current/doc/source user-manual.sgml,2.48,2.49: 00006, noreply |
| Previous by Thread: | current jcc.c,1.161,1.162i: 00006, noreply |
| Next by Thread: | current/doc/source user-manual.sgml,2.48,2.49: 00006, noreply |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |