diff --git a/external/privoxy/AUTHORS b/external/privoxy/AUTHORS index 3f8a6097..d5f05a1f 100644 --- a/external/privoxy/AUTHORS +++ b/external/privoxy/AUTHORS @@ -7,11 +7,8 @@ Current Privoxy Team: David Schmidt, developer Hal Burgiss - Mark Miller - Gerry Murphy Lee Rian Roland Rosenfeld - Jörg Strohmayer Former Privoxy Team Members: @@ -28,10 +25,13 @@ Former Privoxy Team Members: Adam Lock Guy Laroche Justin McMurtry + Mark Miller + Gerry Murphy Andreas Oesterhelt Haroon Rafique Georg Sauthoff Thomas Steudten + Jörg Strohmayer Rodney Stromlund Sviatoslav Sviridov Sarantis Paskalis @@ -43,11 +43,15 @@ alphabetical order): Ken Arromdee Devin Bayer + Havard Berland Gergely Bor + Francois Botha Reiner Buehl Andrew J. Caines Clifford Caoile + Wan-Teh Chang Frédéric Crozat + Billy Crook Michael T. Davis Mattes Dolak Matthias Drochner @@ -58,12 +62,13 @@ alphabetical order): Stephen Gildea Daniel Griscom Felix Gröbert + Jeff H. Aaron Hamid Darel Henman Magnus Holmgren Eric M. Hopper Ralf Horstmann - Stefan Huehner + Stefan Huehner Peter Hyman Derek Jennings Petr Kadlec @@ -71,13 +76,17 @@ alphabetical order): Bert van Leeuwen Don Libes Paul Lieverse + Han Liu Toby Lyward Wil Mahan Jindrich Makovicka + Raphael Marichez + Francois Marier David Mediavilla Raphael Moll Amuro Namie Adam Piggott + Petr Písar Dan Price Roberto Ragusa Félix Rauch @@ -85,6 +94,7 @@ alphabetical order): Chung-chieh Shan Spinor S. Bart Schelstraete + Dan Stahlke Oliver Stoeneberg Peter Thoenen Martin Thomas @@ -114,3 +124,4 @@ If we've missed you off this list, please let us know! Privoxy team. http://www.privoxy.org/ + diff --git a/external/privoxy/ChangeLog b/external/privoxy/ChangeLog index 54cc625d..d92f4076 100644 --- a/external/privoxy/ChangeLog +++ b/external/privoxy/ChangeLog @@ -1,7 +1,713 @@ -------------------------------------------------------------------- ChangeLog for Privoxy -------------------------------------------------------------------- -*** Version 3.0.12 (UNRELEASED) *** +*** Version 3.0.19 Stable *** + +- Bug fixes: + - Prevent a segmentation fault when de-chunking buffered content. + It could be triggered by malicious web servers if Privoxy was + configured to filter the content and running on a platform + where SIZE_T_MAX isn't larger than UINT_MAX, which probably + includes most 32-bit systems. On those platforms, all Privoxy + versions before 3.0.19 appear to be affected. + To be on the safe side, this bug should be presumed to allow + code execution as proving that it doesn't seems unrealistic. + - Do not expect a response from the SOCKS4/4A server until it + got something to respond to. This regression was introduced + in 3.0.18 and prevented the SOCKS4/4A negotiation from working. + Reported by qqqqqw in #3459781. + +- General improvements: + - Fix an off-by-one in an error message about connect failures. + - Use a GNUMakefile variable for the webserver root directory and + update the path. Sourceforge changed it which broke various + web-related targets. + - Update the CODE_STATUS description. + +*** Version 3.0.18 Stable *** + +- Bug fixes: + - If a generated redirect URL contains characters RFC 3986 doesn't + permit, they are (re)encoded. Not doing this makes Privoxy versions + from 3.0.5 to 3.0.17 susceptible to HTTP response splitting (CWE-113) + attacks if the +fast-redirects{check-decoded-url} action is used. + - Fix a logic bug that could cause Privoxy to reuse a server + socket after it got tainted by a server-header-tagger-induced + block that was triggered before the whole server response had + been read. If keep-alive was enabled and the request following + the blocked one was to the same host and using the same forwarding + settings, Privoxy would send it on the tainted server socket. + While the server would simply treat it as a pipelined request, + Privoxy would later on fail to properly parse the server's + response as it would try to parse the unread data from the + first response as server headers for the second one. + Regression introduced in 3.0.17. + - When implying keep-alive in client_connection(), remember that + the client didn't. Fixes a regression introduced in 3.0.13 that + would cause Privoxy to wait for additional client requests after + receiving a HTTP/1.1 request with "Connection: close" set + and connection sharing enabled. + With clients which terminates the client connection after detecting + that the whole body has been received it doesn't really matter, + but with clients that don't the connection would be kept open until + it timed out. + - Fix a subtle race condition between prepare_csp_for_next_request() + and sweep(). A thread preparing itself for the next client request + could briefly appear to be inactive. + If all other threads were already using more recent files, + the thread could get its files swept away under its feet. + So far this has only been reproduced while stress testing in + valgrind while touching action files in a loop. It's unlikely + to have caused any actual problems in the real world. + - Disable filters if SDCH compression is used unless filtering is forced. + If SDCH was combined with a supported compression algorithm, Privoxy + previously could try to decompress it and ditch the Content-Encoding + header even though the SDCH compression wasn't dealt with. + Reported by zebul666 in #3225863. + - Make a copy of the --user value and only mess with that when splitting + user and group. On some operating systems modifying the value directly + is reflected in the output of ps and friends and can be misleading. + Reported by zepard in #3292710. + - If forwarded-connect-retries is set, only retry if Privoxy is actually + forwarding the request. Previously direct connections would be retried + as well. + - Fixed a small memory leak when retrying connections with IPv6 + support enabled. + - Remove an incorrect assertion in compile_dynamic_pcrs_job_list() + It could be triggered by a pcrs job with an invalid pcre + pattern (for example one that contains a lone quantifier). + - If the --user argument user[.group] contains a dot, always bail out + if no group has been specified. Previously the intended, but undocumented + (and apparently untested), behaviour was to try interpreting the whole + argument as user name, but the detection was flawed and checked for '0' + instead of '\0', thus merely preventing group names beginning with a zero. + - In html_code_map[], use a numeric character reference instead of ' + which wasn't standardized before XHTML 1.0. + - Fix an invalid free when compiled with FEATURE_GRACEFUL_TERMINATION + and shut down through http://config.privoxy.org/die + - In get_actions(), fix the "temporary" backwards compatibility hack + to accept block actions without reason. + It also covered other actions that should be rejected as invalid. + Reported by Billy Crook. + +- General improvements: + - Privoxy can (re)compress buffered content before delivering + it to the client. Disabled by default as most users wouldn't + benefit from it. + - The +fast-redirects{check-decoded-url} action checks URL + segments separately. If there are other parameters behind + the redirect URL, this makes it unnecessary to cut them off + by additionally using a +redirect{} pcrs command. + Initial patch submitted by Jamie Zawinski in #3429848. + - When loading action sections, verify that the referenced filters + exist. Currently missing filters only result in an error message, + but eventually the severity will be upgraded to fatal. + - Allow to bind to multiple separate addresses. + Patch set submitted by Petr Pisar in #3354485. + - Set socket_error to errno if connecting fails in rfc2553_connect_to(). + Previously rejected direct connections could be incorrectly reported + as DNS issues if Privoxy was compiled with IPv6 support. + - Adjust url_code_map[] so spaces are replaced with %20 instead of '+' + While '+' can be used by client's submitting form data, this is not + actually what Privoxy is using the lookups for. This is more of a + cosmetic issue and doesn't fix any known problems. + - When compiled without FEATURE_FAST_REDIRECTS, do not silently + ignore +fast-redirect{} directives + - Added a workaround for GNU libc's strptime() reporting negative + year values when the parsed year is only specified with two digits. + On affected systems cookies with such a date would not be turned + into session cookies by the +session-cookies-only action. + Reported by Vaeinoe in #3403560 + - Fixed bind failures with certain GNU libc versions if no non-loopback + IP address has been configured on the system. This is mainly an issue + if the system is using DHCP and Privoxy is started before the network + is completely configured. + Reported by Raphael Marichez in #3349356. + Additional insight from Petr Pisar. + - Privoxy log messages now use the ISO 8601 date format %Y-%m-%d. + It's only slightly longer than the old format, but contains + the full date including the year and allows sorting by date + (when grepping in multiple log files) without hassle. + - In get_last_url(), do not bother trying to decode URLs that do + not contain at least one '%' sign. It reduces the log noise and + a number of unnecessary memory allocations. + - In case of SOCKS5 failures, dump the socks response in the log message. + - Simplify the signal setup in main(). + - Streamline socks5_connect() slightly. + - In socks5_connect(), require a complete socks response from the server. + Previously Privoxy didn't care how much data the server response + contained as long as the first two bytes contained the expected + values. While at it, shrink the buffer size so Privoxy can't read + more than a whole socks response. + - In chat(), do not bother to generate a client request in case of + direct CONNECT requests. It will not be used anyway. + - Reduce server_last_modified()'s stack size. + - Shorten get_http_time() by using strftime(). + - Constify the known_http_methods pointers in unknown_method(). + - Constify the time_formats pointers in parse_header_time(). + - Constify the formerly_valid_actions pointers in action_used_to_be_valid(). + - Introduce a GNUMakefile MAN_PAGE variable that defaults to privoxy.1. + The Debian package uses section 8 for the man page and this + should simplify the patch. + - Deduplicate the INADDR_NONE definition for Solaris by moving it to jbsockets.h + - In block_url(), ditch the obsolete workaround for ancient Netscape versions + that supposedly couldn't properly deal with status code 403. + - Remove a useless NULL pointer check in load_trustfile(). + - Remove two useless NULL pointer checks in load_one_re_filterfile(). + - Change url_code_map[] from an array of pointers to an array of arrays + It removes an unnecessary layer of indirection and on 64bit system reduces + the size of the binary a bit. + - Fix various typos. Fixes taken from Debian's 29_typos.dpatch by Roland Rosenfeld. + - Add a dok-tidy GNUMakefile target to clean up the messy HTML + generated by the other dok targets. + - GNUisms in the GNUMakefile have been removed. + - Change the HTTP version in static responses to 1.1 + - Synced config.sub and config.guess with upstream + 2011-11-11/386c7218162c145f5f9e1ff7f558a3fbb66c37c5. + - Add a dedicated function to parse the values of toggles. Reduces duplicated + code in load_config() and provides better error handling. Invalid or missing + toggle values are now a fatal error instead of being silently ignored. + - Terminate HTML lines in static error messages with \n instead of \r\n. + - Simplify cgi_error_unknown() a bit. + - In LogPutString(), don't bother looking at pszText when not + actually logging anything. + - Change ssplit()'s fourth parameter from int to size_t. + Fixes a clang complaint. + - Add a warning that the statistics currently can't be trusted. + Mention Privoxy-Log-Parser's --statistics option as + an alternative for the time being. + - In rfc2553_connect_to(), start setting cgi->error_message on error. + - Change the expected status code returned for http://p.p/die depending + on whether or not FEATURE_GRACEFUL_TERMINATION is available. + - In cgi_die(), mark the client connection for closing. + If the client will fetch the style sheet through another connection + it gets the main thread out of the accept() state and should thus + trigger the actual shutdown. + - Add a proper CGI message for cgi_die(). + - Don't enforce a logical line length limit in read_config_line(). + - Slightly refactor server_last_modified() to remove useless gmtime*() calls. + - In get_content_type(), also recognize '.jpeg' as JPEG extension. + - Add '.png' to the list of recognized file extensions in get_content_type(). + - In block_url(), consistently use the block reason "Request blocked by Privoxy" + In two places the reason was "Request for blocked URL" which hides the + fact that the request got blocked by Privoxy and isn't necessarily + correct as the block may be due to tags. + - In listen_loop(), reload the configuration files after accepting + a new connection instead of before. + Previously the first connection that arrived after a configuration + change would still be handled with the old configuration. + - In chat()'s receive-data loop, skip a client socket check if + the socket will be written to right away anyway. This can + increase the transfer speed for unfiltered content on fast + network connections. + - The socket timeout is used for SOCKS negotiations as well which + previously couldn't timeout. + - Don't keep the client connection alive if any configuration file + changed since the time the connection came in. This is closer to + Privoxy's behaviour before keep-alive support for client connection + has been added and also less confusing in general. + - Treat all Content-Type header values containing the pattern + 'script' as a sign of text. Reported by pribog in #3134970. + +- Action file improvements: + - Moved the site-specific block pattern section below the one for the + generic patterns so for requests that are matched in both, the block + reason for the domain is shown which is usually more useful than showing + the one for the generic pattern. + - Remove -prevent-compression from the fragile alias. It's no longer + used anywhere by default and isn't known to break stuff anyway. + - Add a (disabled) section to block various Facebook tracking URLs. + Reported by Dan Stahlke in #3421764. + - Add a (disabled) section to rewrite and redirect click-tracking + URLs used on news.google.com. + Reported by Dan Stahlke in #3421755. + - Unblock linuxcounter.net/. + Reported by Dan Stahlke in #3422612. + - Block 'www91.intel.com/' which is used by Omniture. + Reported by Adam Piggott in #3167370. + - Disable the handle-as-empty-doc-returns-ok option and mark it as deprecated. + Reminded by tceverling in #2790091. + - Add ".ivwbox.de/" to the "Cross-site user tracking" section. + Reported by Nettozahler in #3172525. + - Unblock and fast-redirect ".awin1.com/.*=http://". + Reported by Adam Piggott in #3170921. + - Block "b.collective-media.net/". + - Widen the Debian popcon exception to "qa.debian.org/popcon". + Seen in Debian's 05_default_action.dpatch by Roland Rosenfeld. + - Block ".gemius.pl/" which only seems to be used for user tracking. + Reported by johnd16 in #3002731. Additional input from Lee and movax. + - Disable banners-by-size filters for '.thinkgeek.com/'. + The filter only seems to catch pictures of the inventory. + - Block requests for 'go.idmnet.bbelements.com/please/showit/'. + Reported by kacperdominik in #3372959. + - Unblock adainitiative.org/. + - Add a fast-redirects exception for '.googleusercontent.com/.*=cache'. + - Add a fast-redirects exception for webcache.googleusercontent.com/. + - Unblock http://adassier.wordpress.com/ and http://adassier.files.wordpress.com/. + +- Filter file improvements: + - Let the yahoo filter hide '.ads'. + - Let the msn filter hide overlay ads for Facebook 'likes' in search + results and elements with the id 's_notf_div'. They only seem to be + used to advertise site 'enhancements'. + - Let the js-events filter additionally disarm setInterval(). + Suggested by dg1727 in #3423775. + +- Documentation improvements: + - Clarify the effect of compiling Privoxy with zlib support. + Suggested by dg1727 in #3423782. + - Point out that the SourceForge messaging system works like a black + hole and should thus not be used to contact individual developers. + - Mention some of the problems one can experience when not explicitly + configuring an IP addresses as listen address. + - Explicitly mention that hostnames can be used instead of IP addresses + for the listen-address, that only the first address returned will be + used and what happens if the address is invalid. + Requested by Calestyo in #3302213. + +- Log message improvements: + - If only the server connection is kept alive, do not pretend to + wait for a new client request. + - Remove a superfluous log message in forget_connection(). + - In chat(), properly report missing server responses as such + instead of calling them empty. + - In forwarded_connect(), fix a log message nobody should ever see. + - Fix a log message in socks5_connect(), a failed write operation + was logged as failed read operation. + - Let load_one_actions_file() properly complain about a missing + '{' at the beginning of the file. + Simply stating that a line is invalid isn't particularly helpful. + - Do not claim to listen on a socket until Privoxy actually does. + Patch submitted by Petr Pisar #3354485 + - Prevent a duplicated LOG_LEVEL_CLF message when sending out + the "no-server-data" response. + - Also log the client socket when dropping a connection. + - Include the destination host in the 'Request ... marked for + blocking. limit-connect{...} doesn't allow CONNECT ...' message + Patch submitted by Saperski in #3296250. + - Prevent a duplicated log message if none of the resolved IP + addresses were reachable. + - In connect_to(), do not pretend to retry if forwarded-connect-retries + is zero or unset. + - When a specified user or group can't be found, put the name in + single-quotes when logging it. + - In rfc2553_connect_to(), explain getnameinfo() errors better. + - Remove a useless log message in chat(). + - When retrying to connect, also log the maximum number of connection + attempts. + - Rephrase a log message in compile_dynamic_pcrs_job_list(). + Divide the error code and its meaning with a colon. Call the pcrs + job dynamic and not the filter. Filters may contain dynamic and + non-dynamic pcrs jobs at the same time. Only mention the name of + the filter or tagger, but don't claim it's a filter when it could + be a tagger. + - In a fatal error message in load_one_actions_file(), cover both + URL and TAG patterns. + - In pcrs_strerror(), properly report unknown positive error code + values as such. Previously they were handled like 0 (no error). + - In compile_dynamic_pcrs_job_list(), also log the actual error code as + pcrs_strerror() doesn't handle all errors reported by pcre. + - Don't bother trying to continue chatting if the client didn't ask for it. + Reduces log noise a bit. + - Make two fatal error message in load_one_actions_file() more descriptive. + - In cgi_send_user_manual(), log when rejecting a file name due to '/' or '..'. + - In load_file(), log a message if opening a file failed. + The CGI error message alone isn't too helpful. + - In connection_destination_matches(), improve two log messages + to help understand why the destinations don't match. + - Rephrase a log message in serve(). Client request arrival + should be differentiated from closed client connections now. + - In serve(), log if a client connection isn't reused due to a + configuration file change. + - Let mark_server_socket_tainted() always mark the server socket tainted, + just don't talk about it in cases where it has no effect. It doesn't change + Privoxy's behaviour, but makes understanding the log file easier. + +- configure: + - Added a --disable-ipv6-support switch for platforms where support + is detected but doesn't actually work. + - Do not check for the existence of strerror() and memmove() twice + - Remove a useless test for setpgrp(2). Privoxy doesn't need it and + it can cause problems when cross-compiling. + - Rename the --disable-acl-files switch to --disable-acl-support. + Since about 2001, ACL directives are specified in the standard + config file. + - Update the URL of the 'Removing outdated PCRE version after the + next stable release' posting. The old URL stopped working after + one of SF's recent site "optimizations". Reported by Han Liu. + +- Privoxy-Regression-Test: + - Added --shuffle-tests option to increase the chances of detection race conditions. + - Added a --local-test-file option that allows to use Privoxy-Regression-Test without Privoxy. + - Added tests for missing socks4 and socks4a forwarders. + - The --privoxy-address option now works with IPv6 addresses containing brackets, too. + - Perform limited sanity checks for parameters that are supposed to have numerical values. + - Added a --sleep-time option to specify a number of seconds to + sleep between tests, defaults to 0. + - Disable the range-requests tagger for tests that break if it's enabled. + - Log messages use the ISO 8601 date format %Y-%m-%d. + - Fix spelling in two error messages. + - In the --help output, include a list of supported tests and their default levels. + - Adjust the tests to properly deal with FEATURE_TOGGLE being disabled. + +- Privoxy-Log-Parser: + - Perform limited sanity checks for command line parameters that + are supposed to have numerical values. + - Implement a --unbreak-lines-only option to try to revert MUA breakage. + - Accept and highlight: Added header: Content-Encoding: deflate + - Accept and highlight: Compressed content from 29258 to 8630 bytes. + - Accept and highlight: Client request arrived in time on socket 21. + - Highlight: Didn't receive data in time: a.fsdn.com:443 + - Accept log messages with ISO 8601 time stamps, too. + +- uagen: + - Bump generated Firefox version to 8.0. + - Only randomize the release date if the new --randomize-release-date + option is enabled. Firefox versions after 4 use a fixed date string + without meaning. + +*** Version 3.0.17 Stable *** + +- Fixed last-chunk-detection for responses where the body was small + enough to be read with the headers, causing Privoxy to wait for the + end of the content until the server closed the connection or the + request timed out. Reported by "Karsten" in #3028326. +- Responses with status code 204 weren't properly detected as body-less + like RFC2616 mandates. Like the previous bug, this caused Privoxy to + wait for the end of the content until the server closed the connection + or the request timed out. Fixes #3022042 and #3025553, reported by a + user with no visible name. Most likely also fixes a bunch of other + AJAX-related problem reports that got closed in the past due to + insufficient information and lack of feedback. +- Fixed an ACL bug that made it impossible to build a blacklist. + Usually the ACL directives are used in a whitelist, which worked + as expected, but blacklisting is still useful for public proxies + where one only needs to deny known abusers access. +- Added LOG_LEVEL_RECEIVED to log the not-yet-parsed data read from the + network. This should make debugging various parsing issues a lot easier. +- The IPv6 code is enabled by default on Windows versions that support it. + Patch submitted by oCameLo in #2942729. +- In mingw32 versions, the user.filter file is reachable through the + GUI, just like default.filter is. Feature request 3040263. +- Added the configure option --enable-large-file-support to set a few + defines that are required by platforms like GNU/Linux to support files + larger then 2GB. Mainly interesting for users without proper logfile + management. +- Logging with "debug 16" no longer stops at the first nul byte which is + pretty useless. Non-printable characters are replaced with their hex value + so the result can't span multiple lines making parsing them harder then + necessary. +- Privoxy logs when reading an action, filter or trust file. +- Fixed incorrect regression test markup which caused a test in + 3.0.16 to fail while Privoxy itself was working correctly. + While Privoxy accepts hide-referer, too, the action name is actually + hide-referrer which is also the name used one the final results page, + where the test expected the alias. + +- CGI interface improvements: + - In finish_http_response(), continue to add the 'Connection: close' + header if the client connection will not be kept alive. + Anonymously pointed out in #2987454. + - Apostrophes in block messages no longer cause parse errors + when the blocked page is viewed with JavaScript enabled. + Reported by dg1727 in #3062296. + - Fix a bunch of anchors that used underscores instead of dashes. + - Allow to keep the client connection alive after crunching the previous request. + Already opened server connections can be kept alive, too. + - In cgi_show_url_info(), don't forget to prefix URLs that only contain + http:// or https:// in the path. Fixes #2975765 reported by Adam Piggott. + - Show the 404 CGI page if cgi_send_user_manual() is called while + local user manual delivery is disabled. + +- Action file improvements: + - Enable user.filter by default. Suggested by David White in #3001830. + - Block .sitestat.com/. Reported by johnd16 in #3002725. + - Block .atemda.com/. Reported by johnd16 in #3002723. + - Block js.adlink.net/. Reported by johnd16 in #3002720. + - Block .analytics.yahoo.com/. Reported by johnd16 in #3002713. + - Block sb.scorecardresearch.com, too. Reported by dg1727 in #2992652. + - Fix problems noticed on Yahoo mail and news pages. + - Remove the too broad yahoo section, only keeping the + fast-redirects exception as discussed on ijbswa-devel@. + - Don't block adesklets.sourceforge.net. Reported in #2974204. + - Block chartbeat ping tracking. Reported in #2975895. + - Tag CSS and image requests with cautious and medium settings, too. + - Don't handle view.atdmt.com as image. It's used for click-throughs + so users should be able to "go there anyway". + Reported by Adam Piggott in #2975927. + - Also let the refresh-tags filter remove invalid refresh tags where + the 'url=' part is missing. Anonymously reported in #2986382. + While at it, update the description to mention the fact that only + refresh tags with refresh times above 9 seconds are covered. + - javascript needs to be blocked with +handle-as-empty-document to + work around Firefox bug 492459. So move .js blockers from + +block{Might be a web-bug.} -handle-as-empty-document to + +block{Might be a web-bug.} +handle-as-empty-document. + - ijbswa-Feature Requests-3006719 - Block 160x578 Banners. + - Block another omniture tracking domain. + - Added a range-requests tagger. + - Added two sections to get Flickr's Ajax interface working with + default pre-settings. If you change the configuration to block + cookies by default, you'll need additional exceptions. + Reported by Mathias Homann in #3101419 and by Patrick on ijbswa-users@. + +- Documentation improvements: + - Explicitly mention how to match all URLs. + - Consistently recommend socks5 in the Tor FAQ entry and mention + its advantage compared to socks4a. Reported by David in #2960129. + - Slightly improve the explanation of why filtering may appear + slower than it is. + - Grammar fixes for the ACL section. + - Fixed a link to the 'intercepting' entry and add another one. + - Rename the 'Other' section to 'Mailing Lists' and reword it + to make it clear that nobody is forced to use the trackers + - Note that 'anonymously' posting on the trackers may not always + be possible. + - Suggest to enable debug 32768 when suspecting parsing problems. + +- Privoxy-Log-Parser improvements: + - Gather statistics for ressources, methods, and HTTP versions + used by the client. + - Also gather statistics for blocked and redirected requests. + - Provide the percentage of keep-alive offers the client accepted. + - Add a --url-statistics-threshold option. + - Add a --host-statistics-threshold option to also gather + statistics about how many request where made per host. + - Fix a bug in handle_loglevel_header() where a 'scan: ' got lost. + - Add a --shorten-thread-ids option to replace the thread id with + a decimal number. + - Accept and ignore: Looks like we got the last chunk together + with the server headers. We better stop reading. + - Accept and ignore: Continue hack in da house. + - Accept and higlight: Rejecting connection from 10.0.0.2. + Maximum number of connections reached. + - Accept and highlight: Loading actions file: /usr/local/etc/privoxy/default.action + - Accept and highlight: Loading filter file: /usr/local/etc/privoxy/default.filter + - Accept and highlight: Killed all-caps Host header line: HOST: bestproxydb.com + - Accept and highlight: Reducing expected bytes to 0. Marking + the server socket tainted after throwing 4 bytes away. + - Accept: Merged multiple header lines to: 'X-FORWARDED-PROTO: http X-HOST: 127.0.0.1' + +- Code cleanups: + - Remove the next member from the client_state struct. Only the main + thread needs access to all client states so give it its own struct. + - Garbage-collect request_contains_null_bytes(). + - Ditch redundant code in unload_configfile(). + - Ditch LogGetURLUnderCursor() which doesn't seem to be used anywhere. + - In write_socket(), remove the write-only variable write_len in + an ifdef __OS2__ block. Spotted by cppcheck. + - In connect_to(), don't declare the variable 'flags' on OS/2 where + it isn't used. Spotted by cppcheck. + - Limit the scope of various variables. Spotted by cppcheck. + - In add_to_iob(), turn an interestingly looking for loop into a + boring while loop. + - Code cleanup in preparation for external filters. + - In listen_loop(), mention the socket on which we accepted the + connection, not just the source IP address. + - In write_socket(), also log the socket we're writing to. + - In log_error(), assert that escaped characters get logged + completely or not at all. + - In log_error(), assert that ival and sval have reasonable values. + There's no reason not to abort() if they don't. + - Remove an incorrect cgi_error_unknown() call in a + cannot-happen-situation in send_crunch_response(). + - Clean up white-space in http_response definition and + move the crunch_reason to the beginning. + - Turn http_response.reason into an enum and rename it + to http_response.crunch_reason. + - Silence a 'gcc (Debian 4.3.2-1.1) 4.3.2' warning on i686 GNU/Linux. + - Fix white-space in a log message in remove_chunked_transfer_coding(). + While at it, add a note that the message doesn't seem to + be entirely correct and should be improved later on. + +- GNUmakefile improvements: + - Use $(SSH) instead of ssh, so one only needs to specify a username once. + - Removed references to the action feedback thingy that hasn't been + working for years. + - Consistently use shell.sourceforge.net instead of shell.sf.net so + one doesn't need to check server fingerprints twice. + - Removed GNUisms in the webserver and webactions targets so they + work with standard tar. + +*** Version 3.0.16 Stable *** + +- Added the config file option handle-as-empty-doc-returns-ok to + work around Firefox bug #492459, which causes Firefox to hang + if JavaScripts are blocked in certain situations. The option is + enabled in the default config file. +- Added the config file option default-server-timeout to control the + assumed default server timeout. Since Privoxy no longer returns + an error message for connection resets on reused client connections, + assuming larger server timeout values appears to actually work + pretty well as long as connections aren't shared. +- Added optional support for FreeBSD's accf_http(9). Use the + configure option --enable-accept-filter to enable it. +- Added fancier Privoxy icons for win32. Contributed by Jeff H. +- In daemon mode, fd 0, 1 and 2 are bound to /dev/null. +- Resolve localhost using whatever address family the operating + system feels like. Previous betas would try to use IPv4 as this + is what most users expect, but this didn't work reliably on + GNU/Linux systems. +- In the action lists on CGI pages, actions and their parameters are + no longer separated with a space. The action file parser doesn't + actually allow this and will throw an invalid syntax error if actions + and parameters in the action files are separated. Not adding the + spaces means copy and pasting CGI output into the action files works. +- The default keep-alive timeout has been reduced to 5 seconds to work + around hangs in clients that treat the proxy like any other host and + stop allowing any new connections if the "maximum number of + connections per host" is reached. +- Several webbug URLs that look like they are leading to images are now + blocked as image instead of empty documents. Doing the latter causes + WebKit-based clients to show a "missing image" icon which may mess up + the layout. +- The no-such-domain template is used for DNS resolution + problems with FEATURE_IPV6_SUPPORT enabled. Previously the + connect-failed template was used. Reported by 'zebul666'. +- Accepts quoted expiration dates even though RFC 2109 10.1.2 + doesn't seem to allow them. Reported anonymously. +- Don't try to forget connections if connection sharing is disabled. + This wasn't a real problem but caused an unnecessary log message. +- The still undocumented --enable-extended-host-patterns configure + option has a better description. +- Fixed an error message that would claim a write to the server + failed when actually writing to the client failed. +- Log the crunch reason before trying to write to the client. + The log is easier to read that way. +- Several log messages about client connections also mention + the socket number. +- handle-as-empty-document no longer depends on the image blocking + code being enabled. +- Privoxy-Log-Parser is roughly 40% faster in highlighting mode. +- uagen, a Firefox User-Agent generator for Privoxy and Mozilla + browsers has been imported and is available in the tarball's + tools directory. +- The scripts in the tools directory treat unknown parameters + as fatal errors. + +*** Version 3.0.15 Beta *** + +- In case of missing server data, no error message is send to the + client if the request arrived on a reused connection. The client + is then supposed to silently retry the request without bothering + the user. This should significantly reduce the frequency of the + "No server or forwarder data received" error message many users + reported. +- More reliable detection of prematurely closed client sockets + with keep-alive enabled. +- FEATURE_CONNECTION_KEEP_ALIVE is decoupled from + FEATURE_CONNECTION_SHARING and now available on + all platforms. +- Improved handling of POST requests on reused connections. + Should fix problems with stalled connections after submitting + form data with some browser configurations. +- Fixed various latency calculation issues. +- Allows the client to pass NTLM authentication requests to a + forwarding proxy. This was already assumed and hinted to work + in 3.0.13 beta but actually didn't. Now it's confirmed to work + with IE, Firefox and Chrome. + Thanks to Francois Botha and Wan-Teh Chang +- Fixed a calculation problem if receiving the server headers + takes more than two reads, that could cause Privoxy to terminate + the connection prematurely. Reported by Oliver. +- Compiles again on platforms such as OpenBSD and systems + using earlier glibc version that don't support AI_ADDRCONFIG. + Anonymously submitted in #2872591. +- A bunch of MS VC project files and Suse and Redhat RPM spec + files have been removed as they were no longer maintained for + quite some time. +- Overly long action lines are properly rejected with a proper + error message. Previously they would be either rejected as + invalid or cause a core dump through abort(). +- Already timed-out connections are no longer temporarily remembered. + They weren't reused anyway, but wasted a socket slot. +- len refers to the number of bytes actually read which might + differ from the ones received. Adjust log messages accordingly. +- The optional JavaScript on the CGI page uses encodeURIComponent() + instead of escape() which doesn't encode all characters that matter. + Anonymously reported in #2832722. +- Fix gcc45 warnings in decompress_iob(). +- Various log message improvements. +- Privoxy-Regression-Test supports redirect tests. +- Privoxy-Log-Parser can gather some connection statistics. + +*** Version 3.0.14 Beta *** + +- The latency is taken into account when evaluating whether or not to + reuse a connection. This should significantly reduce the number of + connections problems several users reported. +- If the server doesn't specify how long the connection stays alive, + Privoxy errs on the safe side of caution and assumes it's only a second. +- The error pages for connection timeouts or missing server data use a + Last-Modified date in the past. Retry attempts are detected and Privoxy + removes the If-Modified-Since header to prevent the server from responding + with status code 304 in which case the client would reuse the error message. +- Setting keep-alive-timeout to 0 disables keep-alive support. Previously + Privoxy would claim to allow persistence but not reuse the connection. +- Pipelined requests are less likely to be mistaken for the request + body of the previous request. Note that Privoxy still has no real + pipeline support and will either serialize pipelined requests or + drop them in which case the client has to resent them. +- Fixed a crash on some Windows versions when header randomization + is enabled and the date couldn't be parsed. +- Privoxy's keep-alive timeout for the current connection is reduced + to the one specified in the client's Keep-Alive header. +- For HTTP/1.1 requests, Privoxy implies keep-alive support by not + setting any Connection header instead of using 'Connection: keep-alive'. +- If the socket isn't reusable, Privoxy doesn't temporarily waste + a socket slot to remember the connection. +- If keep-alive support is disabled but compiled in, the client's + Keep-Alive header is removed. +- Fixed a bug on mingw32 where downloading large files failed if + keep-alive support was enabled. +- Fixed a bug that (at least theoretically) could cause log + timestamps to be occasionally off by about a second. +- No Proxy-Connection header if added if there already is one. +- The configure script respects the $PATH variable when searching + for groups and id. + +*** Version 3.0.13 Beta *** + +- Added IPv6 support. Thanks to Petr Pisar who not only provided + the initial patch but also helped a lot with the integration. +- Added client-side keep-alive support. +- The connection sharing code is only used if the connection-sharing + option is enabled. +- The max-client-connections option has been added to restrict + the number of client connections below a value enforced by + the operating system. +- Fixed a regression reintroduced in 3.0.12 that could cause + crashes on mingw32 if header date randomization was enabled. +- Compressed content with extra fields couldn't be decompressed + and would get passed to the client unfiltered. This problem + has only be detected through statical analysis with clang as + nobody seems to be using extra fields anyway. +- If the server resets the Connection after sending only the headers + Privoxy forwards what it got to the client. Previously Privoxy + would deliver an error message instead. +- Error messages in case of connection timeouts use the right + HTTP status code. +- If spawning a child to handle a request fails, the client + gets an error message and Privoxy continues to listen for + new requests right away. +- The error messages in case of server-connection timeouts or + prematurely closed server connections are now template-based. +- If zlib support isn't compiled in, Privoxy no longer tries to + filter compressed content unless explicitly asked to do so. +- In case of connections that are denied based on ACL directives, + the memory used for the client IP is no longer leaked. +- Fixed another small memory leak if the client request times out + while waiting for client headers other than the request line. +- The client socket is kept open until the server socket has + been marked as unused. This should increase the chances that + the still-open connection will be reused for the client's next + request to the same destination. Note that this only matters + if connection-sharing is enabled. +- A TODO list has been added to the source tarball to give potential + volunteers a better idea of what the current goals are. Donations + are still welcome too: http://www.privoxy.org/faq/general.html#DONATE + +*** Version 3.0.12 *** - The socket-timeout option now also works on platforms whose select() implementation modifies the timeout structure. @@ -36,7 +742,7 @@ ChangeLog for Privoxy skip reason. *** Version 3.0.11 *** - + - On most platforms, outgoing connections can be kept alive and reused if the server supports it. Whether or not this improves things depends on the connection. @@ -251,7 +957,7 @@ ChangeLog for Privoxy forbidden characters like dots. - New trust entries are saved with a comment that contains the trusted referring URL (Suggested by Daniel Griscom). -- Filter descriptions are HTML encoded automatically. +- Filter descriptions are HTML encoded automatically. - New config option "split-large-forms" to work around a browser bug that caused IE6 and IE7 to ignore the Submit button on the edit-actions-for-url CGI page. @@ -290,11 +996,11 @@ ChangeLog for Privoxy Privoxy detection "attack". Note that detecting Privoxy is still possible through other ways and Privoxy was never intended to be invisible anyway. -- Added support for AmigaOS 4, fixed build for AmigaOS 3.x. +- Added support for AmigaOS 4, fixed build for AmigaOS 3.x. - The show-url-info CGI page displays a warning if Privoxy is currently toggled off. - The show-status CGI page suppresses the edit button - for action files if Privoxy has no write access. + for action files if Privoxy has no write access. - Most CGI error pages react properly to HEAD requests. - Requests with RFC 3253 HTTP methods (used by Subversion) are accepted. (Patch provided by Petr Kadlec) @@ -369,18 +1075,18 @@ ChangeLog for Privoxy - Improved the filters img-reorder, js-annoyances, webbugs, banners-by-size, banners-by-link and ie-exploits to make them less likely to break anything. -- Removed outdated URL patterns in default.action and added new ones. +- Removed outdated URL patterns in default.action and added new ones. - Added redirection from http://p.p/user-manual to http://p.p/user-manual/ - Changed webinterface default values for hide-user-agent, hide-referrer and set-image-blocker. - + *** Version 3.0.5 Beta *** - Windows version can be installed/started as a service. - Windows icon stays blue when Privoxy is idle, green when busy. - Integrated Fabian Keil's extensive patch. See: - http://www.fabiankeil.de/sourcecode/privoxy/. Includes the - following new or significantly improved actions (among many + http://www.fabiankeil.de/sourcecode/privoxy/. Includes the + following new or significantly improved actions (among many other improvements): content-type-overwrite{} @@ -408,17 +1114,17 @@ ChangeLog for Privoxy - Added jpeg filtering to defend against MS jpeg vulnerability MS04-028 with the new inspect-jpegs action. - Removed the "arbitrary" 1000 filter limit - addresses tracker #911950 -- Thanks to Jindrich Makovicka for a race condition fix for the log +- Thanks to Jindrich Makovicka for a race condition fix for the log file. The race condition remains for non-pthread implementations. Reference patch #1175720. Various other logging enhancements. - A pile of assorted bug fixes, memory leaks, enhancements, etc. - Moved Actions file reporting mechanism to SF tracker. -- Two new options for config: enable-remote-http-toggle and +- Two new options for config: enable-remote-http-toggle and forwarded-connect-retries. - Trap unsupported FTP requests. - Let text/xml be filtered. - Numerous updates to default.action -- Increase the compiled in limit of trusted referrers from 64 to 512 +- Increase the compiled in limit of trusted referrers from 64 to 512 (for trustfile users). *** Version 3.0.3 *** @@ -435,15 +1141,15 @@ ChangeLog for Privoxy - Workarounds for client (iTunes etc) and server (PHP < 4.2.3) bugs including the notorious "blank page" problem. - Various filter improvements; most notably the unsolicited-popups - filter became less destructive + filter became less destructive - Major revamp of the actions file - + *** Version 3.0.2 *** - Fixed two memory leaks, one serious - Fixed bug in pcrs which could cause crashes with user-defined filters - Fixed bug in domain name matching -- Assorted small fixes (Win32 menu, CGI URL editor, ..) +- Assorted small fixes (Win32 menu, CGI URL editor, ..) - Added basic support for the OPTIONS and TRACE http methods - Added workaround for Bug in Mac OSX that made Privoxy crash occasionally - Refined the default action file through >400 items of user feedback @@ -454,7 +1160,7 @@ ChangeLog for Privoxy - Replaced filter "popups" by choice between two modes: - "unsolicited-popups" tries to catch only the unsolicited ones - "all-popups" tries to kill them all (as before) - - New filter "tiny-textforms" Help those tiny or hard-wrap textareas. + - New filter "tiny-textforms" Help those tiny or hard-wrap textareas. - New filter "jumping-windows" that prevents windows from resizing and moving themselves - New filter "demoronizer" which fixes MS's abuse of std charsets @@ -478,7 +1184,7 @@ ChangeLog for Privoxy - Added quicktime-kioskmode filter and improved frameset-borders - Updated default.action based on latest feedback - New PDF doc build process -- Add a user contrib module to cvs: +- Add a user contrib module to cvs: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ijbswa/contrib/ *** Version 2.9.18 *** @@ -488,7 +1194,7 @@ ChangeLog for Privoxy - Three filters fixed (again!) - Assorted small fixes and doc enhancements -*** Version 2.9.16 *** +*** Version 2.9.16 *** - Major revamp of default.action to get rid of years of cruft. - Same for default.filter @@ -500,11 +1206,11 @@ ChangeLog for Privoxy - user-manual directive added to config for help links from within CGI editor. - Multiple actions files can now be specified in config. -- Actions files are changed to: default.action, standard.action, and +- Actions files are changed to: default.action, standard.action, and user.action. user.action is for personal/local configuration. - The usual many small and miscellaneous bug and security fixes. -*** Version 2.9.14 Beta *** +*** Version 2.9.14 Beta *** - Fix Solaris compile problem (gateway.h and filters.h) - Makefile fixes for Solaris, FreeBSD (?) @@ -518,30 +1224,30 @@ ChangeLog for Privoxy - #include mechansim for common text in templates - Various other minor fixes. -*** Version 2.9.13 Beta *** +*** Version 2.9.13 Beta *** -- *NEWS*: The project has been renamed to Privoxy! The new name is +- *NEWS*: The project has been renamed to Privoxy! The new name is reflected throughout (file locations, etc). -- ijb.action is now default.action. re_filterfile is now +- ijb.action is now default.action. re_filterfile is now default.filter. - http://i.j.b/ is now http://p.p/ -- The 'logo' option for replacing ad iamges is removed now. 'Pattern' +- The 'logo' option for replacing ad iamges is removed now. 'Pattern' (checkerboard) is now the default. - RPM spec file make over. -*** Version 2.9.12 Beta *** +*** Version 2.9.12 Beta *** -- **READ**: The default listening PORT is NOW 8118!!! Changed from - 8000 due to conflict with NAS (Network Audio Server, whatever that +- **READ**: The default listening PORT is NOW 8118!!! Changed from + 8000 due to conflict with NAS (Network Audio Server, whatever that is.) - More CGI actions editor fixes and improvements. - Win32 command line fix ups. -- re_filterfile now has modular sections that can be activated on a +- re_filterfile now has modular sections that can be activated on a per site basis. Some new goodies there too. - +filter now takes arguments to match FILTER sections in re_filterfile - for even more flexibility. -- Added a new image blocker option: +image-blocker{pattern}, which + for even more flexibility. +- Added a new image blocker option: +image-blocker{pattern}, which displays a checkerboard patthern and scales better than the logo. - PNG images will be used in place of GIF for JB built-in images if configured with --enable-no-gif. @@ -554,14 +1260,14 @@ ChangeLog for Privoxy - CGI Editor works on OS/2 now. - Fix restart failure where sockets were in TIME_WAIT. - Fixes for actions cgi editor, make sure we have right file. -- A --pidfile command line option now, in addition to --help, +- A --pidfile command line option now, in addition to --help, --version, --no-daemon, --user and configfile. --no-daemon replaces - the former -d option and _DEBUG define. --user will drop privileges + the former -d option and _DEBUG define. --user will drop privileges to the specified user. - Signal handling cleanups (*nix). - CGI actions editor improvements and fixes. - Error handling improvements, especially out of memory. -- Default re_filterfile fix that caused spurious IJB logos +- Default re_filterfile fix that caused spurious IJB logos (instead of 'blank'). - configure.in threading fixes for Solaris. - Various other minor fixes. @@ -569,14 +1275,14 @@ ChangeLog for Privoxy *** Version 2.9.11 Beta Changes *** -- Add "session" cookie concept where cookies exist for the life -of that browser session only (ie never goes to disk). +- Add "session" cookie concept where cookies exist for the life + of that browser session only (ie never goes to disk). - Checks for correct header length. - Fix user:pass@host.domain.com auth bug. - Better signal handling on *nix. - Fix CFLAGS hard-coded in configure.in -- Fix threading bug re: gethostbyname() that caused random -URLs to fail in some cases. +- Fix threading bug re: gethostbyname() that caused random + URLs to fail in some cases. *** Version 2.9.11 Alpha Changes *** @@ -616,7 +1322,7 @@ The only other URLs left are the GNU GPL: and the home page: http://ijbswa.sourceforge.net/ ... and various URLs which will be intercepted by Junkbuster anyway. -TODO: Still need to do something with the URLs in Junkbuster Corp's +TODO: Still need to do something with the URLs in Junkbuster Corp's copyright/trademark notice on the bottom of the show-proxy-args page. - PCRE or GNU Regex is now a #define option. @@ -640,7 +1346,7 @@ parsers.c (again). They obviously got lost in our current patch war ;-) - Cut the credit for the §-referrer-option from the config file, that Stefan had placed there. -- Improved the re_filterfile +- Improved the re_filterfile *** Version 2.9.0 pre-Alpha Changes *** @@ -648,9 +1354,9 @@ that Stefan had placed there. - Now use PCRE, not GNU REGEX. I have not yet had chance to check the syntax of the block/image/cookie file to ensure that they match what is expected - however they seem to work. -- Replaced "configure" script with one generated by "autoconf". Also -use a header "config.h" (was ijbconfig.h in my previous release) for -the #defines. "config.h" is now generated with "autoheader" from +- Replaced "configure" script with one generated by "autoconf". Also +use a header "config.h" (was ijbconfig.h in my previous release) for +the #defines. "config.h" is now generated with "autoheader" from "acconfig.h" and "configure.in". (Note that to install you do not need autoconf or autoheader - just run "./configure".) To see command-line options, run "./configure --help". @@ -663,7 +1369,7 @@ apply all of these, since I had already independently done conditional popup file, conditional image file, and integration of popup code. - ACL, Jar and trust files conditionally compiled. - New source file headers. -- Various cosmetic changes. (But I have not consistently ordered the +- Various cosmetic changes. (But I have not consistently ordered the config files - I think that's worthwhile, but it's 1am and I want to get this released!) - RCS tags on .h files. @@ -689,16 +1395,15 @@ being a mix of "U.S. English", "U.K. English" and "Irish English". - Version number changes to 2.9.0 - ---------------------------------------------------------------------- -Copyright : Written by and Copyright (C) 2001-2008 the SourceForge +Copyright : Written by and Copyright (C) 2001-2010 the Privoxy team. http://www.privoxy.org/ Based on the Internet Junkbuster originally written - by and Copyright (C) 1997 Anonymous Coders and + by and Copyright (C) 1997 Anonymous Coders and Junkbusters Corporation. http://www.junkbusters.com/ - This program is free software; you can redistribute it + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at diff --git a/external/privoxy/GNUmakefile b/external/privoxy/GNUmakefile deleted file mode 100644 index 20ea605c..00000000 --- a/external/privoxy/GNUmakefile +++ /dev/null @@ -1,2156 +0,0 @@ -# Note: Makefile is built automatically from Makefile.in -# -# $Id: GNUmakefile.in,v 1.180 2009/02/28 08:28:14 fabiankeil Exp $ -# -# Written by and Copyright (C) 2001 - 2008 the SourceForge -# Privoxy team. http://www.privoxy.org/ -# -# Based on the Internet Junkbuster originally written -# by and Copyright (C) 1997 Anonymous Coders and -# Junkbusters Corporation. http://www.junkbusters.com -# -# This program is free software; you can redistribute it -# and/or modify it under the terms of the GNU General -# Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will -# be useful, but WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public -# License for more details. -# -# The GNU General Public License should be included with -# this file. If not, you can view it at -# http://www.gnu.org/copyleft/gpl.html -# or write to the Free Software Foundation, Inc., 59 -# Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - -############################################################################# -# Set make command correctly -############################################################################# - - -############################################################################# -# Version number (for RPM) -############################################################################# - -VERSION_MAJOR = 3 -VERSION_MINOR = 0 -VERSION_POINT = 12 -CODE_STATUS = stable -VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_POINT) -RPM_VERSION = $(VERSION) -RPM_PACKAGEV = "" -SNAPVERSION = $(RPM_VERSION)-$(shell date "+%Y%m%d") - - -############################################################################# -# "make install" directories and variables -############################################################################# - -#User Group paras -USER = -GROUP = - -datarootdir = ${prefix}/share -prefix = /usr/local -exec_prefix = ${prefix} -CONF_BASE = ${prefix}/etc -SBIN_DEST = ${exec_prefix}/sbin -MAN_DIR = ${datarootdir}/man -MAN_DEST = $(MAN_DIR)/man1 -SHARE_DEST = ${datarootdir} -DOC_DEST = $(SHARE_DEST)/doc/privoxy -VAR_DEST = ${prefix}/var -LOGS_DEST = $(VAR_DEST)/log/privoxy -PIDS_DEST = $(VAR_DEST)/run - -# if $prefix = /usr/local then the default CONFDEST change from -# CONF_DEST = $(CONF_BASE) to CONF_DEST = $(CONF_BASE)/privoxy -# by the target rule CONF_DEST -# -# also if the $prefix is /usr/local and there is no -# $(SHARE_DEST)/doc, it checks for $prefix/doc and installs there -# instead in this situation -# -# finally if $prefix=/usr/local and VAR_DEST=$prefix/var it -# changes this to /var for storing the logs and pidfile - -# used in source dir only, the install goes to $share_dest/doc/privoxy -DOK_WEB = doc/webserver/ - -# Install usage should be compatible with install-sh. -INSTALL = /usr/bin/install -c -# Binaries -BIN_MODE = 0755 -# Support files, docs, etc. -RA_MODE = 0664 -# Directory -DIR_MODE = 0755 -# Files daemon writes to. -RWD_MODE = 0660 -INSTALL_P = -m $(BIN_MODE) -INSTALL_T = -m $(RA_MODE) -INSTALL_D = -m $(DIR_MODE) -d -INSTALL_R = -m $(RWD_MODE) - -# install options for superuser install -#INSTALL_S = -g -o - -############################################################################# -# Build tools -############################################################################# - -PROGRAM = privoxy -CC = /home/n8fr8/dev/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc --sysroot=/home/n8fr8/dev/android/ndk/platforms/android-8/arch-arm -ECHO = echo -GZIP_PROG = gzip - -# id -u is not universal. FIXME: need to set from configure. Breaks on -# Solaris. -#ID = id -u -ID = id -LD = /home/n8fr8/dev/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc --sysroot=/home/n8fr8/dev/android/ndk/platforms/android-8/arch-arm -RM = rm -f -CP = cp -f -RMDIR = rmdir -MKDIR = ./mkinstalldirs -STRIP_PROG = strip -SED = sed -GREP = grep -CAT = cat -RPM = rpm -RPMBUILD = rpmbuild -MV = mv -TAR = tar -LN = ln -TOUCH = touch -KILL = kill -CHMOD = chmod -CHOWN = chown -CHGRP = chgrp -GROUPS = groups -WDUMP = -dump -JADECAT = -JADEBIN = false -DB = $(JADEBIN) $(JADECAT) -ihtml -t sgml -D.. -d ldp.dsl\#html -DB2HTML = false -MAN2HTML = false -G2H_CMD = groff -mandoc -Thtml -TARGET_OS = arm-linux-eabi -PERL = perl -DOC_DIR = doc/source -DOC_TMP = $(DOC_DIR)/tmp -DOC_STATUS = p-stable - -# Program to do LF->CRLF -# -# The sed version should be the most portable, but it doesn't for for me, -# the other two do. FIXME. -# - Jon -#DOSFILTER = $(SED) -e $$'s,$$,\r,' -#DOSFILTER = gawk -v ORS='\r\n' '{print $0;}' -DOSFILTER = $(PERL) -p -e 's/\n/\r\n/' -CVSROOT = :pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa -#TMPDIR := $(shell mktemp -d /tmp/$(PROGRAM).XXXXXX) - -############################################################################# -# Setup for make distribution rh and suse for now -############################################################################# - -TAR_ARCH = /tmp/privoxy-$(RPM_VERSION).tar.gz -RPM_BASE = /home/n8fr8/rpmbuild - -############################################################################# -# We include these files in our distributions -############################################################################# -CONFIGS = config trust default.action match-all.action user.action default.filter user.filter -# take care that no CVS .cvsignore or other crappy files -# are included here -# and escape every '#' in the find. doh. -CONFIG_FILES = $(CONFIGS) \ - `find templates/ -type f | grep -v "CVS" | grep -v "\.\#" | grep -v ".*~" | grep -v ".cvsignore" | grep -v "TAGS"` - -DOC_FILES = AUTHORS LICENSE README ChangeLog INSTALL \ - `find doc/webserver/ -name "*.html" | grep -v "\(webserver\|team\)\/index\.html"` \ - `find doc/webserver/ -name "*.css"` \ - privoxy.1 - -############################################################################# -# Filenames and libraries -############################################################################# - -C_SRC = actions.c cgi.c cgiedit.c cgisimple.c deanimate.c encode.c \ - errlog.c filters.c gateway.c jbsockets.c jcc.c \ - list.c loadcfg.c loaders.c miscutil.c parsers.c ssplit.c \ - urlmatch.c - -C_OBJS = $(C_SRC:.c=.o) -C_HDRS = $(C_SRC:.c=.h) project.h actionlist.h - -W32_SRC = #w32log.c w32taskbar.c win32.c w32svrapi.c -W32_FILES = #w32.res -W32_OBJS = #$(W32_SRC:.c=.o) $(W32_FILES) -W32_HDRS = #w32log.h w32taskbar.h win32.h w32res.h w32svrapi.h -W32_LIB = #-lwsock32 -lcomctl32 -W32_INIS = #config.txt trust.txt - -PCRS_SRC = pcrs.c -PCRS_OBJS = $(PCRS_SRC:.c=.o) -PCRS_HDRS = $(PCRS_SRC:.c=.h) - -PCRE_SRC = pcre/get.c pcre/maketables.c pcre/study.c pcre/pcre.c -PCRE_OBJS = $(PCRE_SRC:.c=.o) -PCRE_HDRS = pcre/config.h pcre/chartables.c pcre/internal.h pcre/pcre.h - -# No REGEX (maybe because dynamically linked pcreposix): -REGEX_SRC = -REGEX_SRC = pcre/pcreposix.c - -REGEX_OBJS = $(REGEX_SRC:.c=.o) -REGEX_HDRS = $(REGEX_SRC:.c=.h) - -# Dependencies introduced by #include "project.h". -PROJECT_H_DEPS = project.h $(REGEX_HDRS) $(PCRS_HDRS) pcre/pcre.h - -# Socket libraries for platforms that need them explicitly defined -SOCKET_LIB = - -# PThreads library, if needed. -PTHREAD_LIB = - -SRCS = $(C_SRC) $(W32_SRC) $(PCRS_SRC) $(PCRE_SRC) $(REGEX_SRC) -OBJS = $(C_OBJS) $(W32_OBJS) $(PCRS_OBJS) $(PCRE_OBJS) $(REGEX_OBJS) -HDRS = $(C_HDRS) $(W32_HDRS) $(PCRS_HDRS) $(PCRE_OBJS) $(REGEX_HDRS) -LIBS = -lz $(W32_LIB) $(SOCKET_LIB) $(PTHREAD_LIB) - - -############################################################################# -# Compiler switches -############################################################################# - -# The flag "-mno-win32" can be used by Cygwin to emulate a un?x type build. -# The flag "-mwindows -mno-cygwin" will cause Cygwin to use MingW32 for a -# Win32 GUI build. -# The flag "-pthread" is required if using Pthreads under Linux (and -# possibly other OSs). -SPECIAL_CFLAGS = - -# Add your flags here -OTHER_CFLAGS = - -CFLAGS = -pipe -DANDROID -I/home/n8fr8/dev/gp/repos/orbot/external/include -I/home/n8fr8/dev/android/ndk/platforms/android-8/arch-arm/usr/include -fdata-sections -ffunction-sections -Os $(OTHER_CFLAGS) $(SPECIAL_CFLAGS) -Wall \ - -Ipcre - -LDFLAGS = -L/home/n8fr8/dev/gp/repos/orbot/external/lib -L/home/n8fr8/dev/android/ndk/platforms/android-8/arch-arm/usr/lib -Wl,--gc-sections $(DEBUG_CFLAGS) $(SPECIAL_CFLAGS) - - -############################################################################# -# Build section. -# -# There should NOT be any targets above this line. -############################################################################# -all: $(PROGRAM) default.action - - -############################################################################# -# Phony targets -############################################################################# -.PHONY: all inifiles redhat-dist redhat-upload solaris-dist suse-dist \ -suse-upload win-dist tarball-dist dok redhat-dok webserver clean clobber tags \ -install conectiva-spec conectiva-dist conectiva-upload CONF_DEST LOG_DEST \ -PID_DEST check_doc install-strip uninstall GROUP_T - -############################################################################# -# Define this explicitly because Solaris is broken! -############################################################################# -%.o: %.c - $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ - - -############################################################################# -# Strip master copy comments from default.action: -############################################################################# -default.action: default.action.master - $(GREP) -v '^#MASTER#' $< > $@ - -############################################################################# -# Win32 config files -############################################################################# - -inifiles: $(W32_INIS) - -config.txt: config - $(SED) -e 's!\trustfile trust!trustfile trust.txt!' \ - -e 's!\logfile logfile!logfile privoxy.log!' \ - -e 's!#Win32-only: !!' \ - < $< | \ - $(DOSFILTER) > $@ - # LF to CRLF in default.action - $(DOSFILTER) default.action.txt && mv default.action.txt default.action - # LF to CRLF in default.filter - $(DOSFILTER) default.filter.txt && mv default.filter.txt default.filter - -trust.txt: trust - $(DOSFILTER) < $< > $@ - -############################################################################# -# Pre-dist check: -############################################################################# -dist-check: - @if [ -d CVS ]; then \ - $(ECHO) "***************************************************"; \ - $(ECHO) "*** ***"; \ - $(ECHO) "*** WARNING ***"; \ - $(ECHO) "*** ***"; \ - $(ECHO) "*** The presence of a CVS subdirectory suggests ***"; \ - $(ECHO) "*** that you are trying to build a distribution ***"; \ - $(ECHO) "*** package based on a checked out, not an ***"; \ - $(ECHO) "*** exported copy of the source tree. Please ***"; \ - $(ECHO) "*** see \"Releasing a new version\" in the ***"; \ - $(ECHO) "*** developer manual. ***"; \ - $(ECHO) "*** ***"; \ - $(ECHO) "***************************************************"; \ - $(ECHO) "Type \"yes i am sure\" if you are sure that you"; \ - $(ECHO) -n "really want to proceed: "; \ - read answer; \ - if [ "$$answer" != "yes i am sure" ]; then exit 1; fi \ - fi; - - -############################################################################# -# create tar.gz from CVS: -# This make-target is usually called through 'create-archive'. If you -# run 'make create-snapshot' without setting SNAPVERSION, you'll get a -# tar.gz with the current date in the name and as a releasenumber in the -# spec-file. But the main usage is to run it as follows (Red Hat example): -# make SNAPVERSION=1.6x create-snapshot -# This creates a tar.gz and spec-file for a Red Hat 6.x version. -############################################################################# -create-snapshot: - @tag=`cvs -d $(CVSROOT) status Makefile | awk ' /Sticky Tag/ { print $$3 } '` 2> /dev/null; \ - [ x"$$tag" = x"(none)" ] && tag=HEAD; \ - echo "*** Creating package from $$tag!"; \ - TMPDIR=$(shell mktemp -d /tmp/$(PROGRAM).XXXXXX); \ - cd $$TMPDIR ; cvs -Q -d $(CVSROOT) export -r $$tag current || echo "Um... export aborted."; \ - cd $$TMPDIR/current; \ - TMPFILE=$$(mktemp -q /tmp/$(PROGRAM).XXXXXX); \ - if $(SED) -e 's/^\(Version:\).*/\1 $(RPM_VERSION)/g' \ - -e 's/^\(Release:\).*/\1 $(SNAPVERSION)/g' \ - privoxy-rh.spec > $$TMPFILE ; then \ - $(MV) -f $$TMPFILE privoxy-rh.spec; \ - else \ - $(ECHO) "Could not set version info in specfile."; \ - exit 1;\ - fi;\ - if $(SED) -e 's/^\(Version:\).*/\1 $(RPM_VERSION)/g' \ - -e 's/^\(Release:\).*/\1 $(SNAPVERSION)/g' \ - privoxy-suse.spec > $$TMPFILE ; then \ - $(MV) -f $$TMPFILE privoxy-suse.spec; \ - else \ - $(ECHO) "Could not set version info in specfile."; \ - exit 1;\ - fi; \ - $(RM) $$TMPFILE; \ - cd $$TMPDIR/current; \ - $(TAR) --exclude ".cvsignore" --exclude "CVS" \ - -czf /tmp/$(PROGRAM)-$(VERSION).tar.gz .; \ - $(RM) -rf $$TMPDIR - @echo "Resulting file is /tmp/$(PROGRAM)-$(VERSION).tar.gz" - - -############################################################################# -# looks at the version of Makefile and exports a corresponding source-tree -# example: if the Makefile has the sticky tag v_2_9_13, you'll get -# privoxy-*-2.4.13.tar.gz. Two different tar files will be written, one for -# Red Hat and one for SuSe (different spec-files) -############################################################################# -create-archive: - make SNAPVERSION=$(SNAPVERSION) create-snapshot - -############################################################################# -# RPM specifice stuff (SuSE or Redhat, ..) -############################################################################# -rpm-stuff: dist-check clean clobber - for dir in RPMS SRPMS BUILD SOURCES SPECS; do \ - if [ ! -w $(RPM_BASE)/$$dir ]; then \ - $(ECHO) "$(RPM_BASE)/$$dir is not writable for you. Maybe try as root."; \ - $(ECHO) "Or add a suitable path to .rpmmacros like."; \ - $(ECHO) "%_topdir /home/foo/rpm-build"; \ - exit 1; \ - fi; \ - done; \ - -check-release: - @if [ "$(RPM_PACKAGEV)" = "" ]; then \ - echo ; \ - echo " ERROR: NO RPM_PACKAGEV VALUE"; \ - echo " No value given for RPM_PACKAGEV. Please use:"; \ - echo " make dist-upload RPM_PACKAGEV=release"; \ - echo " where \"release\" is the release number you want to and"; \ - echo " where \"dist\" is the name of the distro (redhat or suse)"; \ - echo ; \ - echo " Ex: make redhat-upload RPM_PACKAGEV=1"; \ - echo ""; \ - echo "ATTENTION: If your distribution use a specific tag on the"; \ - echo " release field (like \"cl\" for Conectiva, and"; \ - echo " \"mdk\" for Mandrake), DO NOT put it on the value"; \ - echo " given to RPM_PACKAGEV. It will be added automaticaly."; \ - echo " Do it like you would do for a redhat package,"; \ - echo " (i.e. just the number)."; \ - echo ; \ - exit 1; \ - fi - - -############################################################################# -# Create Conectiva specfile from RedHat specfile -############################################################################# -conectiva-spec: - $(RM) privoxy-cl.spec - chmod a+x genclspec.sh - ./genclspec.sh - -############################################################################# -# Conectiva distribution for x86 -############################################################################# -conectiva-dist: rpm-stuff conectiva-spec - - $(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-suse.spec" --exclude "privoxy-rh.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) . - $(RPMBUILD) --clean -ta $(TAR_ARCH) - if [ -f $(TAR_ARCH) ]; then $(RM) $(TAR_ARCH); fi - -conectiva-upload: check-release - make redhat-upload RPM_PACKAGEV=$(RPM_PACKAGEV)cl - -############################################################################# -# redhat distribution alpha and x86 -############################################################################# -redhat-dist: rpm-stuff - echo $(CONFIG_FILES) - $(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-suse.spec" --exclude "privoxy-cl.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) . - $(RPMBUILD) --clean -ta $(TAR_ARCH) - if [ -f $(TAR_ARCH) ]; then $(RM) $(TAR_ARCH); fi - -# For testing build issues only! Use redhat-dist for official releases. -redhat-test: - echo $(CONFIG_FILES) - $(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-suse.spec" --exclude "privoxy-cl.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) . - $(RPMBUILD) --clean -tb $(TAR_ARCH) - if [ -f $(TAR_ARCH) ]; then $(RM) $(TAR_ARCH); fi - @echo "WARNING: This target is only for testing. Use redhat-dist for releases!!!" - -# anonymously ncftps the rpms to sourceforge -redhat-upload: check-release - ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/SRPMS/privoxy-$(RPM_VERSION)-$(RPM_PACKAGEV).src.rpm -# better should use `arch` here instead of ix86 to support other platforms too - ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/RPMS/*/privoxy-$(RPM_VERSION)-$(RPM_PACKAGEV).*.rpm - @$(ECHO) ------------------------------------------------------- - @$(ECHO) Now goto - @$(ECHO) https://sourceforge.net/project/admin/editpackages.php?group_id=11118 - @$(ECHO) ... and release the files. - @$(ECHO) ------------------------------------------------------- - # w3m http://sourceforge.net/project/admin/editpackages.php?group_id=11118 - - -############################################################################# -# Creates a Red Hat sourcepackage from CVS (not from the current sources -# on disk) -############################################################################# -redhat-srpm: - make create-archive - $(RPMBUILD) -ts --nodeps $(PROGRAM)-$(VERSION).tar.gz - - -############################################################################# -# suse distribution. works fine. no need to be root. -############################################################################# -suse-dist: rpm-stuff -# TMPFILE=$$(mktemp -q /tmp/$(PROGRAM).XXXXXX); \ -# if $(SED) -e 's/^\(Version:\).*/\1 $(RPM_VERSION)/g' \ -# -e 's/^\(Release:\).*/\1 $(RPM_PACKAGEV)/g' \ -# privoxy-suse.spec > $$TMPFILE ; then \ -# $(MV) -f $$TMPFILE privoxy-suse.spec; \ -# else \ -# $(ECHO) "Could not set version info in specfile."; \ -# exit 1;\ -# fi - - $(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-rh.spec" --exclude "privoxy-cl.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) . - $(RPMBUILD) --clean -ta $(TAR_ARCH) - if [ -f $(TAR_ARCH) ]; then $(RM) $(TAR_ARCH); fi - -# anonymously ncftps the rpms to sourceforge -suse-upload: check-release - ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/SRPMS/privoxy-suse-$(RPM_VERSION)-$(RPM_PACKAGEV).src.rpm -# better should use `arch` here instead of ix86 to support other platforms too - ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/RPMS/*/privoxy-suse-$(RPM_VERSION)-$(RPM_PACKAGEV).*.rpm - @$(ECHO) ------------------------------------------------------- - @$(ECHO) Now goto - @$(ECHO) https://sourceforge.net/project/admin/editpackages.php?group_id=11118 - @$(ECHO) ... and release the files. - @$(ECHO) ------------------------------------------------------- - -# handle with care. use with root. -suse-clean: - $(RPM) -e junkbuster-suse || true - $(RM) -r /etc/junkbuster - $(RM) -r /etc/rc.d/junkbuster* - $(RM) -r /var/run/junkbuster.pid - $(RM) -r /var/log/junkbuster - $(RM) /etc/init.d/junkbuster - $(RM) /usr/sbin/junkbuster - $(RM) /usr/sbin/rcjunkbuster - $(RM) /usr/share/man/man1/junkbuster.1.gz - $(RPM) -e privoxy-suse || true - $(RM) -r /etc/privoxy - $(RM) -r /etc/rc.d/privoxy* - $(RM) -r /var/run/privoxy.pid - $(RM) -r /var/log/privoxy - $(RM) /etc/init.d/privoxy - $(RM) /usr/sbin/privoxy - $(RM) /usr/sbin/rcprivoxy - $(RM) /usr/share/man/man1/privoxy.1.gz - -############################################################################# -# generic distribution -############################################################################# -gen-dist: dist-check - @$(ECHO) "" - @$(ECHO) "You have run autoconf && autoheader && ./configure right?" - @$(ECHO) "" - $(MAKE) $(PROGRAM) - $(STRIP_PROG) $(PROGRAM) - $(LN) -s current ../privoxy-$(VERSION)-$(CODE_STATUS) -# add program - (cd .. && $(TAR) -cvhf --exclude "PACKAGERS" privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar privoxy-$(VERSION)-$(CODE_STATUS)/$(PROGRAM)) -# add config files - for foo in $(CONFIG_FILES); do \ - (cd .. && $(TAR) -uvhf --exclude "PACKAGERS" privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar privoxy-$(VERSION)-$(CODE_STATUS)/$$foo;) \ - done; -# add documentation - for foo in $(DOC_FILES); do \ - (cd .. && $(TAR) -uvhf --exclude "PACKAGERS" privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar privoxy-$(VERSION)-$(CODE_STATUS)/$$foo;) \ - done; -# and zip the archive - $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS) - $(GZIP_PROG) ../privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar - @$(ECHO) Distribution with binary created. - -# anonymously ncftps the package to sourceforge -gen-upload: - ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming ../privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar.gz - @$(ECHO) ------------------------------------------------------- - @$(ECHO) Now goto - @$(ECHO) https://sourceforge.net/project/admin/editpackages.php?group_id=11118 - @$(ECHO) ... and release the files. - @$(ECHO) ------------------------------------------------------- - -# use with care -gen-clean: - $(RM) privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar* - -############################################################################# -# solaris distribution. verified on SF machines by swa. -############################################################################# -solaris-dist: gen-dist - @$(ECHO) Done. -# anonymously ncftps the package to sourceforge -solaris-upload: gen-upload - @$(ECHO) Done. -# use with care -solaris-clean: gen-clean - @$(ECHO) Done. - -############################################################################# -# hpux distribution -############################################################################# -hpux-dist: - @$(ECHO) coming soon. -hpux-upload: - @$(ECHO) coming soon. - -############################################################################# -# debian distribution -############################################################################# -debian-dist: - @$(ECHO) coming soon. -debian-upload: - @$(ECHO) coming soon. - -############################################################################# -# macosx distribution -############################################################################# -macosx-dist: - @$(ECHO) coming soon. -macosx-upload: - @$(ECHO) coming soon. - -############################################################################# -# amiga distribution -############################################################################# -amiga-dist: - @$(ECHO) coming soon. -amiga-upload: - @$(ECHO) coming soon. - -############################################################################# -# freebsd distribution. verified on SF machines by swa. -############################################################################# -freebsd-dist: gen-dist - @$(ECHO) Done. -# anonymously ncftps the package to sourceforge -freebsd-upload: gen-upload - @$(ECHO) Done. -# use with care -freebsd-clean: gen-clean - @$(ECHO) Done. - -############################################################################# -# Windows distribution -############################################################################# -win-dist: - $(ECHO) Not implemented. - - -############################################################################# -# Tarball distribution: No CVS dirs, dotfiles, debian build dir, -# (FIXME:) only parts of the static / generated docs mix in doc/webserver -############################################################################# - -tarball-dist: dist-check clean clobber - $(LN) -s current ../privoxy-$(VERSION)-$(CODE_STATUS) - - for i in `find . -type f -a -not \( -path "*/CVS*" -o -name ".*" \ - -o -path "*/debian/*" -o -path "*/actions/*" -o -name "*.php" -o \ - -name "PACKAGERS" \)`; do \ - files="$$files privoxy-$(VERSION)-$(CODE_STATUS)/$$i"; \ - done && \ - cd .. && $(TAR) -cvhf privoxy-$(VERSION)-$(CODE_STATUS)-src.tar $$files ; \ - -# and zip the archive - $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS) - $(GZIP_PROG) ../privoxy-$(VERSION)-$(CODE_STATUS)-src.tar - @$(ECHO) Tarball distribution created. - -# anonymously ncftps the tarball to sourceforge -tarball-upload: - ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming ../privoxy-$(VERSION)-$(CODE_STATUS)-src.tar.gz - @$(ECHO) ------------------------------------------------------- - @$(ECHO) Now goto - @$(ECHO) https://sourceforge.net/project/admin/editpackages.php?group_id=11118 - @$(ECHO) ... and release the files. - @$(ECHO) ------------------------------------------------------- - -tarball-clean: - $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS)-src.tar.gz - -############################################################################# -# -# Documentation -# -# converts doc/source/*.sgml into html and man pages -# -############################################################################# - -# developer manual -dok-devel: - $(RM) doc/webserver/developer-manual/*.html - $(RM) -r doc/source/developer-manual - mkdir -p doc/source/developer-manual - cd doc/source/developer-manual && $(DB) ../developer-manual.sgml && cd .. && cp developer-manual/*.html ../webserver/developer-manual/ - -# user manual -dok-user: - $(RM) doc/webserver/user-manual/*.html - $(RM) -r doc/source/user-manual/ - mkdir -p doc/source/user-manual - cd doc/source/user-manual && $(DB) -iuser-man ../user-manual.sgml && cd .. && cp user-manual/*.html ../webserver/user-manual/ - # FIXME: temp fix so same stylesheet gets in more than one place so it works - # for all doc set-ups, including the 'user manual' config option in local - # system where it MUST be in same directory as html. - $(PERL) -pi.bak -e 's/<\/head/\n\n<\/head/i' doc/webserver/user-manual/*html - -# faq -dok-faq: - $(RM) doc/webserver/faq/*.html - $(RM) -r doc/source/faq - mkdir -p doc/source/faq - cd doc/source/faq && $(DB) ../faq.sgml && cd .. && cp faq/*.html ../webserver/faq/ - -# man page, one variation. Try to use the next target, just 'make man'. -dok-man: - $(RM) doc/man/* doc/webserver/man-page/*.html -ifneq ($(MAN2HTML),false) - $(ECHO) "Privoxy Man page

NAME

" > doc/webserver/man-page/privoxy-man-page.html - man ./privoxy.1 | $(MAN2HTML) -bare >> doc/webserver/man-page/privoxy-man-page.html - $(ECHO) "" >> doc/webserver/man-page/privoxy-man-page.html -else - $(MAKE) groff2html -endif - -# Build man page from sgml. This requires the SGMLSpm perl module. -# See CPAN, or your favorite perl repository. This is the preferred -# target for man page generation! -man: dok-release - mkdir -p doc/source/temp && cd doc/source/temp && $(RM) * ;\ - nsgmls ../privoxy-man-page.sgml | sgmlspl ../../../utils/docbook2man/docbook2man-spec.pl &&\ - perl -pi.bak -e 's/ //; s/\[ /\[/g' privoxy.1 ;\ - perl -pi.bak -e "s/\[ /\[/g;s/á/\\\\['a]/g;s/é/\\\\['e]/g" privoxy.1; \ - perl -pi.bak -e "s/ö/\\\\[:o]/g" privoxy.1; \ - perl -pi.bak -e 's/([ {])-([a-z])/$$1\\-$$2/g' privoxy.1; \ - perl -pi.bak -e 's/ --([a-z])/ \\-\\-$$1/g' privoxy.1; \ - perl -pi.bak -e 's/\\fB--/\\fB\\-\\-/g' privoxy.1; \ - $(DB) ../privoxy-man-page.sgml && $(MV) -f privoxy.1 ../../../privoxy.1 - -# For those with man2html ala RH7s. -man2html: - mkdir -p doc/webserver/man-page -ifneq ($(MAN2HTML),false) - $(MAN2HTML) privoxy.1 |grep -v "^Content-type" > tmp.html - $(PERL) -pi.bak -e 's///; s//man2html/' tmp.html - $(PERL) -pi.bak -e 's/(<\/HEAD>)/<\/HEAD>/' tmp.html -# Twice because my version of man2html is pulling in commas and periods in URLs. - $(PERL) -pi.bak -e 's/()/$$1$$2/g' tmp.html - $(PERL) -pi.bak -e 's,\.">,">,g' tmp.html - $(PERL) -pi.bak -e "s/\['a\]/\á/g;s/\['e\]/\é/g" tmp.html -# Get rid of spurious  from conversion. (How to do this with perl?) - $(SED) -e 's///g' tmp.html > doc/webserver/man-page/privoxy-man-page.html && $(RM) tmp.* -else - $(MAKE) groff2html -endif - - -# Otherwise we get plain groff conversion. -groff2html: - $(G2H_CMD) ./privoxy.1 | $(SED) -e 's@@@' > doc/webserver/man-page/privoxy-man-page.html - - -# readme page and INSTALL file -dok-readme: dok-release - cd doc/source && $(DB)-notoc -V nochunks readme.sgml > tmp.html &&\ - env -u LANG $(WDUMP) tmp.html > ../../README ;\ - $(DB)-notoc -V nochunks install.sgml > tmp.html &&\ - env -u LANG $(WDUMP) tmp.html > ../../INSTALL ;\ - $(RM) tmp.* - -# index.sgml is used to create both the Home Page, and a local index -# for documentation, etc. -# -# index.html for webserver: -dok-webserver: - cd doc/source/webserver && $(DB)-notoc -ip-homepage -V nochunks index.sgml > ../../webserver/index.html - $(PERL) -pi.bak -e 's/..\/p_doc.css/p_doc.css/;\ - s/<\/HEAD/\n<\/HEAD/;\ - s/<\/HEAD/\n<\/HEAD/;\ - s/\.\d\. //;\ - s/__copy/©/'\ - doc/webserver/index.html && $(RM) doc/webserver/*.bak - -# privoxy-index.html for local documentation: -dok-index: - cd doc/source/webserver && $(DB)-notoc -ip-index -V nochunks index.sgml > ../../webserver/privoxy-index.html - $(PERL) -pi.bak -e 's/..\/p_doc.css/p_doc.css/;\ - s/<\/HEAD/\n<\/HEAD/;\ - s/<\/HEAD/\n<\/HEAD/;\ - s/\.\d\. //;\ - s/__copy/©/' \ - doc/webserver/privoxy-index.html && $(RM) doc/webserver/*.bak - -# Main documentation target. -dok: dok-release dok-devel dok-user dok-faq dok-readme dok-webserver dok-authors dok-index - @$(ECHO) Documentation created. - -# -# an alternative to the above dok. disabled man page creation for the moment -# -redhat-dok: dok-release dok-devel dok-user dok-faq redhat-readme dok-webserver dok-authors - @$(ECHO) Documentation created. - -## Make README -redhat-readme: - cd doc/source && $(DB)-notoc -V nochunks readme.sgml > tmp.html && $(WDUMP) \ - tmp.html > ../../README && $(RM) -r tmp.html - -## Make AUTHORS file -dok-authors: - cd doc/source && $(DB) -V nochunks authors.sgml > tmp.html && env -u LANG $(WDUMP) \ - tmp.html > ../../AUTHORS && $(RM) tmp.html - -# Set doc entities for VERSION and CODE_STATUS in sgml docs. Toggle content -# exceptions accordingly. This needs to go before any doc building (doh). -dok-release: - @$(ECHO) Setting doc version and status to $(VERSION), $(CODE_STATUS) - @$(PERL) -pi.bak -e 's///;\ - s///' \ - doc/source/*sgml doc/source/*/*sgml - $(RM) -r doc/source/*bak doc/source/*/*bak -ifeq ($(CODE_STATUS),stable) - @$(ECHO) Setting docs to stable $(VERSION) - @$(PERL) -pi.bak -e 's///;\ - s///' \ - doc/source/*sgml doc/source/*/*sgml - $(RM) -r doc/source/*bak doc/source/*/*bak -else - @$(ECHO) Setting docs to not stable $(VERSION) - @$(PERL) -pi.bak -e 's///;\ - s///' \ - doc/source/*sgml doc/source/*/*sgml - $(RM) -r doc/source/*bak doc/source/*/*bak -endif - -# Create release announcement in text and html, with short and long versions. -# This is a standalone target, and must be invoked directly. -# announce: dok-release -# mkdir -p $(DOC_TMP) -# cd $(DOC_TMP) && cp -f ../announce.sgml . && $(DB) -iannounce-big announce.sgml &&\ -# mv -f index.html announce.html && $(WDUMP) announce.html > announce.txt -# cd $(DOC_TMP) && $(DB) announce.sgml &&\ -# mv -f index.html announce-mini.html && $(WDUMP) announce-mini.html > announce-mini.txt &&\ -# mv -f *html *txt ../../.. -# rm -fr $(DOC_TMP) - -# The main Privoxy config file, generated from sgml sources. -# NOTE: This will require some hand editing. The new file is outputted -# as config.new so that problem sections can be compared to previous -# version. This is hardcored to w3m for html/text conversion. Also, -# requires the shell util 'fmt'. -config-file: dok-release - cd doc/source && $(DB)-notoc -iconfig-file -V nochunks config.sgml > __tmp.html &&\ - env -u LANG w3m -dump __tmp.html | fmt -w 70 > ../../config.new && $(RM) -r __tmp.* - $(PERL) -i.bak utils/prepare-configfile.pl config.new - - $(RM) *.bak - @$(ECHO) "****************************************************" - @$(ECHO) "The output file is config.new." - @$(ECHO) "Now -- you need to hand edit the results!!!" - @$(ECHO) "In particular, check the Debug levels, the" - @$(ECHO) "permit-access, forward & socks examples and the" - @$(ECHO) "various user-manual examples, which all" - @$(ECHO) "probably got hammered." - @$(ECHO) "****************************************************" - -# config file, alternate version using lynx (perl stuff unfinished). Lynx -# does not do so good a job. -config-file-alt: - cd doc/source && $(ECHO) -e ".h2 JUSTIFY\\nJUSTIFY:FALSE" > __tmp.lynx_cfg &&\ - $(DB)-notoc -iconfig-file -V nochunks config.sgml > __tmp.html &&\ - lynx -cfg=__tmp.lynx_cfg -width=78 -dump __tmp.html > ../../config.new && $(RM) -r __tmp.* - $(PERL) -pi -e 's/^( )//;\ - s/:$\/:\n/' config.new - -############################################################################# -# -# Webserver -# -# moves dokumentation to webserver -# -############################################################################# -webserver: tidy - @$(ECHO) ------------------------------------------------------- - @$(ECHO) You will need to "create" a SF shell first: - @$(ECHO) ssh -t USER,PROJECT@shell.sourceforge.net create - @$(ECHO) Please make sure your documentation files are up to date. - @$(ECHO) Note that this command updates the home page and scps - @$(ECHO) all stuff to the webserver, it will not remove obsolete documents. - @$(ECHO) You will also need to change the user-manual symlink manually. - @$(ECHO) ------------------------------------------------------- - - @$(ECHO) Uploading html - @cd doc/webserver; \ - upload=`find . -type f -a -not \( -path "*/CVS*" -o -path "*/results*" \)`; \ - $(TAR) c $$upload | ssh shell.sf.net 'cd /home/groups/i/ij/ijbswa/htdocs/; tar xvm 2>&1 | grep -v timestamp' - - @$(ECHO) Fixing permissions - @ssh shell.sf.net 'chmod -R 775 /home/groups/i/ij/ijbswa/htdocs 2>/dev/null; true' - @ssh shell.sf.net 'find /home/groups/i/ij/ijbswa/htdocs/ -type f | xargs chmod 664 2>/dev/null; true' - @ssh shell.sf.net 'chmod 666 /home/groups/i/ij/ijbswa/htdocs/actions/results/actions-feedback.txt 2>/dev/null; true' - - -web-actions: tidy - @$(ECHO) Uploading - @cd doc/webserver/actions; \ - upload=`find . -type f -a -not \( -path "*/CVS*" -o -path "*/results*" \)`; \ - $(TAR) c $$upload | ssh ijbswa.sourceforge.net 'cd /home/groups/i/ij/ijbswa/htdocs/actions; tar xvm' - - @$(ECHO) Fixing permissions - @ssh ijbswa.sourceforge.net 'find /home/groups/i/ij/ijbswa/htdocs/actions/ -type f | xargs chmod 664 2>/dev/null' - @ssh ijbswa.sourceforge.net 'chmod 666 /home/groups/i/ij/ijbswa/htdocs/actions/results/actions-feedback.txt 2>/dev/null' - -## -dok-put: - tar --exclude ".cvsignore" --exclude "CVS" --exclude "source" --exclude ".htaccess" \ - --exclude "obsolete" --exclude "actions" --exclude "*.zip" --exclude "robots.txt"\ - doc/* INSTALL LICENSE AUTHORS README \ - -czf $(DOC_FILE) ;\ - $(ECHO) "Uploading doc package ..." ;\ - scp $(DOC_FILE) ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/docs/ - @ssh ijbswa.sourceforge.net 'chmod 775 /home/groups/i/ij/ijbswa/htdocs/docs/*gz 2>/dev/null; true' - $(RM) $(DOC_FILE) - -dok-get: - cd /tmp ;\ - $(WGET) http://www.privoxy.org/docs/$(DOC_FILE) ;\ - $(TAR) -zxvf $(DOC_FILE) - - -############################################################################# -# Source file dependencies -############################################################################# - -actions.o: actions.c actions.h config.h $(PROJECT_H_DEPS) errlog.h jcc.h list.h loaders.h miscutil.h actionlist.h ssplit.h -cgi.o: cgi.c cgi.h config.h $(PROJECT_H_DEPS) cgiedit.h cgisimple.h jbsockets.h list.h pcrs.h encode.h ssplit.h jcc.h filters.h actions.h errlog.h miscutil.h -cgiedit.o: cgiedit.c cgiedit.h config.h $(PROJECT_H_DEPS) cgi.h list.h pcrs.h encode.h ssplit.h jcc.h filters.h actionlist.h actions.h errlog.h miscutil.h -cgisimple.o: cgisimple.c cgisimple.h config.h $(PROJECT_H_DEPS) cgi.h list.h pcrs.h encode.h ssplit.h jcc.h filters.h actions.h errlog.h miscutil.h urlmatch.h -deanimate.o: deanimate.c deanimate.h config.h $(PROJECT_H_DEPS) -encode.o: encode.c encode.h config.h -errlog.o: errlog.c errlog.h config.h $(PROJECT_H_DEPS) #w32log.h -filters.o: filters.c filters.h config.h $(PROJECT_H_DEPS) errlog.h encode.h gateway.h jbsockets.h jcc.h loadcfg.h parsers.h ssplit.h cgi.h deanimate.h urlmatch.h #win32.h -gateway.o: gateway.c gateway.h config.h $(PROJECT_H_DEPS) errlog.h jbsockets.h jcc.h loadcfg.h -jbsockets.o: jbsockets.c jbsockets.h config.h $(PROJECT_H_DEPS) filters.h -jcc.o: jcc.c jcc.h config.h $(PROJECT_H_DEPS) errlog.h filters.h gateway.h jbsockets.h loadcfg.h loaders.h miscutil.h parsers.h #w32log.h win32.h w32svrapi.h cgi.h -list.o: list.c list.h config.h $(PROJECT_H_DEPS) list.h miscutil.h -loadcfg.o: loadcfg.c loadcfg.h config.h $(PROJECT_H_DEPS) errlog.h filters.h gateway.h jbsockets.h jcc.h loaders.h miscutil.h parsers.h #w32log.h win32.h -loaders.o: loaders.c loaders.h config.h $(PROJECT_H_DEPS) errlog.h encode.h filters.h gateway.h jcc.h loadcfg.h miscutil.h parsers.h ssplit.h -miscutil.o: miscutil.c miscutil.h config.h -parsers.o: parsers.c parsers.h config.h $(PROJECT_H_DEPS) errlog.h filters.h jbsockets.h jcc.h loadcfg.h loaders.h miscutil.h ssplit.h -ssplit.o: ssplit.c ssplit.h config.h miscutil.h -urlmatch.o: urlmatch.c urlmatch.h config.h $(PROJECT_H_DEPS) errlog.h miscutil.h ssplit.h - -# GNU regex -gnu_regex.o: gnu_regex.c gnu_regex.h config.h - -# PCRS -pcrs.o: pcrs.c pcrs.h config.h pcre/pcre.h - -# PCRE -pcre/get.o: pcre/get.c pcre/config.h pcre/internal.h pcre/pcre.h -pcre/maketables.o: pcre/maketables.c pcre/config.h pcre/internal.h pcre/pcre.h -pcre/pcre.o: pcre/pcre.c pcre/config.h pcre/internal.h pcre/pcre.h pcre/chartables.c -pcre/pcreposix.o: pcre/pcreposix.c pcre/config.h pcre/internal.h pcre/pcre.h pcre/pcreposix.h -pcre/study.o: pcre/study.c pcre/config.h pcre/internal.h pcre/pcre.h - -# An auxiliary program makes the PCRE default character table source - -pcre/chartables.c: pcre/dftables - pcre/dftables >pcre/chartables.c - -pcre/dftables: pcre/dftables.c pcre/maketables.c pcre/pcre.h pcre/internal.h pcre/config.h - $(CC) -o pcre/dftables $(CFLAGS) pcre/dftables.c - -# Win32 -w32log.o: w32log.c errlog.h config.h jcc.h loadcfg.h miscutil.h pcre/pcre.h pcre/pcreposix.h pcrs.h project.h w32log.h w32taskbar.h win32.h -w32taskbar.o: w32taskbar.c config.h w32log.h w32taskbar.h -win32.o: win32.c config.h jcc.h loadcfg.h pcre/pcre.h pcre/pcreposix.h pcrs.h project.h w32log.h win32.h w32svrapi.h - -w32.res: w32.rc w32res.h icons/ico00001.ico icons/ico00002.ico icons/ico00003.ico icons/ico00004.ico icons/ico00005.ico icons/ico00006.ico icons/ico00007.ico icons/ico00008.ico icons/idle.ico icons/privoxy.ico config.h - windres -D__MINGW32__=0.2 -O coff -i $< -o $@ - -# AmigaOS -#OBJS += amiga.o -#ifeq ($(shell $(CC) -dumpmachine), m68k-amigaos) -#CFLAGS += -D__AMIGAVERSION__=\"$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_POINT)\" -D__AMIGADATE__=\"`date +%d.%m.%Y`\" -W -m68020 -noixemul -fbaserel -msmall-code -#LDFLAGS += -m68020 -noixemul -fbaserel -#LIBS = -lm /gg/lib/libb/libm020/libnix/swapstack.o -#else -#CFLAGS += -D__AMIGAVERSION__=\"$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_POINT)\" -D__AMIGADATE__=\"`date +%d.%m.%Y`\" -Wextra -D__USE_INLINE__ -D__NO_INTUITION_RJ_MACROS -#endif -#amiga.o: amiga.c amiga.h config.h - - -$(PROGRAM): $(OBJS) $(W32_FILES) - $(LD) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS) - -clean: - $(RM) a.out $(OBJS) $(W32_FILES) $(W32_INIS) $(PROGRAM) default.action `find . -name TAGS -o -name tags` config.base config.tmp - -tidy: - $(RM) `find . -name "*~"` - $(RM) `find . -name "#*#"` # Emacs backup files - $(RM) `find . -name ".\#*"` - -clobber: tidy - $(RM) GNUmakefile configure config.h.in config.h config.cache config.status config.log logfile \ - privoxy.log core *.tar.gz *.tar privoxy-cl.spec doc/source/ldp.dsl config.new - $(RM) -r autom4te.cache - -# -# FIXME: What is all this? -# - $(RM) cscope.* *.pdb *.lib *.exp - -distclean: clobber - -tags: $(SRCS) $(HDRS) - etags $(SRCS) $(HDRS) - -CONF_DEST:=$(shell if [ "$(prefix)" = "/usr/local" ] && [ "$(CONF_BASE)" = "$(prefix)/etc" ];then \ - $(ECHO) "$(CONF_BASE)/privoxy";\ - else\ - $(ECHO) "$(CONF_BASE)";\ - fi) - -LOG_DEST:=$(shell if [ "$(prefix)" = "/usr/local" ] && [ "$(LOGS_DEST)" = "$(prefix)/var/log/privoxy" ];then \ - $(ECHO) "/var/log/privoxy" ;\ - else\ - $(ECHO) "$(LOGS_DEST)";\ - fi) - -PID_DEST:=$(shell if [ "$(prefix)" = "/usr/local" ] && [ "$(PIDS_DEST)" = "$(prefix)/var/run" ];then \ - $(ECHO) "/var/run" ;\ - else\ - $(ECHO) "$(PIDS_DEST)";\ - fi) - -check_doc:=$(shell if [ ! -d "$(SHARE_DEST)/doc" ] && [ "$(prefix)" = "/usr/local" ] && [ -d "$(prefix)/doc" ];then \ - $(ECHO) "1";\ - else\ - $(ECHO) "0";\ - fi) - -# If USER is specified but no GROUP, assume there is a GROUP of same name. -GROUP_T:=$(shell if [ x$(GROUP) = x ] && [ x$(USER) != x ];then \ - $(ECHO) "$(USER)" ;\ - else\ - $(ECHO) "$(GROUP)";\ - fi) - -install-strip: - $(MAKE) install STRIP=-s - -# FIXME: Test USER and GROUP on Slack to make sure this works as -# intended. -# -# FIXME: id handling needs help, probably via configure, since 'id -u' is not -# universally reliable (eg Solaris). Group handling could be better. -# Perhaps the whole user/group validation should be done here, and simplified. -PROGRAM_V = Privoxy $(VERSION) $(CODE_STATUS) -install: CONF_DEST LOG_DEST PID_DEST check_doc GROUP_T - @# Quick test for valid USER. - @if [ -n "$(USER)" ]; then \ - $(ID) $(USER) >/dev/null || exit 1;\ - fi - @# Test for valid group. FIXME. USER does not have to belong to GROUP - @# for file ownership purposes. -# if [ -n "$(GROUP_T)" ] && [ -n "$(USER)" ] && ! $(GROUPS) $(USER) | $(GREP) "\<$(GROUP_T)\>" >/dev/null; then \ -# $(ECHO) Group $(GROUP_T) for User $(USER) is invalid && exit 1 ;\ -# fi - - @$(ECHO) "Creating directories, and preparing $(PROGRAM_V) installation" - $(CHMOD) $(DIR_MODE) $(MKDIR) - @$(MKDIR) $(DESTDIR)$(SBIN_DEST) $(DESTDIR)$(prefix) $(DESTDIR)$(CONF_DEST) \ - $(DESTDIR)$(CONF_DEST)/templates $(DESTDIR)$(SHARE_DEST) \ - $(DESTDIR)$(LOG_DEST) $(DESTDIR)$(PID_DEST) - @# Install the executable binary, strip if invoked as install-strip - @test -n "$(STRIP)" &&\ - $(ECHO) Installing $(PROGRAM) stripped executable to $(SBIN_DEST) ||\ - $(ECHO) Installing $(PROGRAM) executable to $(DESTDIR)$(SBIN_DEST) - $(INSTALL) $(INSTALL_P) $(STRIP) $(PROGRAM) $(DESTDIR)$(SBIN_DEST) - - @# Install the DOCS and man page. install-sh only does one file at a time. - @# FIXME: only handles jpegs. - -@if [ $(check_doc) = 0 ]; then \ - DOC=$(DOC_DEST) ;\ - else \ - DOC=$(prefix)/doc/privoxy ;\ - fi;\ - $(MKDIR) $(DESTDIR)$$DOC $(DESTDIR)$$DOC/user-manual $(DESTDIR)$$DOC/faq $(DESTDIR)$$DOC/developer-manual \ - $(DESTDIR)$$DOC/man-page $(DESTDIR)$$DOC/images $(DESTDIR)$(MAN_DEST) ;\ - if [ -d "$(DOK_WEB)" ]; then \ - $(ECHO) Installing FAQ, Manual, and other docs to $(DESTDIR)$$DOC;\ - for i in user-manual developer-manual faq; do \ - for ii in $(DOK_WEB)/$$i/*html; do \ - $(INSTALL) $(INSTALL_T) $$ii $(DESTDIR)$$DOC/$$i;\ - done ;\ - done ;\ - for i in $(DOK_WEB)/user-manual/*jpg; do \ - $(INSTALL) $(INSTALL_T) $$i $(DESTDIR)$$DOC/user-manual;\ - done ;\ - $(INSTALL) $(INSTALL_T) $(DOK_WEB)/man-page/*html $(DESTDIR)$$DOC/man-page;\ - $(INSTALL) $(INSTALL_T) $(DOK_WEB)/privoxy-index.html $(DESTDIR)$$DOC/index.html;\ - $(INSTALL) $(INSTALL_T) AUTHORS $(DESTDIR)$$DOC;\ - $(INSTALL) $(INSTALL_T) LICENSE $(DESTDIR)$$DOC;\ - $(INSTALL) $(INSTALL_T) README $(DESTDIR)$$DOC;\ - $(INSTALL) $(INSTALL_T) ChangeLog $(DESTDIR)$$DOC;\ - $(INSTALL) $(INSTALL_T) $(DOK_WEB)/p_doc.css $(DESTDIR)$$DOC;\ - $(INSTALL) $(INSTALL_T) $(DOK_WEB)/p_doc.css $(DESTDIR)$$DOC/user-manual;\ - fi - @# Not all platforms support gzipped man pages. - @$(ECHO) Installing man page to $(DESTDIR)$(MAN_DEST)/privoxy.1 - -$(INSTALL) $(INSTALL_T) privoxy.1 $(DESTDIR)$(MAN_DEST)/privoxy.1 - - @# Change the config file default directories according to the configured ones - @$(ECHO) Rewriting config for this installation - @if [ -f config.base ] ; then \ - $(CAT) config >config~ ;\ - $(MV) config.base config ;\ - fi - $(SED) 's+^confdir \.+confdir $(CONF_DEST)+' config | \ - $(SED) 's+^logdir \.+logdir $(LOG_DEST)+' >config.tmp - -@if [ $(check_doc) = 0 ]; then \ - $(SED) 's+^#\?user-manual .*+user-manual $(DOC_DEST)/user-manual/+' config.tmp >config.updated ;\ - else \ - $(SED) 's+^#\?user-manual .*+user-manual $(prefix)/doc/privoxy/user-manual/+' config.tmp >config.updated ;\ - fi;\ - $(MV) config config.base - $(MV) config.updated config - - @# Install the config support files. Test for root install, and abort - @# if there is no privoxy user, and no other user was enabled during - @# configure. Later, install init script if appropriate. - @$(ECHO) Installing templates to $(DESTDIR)$(CONF_DEST)/templates - @for i in `find templates -type f`; do \ - $(INSTALL) $(INSTALL_T) $$i $(DESTDIR)$(CONF_DEST)/templates ;\ - done - - @# FIXME: group/user validation is overly convoluted. - @# If superuser install ... we require a minimum of group ownership - @# of those files the daemon writes to, to be non-root owned. - @if [ "`$(ID) |sed 's/(.*//' |sed 's/.*=//'`" = "0" ] ;then\ - if [ x$(USER) = x ] || [ $(USER) = root ]; then \ - if [ x$(GROUP) = x ] || [ $(GROUP) = root ]; then \ - if [ "`$(ID) privoxy`" ] && \ - $(GROUPS) privoxy | $(SED) 's/^.*://' |$(GREP) "\" >/dev/null; then \ - $(ECHO) "Warning: Setting group owner to privoxy";\ - GROUP_T=privoxy ;\ - else \ - $(ECHO) "******************************************************************" ;\ - $(ECHO) " WARNING! WARNING! installing config files as root!" ;\ - $(ECHO) " It is strongly recommended to run $(PROGRAM) as a non-root user," ;\ - $(ECHO) " and to install the config files as that user and/or group!" ;\ - $(ECHO) " Please read INSTALL, and create a privoxy user and group!" ;\ - $(ECHO) "*******************************************************************" ;\ - exit 1 ;\ - fi ;\ - else \ - GROUP_T=$(GROUP) ;\ - fi ;\ - INSTALL_CONF="$(INSTALL_R) -g $$GROUP_T " ;\ - else \ - $(ECHO) "Superuser install, installing config files as $(USER):$(GROUP_T)" ;\ - INSTALL_CONF="$(INSTALL_R) -o $(USER) -g $(GROUP_T)" ;\ - GROUP_T=$(GROUP_T) ;\ - fi ;\ - else \ - if [ ! "`id $(USER)`" = "`id`" ] ;then \ - $(ECHO) "** WARNING ** current install user different from configured user!!" ;\ - $(ECHO) "Edit may fail." ;\ - fi ;\ - INSTALL_CONF="$(INSTALL_R)" ;\ - fi ;\ - $(ECHO) Installing configuration files to $(DESTDIR)$(CONF_DEST);\ - for i in $(CONFIGS); do \ - if [ "$$i" = "default.action" ] || [ "$$i" = "default.filter" ] ; then \ - $(RM) $(DESTDIR)$(CONF_DEST)/$$i ;\ - $(ECHO) Installing fresh $$i;\ - $(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST) || exit 1;\ - elif [ -s "$(CONF_DEST)/$$i" ]; then \ - $(ECHO) Installing $$i as $$i.new ;\ - $(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST)/$$i.new || exit 1;\ - NEW=1;\ - else \ - $(INSTALL) $$INSTALL_CONF $$i $(DESTDIR)$(CONF_DEST) || exit 1;\ - fi ;\ - done ;\ - if [ -n "$$NEW" ]; then \ - $(CHMOD) $(RWD_MODE) $(DESTDIR)$(CONF_DEST)/*.new || exit 1 ;\ - $(ECHO) "Warning: Older config files are preserved. Check new versions for changes!" ;\ - fi ;\ - [ ! -f $(DESTDIR)$(LOG_DEST)/logfile ] && $(ECHO) Creating logfiles in $(DESTDIR)$(LOG_DEST) || \ - $(ECHO) Checking logfiles in $(DESTDIR)$(LOG_DEST) ;\ - $(TOUCH) $(DESTDIR)$(LOG_DEST)/logfile || exit 1 ;\ - if [ x$$USER != x ]; then \ - $(CHOWN) $$USER $(DESTDIR)$(LOG_DEST)/logfile || \ - $(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\ - fi ;\ - if [ x$$GROUP_T != x ]; then \ - $(CHGRP) $$GROUP_T $(DESTDIR)$(LOG_DEST)/logfile || \ - $(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\ - fi ;\ - $(CHMOD) $(RWD_MODE) $(DESTDIR)$(LOG_DEST)/logfile || exit 1 ;\ - if [ "$(prefix)" = "/usr/local" ] || [ "$(prefix)" = "/usr" ]; then \ - if [ -f /etc/slackware-version ] && [ -d /etc/rc.d/ ] && [ -w /etc/rc.d/ ] ; then \ - $(SED) 's+%PROGRAM%+$(PROGRAM)+' slackware/rc.privoxy.orig | \ - $(SED) 's+%SBIN_DEST%+$(SBIN_DEST)+' | \ - $(SED) 's+%CONF_DEST%+$(CONF_DEST)+' | \ - $(SED) 's+%USER%+$(USER)+' | \ - $(SED) 's+%GROUP%+$(GROUP_T)+' >slackware/rc.privoxy ;\ - $(INSTALL) $(INSTALL_P) slackware/rc.privoxy $(DESTDIR)/etc/rc.d/ ;\ - $(ECHO) "Installing for Slackware." ;\ - $(ECHO) "Dont forget to add the rc.privoxy to rc.local if you want it started at every boot" ;\ - elif [ -f /etc/redhat-release ] && [ -d /etc/rc.d/init.d/ ] && [ -w /etc/rc.d/init.d/ ] ; then \ - $(ECHO) "Installing init script to /etc/rc.d/init.d/privoxy" ;\ - $(SED) 's,^PRIVOXY_BIN=.*,PRIVOXY_BIN="/usr/local/sbin/$(PROGRAM)",' privoxy.init |\ - $(SED) 's,^PRIVOXY_CONF=.*,PRIVOXY_CONF="$(CONF_DEST)/config",' |\ - $(SED) "s,^PRIVOXY_USER=.*,PRIVOXY_USER=$$USER," > init.tmp ;\ - $(INSTALL) $(INSTALL_P) init.tmp $(DESTDIR)/etc/rc.d/init.d/privoxy && $(RM) init.tmp;\ - $(MKDIR) $(DESTDIR)/etc/logrotate.d/ ;\ - $(ECHO) "Installing logrotate script to $(DESTDIR)/etc/logrotate.d/" ;\ - $(INSTALL) -m 0644 privoxy.logrotate $(DESTDIR)/etc/logrotate.d/privoxy ;\ - elif [ -d $(DESTDIR)/etc/init.d ] && [ -w $(DESTDIR)/etc/init.d ] ; then \ - $(ECHO) "Installing generic init script to $(DESTDIR)/etc/init.d/privoxy" ;\ - $(ECHO) "Please check that the PATHs are correct, and edit if needed." ;\ - $(INSTALL) $(INSTALL_P) privoxy-generic.init $(DESTDIR)/etc/init.d/privoxy ;\ - fi ;\ - else \ - $(ECHO) "No init script installed, install it manually if needed" ;\ - fi - $(RM) config.base config.tmp - @# mmmmm, good. - @$(ECHO) "$(PROGRAM_V) installation succeeded!" - @$(ECHO) "The Privoxy configuration files have been installed in $(DESTDIR)$(CONF_DEST)" - -# rmdir is used as a precaution since it will not remove non-empty -# directories. RH init script creates lock file and pid file. -uninstall: CONF_DEST LOG_DEST PID_DEST check_doc - @$(ECHO) Starting Privoxy uninstallation - @# KILL privoxy if running - @# XXX: the chkconfig line may need a DESTDIR prefix. - -@if [ -f $(DESTDIR)/etc/redhat-release ] && [ -x $(DESTDIR)/etc/rc.d/init.d/privoxy ]; then \ - $(DESTDIR)/etc/rc.d/init.d/privoxy stop >/dev/null 2>/dev/null ;\ - chkconfig --del $(PROGRAM) 2>/dev/null;\ - fi - -@test -f $(DESTDIR)$(PID_DEST)/privoxy.pid && $(ECHO) Stopping $(PROGRAM) &&\ - $(KILL) `$(CAT) $(DESTDIR)$(PID_DEST)/privoxy.pid` || : - -@test -f $(DESTDIR)/var/run/privoxy.pid && $(ECHO) Stopping $(PROGRAM) &&\ - $(KILL) `$(CAT) $(DESTDIR)/var/run/privoxy.pid ` || : - - @# Program binary - @$(ECHO) Removing $(PROGRAM) binary - $(RM) $(DESTDIR)$(SBIN_DEST)/$(PROGRAM) $(SBIN_DEST)/$(PROGRAM)~ - - @# config files and dir, and maybe old install backups - -@if [ -d $(DESTDIR)$(CONF_DEST) ]; then \ - $(ECHO) Saving $(PROGRAM) config files to $(DESTDIR)/tmp/$(PROGRAM)-save ;\ - $(MKDIR) $(DESTDIR)/tmp/$(PROGRAM)-save ;\ - cd $(DESTDIR)$(CONF_DEST) ;\ - for i in $(DESTDIR)$(CONFIGS); do \ - [ -f $$i ] && $(CP) $$i $(DESTDIR)/tmp/$(PROGRAM)-save ;\ - done ;\ - fi - @$(ECHO) Removing $(PROGRAM) config files - -@for i in $(DESTDIR)$(CONFIGS); do \ - test -f $(CONF_DEST)/$$i && $(ECHO) Removing $$i ;\ - $(RM) $(DESTDIR)$(CONF_DEST)/$$i $(DESTDIR)$(CONF_DEST)/$$i~ $(DESTDIR)$(CONF_DEST)/$$i.new ;\ - done - -@test -d $(DESTDIR)$(CONF_DEST)/templates && $(RM) -r $(DESTDIR)$(CONF_DEST)/templates &&\ - $(ECHO) "Removing $(DESTDIR)$(CONF_DEST)/templates/*" - - @# man page and docs - @$(ECHO) Removing $(PROGRAM) docs - -$(RM) $(DESTDIR)$(MAN_DEST)/privoxy.1* - -$(RM) -r $(DESTDIR)$(DOC_DEST) || $(RM) -r $(DESTDIR)$(prefix)/doc/privoxy - - @# Log and pidfile - @$(ECHO) Removing $(PROGRAM) logs - -$(RM) $(DESTDIR)$(LOG_DEST)/logfile $(DESTDIR)$(PID_DEST)/privoxy.pid - - @# Final clean up of unused directories. Special handling of CONF and LOG - # destinations. - @$(ECHO) Removing $(PROGRAM) directories - @for i in $(DESTDIR)$(LOG_DEST) $(DESTDIR)$(CONF_DEST); do \ - if test -d $$i; then \ - $(ECHO) Removing $$i ;\ - $(RMDIR) $$i || $(ECHO) "$$i is not empty, not removed" ;\ - fi;\ - done - @if [ ! "$(prefix)" = "/usr/local" ] ;then \ - for i in $(DESTDIR)$(MAN_DEST) $(DESTDIR)$(MAN_DIR) $(DESTDIR)$(SHARE_DEST)/doc \ - $(DESTDIR)$(SHARE_DEST) $(DESTDIR)$(SBIN_DEST); do \ - if test -d $$i; then \ - $(ECHO) Removing $$i ;\ - $(RMDIR) $$i || $(ECHO) "$$i is not empty, not removed" ;\ - fi;\ - done;\ - if test $(LOG_DEST) != /var/log/privoxy && test -d $(DESTDIR)$(prefix)/var/log; then \ - $(ECHO) Removing $(DESTDIR)$(prefix)/var/log ;\ - $(RMDIR) $(DESTDIR)$(prefix)/var/log || $(ECHO) "$(DESTDIR)$(prefix)/var/log is not empty, not removed";\ - fi ;\ - if test $(PID_DEST) != /var/run && test -d $(DESTDIR)$(prefix)/var/run; then \ - $(ECHO) Removing $(DESTDIR)$(prefix)/var/run ;\ - $(RMDIR) $(DESTDIR)$(prefix)/var/run || $(ECHO) "$(DESTDIR)$(prefix)/var/run is not empty, not removed";\ - fi ;\ - if test $(prefix)/var != /var && test -d $(DESTDIR)$(prefix)/var; then \ - $(ECHO) Removing $(DESTDIR)$(prefix)/var ;\ - $(RMDIR) $(DESTDIR)$(prefix)/var || $(ECHO) "$(DESTDIR)$(prefix)/var is not empty, not removed" ;\ - fi ;\ - if test $(prefix) != / && test $(prefix) != /usr && test -d $(DESTDIR)$(prefix); then \ - $(ECHO) Removing $(DESTDIR)$(prefix) ;\ - $(ECHO) Removing installation directory $(DESTDIR)$(prefix) ;\ - $(RMDIR) $(DESTDIR)$(prefix) || $(ECHO) "$(DESTDIR)$(prefix) is not empty, not removed" ;\ - fi;\ - fi - - @# init scripts and logrotate - @if [ "$(prefix)" = "/usr/local" ] || [ "$(prefix)" = "/usr" ]; then \ - $(ECHO) Removing $(PROGRAM) init script ;\ - if [ -f $(DESTDIR)/etc/slackware-version ] && \ - [ -d $(DESTDIR)/etc/rc.d/ ] && [ -w $(DESTDIR)/etc/rc.d/ ] ; then \ - $(RM) $(DESTDIR)/etc/rc.d/rc.privoxy ;\ - elif [ -f $(DESTDIR)/etc/redhat-release ] && [ -d $(DESTDIR)/etc/rc.d/init.d/ ] \ - && [ -w $(DESTDIR)/etc/rc.d/init.d/ ] ; then \ - $(RM) $(DESTDIR)/etc/rc.d/init.d/privoxy $(DESTDIR)/etc/logrotate.d/privoxy;\ - elif [ -d $(DESTDIR)/etc/init.d ] && [ -w $(DESTDIR)/etc/init.d ] ; then \ - $(RM) $(DESTDIR)/etc/init.d/privoxy ;\ - else \ - $(ECHO) "Unable to remove privoxy init script, not installed or permission denied" ;\ - fi ;\ - fi - @$(ECHO) Privoxy uninstalled, bye - -coffee: - @perl -e 'print pack "C*", (31,139,8,8,153,63,226,60,2,3,99,111,102,102,101,' \ - -e '101,0,109,143,205,13,192,32,8,133,239,78,241,110,234,1,28,160,171,' \ - -e '152,208,53,26,117,247,22,165,73,137,125,9,1,62,126,2,128,169,5,243,' \ - -e '143,13,139,49,164,65,100,149,152,102,73,141,88,73,178,116,205,100,' \ - -e '69,253,36,102,81,49,83,236,19,225,171,131,214,172,163,73,4,168,123,' \ - -e '115,71,126,247,122,94,128,178,227,95,154,12,86,215,122,197,249,146,' \ - -e '187,54,220,125,193,51,228,11,1,0,0);' | zcat - -############################################################################# - -## Local Variables: -## tab-width: 3 -## end: - -# $Log: GNUmakefile.in,v $ -# Revision 1.180 2009/02/28 08:28:14 fabiankeil -# pcrs.o doesn't depend on pcre/pcre.h if we are linking -# dynamically. Patch provided by drauh in #2056286. -# -# Revision 1.179 2009/02/22 14:48:31 hal9 -# Updates to the 'make webserver' target that recreates the home page and uploads -# fresh documents to reflect new SF realities, and more explanation of process. -# -# Revision 1.178 2009/02/08 18:35:48 fabiankeil -# Move the match-all section into a separate file -# (match-all.action) so we can safely overwrite the -# default actions when updating. Based on Roland's -# patch #1563977. -# -# Revision 1.177 2009/01/13 16:44:32 fabiankeil -# Delete the standard.action file after moving -# the pre-settings over to the default actions. -# -# Revision 1.176 2008/09/21 13:24:37 fabiankeil -# Add Roland's man page fixes from 19_manpage_fixup.dpatch. -# -# Revision 1.175 2008/08/30 12:03:07 fabiankeil -# Remove FEATURE_COOKIE_JAR. -# -# Revision 1.174 2008/07/18 17:50:47 fabiankeil -# Fix whitespace. -# -# Revision 1.173 2008/06/18 18:28:42 fabiankeil -# Remove PDF-related stuff. -# -# Revision 1.172 2008/06/17 16:16:08 fabiankeil -# - Stop building text files nobody cares about. -# - Update copyright year. -# -# Revision 1.171 2008/06/13 15:24:57 fabiankeil -# Move previously inline'd Perl code for the config-file target -# into a separate file, have it work with older perl releases, -# clean it up a bit and fix the "underlining" code. -# -# Revision 1.170 2008/06/12 16:38:50 fabiankeil -# Add third-level domain to URL in dok-get target. -# -# Revision 1.169 2008/06/09 17:28:31 fabiankeil -# - Recommend https for releasing files. -# - Fix a warning about datarootdir being ignored. -# -# Revision 1.168 2008/05/23 18:03:12 fabiankeil -# - Shorten meta description inserted in dok-webserver -# and dok-index target. -# - In config-file target, unset LANG for w3m as we -# might otherwise end up with multi-byte characters. -# -# Revision 1.167 2008/05/23 14:39:09 fabiankeil -# Silence dok-user complaint about @# not being found. -# -# Revision 1.166 2008/05/23 14:04:57 fabiankeil -# - Get config-file target working with more recent Perl -# versions. The generated file is still messed up, though. -# - Fix comment typo. -# -# Revision 1.165 2008/05/22 16:57:23 fabiankeil -# Fix coffee machine. -# -# Revision 1.164 2008/05/22 10:26:26 fabiankeil -# - Remove parsers.o's dependency on encode.h. -# - Include Emacs backup files in tidy target again. -# -# Revision 1.163 2008/05/04 18:01:53 fabiankeil -# Dependency fixes: cgisimple.c and filters.c depend on urlmatch.h. -# -# Revision 1.162 2008/03/30 13:31:42 fabiankeil -# Add DESTDIR support for the uninstall target. -# -# Revision 1.161 2008/03/30 13:19:13 fabiankeil -# Add DESTDIR support for the install target. Closes PR#1910612. -# Patch by Radoslaw Zielinski with minor modifications. -# -# Revision 1.160 2008/03/27 18:27:19 fabiankeil -# Remove kill-popups action. -# -# Revision 1.159 2008/03/21 11:13:53 fabiankeil -# Only gather host information if it's actually needed. -# Also move the code out of accept_connection() so it's less likely -# to delay other incoming connections if the host is misconfigured. -# -# Revision 1.158 2007/12/11 21:29:25 fabiankeil -# Fix dependency list for cgiedit.c. -# -# Revision 1.157 2007/12/10 02:28:02 hal9 -# Unset $LANG for text processing of docs so we get pure text. -# -# Revision 1.156 2007/11/15 03:17:43 hal9 -# Some workaround changes to the config file perl stuff and comments, which is -# broken here all by itself on perl 5.8.8. -# -# Revision 1.155 2007/09/22 16:23:25 fabiankeil -# Update copyright line. -# -# Revision 1.154 2007/02/07 11:52:40 fabiankeil -# Fix suse-dist as described in BR#1654052. -# (I didn't test it, but it's done the same -# way in redhat-dist which is known to work). -# -# Revision 1.153 2007/01/07 07:36:36 joergs -# Added AmigaOS4 support. -# -# Revision 1.152 2006/12/13 14:53:51 etresoft -# Include any existing LDFLAGS environment when linking so that a MacOS X Universal Binary can be created. -# -# Revision 1.151 2006/11/30 01:08:55 hal9 -# Fix problem with variable declarations in the Slackware section. Thanks to higuita. -# -# Revision 1.150 2006/10/25 11:55:45 fabiankeil -# Fix sed regexes for rewriting "confdir ." and "logdir .". -# Thanks to Darel Henman for reporting this. -# -# Revision 1.149 2006/10/11 01:40:28 hal9 -# Apply patch from Neil McCalden to fix syntax issue. -# -# Revision 1.148 2006/09/26 10:57:58 hal9 -# Including Karsten's patch to fix make create-snapshot. -# -# Revision 1.147 2006/09/13 01:25:16 hal9 -# Make sure install forces in new default.action, default.filter, and -# standard.filter. These are privoxy files, not user files. -# -# Revision 1.146 2006/09/08 23:57:19 hal9 -# User manual images are now user-manual doc directory, and fix make install -# target accordingly. -# -# Revision 1.145 2006/09/08 02:32:00 hal9 -# Various changes to implement building and installing docs to be compatible -# with the new "user-manual" settings in config from Roland. Docbook does not -# seem to like dealing with more than one css file, so workaround that here. -# Change 'make install' so it provides p_doc.css in the user-manual doc -# directory so that functions well, and lastly modify 'make install' so that the -# PATH is automatically set, and the 'user-manual' directive should done during -# the install. -# -# Revision 1.144 2006/09/07 22:53:20 hal9 -# Make sure config sgml build related artifacts are cleaned out. -# -# Revision 1.143 2006/09/02 15:59:40 hal9 -# Add to code status to make install output. -# -# Revision 1.142 2006/08/29 01:46:24 hal9 -# Add user.filter to $CONFIGS. -# -# Revision 1.141 2006/08/12 03:54:37 david__schmidt -# Windows service integration -# -# Revision 1.140 2006/07/18 14:48:45 david__schmidt -# Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) -# with what was really the latest development (the v_3_0_branch branch) -# -# Revision 1.104.2.28 2004/06/10 17:06:05 hal9 -# Fix bug #959617, by moving TMPDIR var to create-snapshot target, which is the -# only place it is used. -# -# Revision 1.104.2.27 2004/02/07 16:11:10 oes -# Make clobber remove the autom4te.cache dir. -# Closes BR #889300 -# -# Revision 1.104.2.26 2004/01/31 16:32:25 oes -# Adding a check for an htmldoc variant from the debian diff -# -# Revision 1.104.2.25 2004/01/31 01:15:33 oes -# Fixed a typo; updated copyright notice -# -# Revision 1.104.2.24 2003/12/03 10:30:02 oes -# - Added new dependency: actions.c -> ssplit.h -# - Excluded PDF docs from src tarball -# -# Revision 1.104.2.23 2003/04/20 17:28:52 hal9 -# Strip trailing spaces from config-file generation, bug #724596. -# -# Revision 1.104.2.22 2003/03/28 03:32:01 hal9 -# Minor changes for Privoxy home page: -# - Handle © more sanely -# - include link to announce.txt -# Also, disable 'make announce' target. -# -# Revision 1.104.2.21 2002/11/04 07:04:03 hal9 -# Catch up with main trunk install/uninstall. Quiet output, etc. -# -# Revision 1.104.2.20 2002/10/25 02:44:22 hal9 -# Port of make install, etc from main trunk. Needs testing! Add Slackware -# support, and other related changes. Update related docs. -# -# Revision 1.104.2.19 2002/09/26 22:50:02 hal9 -# New user-manual examples in config-file are getting wrapped. Add warning. -# -# Revision 1.104.2.18 2002/08/23 12:22:40 oes -# Added warning to broken install target -# -# Revision 1.104.2.17 2002/08/16 03:19:34 hal9 -# More (minor) cleanup of html before pdf processing to make some relative -# links work as pdf -> pdf. Upload pdf as zip archive now. -# -# Revision 1.104.2.16 2002/08/14 16:43:27 hal9 -# Added pdf docs to make webserver target. -# -# Revision 1.104.2.15 2002/08/11 20:02:41 hal9 -# New targets for man page (make man) and pdf (make dok-pdf) targets. -# -# Revision 1.104.2.14 2002/08/10 11:19:37 oes -# - Make -Ipcre (again) conditional on STATIC_PCRE -# - $(RPMBUILD) -> $(RPM) for SuSE -# - Add dependency: pcrs.o deps on config.h -# -# Revision 1.104.2.13 2002/08/07 15:13:54 hal9 -# Remove pdf2 target, and make it dok-shtml (single page html for pdf -# conversion). -# -# Revision 1.104.2.12 2002/08/06 11:29:36 oes -# Fixed detection/inclusion of pcre.h, which is in a pcre subdir on RH -# -# Revision 1.104.2.11 2002/07/30 19:38:11 hal9 -# Add redhat-test target for testing purposes only. Fix RPM_PACKAGEV to what -# *I think* it was supposed to be (was breaking upload targets since it was -# set to RPM_VERSION). -# -# Revision 1.104.2.10 2002/07/27 22:56:53 kick_ -# cleanups of the redhat-srpm target -# -# Revision 1.104.2.9 2002/07/26 15:17:02 oes -# - Added generation of default.action from defaul.action.master -# - Deleted obsolete re_filterfile.txt generation -# -# Revision 1.104.2.8 2002/07/12 10:04:32 kick_ -# added helper targets to the makefile. They shouldn't break anything, but -# make my life a lot easier. -# -# The new rpm has been splitted into two parts, one for package installation/ -# removal, one for package building. -# Therefore rpm -ta isn't a valid command anymore and needs to be replaced -# by rpmbuild -ta (this is backwards compatible) -# -# Revision 1.104.2.7 2002/06/07 00:23:47 hal9 -# Fixing a quirk of man2html (on my system) that pulls punctuation into URLs, -# thus breaking them completely. -# -# Revision 1.104.2.6 2002/06/02 03:26:25 hal9 -# Update CONFIG_FILES (ie update basic.action, etc), and also DOC_FILES (exclude -# index.html and team/index.html) -# -# Revision 1.104.2.5 2002/05/30 15:35:01 hal9 -# This is more cleanup on the make config-file target. Most issues for -# automatic generation are taken care of. There are still some problems -# that require hand editing. Namely, some of the examples that are > 80 chars. -# -# Revision 1.104.2.4 2002/05/29 02:12:17 hal9 -# Ooops...forgot about perl -pi cygwin problem. Add -pi.bak. Also, the -# new target is 'make config-file', _not_ make config. -# -# Revision 1.104.2.3 2002/05/29 02:05:48 hal9 -# 'make config' target added (WIP) for future generation of config file from -# text in u-m so the two are in sync. New generated config, which requires -# some hand editing for the time being. -# -# Revision 1.104.2.2 2002/05/28 02:32:55 hal9 -# New target 'make dok-index' for privoxy-index.html. Also, fixed *.bak files -# not being cleaned up in doc/webserver. -# -# Revision 1.104.2.1 2002/05/26 17:19:34 hal9 -# Remove Table of Contents from readme with oes's dsl trick. -# -# Revision 1.104 2002/05/24 00:03:49 oes -# Use p_doc.css for the Homepage for consistency -# -# Revision 1.103 2002/05/23 23:19:00 oes -# Use dsl without TOC for the homepage -# -# Revision 1.102 2002/05/16 01:20:17 hal9 -# make announce target added. -# -# Revision 1.101 2002/05/15 12:28:46 oes -# Trying to keep Hal happy :) -# -# Revision 1.100 2002/05/08 13:48:18 hal9 -# Ooops, that trashed JB v2.0.2 comment. Fixed. -# -# Revision 1.99 2002/05/08 13:42:07 hal9 -# This fixes the numbering problem on index.html in contact info section (.1.). Using -# perl, since its way too convoluted to try to fix proper with docbook. -# -# Revision 1.98 2002/05/03 14:33:06 oes -# Replaced ldp(OK).dsl handling with generation via autoconf; handle all file exeptions to src tarball via find -# -# Revision 1.97 2002/04/27 20:27:43 swa -# no longer needed due to new -# PACKAGE_VERSION process -# -# Revision 1.96 2002/04/27 17:44:32 morcego -# - Correcting typo in my name (Rodrigo, not Rodgrigo) :-) -# - Using the RM macro everywhere rm is called (either we use, or don't) -# - Same for RPM -# -# Revision 1.95 2002/04/27 15:37:25 swa -# replacing directory in document creation process -# no longer necessary. -# -# Revision 1.94 2002/04/27 08:23:29 swa -# pdf process reviewed and cleaned up -# -# Revision 1.93 2002/04/27 04:55:53 morcego -# privoxy-cl.spec now gets removed by clobber target -# -# Revision 1.92 2002/04/27 04:53:40 morcego -# Adding --exclude "PACKAGERS" to every tar command that applies (not for -# webserver target) -# -# Revision 1.91 2002/04/27 04:44:51 morcego -# GNUmakefile.in: The tarball created on redhat-dist and suse-dist now ignore -# the PACKAGERS file, as well privoxy-cl.spec (in case it was created) -# GNUmakefile.in: New targets -> conectiva-spec, conectiva-dist and -# conectiva-upload -# genclspec.sh : New file to generate, from privoxy-rh.spec, a specfile -# for Conectiva Linux -# -# Revision 1.90 2002/04/26 17:46:53 swa -# be consistent -# -# Revision 1.89 2002/04/26 17:20:54 swa -# just produce single html files to proces them later with Destiller or somesuch. looks prettier. -# -# Revision 1.88 2002/04/25 19:13:57 morcego -# Removed RPM release number declaration on configure.in -# Changed makefile to use given value for RPM_PACKAGEV when on uploading -# targets (will produce an error, explaining who to do it, if no value -# if provided). -# -# Revision 1.87 2002/04/23 14:10:59 swa -# now create pdf documents -# -# Revision 1.86 2002/04/15 04:30:27 hal9 -# Missed two -pi.bak's on perl/cygwin problem. -# -# Revision 1.85 2002/04/14 01:05:34 hal9 -# Revert dok-webserver change for SF logo. -# -# Revision 1.84 2002/04/13 22:43:25 hal9 -# -Fix dok-webserver for SF logo (more perl). -# -Change all perl -pi to perl -pi.bak for Cygwin problem. -# -# Revision 1.83 2002/04/12 09:39:25 oes -# Excluding yet more files from tarball; making dist warning yet more scary -# -# Revision 1.82 2002/04/11 21:07:11 oes -# Excluding more files from tarball build -# -# Revision 1.81 2002/04/11 14:40:27 oes -# Fixed typo -- Thanks, Moritz! -# -# Revision 1.80 2002/04/11 12:50:00 oes -# Fixed tarball-dist target -# -# Revision 1.79 2002/04/11 06:49:28 oes -# webserver target: silenced timestamp warnings resulting from uploading westwards, made permissions fixing independant of screwed local dir permissions, suppress (false alarm) make error if not owner of feedback log -# -# Revision 1.78 2002/04/09 13:37:11 sarantis -# fix tar options typo -# -# Revision 1.77 2002/04/09 13:28:53 swa -# build suse and gen-dist with html docs -# -# Revision 1.76 2002/04/08 22:43:41 oes -# Fix: Include dotfiles in fixing webserver permissions -# -# Revision 1.75 2002/04/08 22:14:59 oes -# Silencing tar warnings in the web* targets -# -# Revision 1.74 2002/04/08 15:22:44 hal9 -# This has finishing touches for dok building. Should be ready to go. -# -The main doc build is now 'make dok', should work on Redhat too. -# -Removed man page from main doc build. It is built separately due to -# perl scripts that most aren't likely to have. -# -# Revision 1.73 2002/04/08 14:03:24 oes -# oes for al: Fix install target -# -# Revision 1.72 2002/04/08 13:42:11 oes -# Added safety check to *-dist targets; fixed permissions for feedback logfile -# -# Revision 1.71 2002/04/07 20:32:03 hal9 -# -Add meta data kludge for make dok-webserver via $(PERL). -# -Add subdirs for 'make dok-release'. -# -# Revision 1.70 2002/04/07 08:59:40 swa -# generated files. do NOT edit. -# fixed directory bug in makefile. -# -# Revision 1.69 2002/04/07 08:10:47 swa -# create some of the webserver docs -# automatically (in particular if -# those docs recycle other documentation -# fragments). Now committed webserver's -# index file. -# -# Revision 1.68 2002/04/07 07:58:11 swa -# create some of the webserver docs -# automatically (in particular if -# those docs recycle other documentation -# fragments) -# -# Revision 1.67 2002/04/07 05:31:42 hal9 -# Add 'dok-release' target: -# -Set doc entities to VERSION and CODE_STATUS during make. -# -Set doc conditional content flags (stable vs non-stable). -# A separate target for the time being but needs to be incorporated into -# dok build at some point. -# -Filter out a spurious ^G from new man page > html converion in man2html. -# -# Revision 1.66 2002/04/06 20:28:21 jongfoster -# Prettifying groff2html. -# Using GNU Make's conditional makefile feature rather than shell "if"s. -# (The shell "if"s were hiding errors) -# "perl" -> "$(PERL)" -# Spaces->tabs in a couple of places. -# -# Revision 1.65 2002/04/06 05:16:39 hal9 -# -Add 'authors' and 'man' targets for AUTHORS and man-page (WIP). -# -Both of these will soon be generated files. -# -# Revision 1.64 2002/04/04 22:14:51 oes -# No longer rely on find honoring -iname -# -# Revision 1.63 2002/04/04 21:06:22 swa -# cosmetics. -# -# Revision 1.62 2002/04/04 20:49:50 swa -# attempt to consolidate the -# different dokbook versions. -# -# Revision 1.61 2002/04/04 19:18:21 swa -# readme was leftover directory. use w3m instead -# of lynx to be consistent among developers. use -# consistent target naming. -# -# Revision 1.60 2002/04/04 12:25:41 oes -# Tidy webserver upload w/o *~ files, CVS dirs and logfiles and with proper dir and file permissions -# -# Revision 1.59 2002/04/04 08:32:45 swa -# wrong name for tarball-dist target. further fixed content of tarball dist -# -# Revision 1.58 2002/04/04 06:32:58 hal9 -# New dok targets for make readme. -# -# Revision 1.57 2002/04/04 00:36:36 gliptak -# always use pcre for matching -# -# Revision 1.56 2002/04/03 22:28:03 gliptak -# Removed references to gnu_regex -# -# Revision 1.55 2002/04/03 19:54:29 swa -# freebsd tested to work. attempt to move tarball dist target forward -# -# Revision 1.54 2002/04/03 14:54:07 oes -# Standard clean and clobber semantics II -# -# Revision 1.53 2002/04/03 14:19:16 oes -# Standard clean and clobber semantics -# -# Revision 1.52 2002/04/03 02:56:18 hal9 -# Revert previous FAQ numbering kludge. -# -# Revision 1.51 2002/04/02 13:03:56 oes -# Added fix for webserver permissions -# -# Revision 1.50 2002/04/02 03:46:24 hal9 -# Rewrite ldpOK.dsl so that sections are NOT numbered on FAQ, in an effort -# to make the Table of Contents not so 'busy' looking. SuSE needs testing :) -# -# Revision 1.49 2002/03/30 22:20:12 swa -# cd didn't work. neither did find. -# -# Revision 1.48 2002/03/30 19:04:06 swa -# people release differently. no good. -# I want to make parts of the docs only. -# -# Revision 1.47 2002/03/30 09:05:21 swa -# better packaging. better rpm building. -# tar failed on sun (no exclude there). -# -# Revision 1.46 2002/03/29 20:09:01 swa -# al's patch -# -# Revision 1.45 2002/03/29 19:45:45 swa -# for lazy swa -# -# Revision 1.44 2002/03/29 17:42:44 gliptak -# Correcting for Solaris tar limitations -# -# Revision 1.43 2002/03/29 07:40:03 swa -# fixed make webserver. doh -# -# Revision 1.42 2002/03/29 06:59:04 swa -# other users could not modify files on webserver -# -# Revision 1.41 2002/03/28 20:43:00 swa -# set make correctly -# -# Revision 1.40 2002/03/28 04:22:44 hal9 -# More on man2html stuff. -# -# Revision 1.39 2002/03/28 01:04:14 hal9 -# More man2html stuff for docs. -# -# Revision 1.38 2002/03/27 16:02:30 swa -# have a generic target -# -# Revision 1.37 2002/03/27 15:30:26 swa -# have a consistent appearance -# -# Revision 1.36 2002/03/27 14:58:08 swa -# can be used by mutilple targets -# -# Revision 1.35 2002/03/27 14:53:19 swa -# added solaris-dist -# -# Revision 1.34 2002/03/27 10:30:11 swa -# we want a html man file on the webserver -# -# Revision 1.33 2002/03/27 03:05:35 hal9 -# Added man2html target for docs (redhat-dok only for now) -# -# Revision 1.32 2002/03/26 22:29:54 swa -# we have a new homepage! -# -# Revision 1.31 2002/03/26 14:00:18 swa -# fixed make tarball, tarball-dist, tarball-clean -# -# Revision 1.30 2002/03/25 12:52:25 swa -# new targets -# -# Revision 1.29 2002/03/24 17:03:55 jongfoster -# Name change -# -# Revision 1.28 2002/03/24 16:19:48 swa -# configure needs to be generated. -# -# Revision 1.27 2002/03/24 16:13:57 swa -# generated files are a nono in cvs -# -# Revision 1.26 2002/03/24 15:36:02 swa -# did not build. -# -# Revision 1.25 2002/03/24 14:31:08 swa -# remove more crappy files. set RPM -# release version correctly. -# -# Revision 1.24 2002/03/24 14:19:55 swa -# set rpm package release in configure.in. nowhere else. -# -# Revision 1.23 2002/03/24 13:06:49 swa -# suse-clean now runs fine -# -# Revision 1.22 2002/03/24 12:56:21 swa -# name change related issues. -# -# Revision 1.21 2002/03/24 12:43:57 swa -# name change -# -# Revision 1.20 2002/03/24 11:39:17 jongfoster -# Renaming config files -# -# Revision 1.19 2002/03/22 20:53:03 morcego -# - Ongoing process to change name to JunkbusterNG -# - configure/configure.in: no change needed -# - GNUmakefile.in: -# - TAR_ARCH = /tmp/JunkbusterNG-$(RPM_VERSION).tar.gz -# - PROGRAM = jbng -# - rh-spec now references as junkbusterng-rh.spec -# - redhat-upload: references changed to junkbusterng-* (package names) -# - tarball-dist: references changed to JunkbusterNG-distribution-* -# - tarball-src: now JunkbusterNG-* -# - install: initscript now junkbusterng.init and junkbusterng (when -# installed) -# - junkbuster-rh.spec: renamed to junkbusterng-rh.spec -# - junkbusterng.spec: -# - References to the expression ijb where changed where possible -# - New package name: junkbusterng (all in lower case, acording to -# the LSB recomendation) -# - Version changed to: 2.9.13 -# - Release: 1 -# - Added: junkbuster to obsoletes and conflicts (Not sure this is -# right. If it obsoletes, why conflict ? Have to check it later) -# - Summary changed: Stefan, please check and aprove it -# - Changes description to use the new name -# - Sed string was NOT changed. Have to wait to the manpage to -# change first -# - Keeping the user junkbuster for now. It will require some aditional -# changes on the script (scheduled for the next specfile release) -# - Added post entry to move the old logfile to the new log directory -# - Removing "chkconfig --add" entry (not good to have it automaticaly -# added to the startup list). -# - Added preun section to stop the service with the old name, as well -# as remove it from the startup list -# - Removed the chkconfig --del entry from the conditional block on -# the preun scriptlet (now handled on the %files section) -# - junkbuster.init: renamed to junkbusterng.init -# - junkbusterng.init: -# - Changed JB_BIN to jbng -# - Created JB_OBIN with the old value of JB_BIN (junkbuster), to -# be used where necessary (config dir) -# -# Aditional notes: -# - The config directory is /etc/junkbuster yet. Have to change it on the -# specfile, after it is changes on the code -# - The only files that got renamed on the cvs tree were the rh specfile and -# the init file. Some file references got changes on the makefile and on the -# rh-spec (as listed above) -# -# Revision 1.18 2002/03/21 23:00:00 swa -# want to autogenerate stuff. -# -# Revision 1.17 2002/03/19 19:30:04 morcego -# - Fixing stylesheet checking on configure. If it is found, no further checks -# should be done -# -# - configure will now check for db2html or docbook2html (should work now -# on SuSe without the docbktls package) -# -# Revision 1.16 2002/03/14 22:32:32 hal9 -# Bumped the RPM version. -# -# Revision 1.15 2002/03/08 20:00:28 swa -# some leftovers. -# -# Revision 1.14 2002/03/07 18:25:56 swa -# synced redhat and suse build process -# -# Revision 1.13 2002/03/07 17:17:56 oes -# (Hopefully) fixed for older make versions -# -# Revision 1.12 2002/03/07 15:28:27 swa -# more informative -# -# Revision 1.11 2002/03/06 14:33:18 sarantis -# Use proper temp file, not "abc". -# -# Revision 1.10 2002/03/06 14:19:35 sarantis -# Cleanup PID_FILE_PATH from redhat-dist target -# -# Revision 1.9 2002/03/05 17:31:11 morcego -# Search for docbook.dsl. Should solve portability problems for SuSe. -# -# Revision 1.8 2002/03/05 14:07:42 morcego -# configure now detects rpm topdir, and change GNUmakefile acordingly -# (based on sugestion by Sarantis Paskalis) -# -# Revision 1.7 2002/03/05 13:43:28 morcego -# Checking for text browser, so redhat-dok can work. -# -# Revision 1.6 2002/03/05 13:10:51 morcego -# Changes to implement redhat-dok (Hal Burgiss) -# Changes to make it work on other distros and out-of-the-shelf configurations -# -# Revision 1.5 2002/02/27 15:30:39 hal9 -# Reset $(RPM_PACKAGEV) to 1 (was 2) -# -# Revision 1.4 2002/01/17 21:44:04 jongfoster -# Adding urlmatch.[ch] -# -# Revision 1.3 2002/01/04 15:26:08 oes -# Added tarball-src target -# -# Revision 1.2 2001/12/30 14:07:31 steudten -# - Add signal handling (unix) -# - Add SIGHUP handler (unix) -# - Add creation of pidfile (unix) -# - Add action 'top' in rc file (RH) -# - Add entry 'SIGNALS' to manpage -# - Add exit message to logfile (unix) -# -# Revision 1.1 2001/12/01 11:22:57 jongfoster -# Renaming Makefile.in to GNUmakefile.in so that non-GNU versions of -# make break in a more obvious way. -# Adding .PHONY section. -# -# Revision 1.40 2001/12/01 00:24:11 jongfoster -# Renaming various config files -# Fixing CR->CRLF under Win32 (I hope) -# -# Revision 1.39 2001/11/06 12:07:30 steudten -# Add --clean for building rpm in target redhat-dist. -# -# Revision 1.38 2001/11/05 21:35:23 steudten -# Complete rewrite for the 'redhat-dist' target. -# Checks for writeable RPM build directories for calling user. -# So you must not be root, just set the modes to 1777 to -# build a RH package. -# Fix the upload-target to be arch independant. -# Add target for 'solaris-dist' - coming soon. -# -# Revision 1.37 2001/11/01 00:52:04 hal9 -# Redhat-upload stuff per Stefan. -# -# Revision 1.36 2001/10/31 19:26:13 swa -# automate process of uploading new releases -# to sf. -# -# Revision 1.35 2001/10/15 22:14:59 joergs -# Removed -O2 and -Wall from AmigaOS-only CFLAGS since they are now in -# the general CFLAGS already. -# -# Revision 1.34 2001/10/15 18:28:06 steudten -# remove config.cache for target clobber. -# Cleanup make dist for RH and S.u.S.E. -# -# Revision 1.33 2001/10/10 12:43:33 oes -# Added ugly hack to make install target work at least for some setups. -# -# Revision 1.32 2001/10/09 22:38:19 jongfoster -# Correcting actionsfile filename for Win32 INI build -# -# Revision 1.31 2001/09/23 10:13:48 swa -# upload process established. run make webserver and -# the documentation is moved to the webserver. documents -# are now linked correctly. -# -# Revision 1.30 2001/09/19 17:55:49 oes -# Fixed CFLAGS -# -# Revision 1.29 2001/09/16 17:34:27 jongfoster -# Removing showargs.[ch], adding cgi(simple|edit).[ch] -# Replacing $(OBJEXT) with o - this seems to be a common source -# of build problems. -# -# Revision 1.28 2001/09/13 15:19:08 swa -# we want text files as well. -# -# Revision 1.27 2001/09/13 13:11:37 steudten -# -# Replace DEBUG_CFLAGS with OTHER_CFLAGS -# -# Revision 1.26 2001/09/12 23:44:54 david__schmidt -# Mac OSX (Darwin) support added. -# -# Revision 1.25 2001/09/12 22:55:45 joergs -# AmigaOS support added. -# -# Revision 1.24 2001/09/12 17:28:59 david__schmidt -# -# OS/2 port: update autoconf'd support for the platform. -# -# Revision 1.23 2001/09/12 16:28:42 swa -# added "make dok" section to generate html pages from -# the sgml source documents. note that the we do not want -# generated stuff in cvs. -# -# Revision 1.22 2001/09/10 16:31:23 swa -# buildroot definition in the specfile fucks up the build -# process under suse. hence I moved it to the "rpm -ta" -# command -# -# Revision 1.21 2001/09/10 11:12:49 oes -# Turning on -Wall -# -# Revision 1.20 2001/08/02 22:04:29 jongfoster -# Removing some remaining references to obsolete w32rulesdlg.[ch] -# -# Revision 1.19 2001/07/30 22:14:03 jongfoster -# Removing obsolete w32rulesdlg.c and w32rulesdlg.h -# -# Revision 1.18 2001/07/29 17:09:17 jongfoster -# Major changes to build system in order to fix these bugs: -# - pthreads under Linux was broken - changed -lpthread to -pthread -# - Compiling in MinGW32 mode under CygWin now correctly detects -# which shared libraries are available -# - Solaris support (?) (Not tested under Solaris yet) -# -# Revision 1.17 2001/07/28 16:44:54 oes -# Fixed sed LF->CRLF conversion and removed deprecated files -# -# Revision 1.16 2001/07/15 19:45:33 jongfoster -# Added support for linking with POSIX threads library -# -# Revision 1.15 2001/07/13 13:48:07 oes -# - Moved STATIC #define for pcre to (ac)config.h -# - Made -Ipcre depandant on static pcre compilation to -# avoid version conflicts -# - Included compilation and depandancies for new deanimate.c -# - Made changes to the pcre/pcreposix/pcrs build process -# as required by the new library autodetection in -# configure.in -# -# Revision 1.14 2001/07/01 16:27:44 oes -# Fixed misplaced dependancy -# -# Revision 1.13 2001/06/29 13:18:36 oes -# - added depandancy of filters.o on cgi.h -# -# Revision 1.12 2001/06/12 17:15:56 swa -# fixes, because a clean build on rh6.1 was impossible. -# GZIP confuses make, %configure confuses rpm, etc. -# -# Revision 1.11 2001/06/11 11:26:35 sarantis -# RPM version should be the same as ijbswa version. The rpm release is -# specified in the specfile. -# -# Revision 1.10 2001/06/07 17:27:45 swa -# added suse build section -# -# Revision 1.9 2001/06/04 18:31:58 swa -# files are now prefixed with either `confdir' or `logdir'. -# `make redhat-dist' replaces both entries confdir and logdir -# with redhat values -# -# Revision 1.8 2001/06/04 10:44:57 swa -# `make redhatr-dist' now works. Except for the paths -# in the config file. -# -# Revision 1.7 2001/06/03 17:09:09 swa -# swa for oes: reversed my earlier change -# -# Revision 1.6 2001/06/03 17:07:27 swa -# swa for oes -# -# Revision 1.5 2001/06/03 13:57:26 swa -# compile cgi.c (for andreas' GUI) -# -# Revision 1.4 2001/05/31 21:18:45 jongfoster -# Added files actions.[ch], actionlist.h, list.[ch] to Makefile -# -# Revision 1.3 2001/05/29 20:02:48 joergs -# Changes for AmigaOS added. -# -# Revision 1.2 2001/05/17 22:23:23 oes -# - Added auto-generation of CRLFs for Win32 config files -# - Added comment-prefix to all Win32-only options in the config file -# and provided auto stripping of this prefix for the Win32 platform by make -# -# Revision 1.1.1.1 2001/05/15 13:59:00 oes -# Initial import of version 2.9.3 source tree -# -# diff --git a/external/privoxy/GNUmakefile.in b/external/privoxy/GNUmakefile.in index 481633c8..08c949a3 100644 --- a/external/privoxy/GNUmakefile.in +++ b/external/privoxy/GNUmakefile.in @@ -1,15 +1,15 @@ # Note: Makefile is built automatically from Makefile.in # -# $Id: GNUmakefile.in,v 1.180 2009/02/28 08:28:14 fabiankeil Exp $ +# $Id: GNUmakefile.in,v 1.205 2011/11/20 17:17:56 fabiankeil Exp $ # -# Written by and Copyright (C) 2001 - 2008 the SourceForge +# Written by and Copyright (C) 2001-2011 members of the # Privoxy team. http://www.privoxy.org/ # # Based on the Internet Junkbuster originally written -# by and Copyright (C) 1997 Anonymous Coders and +# by and Copyright (C) 1997 Anonymous Coders and # Junkbusters Corporation. http://www.junkbusters.com # -# This program is free software; you can redistribute it +# This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General # Public License as published by the Free Software # Foundation; either version 2 of the License, or (at @@ -42,9 +42,7 @@ VERSION_MINOR = @VERSION_MINOR@ VERSION_POINT = @VERSION_POINT@ CODE_STATUS = @CODE_STATUS@ VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_POINT) -RPM_VERSION = $(VERSION) -RPM_PACKAGEV = "" -SNAPVERSION = $(RPM_VERSION)-$(shell date "+%Y%m%d") +SNAPVERSION = $(VERSION)-$(shell date "+%Y%m%d") ############################################################################# @@ -62,21 +60,22 @@ CONF_BASE = @sysconfdir@ SBIN_DEST = @sbindir@ MAN_DIR = @mandir@ MAN_DEST = $(MAN_DIR)/man1 +MAN_PAGE = privoxy.1 SHARE_DEST = @datadir@ DOC_DEST = $(SHARE_DEST)/doc/privoxy VAR_DEST = @localstatedir@ LOGS_DEST = $(VAR_DEST)/log/privoxy PIDS_DEST = $(VAR_DEST)/run -# if $prefix = /usr/local then the default CONFDEST change from -# CONF_DEST = $(CONF_BASE) to CONF_DEST = $(CONF_BASE)/privoxy +# if $prefix = /usr/local then the default CONFDEST change from +# CONF_DEST = $(CONF_BASE) to CONF_DEST = $(CONF_BASE)/privoxy # by the target rule CONF_DEST # # also if the $prefix is /usr/local and there is no # $(SHARE_DEST)/doc, it checks for $prefix/doc and installs there # instead in this situation # -# finally if $prefix=/usr/local and VAR_DEST=$prefix/var it +# finally if $prefix=/usr/local and VAR_DEST=$prefix/var it # changes this to /var for storing the logs and pidfile # used in source dir only, the install goes to $share_dest/doc/privoxy @@ -92,13 +91,13 @@ RA_MODE = 0664 DIR_MODE = 0755 # Files daemon writes to. RWD_MODE = 0660 -INSTALL_P = -m $(BIN_MODE) +INSTALL_P = -m $(BIN_MODE) INSTALL_T = -m $(RA_MODE) INSTALL_D = -m $(DIR_MODE) -d INSTALL_R = -m $(RWD_MODE) # install options for superuser install -#INSTALL_S = -g @GROUP@ -o @USER@ +#INSTALL_S = -g @GROUP@ -o @USER@ ############################################################################# # Build tools @@ -122,8 +121,6 @@ STRIP_PROG = strip SED = sed GREP = grep CAT = cat -RPM = rpm -RPMBUILD = rpmbuild MV = mv TAR = tar LN = ln @@ -145,6 +142,7 @@ PERL = perl DOC_DIR = doc/source DOC_TMP = $(DOC_DIR)/tmp DOC_STATUS = @DOC_STATUS@ +TIDY = tidy -modify -indent -clean -wrap 78 # Program to do LF->CRLF # @@ -156,13 +154,16 @@ DOC_STATUS = @DOC_STATUS@ DOSFILTER = $(PERL) -p -e 's/\n/\r\n/' CVSROOT = :pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa #TMPDIR := $(shell mktemp -d /tmp/$(PROGRAM).XXXXXX) +# If your SF user name differs from your local one, +# change this to "ssh -l sf-username" +SSH = ssh +WWW_ROOT = /home/project-web/ijbswa ############################################################################# -# Setup for make distribution rh and suse for now +# Setup for make distribution for now. ############################################################################# -TAR_ARCH = /tmp/privoxy-$(RPM_VERSION).tar.gz -RPM_BASE = @RPM_BASE@ +TAR_ARCH = /tmp/privoxy-$(VERSION).tar.gz ############################################################################# # We include these files in our distributions @@ -177,7 +178,7 @@ CONFIG_FILES = $(CONFIGS) \ DOC_FILES = AUTHORS LICENSE README ChangeLog INSTALL \ `find doc/webserver/ -name "*.html" | grep -v "\(webserver\|team\)\/index\.html"` \ `find doc/webserver/ -name "*.css"` \ - privoxy.1 + $(MAN_PAGE) ############################################################################# # Filenames and libraries @@ -239,11 +240,11 @@ LIBS = @LIBS@ $(W32_LIB) $(SOCKET_LIB) $(PTHREAD_LIB) # possibly other OSs). SPECIAL_CFLAGS = @SPECIAL_CFLAGS@ -# Add your flags here -OTHER_CFLAGS = +# Add your flags here +OTHER_CFLAGS = CFLAGS = @CFLAGS@ @CPPFLAGS@ $(OTHER_CFLAGS) $(SPECIAL_CFLAGS) -Wall \ - @STATIC_PCRE_ONLY@ -Ipcre + @STATIC_PCRE_ONLY@ -Ipcre LDFLAGS = @LDFLAGS@ $(DEBUG_CFLAGS) $(SPECIAL_CFLAGS) @@ -259,9 +260,9 @@ all: $(PROGRAM) default.action ############################################################################# # Phony targets ############################################################################# -.PHONY: all inifiles redhat-dist redhat-upload solaris-dist suse-dist \ -suse-upload win-dist tarball-dist dok redhat-dok webserver clean clobber tags \ -install conectiva-spec conectiva-dist conectiva-upload CONF_DEST LOG_DEST \ +.PHONY: all inifiles solaris-dist \ +win-dist tarball-dist dok webserver clean clobber tags \ +install CONF_DEST LOG_DEST \ PID_DEST check_doc install-strip uninstall GROUP_T ############################################################################# @@ -275,8 +276,7 @@ PID_DEST check_doc install-strip uninstall GROUP_T # Strip master copy comments from default.action: ############################################################################# default.action: default.action.master - $(GREP) -v '^#MASTER#' $< > $@ - + $(GREP) -v '^#MASTER#' default.action.master > $@ ############################################################################# # Win32 config files ############################################################################# @@ -295,7 +295,7 @@ config.txt: config $(DOSFILTER) default.filter.txt && mv default.filter.txt default.filter trust.txt: trust - $(DOSFILTER) < $< > $@ + $(DOSFILTER) < $< > $@ ############################################################################# # Pre-dist check: @@ -323,12 +323,12 @@ dist-check: ############################################################################# # create tar.gz from CVS: -# This make-target is usually called through 'create-archive'. If you +# This make-target is usually called through 'create-archive'. If you # run 'make create-snapshot' without setting SNAPVERSION, you'll get a -# tar.gz with the current date in the name and as a releasenumber in the +# tar.gz with the current date in the name and as a releasenumber in the # spec-file. But the main usage is to run it as follows (Red Hat example): # make SNAPVERSION=1.6x create-snapshot -# This creates a tar.gz and spec-file for a Red Hat 6.x version. +# This creates a tar.gz. ############################################################################# create-snapshot: @tag=`cvs -d $(CVSROOT) status Makefile | awk ' /Sticky Tag/ { print $$3 } '` 2> /dev/null; \ @@ -337,25 +337,6 @@ create-snapshot: TMPDIR=$(shell mktemp -d /tmp/$(PROGRAM).XXXXXX); \ cd $$TMPDIR ; cvs -Q -d $(CVSROOT) export -r $$tag current || echo "Um... export aborted."; \ cd $$TMPDIR/current; \ - TMPFILE=$$(mktemp -q /tmp/$(PROGRAM).XXXXXX); \ - if $(SED) -e 's/^\(Version:\).*/\1 $(RPM_VERSION)/g' \ - -e 's/^\(Release:\).*/\1 $(SNAPVERSION)/g' \ - privoxy-rh.spec > $$TMPFILE ; then \ - $(MV) -f $$TMPFILE privoxy-rh.spec; \ - else \ - $(ECHO) "Could not set version info in specfile."; \ - exit 1;\ - fi;\ - if $(SED) -e 's/^\(Version:\).*/\1 $(RPM_VERSION)/g' \ - -e 's/^\(Release:\).*/\1 $(SNAPVERSION)/g' \ - privoxy-suse.spec > $$TMPFILE ; then \ - $(MV) -f $$TMPFILE privoxy-suse.spec; \ - else \ - $(ECHO) "Could not set version info in specfile."; \ - exit 1;\ - fi; \ - $(RM) $$TMPFILE; \ - cd $$TMPDIR/current; \ $(TAR) --exclude ".cvsignore" --exclude "CVS" \ -czf /tmp/$(PROGRAM)-$(VERSION).tar.gz .; \ $(RM) -rf $$TMPDIR @@ -364,157 +345,12 @@ create-snapshot: ############################################################################# # looks at the version of Makefile and exports a corresponding source-tree -# example: if the Makefile has the sticky tag v_2_9_13, you'll get -# privoxy-*-2.4.13.tar.gz. Two different tar files will be written, one for -# Red Hat and one for SuSe (different spec-files) +# example: if the Makefile has the sticky tag v_2_9_13, you'll get +# privoxy-*-2.4.13.tar.gz. ############################################################################# create-archive: make SNAPVERSION=$(SNAPVERSION) create-snapshot -############################################################################# -# RPM specifice stuff (SuSE or Redhat, ..) -############################################################################# -rpm-stuff: dist-check clean clobber - for dir in RPMS SRPMS BUILD SOURCES SPECS; do \ - if [ ! -w $(RPM_BASE)/$$dir ]; then \ - $(ECHO) "$(RPM_BASE)/$$dir is not writable for you. Maybe try as root."; \ - $(ECHO) "Or add a suitable path to .rpmmacros like."; \ - $(ECHO) "%_topdir /home/foo/rpm-build"; \ - exit 1; \ - fi; \ - done; \ - -check-release: - @if [ "$(RPM_PACKAGEV)" = "" ]; then \ - echo ; \ - echo " ERROR: NO RPM_PACKAGEV VALUE"; \ - echo " No value given for RPM_PACKAGEV. Please use:"; \ - echo " make dist-upload RPM_PACKAGEV=release"; \ - echo " where \"release\" is the release number you want to and"; \ - echo " where \"dist\" is the name of the distro (redhat or suse)"; \ - echo ; \ - echo " Ex: make redhat-upload RPM_PACKAGEV=1"; \ - echo ""; \ - echo "ATTENTION: If your distribution use a specific tag on the"; \ - echo " release field (like \"cl\" for Conectiva, and"; \ - echo " \"mdk\" for Mandrake), DO NOT put it on the value"; \ - echo " given to RPM_PACKAGEV. It will be added automaticaly."; \ - echo " Do it like you would do for a redhat package,"; \ - echo " (i.e. just the number)."; \ - echo ; \ - exit 1; \ - fi - - -############################################################################# -# Create Conectiva specfile from RedHat specfile -############################################################################# -conectiva-spec: - $(RM) privoxy-cl.spec - chmod a+x genclspec.sh - ./genclspec.sh - -############################################################################# -# Conectiva distribution for x86 -############################################################################# -conectiva-dist: rpm-stuff conectiva-spec - - $(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-suse.spec" --exclude "privoxy-rh.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) . - $(RPMBUILD) --clean -ta $(TAR_ARCH) - if [ -f $(TAR_ARCH) ]; then $(RM) $(TAR_ARCH); fi - -conectiva-upload: check-release - make redhat-upload RPM_PACKAGEV=$(RPM_PACKAGEV)cl - -############################################################################# -# redhat distribution alpha and x86 -############################################################################# -redhat-dist: rpm-stuff - echo $(CONFIG_FILES) - $(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-suse.spec" --exclude "privoxy-cl.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) . - $(RPMBUILD) --clean -ta $(TAR_ARCH) - if [ -f $(TAR_ARCH) ]; then $(RM) $(TAR_ARCH); fi - -# For testing build issues only! Use redhat-dist for official releases. -redhat-test: - echo $(CONFIG_FILES) - $(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-suse.spec" --exclude "privoxy-cl.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) . - $(RPMBUILD) --clean -tb $(TAR_ARCH) - if [ -f $(TAR_ARCH) ]; then $(RM) $(TAR_ARCH); fi - @echo "WARNING: This target is only for testing. Use redhat-dist for releases!!!" - -# anonymously ncftps the rpms to sourceforge -redhat-upload: check-release - ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/SRPMS/privoxy-$(RPM_VERSION)-$(RPM_PACKAGEV).src.rpm -# better should use `arch` here instead of ix86 to support other platforms too - ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/RPMS/*/privoxy-$(RPM_VERSION)-$(RPM_PACKAGEV).*.rpm - @$(ECHO) ------------------------------------------------------- - @$(ECHO) Now goto - @$(ECHO) https://sourceforge.net/project/admin/editpackages.php?group_id=11118 - @$(ECHO) ... and release the files. - @$(ECHO) ------------------------------------------------------- - # w3m http://sourceforge.net/project/admin/editpackages.php?group_id=11118 - - -############################################################################# -# Creates a Red Hat sourcepackage from CVS (not from the current sources -# on disk) -############################################################################# -redhat-srpm: - make create-archive - $(RPMBUILD) -ts --nodeps $(PROGRAM)-$(VERSION).tar.gz - - -############################################################################# -# suse distribution. works fine. no need to be root. -############################################################################# -suse-dist: rpm-stuff -# TMPFILE=$$(mktemp -q /tmp/$(PROGRAM).XXXXXX); \ -# if $(SED) -e 's/^\(Version:\).*/\1 $(RPM_VERSION)/g' \ -# -e 's/^\(Release:\).*/\1 $(RPM_PACKAGEV)/g' \ -# privoxy-suse.spec > $$TMPFILE ; then \ -# $(MV) -f $$TMPFILE privoxy-suse.spec; \ -# else \ -# $(ECHO) "Could not set version info in specfile."; \ -# exit 1;\ -# fi - - $(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-rh.spec" --exclude "privoxy-cl.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) . - $(RPMBUILD) --clean -ta $(TAR_ARCH) - if [ -f $(TAR_ARCH) ]; then $(RM) $(TAR_ARCH); fi - -# anonymously ncftps the rpms to sourceforge -suse-upload: check-release - ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/SRPMS/privoxy-suse-$(RPM_VERSION)-$(RPM_PACKAGEV).src.rpm -# better should use `arch` here instead of ix86 to support other platforms too - ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/RPMS/*/privoxy-suse-$(RPM_VERSION)-$(RPM_PACKAGEV).*.rpm - @$(ECHO) ------------------------------------------------------- - @$(ECHO) Now goto - @$(ECHO) https://sourceforge.net/project/admin/editpackages.php?group_id=11118 - @$(ECHO) ... and release the files. - @$(ECHO) ------------------------------------------------------- - -# handle with care. use with root. -suse-clean: - $(RPM) -e junkbuster-suse || true - $(RM) -r /etc/junkbuster - $(RM) -r /etc/rc.d/junkbuster* - $(RM) -r /var/run/junkbuster.pid - $(RM) -r /var/log/junkbuster - $(RM) /etc/init.d/junkbuster - $(RM) /usr/sbin/junkbuster - $(RM) /usr/sbin/rcjunkbuster - $(RM) /usr/share/man/man1/junkbuster.1.gz - $(RPM) -e privoxy-suse || true - $(RM) -r /etc/privoxy - $(RM) -r /etc/rc.d/privoxy* - $(RM) -r /var/run/privoxy.pid - $(RM) -r /var/log/privoxy - $(RM) /etc/init.d/privoxy - $(RM) /usr/sbin/privoxy - $(RM) /usr/sbin/rcprivoxy - $(RM) /usr/share/man/man1/privoxy.1.gz - ############################################################################# # generic distribution ############################################################################# @@ -530,7 +366,7 @@ gen-dist: dist-check # add config files for foo in $(CONFIG_FILES); do \ (cd .. && $(TAR) -uvhf --exclude "PACKAGERS" privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar privoxy-$(VERSION)-$(CODE_STATUS)/$$foo;) \ - done; + done; # add documentation for foo in $(DOC_FILES); do \ (cd .. && $(TAR) -uvhf --exclude "PACKAGERS" privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar privoxy-$(VERSION)-$(CODE_STATUS)/$$foo;) \ @@ -553,69 +389,6 @@ gen-upload: gen-clean: $(RM) privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar* -############################################################################# -# solaris distribution. verified on SF machines by swa. -############################################################################# -solaris-dist: gen-dist - @$(ECHO) Done. -# anonymously ncftps the package to sourceforge -solaris-upload: gen-upload - @$(ECHO) Done. -# use with care -solaris-clean: gen-clean - @$(ECHO) Done. - -############################################################################# -# hpux distribution -############################################################################# -hpux-dist: - @$(ECHO) coming soon. -hpux-upload: - @$(ECHO) coming soon. - -############################################################################# -# debian distribution -############################################################################# -debian-dist: - @$(ECHO) coming soon. -debian-upload: - @$(ECHO) coming soon. - -############################################################################# -# macosx distribution -############################################################################# -macosx-dist: - @$(ECHO) coming soon. -macosx-upload: - @$(ECHO) coming soon. - -############################################################################# -# amiga distribution -############################################################################# -amiga-dist: - @$(ECHO) coming soon. -amiga-upload: - @$(ECHO) coming soon. - -############################################################################# -# freebsd distribution. verified on SF machines by swa. -############################################################################# -freebsd-dist: gen-dist - @$(ECHO) Done. -# anonymously ncftps the package to sourceforge -freebsd-upload: gen-upload - @$(ECHO) Done. -# use with care -freebsd-clean: gen-clean - @$(ECHO) Done. - -############################################################################# -# Windows distribution -############################################################################# -win-dist: - $(ECHO) Not implemented. - - ############################################################################# # Tarball distribution: No CVS dirs, dotfiles, debian build dir, # (FIXME:) only parts of the static / generated docs mix in doc/webserver @@ -632,7 +405,7 @@ tarball-dist: dist-check clean clobber cd .. && $(TAR) -cvhf privoxy-$(VERSION)-$(CODE_STATUS)-src.tar $$files ; \ # and zip the archive - $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS) + $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS) $(GZIP_PROG) ../privoxy-$(VERSION)-$(CODE_STATUS)-src.tar @$(ECHO) Tarball distribution created. @@ -657,14 +430,14 @@ tarball-clean: ############################################################################# # developer manual -dok-devel: +dok-devel: $(RM) doc/webserver/developer-manual/*.html $(RM) -r doc/source/developer-manual mkdir -p doc/source/developer-manual cd doc/source/developer-manual && $(DB) ../developer-manual.sgml && cd .. && cp developer-manual/*.html ../webserver/developer-manual/ # user manual -dok-user: +dok-user: $(RM) doc/webserver/user-manual/*.html $(RM) -r doc/source/user-manual/ mkdir -p doc/source/user-manual @@ -675,58 +448,56 @@ dok-user: $(PERL) -pi.bak -e 's/<\/head/\n\n<\/head/i' doc/webserver/user-manual/*html # faq -dok-faq: +dok-faq: $(RM) doc/webserver/faq/*.html $(RM) -r doc/source/faq mkdir -p doc/source/faq cd doc/source/faq && $(DB) ../faq.sgml && cd .. && cp faq/*.html ../webserver/faq/ -# man page, one variation. Try to use the next target, just 'make man'. -dok-man: +# man page, one variation. Try to use the next target, just 'make man'. +dok-man: $(RM) doc/man/* doc/webserver/man-page/*.html -ifneq ($(MAN2HTML),false) - $(ECHO) "Privoxy Man page

NAME

" > doc/webserver/man-page/privoxy-man-page.html - man ./privoxy.1 | $(MAN2HTML) -bare >> doc/webserver/man-page/privoxy-man-page.html - $(ECHO) "" >> doc/webserver/man-page/privoxy-man-page.html -else - $(MAKE) groff2html -endif + echo MAN2HTML is $(MAN2HTML) + @if [ $(MAN2HTML) != "false" ]; then \ + $(ECHO) "Privoxy Man page

NAME

" > doc/webserver/man-page/privoxy-man-page.html; \ + man ./$(MAN_PAGE) | $(MAN2HTML) -bare >> doc/webserver/man-page/privoxy-man-page.html; \ + $(ECHO) "" >> doc/webserver/man-page/privoxy-man-page.html; \ + else \ + $(MAKE) groff2html; \ + fi; # Build man page from sgml. This requires the SGMLSpm perl module. -# See CPAN, or your favorite perl repository. This is the preferred +# See CPAN, or your favorite perl repository. This is the preferred # target for man page generation! man: dok-release mkdir -p doc/source/temp && cd doc/source/temp && $(RM) * ;\ nsgmls ../privoxy-man-page.sgml | sgmlspl ../../../utils/docbook2man/docbook2man-spec.pl &&\ - perl -pi.bak -e 's/ //; s/\[ /\[/g' privoxy.1 ;\ - perl -pi.bak -e "s/\[ /\[/g;s/á/\\\\['a]/g;s/é/\\\\['e]/g" privoxy.1; \ - perl -pi.bak -e "s/ö/\\\\[:o]/g" privoxy.1; \ - perl -pi.bak -e 's/([ {])-([a-z])/$$1\\-$$2/g' privoxy.1; \ - perl -pi.bak -e 's/ --([a-z])/ \\-\\-$$1/g' privoxy.1; \ - perl -pi.bak -e 's/\\fB--/\\fB\\-\\-/g' privoxy.1; \ - $(DB) ../privoxy-man-page.sgml && $(MV) -f privoxy.1 ../../../privoxy.1 + perl -pi.bak -e 's/ //; s/\[ /\[/g' $(MAN_PAGE) ;\ + perl -pi.bak -e "s/\[ /\[/g;s/á/\\\\['a]/g;s/é/\\\\['e]/g" $(MAN_PAGE); \ + perl -pi.bak -e "s/ö/\\\\[:o]/g" $(MAN_PAGE); \ + perl -pi.bak -e 's/([ {])-([a-z])/$$1\\-$$2/g' $(MAN_PAGE); \ + perl -pi.bak -e 's/ --([a-z])/ \\-\\-$$1/g' $(MAN_PAGE); \ + perl -pi.bak -e 's/\\fB--/\\fB\\-\\-/g' $(MAN_PAGE); \ + $(DB) ../privoxy-man-page.sgml && $(MV) -f $(MAN_PAGE) ../../../$(MAN_PAGE) # For those with man2html ala RH7s. man2html: mkdir -p doc/webserver/man-page -ifneq ($(MAN2HTML),false) - $(MAN2HTML) privoxy.1 |grep -v "^Content-type" > tmp.html - $(PERL) -pi.bak -e 's/
//; s//man2html/' tmp.html - $(PERL) -pi.bak -e 's/(<\/HEAD>)/<\/HEAD>/' tmp.html -# Twice because my version of man2html is pulling in commas and periods in URLs. - $(PERL) -pi.bak -e 's/()/$$1$$2/g' tmp.html - $(PERL) -pi.bak -e 's,\.">,">,g' tmp.html - $(PERL) -pi.bak -e "s/\['a\]/\á/g;s/\['e\]/\é/g" tmp.html -# Get rid of spurious  from conversion. (How to do this with perl?) - $(SED) -e 's///g' tmp.html > doc/webserver/man-page/privoxy-man-page.html && $(RM) tmp.* -else - $(MAKE) groff2html -endif - + @if [ $(MAN2HTML) != "false" ]; then \ + $(MAN2HTML) $(MAN_PAGE) |grep -v "^Content-type" > tmp.html; \ + $(PERL) -pi.bak -e 's///; s//man2html/' tmp.html; \ + $(PERL) -pi.bak -e 's/(<\/HEAD>)/<\/HEAD>/' tmp.html; \ + $(PERL) -pi.bak -e 's/()/$$1$$2/g' tmp.html; \ + $(PERL) -pi.bak -e 's,\.">,">,g' tmp.html; \ + $(PERL) -pi.bak -e "s/\['a\]/\á/g;s/\['e\]/\é/g" tmp.html; \ + $(SED) -e 's///g' tmp.html > doc/webserver/man-page/privoxy-man-page.html && $(RM) tmp.*; \ + else \ + $(MAKE) groff2html; \ + fi; # Otherwise we get plain groff conversion. groff2html: - $(G2H_CMD) ./privoxy.1 | $(SED) -e 's@@@' > doc/webserver/man-page/privoxy-man-page.html + $(G2H_CMD) ./$(MAN_PAGE) | $(SED) -e 's@@@' > doc/webserver/man-page/privoxy-man-page.html # readme page and INSTALL file @@ -741,7 +512,7 @@ dok-readme: dok-release # for documentation, etc. # # index.html for webserver: -dok-webserver: +dok-webserver: cd doc/source/webserver && $(DB)-notoc -ip-homepage -V nochunks index.sgml > ../../webserver/index.html $(PERL) -pi.bak -e 's/..\/p_doc.css/p_doc.css/;\ s/<\/HEAD/\n<\/HEAD/;\ @@ -751,7 +522,7 @@ dok-webserver: doc/webserver/index.html && $(RM) doc/webserver/*.bak # privoxy-index.html for local documentation: -dok-index: +dok-index: cd doc/source/webserver && $(DB)-notoc -ip-index -V nochunks index.sgml > ../../webserver/privoxy-index.html $(PERL) -pi.bak -e 's/..\/p_doc.css/p_doc.css/;\ s/<\/HEAD/\n<\/HEAD/;\ @@ -764,19 +535,8 @@ dok-index: dok: dok-release dok-devel dok-user dok-faq dok-readme dok-webserver dok-authors dok-index @$(ECHO) Documentation created. -# -# an alternative to the above dok. disabled man page creation for the moment -# -redhat-dok: dok-release dok-devel dok-user dok-faq redhat-readme dok-webserver dok-authors - @$(ECHO) Documentation created. - -## Make README -redhat-readme: - cd doc/source && $(DB)-notoc -V nochunks readme.sgml > tmp.html && $(WDUMP) \ - tmp.html > ../../README && $(RM) -r tmp.html - ## Make AUTHORS file -dok-authors: +dok-authors: cd doc/source && $(DB) -V nochunks authors.sgml > tmp.html && env -u LANG $(WDUMP) \ tmp.html > ../../AUTHORS && $(RM) tmp.html @@ -788,19 +548,18 @@ dok-release: s///' \ doc/source/*sgml doc/source/*/*sgml $(RM) -r doc/source/*bak doc/source/*/*bak -ifeq ($(CODE_STATUS),stable) - @$(ECHO) Setting docs to stable $(VERSION) - @$(PERL) -pi.bak -e 's///;\ - s///' \ - doc/source/*sgml doc/source/*/*sgml - $(RM) -r doc/source/*bak doc/source/*/*bak -else - @$(ECHO) Setting docs to not stable $(VERSION) - @$(PERL) -pi.bak -e 's///;\ - s///' \ - doc/source/*sgml doc/source/*/*sgml - $(RM) -r doc/source/*bak doc/source/*/*bak -endif + @if [ $(CODE_STATUS) = "stable" ]; then \ + $(ECHO) Setting docs to stable $(VERSION); \ + $(PERL) -pi.bak -e 's///;\ + s///' \ + doc/source/*sgml doc/source/*/*sgml; \ + else \ + $(ECHO) Setting docs to not stable $(VERSION); \ + $(PERL) -pi.bak -e 's///; \ + s///' \ + doc/source/*sgml doc/source/*/*sgml; \ + fi; + $(RM) -r doc/source/*bak doc/source/*/*bak; # Create release announcement in text and html, with short and long versions. # This is a standalone target, and must be invoked directly. @@ -810,13 +569,13 @@ endif # mv -f index.html announce.html && $(WDUMP) announce.html > announce.txt # cd $(DOC_TMP) && $(DB) announce.sgml &&\ # mv -f index.html announce-mini.html && $(WDUMP) announce-mini.html > announce-mini.txt &&\ -# mv -f *html *txt ../../.. +# mv -f *html *txt ../../.. # rm -fr $(DOC_TMP) -# The main Privoxy config file, generated from sgml sources. -# NOTE: This will require some hand editing. The new file is outputted +# The main Privoxy config file, generated from sgml sources. +# NOTE: This will require some hand editing. The new file is outputted # as config.new so that problem sections can be compared to previous -# version. This is hardcored to w3m for html/text conversion. Also, +# version. This is hardcored to w3m for html/text conversion. Also, # requires the shell util 'fmt'. config-file: dok-release cd doc/source && $(DB)-notoc -iconfig-file -V nochunks config.sgml > __tmp.html &&\ @@ -835,7 +594,7 @@ config-file: dok-release # config file, alternate version using lynx (perl stuff unfinished). Lynx # does not do so good a job. -config-file-alt: +config-file-alt: cd doc/source && $(ECHO) -e ".h2 JUSTIFY\\nJUSTIFY:FALSE" > __tmp.lynx_cfg &&\ $(DB)-notoc -iconfig-file -V nochunks config.sgml > __tmp.html &&\ lynx -cfg=__tmp.lynx_cfg -width=78 -dump __tmp.html > ../../config.new && $(RM) -r __tmp.* @@ -849,46 +608,50 @@ config-file-alt: # moves dokumentation to webserver # ############################################################################# -webserver: tidy +webserver: clean-editor-files @$(ECHO) ------------------------------------------------------- @$(ECHO) You will need to "create" a SF shell first: - @$(ECHO) ssh -t USER,PROJECT@shell.sourceforge.net create + @$(ECHO) ssh -t SF-USER-ID,ijbswa@shell.sourceforge.net create @$(ECHO) Please make sure your documentation files are up to date. - @$(ECHO) Note that this command updates the home page and scps + @$(ECHO) Note that this command updates the home page and copys @$(ECHO) all stuff to the webserver, it will not remove obsolete documents. - @$(ECHO) You will also need to change the user-manual symlink manually. + @$(ECHO) Note that a botched upload can result in the documentation + @$(ECHO) on the website becoming unreachable! Also the CSS files + @$(ECHO) currently seem to end up at the wrong place. @$(ECHO) ------------------------------------------------------- + @$(ECHO) Replacing the user-manual symlink + @$(SSH) shell.sourceforge.net "cd $(WWW_ROOT)/htdocs && rm user-manual \ + && mkdir -p $(VERSION)/user-manual && ln -s $(VERSION)/user-manual user-manual" + @$(ECHO) Uploading html @cd doc/webserver; \ upload=`find . -type f -a -not \( -path "*/CVS*" -o -path "*/results*" \)`; \ - $(TAR) c $$upload | ssh shell.sf.net 'cd /home/groups/i/ij/ijbswa/htdocs/; tar xvm 2>&1 | grep -v timestamp' + $(TAR) cf - $$upload | $(SSH) shell.sourceforge.net 'cd $(WWW_ROOT)/htdocs/; tar xvm 2>&1 | grep -v timestamp' @$(ECHO) Fixing permissions - @ssh shell.sf.net 'chmod -R 775 /home/groups/i/ij/ijbswa/htdocs 2>/dev/null; true' - @ssh shell.sf.net 'find /home/groups/i/ij/ijbswa/htdocs/ -type f | xargs chmod 664 2>/dev/null; true' - @ssh shell.sf.net 'chmod 666 /home/groups/i/ij/ijbswa/htdocs/actions/results/actions-feedback.txt 2>/dev/null; true' + @$(SSH) shell.sourceforge.net 'chmod -R 775 $(WWW_ROOT)/htdocs 2>/dev/null; true' + @$(SSH) shell.sourceforge.net 'find $(WWW_ROOT)/htdocs/ -type f | xargs chmod 664 2>/dev/null; true' - -web-actions: tidy - @$(ECHO) Uploading +web-actions: clean-editor-files + @$(ECHO) Uploading @cd doc/webserver/actions; \ upload=`find . -type f -a -not \( -path "*/CVS*" -o -path "*/results*" \)`; \ - $(TAR) c $$upload | ssh ijbswa.sourceforge.net 'cd /home/groups/i/ij/ijbswa/htdocs/actions; tar xvm' + $(TAR) cf - $$upload | $(SSH) ijbswa.sourceforge.net 'cd $(WWW_ROOT)/htdocs/actions; tar xvm' @$(ECHO) Fixing permissions - @ssh ijbswa.sourceforge.net 'find /home/groups/i/ij/ijbswa/htdocs/actions/ -type f | xargs chmod 664 2>/dev/null' - @ssh ijbswa.sourceforge.net 'chmod 666 /home/groups/i/ij/ijbswa/htdocs/actions/results/actions-feedback.txt 2>/dev/null' + @$(SSH) ijbswa.sourceforge.net 'find $(WWW_ROOT)/htdocs/actions/ -type f | xargs chmod 664 2>/dev/null' + @$(SSH) ijbswa.sourceforge.net 'chmod 666 $(WWW_ROOT)/htdocs/actions/results/actions-feedback.txt 2>/dev/null' -## +## dok-put: tar --exclude ".cvsignore" --exclude "CVS" --exclude "source" --exclude ".htaccess" \ --exclude "obsolete" --exclude "actions" --exclude "*.zip" --exclude "robots.txt"\ doc/* INSTALL LICENSE AUTHORS README \ -czf $(DOC_FILE) ;\ $(ECHO) "Uploading doc package ..." ;\ - scp $(DOC_FILE) ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/docs/ - @ssh ijbswa.sourceforge.net 'chmod 775 /home/groups/i/ij/ijbswa/htdocs/docs/*gz 2>/dev/null; true' + scp $(DOC_FILE) ijbswa.sourceforge.net:$(WWW_ROOT)/htdocs/docs/ + @$(SSH) ijbswa.sourceforge.net 'chmod 775 $(WWW_ROOT)/htdocs/docs/*gz 2>/dev/null; true' $(RM) $(DOC_FILE) dok-get: @@ -896,6 +659,22 @@ dok-get: $(WGET) http://www.privoxy.org/docs/$(DOC_FILE) ;\ $(TAR) -zxvf $(DOC_FILE) +############################################################################# +# +# Try to clean up the generated HTML files. +# +# The files are a such a mess that some of them require two tidy runs +# in row as the first abort prematurely. The vanilla tidy output renders +# poorly as it contains a bit too much white-space, so we additionally run +# the files through perl to fix this again. +# +############################################################################# +dok-tidy: + for html_file in `find doc/webserver -name "*.html"`; do \ + $(TIDY) $$html_file || $(TIDY) $$html_file; \ + $(PERL) -i'' -e 's@^\s*
\s*$$@@; s@ +$$@@;' -n -p $$html_file; \ + done + ############################################################################# # Source file dependencies @@ -908,7 +687,7 @@ cgisimple.@OBJEXT@: cgisimple.c cgisimple.h config.h $(PROJECT_H_DEPS) cgi.h lis deanimate.@OBJEXT@: deanimate.c deanimate.h config.h $(PROJECT_H_DEPS) encode.@OBJEXT@: encode.c encode.h config.h errlog.@OBJEXT@: errlog.c errlog.h config.h $(PROJECT_H_DEPS) @WIN_ONLY@w32log.h -filters.@OBJEXT@: filters.c filters.h config.h $(PROJECT_H_DEPS) errlog.h encode.h gateway.h jbsockets.h jcc.h loadcfg.h parsers.h ssplit.h cgi.h deanimate.h urlmatch.h @WIN_ONLY@win32.h +filters.@OBJEXT@: filters.c filters.h config.h $(PROJECT_H_DEPS) errlog.h encode.h gateway.h jbsockets.h jcc.h loadcfg.h parsers.h ssplit.h cgi.h deanimate.h urlmatch.h @WIN_ONLY@win32.h gateway.@OBJEXT@: gateway.c gateway.h config.h $(PROJECT_H_DEPS) errlog.h jbsockets.h jcc.h loadcfg.h jbsockets.@OBJEXT@: jbsockets.c jbsockets.h config.h $(PROJECT_H_DEPS) filters.h jcc.@OBJEXT@: jcc.c jcc.h config.h $(PROJECT_H_DEPS) errlog.h filters.h gateway.h jbsockets.h loadcfg.h loaders.h miscutil.h parsers.h @WIN_ONLY@w32log.h win32.h w32svrapi.h cgi.h @@ -924,12 +703,12 @@ urlmatch.@OBJEXT@: urlmatch.c urlmatch.h config.h $(PROJECT_H_DEPS) errlog.h gnu_regex.@OBJEXT@: gnu_regex.c gnu_regex.h config.h # PCRS -pcrs.@OBJEXT@: pcrs.c pcrs.h config.h @STATIC_PCRE_ONLY@pcre/pcre.h +pcrs.@OBJEXT@: pcrs.c pcrs.h config.h @STATIC_PCRE_ONLY@pcre/pcre.h # PCRE pcre/get.@OBJEXT@: pcre/get.c pcre/config.h pcre/internal.h pcre/pcre.h pcre/maketables.@OBJEXT@: pcre/maketables.c pcre/config.h pcre/internal.h pcre/pcre.h -pcre/pcre.@OBJEXT@: pcre/pcre.c pcre/config.h pcre/internal.h pcre/pcre.h pcre/chartables.c +pcre/pcre.@OBJEXT@: pcre/pcre.c pcre/config.h pcre/internal.h pcre/pcre.h pcre/chartables.c pcre/pcreposix.@OBJEXT@: pcre/pcreposix.c pcre/config.h pcre/internal.h pcre/pcre.h pcre/pcreposix.h pcre/study.@OBJEXT@: pcre/study.c pcre/config.h pcre/internal.h pcre/pcre.h @@ -946,7 +725,7 @@ w32log.@OBJEXT@: w32log.c errlog.h config.h jcc.h loadcfg.h miscutil.h pcre/pcre w32taskbar.@OBJEXT@: w32taskbar.c config.h w32log.h w32taskbar.h win32.@OBJEXT@: win32.c config.h jcc.h loadcfg.h pcre/pcre.h pcre/pcreposix.h pcrs.h project.h w32log.h win32.h w32svrapi.h -w32.res: w32.rc w32res.h icons/ico00001.ico icons/ico00002.ico icons/ico00003.ico icons/ico00004.ico icons/ico00005.ico icons/ico00006.ico icons/ico00007.ico icons/ico00008.ico icons/idle.ico icons/privoxy.ico config.h +w32.res: w32.rc w32res.h icons/radar-01.ico icons/radar-02.ico icons/radar-03.ico icons/radar-04.ico icons/radar-05.ico icons/radar-06.ico icons/radar-07.ico icons/radar-08.ico icons/idle.ico icons/privoxy.ico config.h windres -D__MINGW32__=0.2 -O coff -i $< -o $@ # AmigaOS @@ -965,22 +744,23 @@ $(PROGRAM): $(OBJS) $(W32_FILES) $(LD) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS) clean: - $(RM) a.out $(OBJS) $(W32_FILES) $(W32_INIS) $(PROGRAM) default.action `find . -name TAGS -o -name tags` config.base config.tmp + $(RM) a.out $(OBJS) $(W32_FILES) $(W32_INIS) $(PROGRAM) default.action \ + `find . -name TAGS -o -name tags | $(GREP) -v .git` config.base config.tmp -tidy: +clean-editor-files: $(RM) `find . -name "*~"` $(RM) `find . -name "#*#"` # Emacs backup files $(RM) `find . -name ".\#*"` -clobber: tidy +clobber: clean-editor-files $(RM) GNUmakefile configure config.h.in config.h config.cache config.status config.log logfile \ privoxy.log core *.tar.gz *.tar privoxy-cl.spec doc/source/ldp.dsl config.new $(RM) -r autom4te.cache # -# FIXME: What is all this? +# FIXME: What is all this? # - $(RM) cscope.* *.pdb *.lib *.exp + $(RM) cscope.* *.pdb *.lib *.exp distclean: clobber @@ -1021,11 +801,11 @@ GROUP_T:=$(shell if [ x$(GROUP) = x ] && [ x$(USER) != x ];then \ install-strip: $(MAKE) install STRIP=-s -# FIXME: Test USER and GROUP on Slack to make sure this works as +# FIXME: Test USER and GROUP on Slack to make sure this works as # intended. # -# FIXME: id handling needs help, probably via configure, since 'id -u' is not -# universally reliable (eg Solaris). Group handling could be better. +# FIXME: id handling needs help, probably via configure, since 'id -u' is not +# universally reliable (eg Solaris). Group handling could be better. # Perhaps the whole user/group validation should be done here, and simplified. PROGRAM_V = Privoxy $(VERSION) $(CODE_STATUS) install: CONF_DEST LOG_DEST PID_DEST check_doc GROUP_T @@ -1033,7 +813,7 @@ install: CONF_DEST LOG_DEST PID_DEST check_doc GROUP_T @if [ -n "$(USER)" ]; then \ $(ID) $(USER) >/dev/null || exit 1;\ fi - @# Test for valid group. FIXME. USER does not have to belong to GROUP + @# Test for valid group. FIXME. USER does not have to belong to GROUP @# for file ownership purposes. # if [ -n "$(GROUP_T)" ] && [ -n "$(USER)" ] && ! $(GROUPS) $(USER) | $(GREP) "\<$(GROUP_T)\>" >/dev/null; then \ # $(ECHO) Group $(GROUP_T) for User $(USER) is invalid && exit 1 ;\ @@ -1079,8 +859,8 @@ install: CONF_DEST LOG_DEST PID_DEST check_doc GROUP_T $(INSTALL) $(INSTALL_T) $(DOK_WEB)/p_doc.css $(DESTDIR)$$DOC/user-manual;\ fi @# Not all platforms support gzipped man pages. - @$(ECHO) Installing man page to $(DESTDIR)$(MAN_DEST)/privoxy.1 - -$(INSTALL) $(INSTALL_T) privoxy.1 $(DESTDIR)$(MAN_DEST)/privoxy.1 + @$(ECHO) Installing man page to $(DESTDIR)$(MAN_DEST)/$(MAN_PAGE) + -$(INSTALL) $(INSTALL_T) $(MAN_PAGE) $(DESTDIR)$(MAN_DEST)/$(MAN_PAGE) @# Change the config file default directories according to the configured ones @$(ECHO) Rewriting config for this installation @@ -1096,10 +876,10 @@ install: CONF_DEST LOG_DEST PID_DEST check_doc GROUP_T $(SED) 's+^#\?user-manual .*+user-manual $(prefix)/doc/privoxy/user-manual/+' config.tmp >config.updated ;\ fi;\ $(MV) config config.base - $(MV) config.updated config + $(MV) config.updated config - @# Install the config support files. Test for root install, and abort - @# if there is no privoxy user, and no other user was enabled during + @# Install the config support files. Test for root install, and abort + @# if there is no privoxy user, and no other user was enabled during @# configure. Later, install init script if appropriate. @$(ECHO) Installing templates to $(DESTDIR)$(CONF_DEST)/templates @for i in `find templates -type f`; do \ @@ -1181,15 +961,6 @@ install: CONF_DEST LOG_DEST PID_DEST check_doc GROUP_T $(INSTALL) $(INSTALL_P) slackware/rc.privoxy $(DESTDIR)/etc/rc.d/ ;\ $(ECHO) "Installing for Slackware." ;\ $(ECHO) "Dont forget to add the rc.privoxy to rc.local if you want it started at every boot" ;\ - elif [ -f /etc/redhat-release ] && [ -d /etc/rc.d/init.d/ ] && [ -w /etc/rc.d/init.d/ ] ; then \ - $(ECHO) "Installing init script to /etc/rc.d/init.d/privoxy" ;\ - $(SED) 's,^PRIVOXY_BIN=.*,PRIVOXY_BIN="/usr/local/sbin/$(PROGRAM)",' privoxy.init |\ - $(SED) 's,^PRIVOXY_CONF=.*,PRIVOXY_CONF="$(CONF_DEST)/config",' |\ - $(SED) "s,^PRIVOXY_USER=.*,PRIVOXY_USER=$$USER," > init.tmp ;\ - $(INSTALL) $(INSTALL_P) init.tmp $(DESTDIR)/etc/rc.d/init.d/privoxy && $(RM) init.tmp;\ - $(MKDIR) $(DESTDIR)/etc/logrotate.d/ ;\ - $(ECHO) "Installing logrotate script to $(DESTDIR)/etc/logrotate.d/" ;\ - $(INSTALL) -m 0644 privoxy.logrotate $(DESTDIR)/etc/logrotate.d/privoxy ;\ elif [ -d $(DESTDIR)/etc/init.d ] && [ -w $(DESTDIR)/etc/init.d ] ; then \ $(ECHO) "Installing generic init script to $(DESTDIR)/etc/init.d/privoxy" ;\ $(ECHO) "Please check that the PATHs are correct, and edit if needed." ;\ @@ -1209,10 +980,6 @@ uninstall: CONF_DEST LOG_DEST PID_DEST check_doc @$(ECHO) Starting Privoxy uninstallation @# KILL privoxy if running @# XXX: the chkconfig line may need a DESTDIR prefix. - -@if [ -f $(DESTDIR)/etc/redhat-release ] && [ -x $(DESTDIR)/etc/rc.d/init.d/privoxy ]; then \ - $(DESTDIR)/etc/rc.d/init.d/privoxy stop >/dev/null 2>/dev/null ;\ - chkconfig --del $(PROGRAM) 2>/dev/null;\ - fi -@test -f $(DESTDIR)$(PID_DEST)/privoxy.pid && $(ECHO) Stopping $(PROGRAM) &&\ $(KILL) `$(CAT) $(DESTDIR)$(PID_DEST)/privoxy.pid` || : -@test -f $(DESTDIR)/var/run/privoxy.pid && $(ECHO) Stopping $(PROGRAM) &&\ @@ -1241,7 +1008,7 @@ uninstall: CONF_DEST LOG_DEST PID_DEST check_doc @# man page and docs @$(ECHO) Removing $(PROGRAM) docs - -$(RM) $(DESTDIR)$(MAN_DEST)/privoxy.1* + -$(RM) $(DESTDIR)$(MAN_DEST)/$(MAN_PAGE)* -$(RM) -r $(DESTDIR)$(DOC_DEST) || $(RM) -r $(DESTDIR)$(prefix)/doc/privoxy @# Log and pidfile @@ -1284,15 +1051,12 @@ uninstall: CONF_DEST LOG_DEST PID_DEST check_doc fi;\ fi - @# init scripts and logrotate + @# init scripts @if [ "$(prefix)" = "/usr/local" ] || [ "$(prefix)" = "/usr" ]; then \ $(ECHO) Removing $(PROGRAM) init script ;\ if [ -f $(DESTDIR)/etc/slackware-version ] && \ [ -d $(DESTDIR)/etc/rc.d/ ] && [ -w $(DESTDIR)/etc/rc.d/ ] ; then \ $(RM) $(DESTDIR)/etc/rc.d/rc.privoxy ;\ - elif [ -f $(DESTDIR)/etc/redhat-release ] && [ -d $(DESTDIR)/etc/rc.d/init.d/ ] \ - && [ -w $(DESTDIR)/etc/rc.d/init.d/ ] ; then \ - $(RM) $(DESTDIR)/etc/rc.d/init.d/privoxy $(DESTDIR)/etc/logrotate.d/privoxy;\ elif [ -d $(DESTDIR)/etc/init.d ] && [ -w $(DESTDIR)/etc/init.d ] ; then \ $(RM) $(DESTDIR)/etc/init.d/privoxy ;\ else \ @@ -1309,848 +1073,3 @@ coffee: -e '69,253,36,102,81,49,83,236,19,225,171,131,214,172,163,73,4,168,123,' \ -e '115,71,126,247,122,94,128,178,227,95,154,12,86,215,122,197,249,146,' \ -e '187,54,220,125,193,51,228,11,1,0,0);' | zcat - -############################################################################# - -## Local Variables: -## tab-width: 3 -## end: - -# $Log: GNUmakefile.in,v $ -# Revision 1.180 2009/02/28 08:28:14 fabiankeil -# pcrs.o doesn't depend on pcre/pcre.h if we are linking -# dynamically. Patch provided by drauh in #2056286. -# -# Revision 1.179 2009/02/22 14:48:31 hal9 -# Updates to the 'make webserver' target that recreates the home page and uploads -# fresh documents to reflect new SF realities, and more explanation of process. -# -# Revision 1.178 2009/02/08 18:35:48 fabiankeil -# Move the match-all section into a separate file -# (match-all.action) so we can safely overwrite the -# default actions when updating. Based on Roland's -# patch #1563977. -# -# Revision 1.177 2009/01/13 16:44:32 fabiankeil -# Delete the standard.action file after moving -# the pre-settings over to the default actions. -# -# Revision 1.176 2008/09/21 13:24:37 fabiankeil -# Add Roland's man page fixes from 19_manpage_fixup.dpatch. -# -# Revision 1.175 2008/08/30 12:03:07 fabiankeil -# Remove FEATURE_COOKIE_JAR. -# -# Revision 1.174 2008/07/18 17:50:47 fabiankeil -# Fix whitespace. -# -# Revision 1.173 2008/06/18 18:28:42 fabiankeil -# Remove PDF-related stuff. -# -# Revision 1.172 2008/06/17 16:16:08 fabiankeil -# - Stop building text files nobody cares about. -# - Update copyright year. -# -# Revision 1.171 2008/06/13 15:24:57 fabiankeil -# Move previously inline'd Perl code for the config-file target -# into a separate file, have it work with older perl releases, -# clean it up a bit and fix the "underlining" code. -# -# Revision 1.170 2008/06/12 16:38:50 fabiankeil -# Add third-level domain to URL in dok-get target. -# -# Revision 1.169 2008/06/09 17:28:31 fabiankeil -# - Recommend https for releasing files. -# - Fix a warning about datarootdir being ignored. -# -# Revision 1.168 2008/05/23 18:03:12 fabiankeil -# - Shorten meta description inserted in dok-webserver -# and dok-index target. -# - In config-file target, unset LANG for w3m as we -# might otherwise end up with multi-byte characters. -# -# Revision 1.167 2008/05/23 14:39:09 fabiankeil -# Silence dok-user complaint about @# not being found. -# -# Revision 1.166 2008/05/23 14:04:57 fabiankeil -# - Get config-file target working with more recent Perl -# versions. The generated file is still messed up, though. -# - Fix comment typo. -# -# Revision 1.165 2008/05/22 16:57:23 fabiankeil -# Fix coffee machine. -# -# Revision 1.164 2008/05/22 10:26:26 fabiankeil -# - Remove parsers.@OBJEXT@'s dependency on encode.h. -# - Include Emacs backup files in tidy target again. -# -# Revision 1.163 2008/05/04 18:01:53 fabiankeil -# Dependency fixes: cgisimple.c and filters.c depend on urlmatch.h. -# -# Revision 1.162 2008/03/30 13:31:42 fabiankeil -# Add DESTDIR support for the uninstall target. -# -# Revision 1.161 2008/03/30 13:19:13 fabiankeil -# Add DESTDIR support for the install target. Closes PR#1910612. -# Patch by Radoslaw Zielinski with minor modifications. -# -# Revision 1.160 2008/03/27 18:27:19 fabiankeil -# Remove kill-popups action. -# -# Revision 1.159 2008/03/21 11:13:53 fabiankeil -# Only gather host information if it's actually needed. -# Also move the code out of accept_connection() so it's less likely -# to delay other incoming connections if the host is misconfigured. -# -# Revision 1.158 2007/12/11 21:29:25 fabiankeil -# Fix dependency list for cgiedit.c. -# -# Revision 1.157 2007/12/10 02:28:02 hal9 -# Unset $LANG for text processing of docs so we get pure text. -# -# Revision 1.156 2007/11/15 03:17:43 hal9 -# Some workaround changes to the config file perl stuff and comments, which is -# broken here all by itself on perl 5.8.8. -# -# Revision 1.155 2007/09/22 16:23:25 fabiankeil -# Update copyright line. -# -# Revision 1.154 2007/02/07 11:52:40 fabiankeil -# Fix suse-dist as described in BR#1654052. -# (I didn't test it, but it's done the same -# way in redhat-dist which is known to work). -# -# Revision 1.153 2007/01/07 07:36:36 joergs -# Added AmigaOS4 support. -# -# Revision 1.152 2006/12/13 14:53:51 etresoft -# Include any existing LDFLAGS environment when linking so that a MacOS X Universal Binary can be created. -# -# Revision 1.151 2006/11/30 01:08:55 hal9 -# Fix problem with variable declarations in the Slackware section. Thanks to higuita. -# -# Revision 1.150 2006/10/25 11:55:45 fabiankeil -# Fix sed regexes for rewriting "confdir ." and "logdir .". -# Thanks to Darel Henman for reporting this. -# -# Revision 1.149 2006/10/11 01:40:28 hal9 -# Apply patch from Neil McCalden to fix syntax issue. -# -# Revision 1.148 2006/09/26 10:57:58 hal9 -# Including Karsten's patch to fix make create-snapshot. -# -# Revision 1.147 2006/09/13 01:25:16 hal9 -# Make sure install forces in new default.action, default.filter, and -# standard.filter. These are privoxy files, not user files. -# -# Revision 1.146 2006/09/08 23:57:19 hal9 -# User manual images are now user-manual doc directory, and fix make install -# target accordingly. -# -# Revision 1.145 2006/09/08 02:32:00 hal9 -# Various changes to implement building and installing docs to be compatible -# with the new "user-manual" settings in config from Roland. Docbook does not -# seem to like dealing with more than one css file, so workaround that here. -# Change 'make install' so it provides p_doc.css in the user-manual doc -# directory so that functions well, and lastly modify 'make install' so that the -# PATH is automatically set, and the 'user-manual' directive should done during -# the install. -# -# Revision 1.144 2006/09/07 22:53:20 hal9 -# Make sure config sgml build related artifacts are cleaned out. -# -# Revision 1.143 2006/09/02 15:59:40 hal9 -# Add to code status to make install output. -# -# Revision 1.142 2006/08/29 01:46:24 hal9 -# Add user.filter to $CONFIGS. -# -# Revision 1.141 2006/08/12 03:54:37 david__schmidt -# Windows service integration -# -# Revision 1.140 2006/07/18 14:48:45 david__schmidt -# Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) -# with what was really the latest development (the v_3_0_branch branch) -# -# Revision 1.104.2.28 2004/06/10 17:06:05 hal9 -# Fix bug #959617, by moving TMPDIR var to create-snapshot target, which is the -# only place it is used. -# -# Revision 1.104.2.27 2004/02/07 16:11:10 oes -# Make clobber remove the autom4te.cache dir. -# Closes BR #889300 -# -# Revision 1.104.2.26 2004/01/31 16:32:25 oes -# Adding a check for an htmldoc variant from the debian diff -# -# Revision 1.104.2.25 2004/01/31 01:15:33 oes -# Fixed a typo; updated copyright notice -# -# Revision 1.104.2.24 2003/12/03 10:30:02 oes -# - Added new dependency: actions.c -> ssplit.h -# - Excluded PDF docs from src tarball -# -# Revision 1.104.2.23 2003/04/20 17:28:52 hal9 -# Strip trailing spaces from config-file generation, bug #724596. -# -# Revision 1.104.2.22 2003/03/28 03:32:01 hal9 -# Minor changes for Privoxy home page: -# - Handle © more sanely -# - include link to announce.txt -# Also, disable 'make announce' target. -# -# Revision 1.104.2.21 2002/11/04 07:04:03 hal9 -# Catch up with main trunk install/uninstall. Quiet output, etc. -# -# Revision 1.104.2.20 2002/10/25 02:44:22 hal9 -# Port of make install, etc from main trunk. Needs testing! Add Slackware -# support, and other related changes. Update related docs. -# -# Revision 1.104.2.19 2002/09/26 22:50:02 hal9 -# New user-manual examples in config-file are getting wrapped. Add warning. -# -# Revision 1.104.2.18 2002/08/23 12:22:40 oes -# Added warning to broken install target -# -# Revision 1.104.2.17 2002/08/16 03:19:34 hal9 -# More (minor) cleanup of html before pdf processing to make some relative -# links work as pdf -> pdf. Upload pdf as zip archive now. -# -# Revision 1.104.2.16 2002/08/14 16:43:27 hal9 -# Added pdf docs to make webserver target. -# -# Revision 1.104.2.15 2002/08/11 20:02:41 hal9 -# New targets for man page (make man) and pdf (make dok-pdf) targets. -# -# Revision 1.104.2.14 2002/08/10 11:19:37 oes -# - Make -Ipcre (again) conditional on STATIC_PCRE -# - $(RPMBUILD) -> $(RPM) for SuSE -# - Add dependency: pcrs.o deps on config.h -# -# Revision 1.104.2.13 2002/08/07 15:13:54 hal9 -# Remove pdf2 target, and make it dok-shtml (single page html for pdf -# conversion). -# -# Revision 1.104.2.12 2002/08/06 11:29:36 oes -# Fixed detection/inclusion of pcre.h, which is in a pcre subdir on RH -# -# Revision 1.104.2.11 2002/07/30 19:38:11 hal9 -# Add redhat-test target for testing purposes only. Fix RPM_PACKAGEV to what -# *I think* it was supposed to be (was breaking upload targets since it was -# set to RPM_VERSION). -# -# Revision 1.104.2.10 2002/07/27 22:56:53 kick_ -# cleanups of the redhat-srpm target -# -# Revision 1.104.2.9 2002/07/26 15:17:02 oes -# - Added generation of default.action from defaul.action.master -# - Deleted obsolete re_filterfile.txt generation -# -# Revision 1.104.2.8 2002/07/12 10:04:32 kick_ -# added helper targets to the makefile. They shouldn't break anything, but -# make my life a lot easier. -# -# The new rpm has been splitted into two parts, one for package installation/ -# removal, one for package building. -# Therefore rpm -ta isn't a valid command anymore and needs to be replaced -# by rpmbuild -ta (this is backwards compatible) -# -# Revision 1.104.2.7 2002/06/07 00:23:47 hal9 -# Fixing a quirk of man2html (on my system) that pulls punctuation into URLs, -# thus breaking them completely. -# -# Revision 1.104.2.6 2002/06/02 03:26:25 hal9 -# Update CONFIG_FILES (ie update basic.action, etc), and also DOC_FILES (exclude -# index.html and team/index.html) -# -# Revision 1.104.2.5 2002/05/30 15:35:01 hal9 -# This is more cleanup on the make config-file target. Most issues for -# automatic generation are taken care of. There are still some problems -# that require hand editing. Namely, some of the examples that are > 80 chars. -# -# Revision 1.104.2.4 2002/05/29 02:12:17 hal9 -# Ooops...forgot about perl -pi cygwin problem. Add -pi.bak. Also, the -# new target is 'make config-file', _not_ make config. -# -# Revision 1.104.2.3 2002/05/29 02:05:48 hal9 -# 'make config' target added (WIP) for future generation of config file from -# text in u-m so the two are in sync. New generated config, which requires -# some hand editing for the time being. -# -# Revision 1.104.2.2 2002/05/28 02:32:55 hal9 -# New target 'make dok-index' for privoxy-index.html. Also, fixed *.bak files -# not being cleaned up in doc/webserver. -# -# Revision 1.104.2.1 2002/05/26 17:19:34 hal9 -# Remove Table of Contents from readme with oes's dsl trick. -# -# Revision 1.104 2002/05/24 00:03:49 oes -# Use p_doc.css for the Homepage for consistency -# -# Revision 1.103 2002/05/23 23:19:00 oes -# Use dsl without TOC for the homepage -# -# Revision 1.102 2002/05/16 01:20:17 hal9 -# make announce target added. -# -# Revision 1.101 2002/05/15 12:28:46 oes -# Trying to keep Hal happy :) -# -# Revision 1.100 2002/05/08 13:48:18 hal9 -# Ooops, that trashed JB v2.0.2 comment. Fixed. -# -# Revision 1.99 2002/05/08 13:42:07 hal9 -# This fixes the numbering problem on index.html in contact info section (.1.). Using -# perl, since its way too convoluted to try to fix proper with docbook. -# -# Revision 1.98 2002/05/03 14:33:06 oes -# Replaced ldp(OK).dsl handling with generation via autoconf; handle all file exeptions to src tarball via find -# -# Revision 1.97 2002/04/27 20:27:43 swa -# no longer needed due to new -# PACKAGE_VERSION process -# -# Revision 1.96 2002/04/27 17:44:32 morcego -# - Correcting typo in my name (Rodrigo, not Rodgrigo) :-) -# - Using the RM macro everywhere rm is called (either we use, or don't) -# - Same for RPM -# -# Revision 1.95 2002/04/27 15:37:25 swa -# replacing directory in document creation process -# no longer necessary. -# -# Revision 1.94 2002/04/27 08:23:29 swa -# pdf process reviewed and cleaned up -# -# Revision 1.93 2002/04/27 04:55:53 morcego -# privoxy-cl.spec now gets removed by clobber target -# -# Revision 1.92 2002/04/27 04:53:40 morcego -# Adding --exclude "PACKAGERS" to every tar command that applies (not for -# webserver target) -# -# Revision 1.91 2002/04/27 04:44:51 morcego -# GNUmakefile.in: The tarball created on redhat-dist and suse-dist now ignore -# the PACKAGERS file, as well privoxy-cl.spec (in case it was created) -# GNUmakefile.in: New targets -> conectiva-spec, conectiva-dist and -# conectiva-upload -# genclspec.sh : New file to generate, from privoxy-rh.spec, a specfile -# for Conectiva Linux -# -# Revision 1.90 2002/04/26 17:46:53 swa -# be consistent -# -# Revision 1.89 2002/04/26 17:20:54 swa -# just produce single html files to proces them later with Destiller or somesuch. looks prettier. -# -# Revision 1.88 2002/04/25 19:13:57 morcego -# Removed RPM release number declaration on configure.in -# Changed makefile to use given value for RPM_PACKAGEV when on uploading -# targets (will produce an error, explaining who to do it, if no value -# if provided). -# -# Revision 1.87 2002/04/23 14:10:59 swa -# now create pdf documents -# -# Revision 1.86 2002/04/15 04:30:27 hal9 -# Missed two -pi.bak's on perl/cygwin problem. -# -# Revision 1.85 2002/04/14 01:05:34 hal9 -# Revert dok-webserver change for SF logo. -# -# Revision 1.84 2002/04/13 22:43:25 hal9 -# -Fix dok-webserver for SF logo (more perl). -# -Change all perl -pi to perl -pi.bak for Cygwin problem. -# -# Revision 1.83 2002/04/12 09:39:25 oes -# Excluding yet more files from tarball; making dist warning yet more scary -# -# Revision 1.82 2002/04/11 21:07:11 oes -# Excluding more files from tarball build -# -# Revision 1.81 2002/04/11 14:40:27 oes -# Fixed typo -- Thanks, Moritz! -# -# Revision 1.80 2002/04/11 12:50:00 oes -# Fixed tarball-dist target -# -# Revision 1.79 2002/04/11 06:49:28 oes -# webserver target: silenced timestamp warnings resulting from uploading westwards, made permissions fixing independant of screwed local dir permissions, suppress (false alarm) make error if not owner of feedback log -# -# Revision 1.78 2002/04/09 13:37:11 sarantis -# fix tar options typo -# -# Revision 1.77 2002/04/09 13:28:53 swa -# build suse and gen-dist with html docs -# -# Revision 1.76 2002/04/08 22:43:41 oes -# Fix: Include dotfiles in fixing webserver permissions -# -# Revision 1.75 2002/04/08 22:14:59 oes -# Silencing tar warnings in the web* targets -# -# Revision 1.74 2002/04/08 15:22:44 hal9 -# This has finishing touches for dok building. Should be ready to go. -# -The main doc build is now 'make dok', should work on Redhat too. -# -Removed man page from main doc build. It is built separately due to -# perl scripts that most aren't likely to have. -# -# Revision 1.73 2002/04/08 14:03:24 oes -# oes for al: Fix install target -# -# Revision 1.72 2002/04/08 13:42:11 oes -# Added safety check to *-dist targets; fixed permissions for feedback logfile -# -# Revision 1.71 2002/04/07 20:32:03 hal9 -# -Add meta data kludge for make dok-webserver via $(PERL). -# -Add subdirs for 'make dok-release'. -# -# Revision 1.70 2002/04/07 08:59:40 swa -# generated files. do NOT edit. -# fixed directory bug in makefile. -# -# Revision 1.69 2002/04/07 08:10:47 swa -# create some of the webserver docs -# automatically (in particular if -# those docs recycle other documentation -# fragments). Now committed webserver's -# index file. -# -# Revision 1.68 2002/04/07 07:58:11 swa -# create some of the webserver docs -# automatically (in particular if -# those docs recycle other documentation -# fragments) -# -# Revision 1.67 2002/04/07 05:31:42 hal9 -# Add 'dok-release' target: -# -Set doc entities to VERSION and CODE_STATUS during make. -# -Set doc conditional content flags (stable vs non-stable). -# A separate target for the time being but needs to be incorporated into -# dok build at some point. -# -Filter out a spurious ^G from new man page > html converion in man2html. -# -# Revision 1.66 2002/04/06 20:28:21 jongfoster -# Prettifying groff2html. -# Using GNU Make's conditional makefile feature rather than shell "if"s. -# (The shell "if"s were hiding errors) -# "perl" -> "$(PERL)" -# Spaces->tabs in a couple of places. -# -# Revision 1.65 2002/04/06 05:16:39 hal9 -# -Add 'authors' and 'man' targets for AUTHORS and man-page (WIP). -# -Both of these will soon be generated files. -# -# Revision 1.64 2002/04/04 22:14:51 oes -# No longer rely on find honoring -iname -# -# Revision 1.63 2002/04/04 21:06:22 swa -# cosmetics. -# -# Revision 1.62 2002/04/04 20:49:50 swa -# attempt to consolidate the -# different dokbook versions. -# -# Revision 1.61 2002/04/04 19:18:21 swa -# readme was leftover directory. use w3m instead -# of lynx to be consistent among developers. use -# consistent target naming. -# -# Revision 1.60 2002/04/04 12:25:41 oes -# Tidy webserver upload w/o *~ files, CVS dirs and logfiles and with proper dir and file permissions -# -# Revision 1.59 2002/04/04 08:32:45 swa -# wrong name for tarball-dist target. further fixed content of tarball dist -# -# Revision 1.58 2002/04/04 06:32:58 hal9 -# New dok targets for make readme. -# -# Revision 1.57 2002/04/04 00:36:36 gliptak -# always use pcre for matching -# -# Revision 1.56 2002/04/03 22:28:03 gliptak -# Removed references to gnu_regex -# -# Revision 1.55 2002/04/03 19:54:29 swa -# freebsd tested to work. attempt to move tarball dist target forward -# -# Revision 1.54 2002/04/03 14:54:07 oes -# Standard clean and clobber semantics II -# -# Revision 1.53 2002/04/03 14:19:16 oes -# Standard clean and clobber semantics -# -# Revision 1.52 2002/04/03 02:56:18 hal9 -# Revert previous FAQ numbering kludge. -# -# Revision 1.51 2002/04/02 13:03:56 oes -# Added fix for webserver permissions -# -# Revision 1.50 2002/04/02 03:46:24 hal9 -# Rewrite ldpOK.dsl so that sections are NOT numbered on FAQ, in an effort -# to make the Table of Contents not so 'busy' looking. SuSE needs testing :) -# -# Revision 1.49 2002/03/30 22:20:12 swa -# cd didn't work. neither did find. -# -# Revision 1.48 2002/03/30 19:04:06 swa -# people release differently. no good. -# I want to make parts of the docs only. -# -# Revision 1.47 2002/03/30 09:05:21 swa -# better packaging. better rpm building. -# tar failed on sun (no exclude there). -# -# Revision 1.46 2002/03/29 20:09:01 swa -# al's patch -# -# Revision 1.45 2002/03/29 19:45:45 swa -# for lazy swa -# -# Revision 1.44 2002/03/29 17:42:44 gliptak -# Correcting for Solaris tar limitations -# -# Revision 1.43 2002/03/29 07:40:03 swa -# fixed make webserver. doh -# -# Revision 1.42 2002/03/29 06:59:04 swa -# other users could not modify files on webserver -# -# Revision 1.41 2002/03/28 20:43:00 swa -# set make correctly -# -# Revision 1.40 2002/03/28 04:22:44 hal9 -# More on man2html stuff. -# -# Revision 1.39 2002/03/28 01:04:14 hal9 -# More man2html stuff for docs. -# -# Revision 1.38 2002/03/27 16:02:30 swa -# have a generic target -# -# Revision 1.37 2002/03/27 15:30:26 swa -# have a consistent appearance -# -# Revision 1.36 2002/03/27 14:58:08 swa -# can be used by mutilple targets -# -# Revision 1.35 2002/03/27 14:53:19 swa -# added solaris-dist -# -# Revision 1.34 2002/03/27 10:30:11 swa -# we want a html man file on the webserver -# -# Revision 1.33 2002/03/27 03:05:35 hal9 -# Added man2html target for docs (redhat-dok only for now) -# -# Revision 1.32 2002/03/26 22:29:54 swa -# we have a new homepage! -# -# Revision 1.31 2002/03/26 14:00:18 swa -# fixed make tarball, tarball-dist, tarball-clean -# -# Revision 1.30 2002/03/25 12:52:25 swa -# new targets -# -# Revision 1.29 2002/03/24 17:03:55 jongfoster -# Name change -# -# Revision 1.28 2002/03/24 16:19:48 swa -# configure needs to be generated. -# -# Revision 1.27 2002/03/24 16:13:57 swa -# generated files are a nono in cvs -# -# Revision 1.26 2002/03/24 15:36:02 swa -# did not build. -# -# Revision 1.25 2002/03/24 14:31:08 swa -# remove more crappy files. set RPM -# release version correctly. -# -# Revision 1.24 2002/03/24 14:19:55 swa -# set rpm package release in configure.in. nowhere else. -# -# Revision 1.23 2002/03/24 13:06:49 swa -# suse-clean now runs fine -# -# Revision 1.22 2002/03/24 12:56:21 swa -# name change related issues. -# -# Revision 1.21 2002/03/24 12:43:57 swa -# name change -# -# Revision 1.20 2002/03/24 11:39:17 jongfoster -# Renaming config files -# -# Revision 1.19 2002/03/22 20:53:03 morcego -# - Ongoing process to change name to JunkbusterNG -# - configure/configure.in: no change needed -# - GNUmakefile.in: -# - TAR_ARCH = /tmp/JunkbusterNG-$(RPM_VERSION).tar.gz -# - PROGRAM = jbng@EXEEXT@ -# - rh-spec now references as junkbusterng-rh.spec -# - redhat-upload: references changed to junkbusterng-* (package names) -# - tarball-dist: references changed to JunkbusterNG-distribution-* -# - tarball-src: now JunkbusterNG-* -# - install: initscript now junkbusterng.init and junkbusterng (when -# installed) -# - junkbuster-rh.spec: renamed to junkbusterng-rh.spec -# - junkbusterng.spec: -# - References to the expression ijb where changed where possible -# - New package name: junkbusterng (all in lower case, acording to -# the LSB recomendation) -# - Version changed to: 2.9.13 -# - Release: 1 -# - Added: junkbuster to obsoletes and conflicts (Not sure this is -# right. If it obsoletes, why conflict ? Have to check it later) -# - Summary changed: Stefan, please check and aprove it -# - Changes description to use the new name -# - Sed string was NOT changed. Have to wait to the manpage to -# change first -# - Keeping the user junkbuster for now. It will require some aditional -# changes on the script (scheduled for the next specfile release) -# - Added post entry to move the old logfile to the new log directory -# - Removing "chkconfig --add" entry (not good to have it automaticaly -# added to the startup list). -# - Added preun section to stop the service with the old name, as well -# as remove it from the startup list -# - Removed the chkconfig --del entry from the conditional block on -# the preun scriptlet (now handled on the %files section) -# - junkbuster.init: renamed to junkbusterng.init -# - junkbusterng.init: -# - Changed JB_BIN to jbng -# - Created JB_OBIN with the old value of JB_BIN (junkbuster), to -# be used where necessary (config dir) -# -# Aditional notes: -# - The config directory is /etc/junkbuster yet. Have to change it on the -# specfile, after it is changes on the code -# - The only files that got renamed on the cvs tree were the rh specfile and -# the init file. Some file references got changes on the makefile and on the -# rh-spec (as listed above) -# -# Revision 1.18 2002/03/21 23:00:00 swa -# want to autogenerate stuff. -# -# Revision 1.17 2002/03/19 19:30:04 morcego -# - Fixing stylesheet checking on configure. If it is found, no further checks -# should be done -# -# - configure will now check for db2html or docbook2html (should work now -# on SuSe without the docbktls package) -# -# Revision 1.16 2002/03/14 22:32:32 hal9 -# Bumped the RPM version. -# -# Revision 1.15 2002/03/08 20:00:28 swa -# some leftovers. -# -# Revision 1.14 2002/03/07 18:25:56 swa -# synced redhat and suse build process -# -# Revision 1.13 2002/03/07 17:17:56 oes -# (Hopefully) fixed for older make versions -# -# Revision 1.12 2002/03/07 15:28:27 swa -# more informative -# -# Revision 1.11 2002/03/06 14:33:18 sarantis -# Use proper temp file, not "abc". -# -# Revision 1.10 2002/03/06 14:19:35 sarantis -# Cleanup PID_FILE_PATH from redhat-dist target -# -# Revision 1.9 2002/03/05 17:31:11 morcego -# Search for docbook.dsl. Should solve portability problems for SuSe. -# -# Revision 1.8 2002/03/05 14:07:42 morcego -# configure now detects rpm topdir, and change GNUmakefile acordingly -# (based on sugestion by Sarantis Paskalis) -# -# Revision 1.7 2002/03/05 13:43:28 morcego -# Checking for text browser, so redhat-dok can work. -# -# Revision 1.6 2002/03/05 13:10:51 morcego -# Changes to implement redhat-dok (Hal Burgiss) -# Changes to make it work on other distros and out-of-the-shelf configurations -# -# Revision 1.5 2002/02/27 15:30:39 hal9 -# Reset $(RPM_PACKAGEV) to 1 (was 2) -# -# Revision 1.4 2002/01/17 21:44:04 jongfoster -# Adding urlmatch.[ch] -# -# Revision 1.3 2002/01/04 15:26:08 oes -# Added tarball-src target -# -# Revision 1.2 2001/12/30 14:07:31 steudten -# - Add signal handling (unix) -# - Add SIGHUP handler (unix) -# - Add creation of pidfile (unix) -# - Add action 'top' in rc file (RH) -# - Add entry 'SIGNALS' to manpage -# - Add exit message to logfile (unix) -# -# Revision 1.1 2001/12/01 11:22:57 jongfoster -# Renaming Makefile.in to GNUmakefile.in so that non-GNU versions of -# make break in a more obvious way. -# Adding .PHONY section. -# -# Revision 1.40 2001/12/01 00:24:11 jongfoster -# Renaming various config files -# Fixing CR->CRLF under Win32 (I hope) -# -# Revision 1.39 2001/11/06 12:07:30 steudten -# Add --clean for building rpm in target redhat-dist. -# -# Revision 1.38 2001/11/05 21:35:23 steudten -# Complete rewrite for the 'redhat-dist' target. -# Checks for writeable RPM build directories for calling user. -# So you must not be root, just set the modes to 1777 to -# build a RH package. -# Fix the upload-target to be arch independant. -# Add target for 'solaris-dist' - coming soon. -# -# Revision 1.37 2001/11/01 00:52:04 hal9 -# Redhat-upload stuff per Stefan. -# -# Revision 1.36 2001/10/31 19:26:13 swa -# automate process of uploading new releases -# to sf. -# -# Revision 1.35 2001/10/15 22:14:59 joergs -# Removed -O2 and -Wall from AmigaOS-only CFLAGS since they are now in -# the general CFLAGS already. -# -# Revision 1.34 2001/10/15 18:28:06 steudten -# remove config.cache for target clobber. -# Cleanup make dist for RH and S.u.S.E. -# -# Revision 1.33 2001/10/10 12:43:33 oes -# Added ugly hack to make install target work at least for some setups. -# -# Revision 1.32 2001/10/09 22:38:19 jongfoster -# Correcting actionsfile filename for Win32 INI build -# -# Revision 1.31 2001/09/23 10:13:48 swa -# upload process established. run make webserver and -# the documentation is moved to the webserver. documents -# are now linked correctly. -# -# Revision 1.30 2001/09/19 17:55:49 oes -# Fixed CFLAGS -# -# Revision 1.29 2001/09/16 17:34:27 jongfoster -# Removing showargs.[ch], adding cgi(simple|edit).[ch] -# Replacing $(OBJEXT) with @OBJEXT@ - this seems to be a common source -# of build problems. -# -# Revision 1.28 2001/09/13 15:19:08 swa -# we want text files as well. -# -# Revision 1.27 2001/09/13 13:11:37 steudten -# -# Replace DEBUG_CFLAGS with OTHER_CFLAGS -# -# Revision 1.26 2001/09/12 23:44:54 david__schmidt -# Mac OSX (Darwin) support added. -# -# Revision 1.25 2001/09/12 22:55:45 joergs -# AmigaOS support added. -# -# Revision 1.24 2001/09/12 17:28:59 david__schmidt -# -# OS/2 port: update autoconf'd support for the platform. -# -# Revision 1.23 2001/09/12 16:28:42 swa -# added "make dok" section to generate html pages from -# the sgml source documents. note that the we do not want -# generated stuff in cvs. -# -# Revision 1.22 2001/09/10 16:31:23 swa -# buildroot definition in the specfile fucks up the build -# process under suse. hence I moved it to the "rpm -ta" -# command -# -# Revision 1.21 2001/09/10 11:12:49 oes -# Turning on -Wall -# -# Revision 1.20 2001/08/02 22:04:29 jongfoster -# Removing some remaining references to obsolete w32rulesdlg.[ch] -# -# Revision 1.19 2001/07/30 22:14:03 jongfoster -# Removing obsolete w32rulesdlg.c and w32rulesdlg.h -# -# Revision 1.18 2001/07/29 17:09:17 jongfoster -# Major changes to build system in order to fix these bugs: -# - pthreads under Linux was broken - changed -lpthread to -pthread -# - Compiling in MinGW32 mode under CygWin now correctly detects -# which shared libraries are available -# - Solaris support (?) (Not tested under Solaris yet) -# -# Revision 1.17 2001/07/28 16:44:54 oes -# Fixed sed LF->CRLF conversion and removed deprecated files -# -# Revision 1.16 2001/07/15 19:45:33 jongfoster -# Added support for linking with POSIX threads library -# -# Revision 1.15 2001/07/13 13:48:07 oes -# - Moved STATIC #define for pcre to (ac)config.h -# - Made -Ipcre depandant on static pcre compilation to -# avoid version conflicts -# - Included compilation and depandancies for new deanimate.c -# - Made changes to the pcre/pcreposix/pcrs build process -# as required by the new library autodetection in -# configure.in -# -# Revision 1.14 2001/07/01 16:27:44 oes -# Fixed misplaced dependancy -# -# Revision 1.13 2001/06/29 13:18:36 oes -# - added depandancy of filters.o on cgi.h -# -# Revision 1.12 2001/06/12 17:15:56 swa -# fixes, because a clean build on rh6.1 was impossible. -# GZIP confuses make, %configure confuses rpm, etc. -# -# Revision 1.11 2001/06/11 11:26:35 sarantis -# RPM version should be the same as ijbswa version. The rpm release is -# specified in the specfile. -# -# Revision 1.10 2001/06/07 17:27:45 swa -# added suse build section -# -# Revision 1.9 2001/06/04 18:31:58 swa -# files are now prefixed with either `confdir' or `logdir'. -# `make redhat-dist' replaces both entries confdir and logdir -# with redhat values -# -# Revision 1.8 2001/06/04 10:44:57 swa -# `make redhatr-dist' now works. Except for the paths -# in the config file. -# -# Revision 1.7 2001/06/03 17:09:09 swa -# swa for oes: reversed my earlier change -# -# Revision 1.6 2001/06/03 17:07:27 swa -# swa for oes -# -# Revision 1.5 2001/06/03 13:57:26 swa -# compile cgi.c (for andreas' GUI) -# -# Revision 1.4 2001/05/31 21:18:45 jongfoster -# Added files actions.[ch], actionlist.h, list.[ch] to Makefile -# -# Revision 1.3 2001/05/29 20:02:48 joergs -# Changes for AmigaOS added. -# -# Revision 1.2 2001/05/17 22:23:23 oes -# - Added auto-generation of CRLFs for Win32 config files -# - Added comment-prefix to all Win32-only options in the config file -# and provided auto stripping of this prefix for the Win32 platform by make -# -# Revision 1.1.1.1 2001/05/15 13:59:00 oes -# Initial import of version 2.9.3 source tree -# -# diff --git a/external/privoxy/INSTALL b/external/privoxy/INSTALL index f17eadb6..618dede7 100644 --- a/external/privoxy/INSTALL +++ b/external/privoxy/INSTALL @@ -8,10 +8,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -26,8 +26,8 @@ * The GNU General Public License should be included with * this file. If not, you can view it at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * or write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA * *********************************************************************/ @@ -40,9 +40,8 @@ compiler like gcc are required. When building from a source tarball, first unpack the source: - tar xzvf privoxy-3.0.12-stable-src.tar.gz - cd privoxy-3.0.12-stable - + tar xzvf privoxy-3.0.19-stable-src.tar.gz + cd privoxy-3.0.19-stable For retrieving the current CVS sources, you'll need a CVS client installed. Note that sources from CVS are typically development quality, and may not be @@ -53,7 +52,6 @@ documentation, which might give commands like: cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co current cd current - This will create a directory named current/, which will contain the source tree. @@ -70,12 +68,10 @@ adduser, but the command syntax may vary from platform to platform). privoxy:*:7777:7777:privoxy proxy:/no/home:/no/shell - And then /etc/group, like: privoxy:*:7777: - Some binary packages may do this for you. Then, to build from either unpacked tarball or CVS source: @@ -88,13 +84,11 @@ Then, to build from either unpacked tarball or CVS source: make -n install # (to see where all the files will go) make -s install # (to really install, -s to silence output) - Using GNU make, you can have the first four steps automatically done for you by just typing: make - in the freshly downloaded or unpacked source directory. To build an executable with security enhanced features so that users cannot @@ -103,7 +97,6 @@ configurations, configure like this: ./configure --disable-toggle --disable-editor --disable-force - Then build as above. In Privoxy 3.0.7 and later, all of these options can also be disabled through the configuration file. @@ -124,7 +117,6 @@ sure both already exist: make -s install USER=privoxy GROUP=privoxy - The default installation path for make install is /usr/local. This may of course be customized with the various ./configure path options. If you are doing an install to anywhere besides /usr/local, be sure to set the appropriate diff --git a/external/privoxy/README b/external/privoxy/README index a145e817..6ba2f1ee 100644 --- a/external/privoxy/README +++ b/external/privoxy/README @@ -4,14 +4,14 @@ * * Purpose : README file to give a short intro. * - * Copyright : Written by and Copyright (C) 2001-2009 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2011 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -26,13 +26,13 @@ * The GNU General Public License should be included with * this file. If not, you can view it at * http://www.gnu.org/copyleft/gpl.html - * or write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * or write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA * *********************************************************************/ -This README is included with Privoxy 3.0.12. See http://www.privoxy.org/ for +This README is included with Privoxy 3.0.19. See http://www.privoxy.org/ for more information. The current code maturity level is "stable". ------------------------------------------------------------------------------- @@ -44,36 +44,22 @@ flexible configuration and can be customized to suit individual needs and tastes. It has application for both stand-alone systems and multi-user networks. -Privoxy is Free Software and licensed under the GPL2. +Privoxy is Free Software and licensed under the GNU GPLv2. Privoxy is an associated project of Software in the Public Interest (SPI). -Donations are welcome. + +Helping hands and donations are welcome: + + * http://www.privoxy.org/faq/general.html#PARTICIPATE + + * http://www.privoxy.org/faq/general.html#DONATE ------------------------------------------------------------------------------- -1. IMPORTANT CHANGES +1. CHANGES -March 2009, Privoxy 3.0.12 is released. - -This is primarily a bug fix release. See the "ChangeLog", and the "What's New" -section and the "Upgrader's Notes" in the User Manual for details. - -February 2009, Privoxy 3.0.11 is released. - -As usual there are changes that effect the configuration. See the "ChangeLog", -and the "What's New" section and the "Upgrader's Notes" in the User Manual for -details and specifics. - -This is a stable release, and marks a departure for Privoxy development. - -Previously, odd numbered releases were considered beta versions and were only -released at the end of the development cycle when the code was already believed -to be stable. Usually it was, so the stable release contained pretty much the -same code, but got a higher version number. In the future we intend to release -several snapshots between stable releases. There will probably still be about -two stable releases per year, but hopefully about six snapshots instead of the -two betas we have now. The intentions is to make testing without CVS access -easier. +For a list of changes in this release, please have a look at the "ChangeLog", +the "What's New" section or the "Upgrader's Notes" in the User Manual. ------------------------------------------------------------------------------- @@ -96,10 +82,6 @@ If no config_file is specified on the command line, Privoxy will look for a file named 'config' in the current directory (except Win32 which will look for 'config.txt'). If no config_file is found, Privoxy will fail to start. -Or for Red Hat and Fedora based distributions: /etc/rc.d/init.d/privoxy start - -Or Debian and Ubuntu: /etc/init.d/privoxy start - ------------------------------------------------------------------------------- 4. CONFIGURATION @@ -116,7 +98,7 @@ www.privoxy.org/user-manual/. Be sure to set your browser(s) for HTTP/HTTPS Proxy at :, or whatever you specify in the config file under 'listen-address'. DEFAULT is -localhost:8118. Note that Privoxy ONLY proxies HTTP (and HTTPS) traffic. Do not +127.0.0.1:8118. Note that Privoxy ONLY proxies HTTP (and HTTPS) traffic. Do not try it with FTP or other protocols for the simple reason it does not work. The actions list can be configured via the web interface accessed via http:// @@ -158,6 +140,13 @@ list, where the developers also hang around. Please don't sent private support requests to individual Privoxy developers, either use the mailing lists or the support trackers. +If you have to contact a Privoxy developer directly for other reasons, please +send a real mail and do not bother with SourceForge's messaging system. Answers +to SourceForge messages are usually bounced by SourceForge's mail server in +which case the developer wasted time writing a response you don't get. From +your point of view it will look like your message has been completely ignored, +so this is frustrating for all parties involved. + Note that the Privoxy mailing lists are moderated. Posts from unsubscribed addresses have to be accepted manually by a moderator. This may cause a delay of several days and if you use a subject that doesn't clearly mention Privoxy @@ -246,16 +235,49 @@ Please be sure to provide the following information: * Any other pertinent information to help identify the problem such as config or log file excerpts (yes, you should have log file entries for each action - taken). + taken). To get a meaningful logfile, please make sure that the logfile + directive is being used and the following debug options are enabled: -You don't have to tell us your actual name when filing a problem report, but -please use a nickname so we can differentiate between your messages and the -ones entered by other "anonymous" users that may respond to your request if -they have the same problem or already found a solution. + debug 1 # Log the destination for each request Privoxy let through. See also debug 1024. + debug 2 # show each connection status + debug 4 # show I/O status + debug 8 # show header parsing + debug 128 # debug redirects + debug 256 # debug GIF de-animation + debug 512 # Common Log Format + debug 1024 # Log the destination for requests Privoxy didn't let through, and the reason why. + debug 4096 # Startup banner and warnings. + debug 8192 # Non-fatal errors + + If you are having trouble with a filter, please additionally enable + + debug 64 # debug regular expression filters + + If you are using Privoxy 3.0.17 or later and suspect that it interprets the + request or the response incorrectly, please enable + + debug 32768 # log all data read from the network + + Note that Privoxy log files may contain sensitive information so please + don't submit any logfiles you didn't read first. You can mask sensitive + information as long as it's clear that you removed something. + +You don't have to tell us your actual name when filing a problem report, but if +you don't, please use a nickname so we can differentiate between your messages +and the ones entered by other "anonymous" users that may respond to your +request if they have the same problem or already found a solution. Note that +due to spam the trackers may not always allow to post without being logged into +SourceForge. If that's the case, you are still free to create a login that +isn't directly linked to your name, though. Please also check the status of your request a few days after submitting it, as we may request additional information. If you use a SF id, you should -automatically get a mail when someone responds to your request. +automatically get a mail when someone responds to your request. Please don't +bother to add an email address when using the tracker. If you prefer to +communicate through email, just use one of the mailing lists directly. + +If you are new to reporting problems, you might be interested in How to Report +Bugs Effectively. The appendix of the Privoxy User Manual also has helpful information on understanding actions, and action debugging. @@ -270,11 +292,13 @@ tracker/?atid=361118&group_id=11118. ------------------------------------------------------------------------------- -6.4. Other +6.4. Mailing Lists -For any other issues, feel free to use the mailing lists. Technically -interested users and people who wish to contribute to the project are also -welcome on the developers list! You can find an overview of all Privoxy-related +If you prefer to communicate through email, instead of using a web interface, +feel free to use one of the mailing lists. To discuss issues that haven't been +completely diagnosed yet, please use the Privoxy users list. Technically +interested users and people who wish to contribute to the project are always +welcome on the developers list. You can find an overview of all Privoxy-related mailing lists, including list archives, at: http://sourceforge.net/mail/? group_id=11118. diff --git a/external/privoxy/acconfig.h b/external/privoxy/acconfig.h index ea2792df..29e95396 100644 --- a/external/privoxy/acconfig.h +++ b/external/privoxy/acconfig.h @@ -5,19 +5,19 @@ * File : $Source: /cvsroot/ijbswa/current/acconfig.h,v $ * * Purpose : This file should be the first thing included in every - * .c file. (Before even system headers). It contains + * .c file. (Before even system headers). It contains * #define statements for various features. It was * introduced because the compile command line started * getting ludicrously long with feature defines. * - * Copyright : Written by and Copyright (C) 2001 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2009 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -35,211 +35,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: acconfig.h,v $ - * Revision 1.36 2008/10/18 11:17:52 fabiankeil - * Connection keep-alive support is ready for testing, - * allow enabling it through the configure script. - * - * Revision 1.35 2008/04/06 15:18:33 fabiankeil - * Oh well, rename the --enable-pcre-host-patterns option to - * --enable-extended-host-patterns as it's not really PCRE syntax. - * - * Revision 1.34 2008/04/06 14:54:26 fabiankeil - * Use PCRE syntax in host patterns when configured - * with --enable-pcre-host-patterns. - * - * Revision 1.33 2006/12/17 19:15:26 fabiankeil - * Added ./configure switch for FEATURE_GRACEFUL_TERMINATION. - * - * Revision 1.32 2006/07/18 14:48:45 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.27.2.4 2003/12/17 16:34:40 oes - * Cosmetics - * - * Revision 1.27.2.3 2003/03/27 16:03:19 oes - * Another shot at Bug #707467 - * - * Revision 1.27.2.2 2003/03/21 14:39:12 oes - * Presumably fixed Bug #707467 by defining unix ifdef __unix__ - * - * Revision 1.27.2.1 2002/08/10 11:22:31 oes - * - Add two AC_DEFINEs that indicate if the pcre*.h headers - * are located in a pcre/ subdir to the include path. - * - * Revision 1.27 2002/04/25 19:13:57 morcego - * Removed RPM release number declaration on configure.in - * Changed makefile to use given value for RPM_PACKAGEV when on uploading - * targets (will produce an error, explaining who to do it, if no value - * if provided). - * - * Revision 1.26 2002/04/11 11:00:21 oes - * Applied Moritz' fix for socklen_t on Solaris - * - * Revision 1.25 2002/04/06 20:38:01 jongfoster - * Renaming VC++ versions of config.h - * - * Revision 1.24 2002/04/04 00:36:36 gliptak - * always use pcre for matching - * - * Revision 1.23 2002/04/03 22:28:03 gliptak - * Removed references to gnu_regex - * - * Revision 1.22 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.21 2002/03/24 14:31:08 swa - * remove more crappy files. set RPM - * release version correctly. - * - * Revision 1.20 2002/03/24 13:46:44 swa - * name change related issue. - * - * Revision 1.19 2002/03/24 13:25:42 swa - * name change related issues - * - * Revision 1.18 2002/03/08 16:40:28 oes - * Added FEATURE_NO_GIFS - * - * Revision 1.17 2002/03/04 17:52:44 oes - * Deleted PID_FILE_PATH - * - * Revision 1.16 2002/01/10 12:36:18 oes - * Moved HAVE_*_R to acconfig.h, where they belong. - * - * Revision 1.15 2001/12/30 14:07:31 steudten - * - Add signal handling (unix) - * - Add SIGHUP handler (unix) - * - Add creation of pidfile (unix) - * - Add action 'top' in rc file (RH) - * - Add entry 'SIGNALS' to manpage - * - Add exit message to logfile (unix) - * - * Revision 1.14 2001/10/23 21:24:09 jongfoster - * Support for FEATURE_CGI_EDIT_ACTIONS - * - * Revision 1.13 2001/10/07 15:30:41 oes - * Removed FEATURE_DENY_GZIP - * - * Revision 1.12 2001/09/13 19:56:37 jongfoster - * Reverting to revision 1.10 - previous checking was majorly broken. - * - * Revision 1.10 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.9 2001/07/29 19:08:52 jongfoster - * Changing _CONFIG_H to CONFIG_H_INCLUDED. - * Also added protection against using a MinGW32 or CygWin version of - * config.h from within MS Visual C++ - * - * Revision 1.8 2001/07/29 17:09:17 jongfoster - * Major changes to build system in order to fix these bugs: - * - pthreads under Linux was broken - changed -lpthread to -pthread - * - Compiling in MinGW32 mode under CygWin now correctly detects - * which shared libraries are available - * - Solaris support (?) (Not tested under Solaris yet) - * - * Revision 1.7 2001/07/25 22:53:59 jongfoster - * Will #error if pthreads is enabled under BeOs - * - * Revision 1.6 2001/07/15 17:54:29 jongfoster - * Renaming #define STATIC to STATIC_PCRE - * Adding new #define FEATURE_PTHREAD that will be used to enable - * POSIX threads support. - * - * Revision 1.5 2001/07/13 13:48:37 oes - * - (Fix:) Copied CODE_STATUS #define from config.h.in - * - split REGEX #define into REGEX_GNU and REGEX_PCRE - * and removed PCRE. - * (REGEX = REGEX_GNU || REGEX_PCRE per project.h) - * - Moved STATIC (for pcre) here from Makefile.in - * - Introduced STATIC_PCRS #define to allow for dynaimc linking with - * libpcrs - * - Removed PCRS #define, since pcrs is now needed for CGI anyway - * - * Revision 1.4 2001/05/29 09:50:24 jongfoster - * Unified blocklist/imagelist/permissionslist. - * File format is still under discussion, but the internal changes - * are (mostly) done. - * - * Also modified interceptor behaviour: - * - We now intercept all URLs beginning with one of the following - * prefixes (and *only* these prefixes): - * * http://i.j.b/ - * * http://ijbswa.sf.net/config/ - * * http://ijbswa.sourceforge.net/config/ - * - New interceptors "home page" - go to http://i.j.b/ to see it. - * - Internal changes so that intercepted and fast redirect pages - * are not replaced with an image. - * - Interceptors now have the option to send a binary page direct - * to the client. (i.e. ijb-send-banner uses this) - * - Implemented show-url-info interceptor. (Which is why I needed - * the above interceptors changes - a typical URL is - * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". - * The previous mechanism would not have intercepted that, and - * if it had been intercepted then it then it would have replaced - * it with an image.) - * - * Revision 1.3 2001/05/26 01:26:34 jongfoster - * New #define, WIN_GUI_EDIT, enables the (embryonic) Win32 GUI editor. - * This #define cannot be set from ./configure - there's no point, it - * doesn't work yet. See feature request # 425722 - * - * Revision 1.2 2001/05/22 17:43:35 oes - * - * - Enabled filtering banners by size rather than URL - * by adding patterns that replace all standard banner - * sizes with the "Junkbuster" gif to the re_filterfile - * - * - Enabled filtering WebBugs by providing a pattern - * which kills all 1x1 images - * - * - Added support for PCRE_UNGREEDY behaviour to pcrs, - * which is selected by the (nonstandard and therefore - * capital) letter 'U' in the option string. - * It causes the quantifiers to be ungreedy by default. - * Appending a ? turns back to greedy (!). - * - * - Added a new interceptor ijb-send-banner, which - * sends back the "Junkbuster" gif. Without imagelist or - * MSIE detection support, or if tinygif = 1, or the - * URL isn't recognized as an imageurl, a lame HTML - * explanation is sent instead. - * - * - Added new feature, which permits blocking remote - * script redirects and firing back a local redirect - * to the browser. - * The feature is conditionally compiled, i.e. it - * can be disabled with --disable-fast-redirects, - * plus it must be activated by a "fast-redirects" - * line in the config file, has its own log level - * and of course wants to be displayed by show-proxy-args - * Note: Boy, all the #ifdefs in 1001 locations and - * all the fumbling with configure.in and acconfig.h - * were *way* more work than the feature itself :-( - * - * - Because a generic redirect template was needed for - * this, tinygif = 3 now uses the same. - * - * - Moved GIFs, and other static HTTP response templates - * to project.h - * - * - Many minor fixes - * - * - Removed some >400 CRs again (Jon, you really worked - * a lot! ;-) - * - * Revision 1.1.1.1 2001/05/15 13:58:45 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + @TOP@ /* @@ -267,7 +64,7 @@ */ #undef CODE_STATUS -/* +/* * Should pcre be statically built in instead of linkling with libpcre? * (This is determined by configure depending on the availiability of * libpcre and user preferences). The name is ugly, but pcre needs it. @@ -275,7 +72,7 @@ */ #undef STATIC_PCRE -/* +/* * Should pcrs be statically built in instead of linkling with libpcrs? * (This is determined by configure depending on the availiability of * libpcrs and user preferences). @@ -288,6 +85,11 @@ */ #undef FEATURE_ACL +/* + * Allow Privoxy to use accf_http(9) if supported. + */ +#undef FEATURE_ACCEPT_FILTER + /* * Enables the web-based configuration (actionsfile) editor. If you * have a shared proxy, you might want to turn this off. @@ -334,14 +136,14 @@ * User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) * Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, * / * * - * And no, I haven't got that backwards - IE is being wierd. + * And no, I haven't got that backwards - IE is being weird. * - * Known limitations: + * Known limitations: * 1) If you press shift-reload on a blocked HTML page, you get * the image "blocked" page, not the HTML "blocked" page. - * 2) Once an image "blocked" page has been sent, viewing it + * 2) Once an image "blocked" page has been sent, viewing it * in it's own browser window *should* bring up the HTML - * "blocked" page, but it doesn't. You need to clear the + * "blocked" page, but it doesn't. You need to clear the * browser cache to get the HTML version again. * * These limitations are due to IE making inconsistent choices @@ -349,11 +151,6 @@ */ #undef FEATURE_IMAGE_DETECT_MSIE -/* - * Kills JavaScript popups - window.open, onunload, etc. - */ -#undef FEATURE_KILL_POPUPS - /* * Use PNG instead of GIF for built-in images */ @@ -370,10 +167,15 @@ #undef FEATURE_EXTENDED_HOST_PATTERNS /* - * Keep outgoing connections alive if possible. + * Keep connections alive if possible. */ #undef FEATURE_CONNECTION_KEEP_ALIVE +/* + * Allow to share outgoing connections between incoming connections. + */ +#undef FEATURE_CONNECTION_SHARING + /* * Use POSIX threads instead of native threads. */ @@ -435,7 +237,7 @@ #undef HAVE_GMTIME_R #undef HAVE_LOCALTIME_R -/* Define to 'int' if doesn't have it. +/* Define to 'int' if doesn't have it. */ #undef socklen_t @@ -485,7 +287,7 @@ /* * It's too easy to accidentally use a Cygwin or MinGW32 version of config.h - * under VC++, and it usually gives many wierd error messages. Let's make + * under VC++, and it usually gives many weird error messages. Let's make * the error messages understandable, by bailing out now. */ #ifdef _MSC_VER diff --git a/external/privoxy/actionlist.h b/external/privoxy/actionlist.h index 339c878c..922b607b 100644 --- a/external/privoxy/actionlist.h +++ b/external/privoxy/actionlist.h @@ -12,14 +12,14 @@ * DEFINE_ACTION_BOOL() * DEFINE_ACTION_ALIAS * - * Copyright : Written by and Copyright (C) 2001-2008 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2008 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -37,156 +37,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: actionlist.h,v $ - * Revision 1.36 2008/09/20 10:04:33 fabiankeil - * Remove hide-forwarded-for-headers action which has - * been obsoleted by change-x-forwarded-for{block}. - * - * Revision 1.35 2008/09/19 15:43:54 fabiankeil - * Fix sorting. - * - * Revision 1.34 2008/09/19 15:26:28 fabiankeil - * Add change-x-forwarded-for{} action to block or add - * X-Forwarded-For headers. Mostly based on code removed - * before 3.0.7. - * - * Revision 1.33 2008/03/29 12:13:45 fabiankeil - * Remove send-wafer and send-vanilla-wafer actions. - * - * Revision 1.32 2008/03/28 15:13:42 fabiankeil - * Remove inspect-jpegs action. - * - * Revision 1.31 2008/03/27 18:27:20 fabiankeil - * Remove kill-popups action. - * - * Revision 1.30 2008/03/04 18:30:34 fabiankeil - * Remove the treat-forbidden-connects-like-blocks action. We now - * use the "blocked" page for forbidden CONNECT requests by default. - * - * Revision 1.29 2008/03/01 14:00:43 fabiankeil - * Let the block action take the reason for the block - * as argument and show it on the "blocked" page. - * - * Revision 1.28 2007/12/11 21:08:29 fabiankeil - * Let the CGI editor suggest a forward-override - * parameter whose syntax is actually valid. - * - * Revision 1.27 2007/11/10 15:04:08 fabiankeil - * Tell the CGI editor about +hide-referrer{conditional-forge}. - * - * Revision 1.26 2007/06/01 16:54:28 fabiankeil - * Add forward-override{} to change the forwarding settings through - * action sections. This is mainly interesting to forward different - * clients differently (for example based on User-Agent or request - * origin). - * - * Revision 1.25 2007/04/15 16:39:20 fabiankeil - * Introduce tags as alternative way to specify which - * actions apply to a request. At the moment tags can be - * created based on client and server headers. - * - * Revision 1.24 2007/03/20 15:16:34 fabiankeil - * Use dedicated header filter actions instead of abusing "filter". - * Replace "filter-client-headers" and "filter-client-headers" - * with "server-header-filter" and "client-header-filter". - * - * Revision 1.23 2006/10/09 10:26:18 fabiankeil - * Changed the path in set-image-blocker's redirection default to - * "send-banner?type=pattern" instead of "show-banner?type=pattern" - * which isn't caught by Privoxy. Fixes BR 1573468. - * - * Changed hide-user-agent's default value to "Privoxy VERSION". - * - * Changed hide-referrer's default fake value to "http://www.privoxy.org/". - * A static referrer is obviously fake anyway, so we might as well - * advertise ourselves. - * - * Revision 1.22 2006/09/01 17:14:18 hal9 - * Re-ordered the actions list so that they display in the actions editor in - * alphabetical order. Some of the new actions were "out of order". - * - * Revision 1.21 2006/08/14 08:25:19 fabiankeil - * Split filter-headers{} into filter-client-headers{} - * and filter-server-headers{}. - * Added parse_header_time() to share some code. - * Replaced timegm() with mktime(). - * - * Revision 1.20 2006/08/03 02:46:41 david__schmidt - * Incorporate Fabian Keil's patch work: http://www.fabiankeil.de/sourcecode/privoxy/ - * - * Revision 1.19 2006/07/18 14:48:45 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.17.2.3 2004/10/03 12:53:32 david__schmidt - * Add the ability to check jpeg images for invalid - * lengths of comment blocks. Defensive strategy - * against the exploit: - * Microsoft Security Bulletin MS04-028 - * Buffer Overrun in JPEG Processing (GDI+) Could - * Allow Code Execution (833987) - * Enabled with +inspect-jpegs in actions files. - * - * Revision 1.17.2.2 2002/09/25 15:25:25 oes - * Added more aliases for prehistoric action names - * - * Revision 1.17.2.1 2002/08/02 12:50:47 oes - * Consistency with docs: Change default name for action from hide-referer to hide-referrer - * - * Revision 1.17 2002/05/14 21:25:55 oes - * Renamed prevent-(setting/reading)-cookies to crunch-(incoming/outgoing)-cookies - * - * Revision 1.16 2002/04/24 02:15:18 oes - * Renamed actions as discussed, Aliased old action names to new ones. - * - * Revision 1.15 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.14 2002/03/24 16:32:08 jongfoster - * Removing logo option - * - * Revision 1.13 2002/03/24 15:23:33 jongfoster - * Name changes - * - * Revision 1.12 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.11 2002/03/12 01:42:49 oes - * Introduced modular filters - * - * Revision 1.10 2002/03/08 18:19:14 jongfoster - * Adding +image-blocker{pattern} option to edit interface - * - * Revision 1.9 2001/11/22 21:58:41 jongfoster - * Adding action +no-cookies-keep - * - * Revision 1.8 2001/10/10 16:42:52 oes - * Fixed a bug, Added +limit-connect string action - * - * Revision 1.7 2001/10/07 15:33:59 oes - * Introduced a +no-compression action - * Introduced a +downgrade action - * - * Revision 1.6 2001/09/16 15:47:37 jongfoster - * First version of CGI-based edit interface. This is very much a - * work-in-progress, and you can't actually use it to edit anything - * yet. You must #define FEATURE_CGI_EDIT_ACTIONS for these changes - * to have any effect. - * - * Revision 1.5 2001/07/18 12:27:03 oes - * Changed deanimate-gifs to string action - * - * Revision 1.4 2001/07/13 13:52:12 oes - * - Formatting - * - Introduced new action ACTION_DEANIMATE - * - * Revision 1.3 2001/06/07 23:03:56 jongfoster - * Added standard comment at top of file. - * - * *********************************************************************/ - + #if !(defined(DEFINE_ACTION_BOOL) && defined(DEFINE_ACTION_MULTI) && defined(DEFINE_ACTION_STRING)) #error Please define lots of macros before including "actionlist.h". @@ -219,9 +71,11 @@ DEFINE_ACTION_STRING ("deanimate-gifs", ACTION_DEANIMATE, DEFINE_CGI_PARAM_RADIO ("deanimate-gifs", ACTION_DEANIMATE, ACTION_STRING_DEANIMATE, "first", 0) DEFINE_CGI_PARAM_RADIO ("deanimate-gifs", ACTION_DEANIMATE, ACTION_STRING_DEANIMATE, "last", 1) DEFINE_ACTION_BOOL ("downgrade-http-version", ACTION_DOWNGRADE) +#ifdef FEATURE_FAST_REDIRECTS DEFINE_ACTION_STRING ("fast-redirects", ACTION_FAST_REDIRECTS, ACTION_STRING_FAST_REDIRECTS) DEFINE_CGI_PARAM_RADIO ("fast-redirects", ACTION_FAST_REDIRECTS, ACTION_STRING_FAST_REDIRECTS, "simple-check", 0) DEFINE_CGI_PARAM_RADIO ("fast-redirects", ACTION_FAST_REDIRECTS, ACTION_STRING_FAST_REDIRECTS, "check-decoded-url", 1) +#endif /* def FEATURE_FAST_REDIRECTS */ DEFINE_ACTION_MULTI ("filter", ACTION_MULTI_FILTER) DEFINE_ACTION_BOOL ("force-text-mode", ACTION_FORCE_TEXT_MODE) DEFINE_ACTION_STRING ("forward-override", ACTION_FORWARD_OVERRIDE, ACTION_STRING_FORWARD_OVERRIDE) @@ -267,19 +121,19 @@ DEFINE_CGI_PARAM_CUSTOM ("set-image-blocker", ACTION_IMAGE_BLOCKER, #if DEFINE_ACTION_ALIAS -/* +/* * Alternative spellings */ DEFINE_ACTION_STRING ("hide-referer", ACTION_HIDE_REFERER, ACTION_STRING_REFERER) DEFINE_ACTION_BOOL ("prevent-keeping-cookies", ACTION_NO_COOKIE_KEEP) -/* +/* * Pre-3.0.7 (pseudo) compatibility */ DEFINE_ACTION_MULTI ("filter-client-headers", ACTION_MULTI_CLIENT_HEADER_FILTER) DEFINE_ACTION_MULTI ("filter-server-headers", ACTION_MULTI_SERVER_HEADER_FILTER) -/* +/* * Pre-3.0 compatibility */ DEFINE_ACTION_BOOL ("no-cookie-read", ACTION_NO_COOKIE_READ) diff --git a/external/privoxy/actions.c b/external/privoxy/actions.c index 172085f0..2f2895c4 100644 --- a/external/privoxy/actions.c +++ b/external/privoxy/actions.c @@ -1,4 +1,4 @@ -const char actions_rcs[] = "$Id: actions.c,v 1.56 2009/03/08 14:19:21 fabiankeil Exp $"; +const char actions_rcs[] = "$Id: actions.c,v 1.73 2011/09/18 14:43:07 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/actions.c,v $ @@ -6,7 +6,7 @@ const char actions_rcs[] = "$Id: actions.c,v 1.56 2009/03/08 14:19:21 fabiankeil * Purpose : Declares functions to work with actions files * Functions declared include: FIXME * - * Copyright : Written by and Copyright (C) 2001-2008 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2011 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written @@ -31,259 +31,8 @@ const char actions_rcs[] = "$Id: actions.c,v 1.56 2009/03/08 14:19:21 fabiankeil * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: actions.c,v $ - * Revision 1.56 2009/03/08 14:19:21 fabiankeil - * Fix justified (but harmless) compiler warnings - * on platforms where sizeof(int) < sizeof(long). - * - * Revision 1.55 2008/12/04 18:18:56 fabiankeil - * Fix some cparser warnings. - * - * Revision 1.54 2008/09/20 10:04:33 fabiankeil - * Remove hide-forwarded-for-headers action which has - * been obsoleted by change-x-forwarded-for{block}. - * - * Revision 1.53 2008/05/26 16:04:04 fabiankeil - * s@memorey@memory@ - * - * Revision 1.52 2008/04/27 16:26:59 fabiankeil - * White space fix for the last commit. - * - * Revision 1.51 2008/04/27 16:20:19 fabiankeil - * Complain about every block action without reason found. - * - * Revision 1.50 2008/03/30 14:52:00 fabiankeil - * Rename load_actions_file() and load_re_filterfile() - * as they load multiple files "now". - * - * Revision 1.49 2008/03/29 12:13:45 fabiankeil - * Remove send-wafer and send-vanilla-wafer actions. - * - * Revision 1.48 2008/03/28 18:17:14 fabiankeil - * In action_used_to_be_valid(), loop through an array of formerly - * valid actions instead of using an OR-chain of strcmpic() calls. - * - * Revision 1.47 2008/03/28 15:13:37 fabiankeil - * Remove inspect-jpegs action. - * - * Revision 1.46 2008/03/27 18:27:20 fabiankeil - * Remove kill-popups action. - * - * Revision 1.45 2008/03/24 11:21:02 fabiankeil - * Share the action settings for multiple patterns in the same - * section so we waste less memory for gigantic block lists - * (and load them slightly faster). Reported by Franz Schwartau. - * - * Revision 1.44 2008/03/04 18:30:34 fabiankeil - * Remove the treat-forbidden-connects-like-blocks action. We now - * use the "blocked" page for forbidden CONNECT requests by default. - * - * Revision 1.43 2008/03/01 14:00:43 fabiankeil - * Let the block action take the reason for the block - * as argument and show it on the "blocked" page. - * - * Revision 1.42 2008/02/09 15:15:38 fabiankeil - * List active and inactive actions in the show-url-info's - * "Final results" section separately. Patch submitted by Lee - * in #1830056, modified to list active actions first. - * - * Revision 1.41 2008/01/28 20:17:40 fabiankeil - * - Mark some parameters as immutable. - * - Hide update_action_bits_for_all_tags() while it's unused. - * - * Revision 1.40 2007/05/21 10:26:50 fabiankeil - * - Use strlcpy() instead of strcpy(). - * - Provide a reason why loading the actions - * file might have failed. - * - * Revision 1.39 2007/04/17 18:21:45 fabiankeil - * Split update_action_bits() into - * update_action_bits_for_all_tags() - * and update_action_bits_for_tag(). - * - * Revision 1.38 2007/04/15 16:39:20 fabiankeil - * Introduce tags as alternative way to specify which - * actions apply to a request. At the moment tags can be - * created based on client and server headers. - * - * Revision 1.37 2007/03/11 15:56:12 fabiankeil - * Add kludge to log unknown aliases and actions before exiting. - * - * Revision 1.36 2006/12/28 17:15:42 fabiankeil - * Fix gcc43 conversion warning. - * - * Revision 1.35 2006/07/18 14:48:45 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.32.2.6 2006/01/29 23:10:56 david__schmidt - * Multiple filter file support - * - * Revision 1.32.2.5 2005/06/09 01:18:41 david__schmidt - * Tweaks to conditionally include pthread.h if FEATURE_PTHREAD is enabled - - * this becomes important when jcc.h gets included later down the line. - * - * Revision 1.32.2.4 2003/12/03 10:33:11 oes - * - Implemented Privoxy version requirement through - * for-privoxy-version= statement in {{settings}} - * block - * - Fix for unchecked out-of-memory condition - * - * Revision 1.32.2.3 2003/02/28 12:52:10 oes - * Fixed memory leak reported by Dan Price in Bug #694713 - * - * Revision 1.32.2.2 2002/11/20 14:36:55 oes - * Extended unload_current_actions_file() to multiple AFs. - * Thanks to Oliver Stoeneberg for the hint. - * - * Revision 1.32.2.1 2002/05/26 12:13:16 roro - * Change unsigned to unsigned long in actions_name struct. This closes - * SourceForge Bug #539284. - * - * Revision 1.32 2002/05/12 21:36:29 jongfoster - * Correcting function comments - * - * Revision 1.31 2002/05/06 07:56:50 oes - * Made actions_to_html independent of FEATURE_CGI_EDIT_ACTIONS - * - * Revision 1.30 2002/04/30 11:14:52 oes - * Made csp the first parameter in *action_to_html - * - * Revision 1.29 2002/04/26 19:30:54 jongfoster - * - current_action_to_html(): Adding help link for the "-" form of - * one-string actions. - * - Some actions had "
-", some "
-" (note the space). - * Standardizing on no space. - * - Greatly simplifying some of the code by using string_join() - * where appropriate. - * - * Revision 1.28 2002/04/26 12:53:15 oes - * - CGI AF editor now writes action lines split into - * single lines with line continuation - * - actions_to_html now embeds each action name in - * link to chapter - * - current_action_to_text is now called current_action_to_html - * and acts like actions_to_html - * - * Revision 1.27 2002/04/24 02:10:31 oes - * - Jon's patch for multiple AFs: - * - split load_actions_file, add load_one_actions_file - * - make csp->actions_list files an array - * - remember file id with each action - * - Copy_action now frees dest action before copying - * - * Revision 1.26 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.25 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.24 2002/03/16 23:54:06 jongfoster - * Adding graceful termination feature, to help look for memory leaks. - * If you enable this (which, by design, has to be done by hand - * editing config.h) and then go to http://i.j.b/die, then the program - * will exit cleanly after the *next* request. It should free all the - * memory that was used. - * - * Revision 1.23 2002/03/07 03:46:16 oes - * Fixed compiler warnings - * - * Revision 1.22 2002/01/21 00:27:02 jongfoster - * Allowing free_action(NULL). - * Moving the functions that #include actionlist.h to the end of the file, - * because the Visual C++ 97 debugger gets extremely confused if you try - * to debug any code that comes after them in the file. - * - * Revision 1.21 2002/01/17 20:54:44 jongfoster - * Renaming free_url to free_url_spec, since it frees a struct url_spec. - * - * Revision 1.20 2001/11/22 21:56:49 jongfoster - * Making action_spec->flags into an unsigned long rather than just an - * unsigned int. - * Fixing a bug in the display of -add-header and -wafer - * - * Revision 1.19 2001/11/13 00:14:07 jongfoster - * Fixing stupid bug now I've figured out what || means. - * (It always returns 0 or 1, not one of it's paramaters.) - * - * Revision 1.18 2001/11/07 00:06:06 steudten - * Add line number in error output for lineparsing for - * actionsfile. - * - * Revision 1.17 2001/10/25 03:40:47 david__schmidt - * Change in porting tactics: OS/2's EMX porting layer doesn't allow multiple - * threads to call select() simultaneously. So, it's time to do a real, live, - * native OS/2 port. See defines for __EMX__ (the porting layer) vs. __OS2__ - * (native). Both versions will work, but using __OS2__ offers multi-threading. - * - * Revision 1.16 2001/10/23 21:30:30 jongfoster - * Adding error-checking to selected functions. - * - * Revision 1.15 2001/10/14 21:58:22 jongfoster - * Adding support for the CGI-based editor: - * - Exported get_actions() - * - Added new function free_alias_list() - * - Added support for {{settings}} and {{description}} blocks - * in the actions file. They are currently ignored. - * - Added restriction to only one {{alias}} block which must appear - * first in the file, to simplify the editor's rewriting rules. - * - Note that load_actions_file() is no longer used by the CGI-based - * editor, but some of the other routines in this file are. - * - * Revision 1.14 2001/09/22 16:36:59 jongfoster - * Removing unused parameter fs from read_config_line() - * - * Revision 1.13 2001/09/16 15:47:37 jongfoster - * First version of CGI-based edit interface. This is very much a - * work-in-progress, and you can't actually use it to edit anything - * yet. You must #define FEATURE_CGI_EDIT_ACTIONS for these changes - * to have any effect. - * - * Revision 1.12 2001/09/16 13:21:27 jongfoster - * Changes to use new list functions. - * - * Revision 1.11 2001/09/14 00:17:32 jongfoster - * Tidying up memory allocation. New function init_action(). - * - * Revision 1.10 2001/09/10 10:14:34 oes - * Removing unused variable - * - * Revision 1.9 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.8 2001/06/29 13:19:52 oes - * Removed logentry from cancelled commit - * - * Revision 1.7 2001/06/09 10:55:28 jongfoster - * Changing BUFSIZ ==> BUFFER_SIZE - * - * Revision 1.6 2001/06/07 23:04:34 jongfoster - * Made get_actions() static. - * - * Revision 1.5 2001/06/03 19:11:48 oes - * adapted to new enlist_unique arg format - * - * Revision 1.4 2001/06/01 20:03:42 jongfoster - * Better memory management - current_action->strings[] now - * contains copies of the strings, not the original. - * - * Revision 1.3 2001/06/01 18:49:17 jongfoster - * Replaced "list_share" with "list" - the tiny memory gain was not - * worth the extra complexity. - * - * Revision 1.2 2001/05/31 21:40:00 jongfoster - * Removing some commented out, obsolete blocks of code. - * - * Revision 1.1 2001/05/31 21:16:46 jongfoster - * Moved functions to process the action list into this new file. - * - * *********************************************************************/ - + #include "config.h" @@ -685,7 +434,7 @@ jb_err get_action_token(char **line, char **name, char **value) *********************************************************************/ static int action_used_to_be_valid(const char *action) { - static const char *formerly_valid_actions[] = { + static const char * const formerly_valid_actions[] = { "inspect-jpegs", "kill-popups", "send-vanilla-wafer", @@ -773,7 +522,7 @@ jb_err get_actions(char *line, if ((value == NULL) || (*value == '\0')) { - if (0 != strcmpic(action->name, "block")) + if (0 == strcmpic(action->name, "+block")) { /* * XXX: Temporary backwards compatibility hack. @@ -1130,7 +879,7 @@ int update_action_bits_for_tag(struct client_state *csp, const char *tag) * Returns : N/A * *********************************************************************/ -void free_current_action (struct current_action_spec *src) +void free_current_action(struct current_action_spec *src) { int i; @@ -1284,6 +1033,108 @@ int load_action_files(struct client_state *csp) return 0; } + +/********************************************************************* + * + * Function : referenced_filters_are_missing + * + * Description : Checks if any filters of a certain type referenced + * in an action spec are missing. + * + * Parameters : + * 1 : csp = Current client state (buffers, headers, etc...) + * 2 : cur_action = The action spec to check. + * 3 : multi_index = The index where to look for the filter. + * 4 : filter_type = The filter type the caller is interested in. + * + * Returns : 0 => All referenced filters exists, everything else is an error. + * + *********************************************************************/ +static int referenced_filters_are_missing(const struct client_state *csp, + const struct action_spec *cur_action, int multi_index, enum filter_type filter_type) +{ + int i; + struct file_list *fl; + struct re_filterfile_spec *b; + struct list_entry *filtername; + + for (filtername = cur_action->multi_add[multi_index]->first; + filtername; filtername = filtername->next) + { + int filter_found = 0; + for (i = 0; i < MAX_AF_FILES; i++) + { + fl = csp->rlist[i]; + if ((NULL == fl) || (NULL == fl->f)) + { + continue; + } + + for (b = fl->f; b; b = b->next) + { + if (b->type != filter_type) + { + continue; + } + if (strcmp(b->name, filtername->str) == 0) + { + filter_found = 1; + } + } + } + if (!filter_found) + { + log_error(LOG_LEVEL_ERROR, "Missing filter '%s'", filtername->str); + return 1; + } + } + + return 0; + +} + + +/********************************************************************* + * + * Function : action_spec_is_valid + * + * Description : Should eventually figure out if an action spec + * is valid, but currently only checks that the + * referenced filters are accounted for. + * + * Parameters : + * 1 : csp = Current client state (buffers, headers, etc...) + * 2 : cur_action = The action spec to check. + * + * Returns : 0 => No problems detected, everything else is an error. + * + *********************************************************************/ +static int action_spec_is_valid(struct client_state *csp, const struct action_spec *cur_action) +{ + struct { + int multi_index; + enum filter_type filter_type; + } filter_map[] = { + {ACTION_MULTI_FILTER, FT_CONTENT_FILTER}, + {ACTION_MULTI_CLIENT_HEADER_FILTER, FT_CLIENT_HEADER_FILTER}, + {ACTION_MULTI_SERVER_HEADER_FILTER, FT_SERVER_HEADER_FILTER}, + {ACTION_MULTI_CLIENT_HEADER_TAGGER, FT_CLIENT_HEADER_TAGGER}, + {ACTION_MULTI_SERVER_HEADER_TAGGER, FT_SERVER_HEADER_TAGGER} + }; + int errors = 0; + int i; + + for (i = 0; i < SZ(filter_map); i++) + { + errors += referenced_filters_are_missing(csp, cur_action, + filter_map[i].multi_index, filter_map[i].filter_type); + } + + return errors; + +} + + /********************************************************************* * * Function : load_one_actions_file @@ -1306,23 +1157,24 @@ static int load_one_actions_file(struct client_state *csp, int fileid) * Note: Keep these in the order they occur in the file, they are * sometimes tested with <= */ -#define MODE_START_OF_FILE 1 -#define MODE_SETTINGS 2 -#define MODE_DESCRIPTION 3 -#define MODE_ALIAS 4 -#define MODE_ACTIONS 5 - - int mode = MODE_START_OF_FILE; + enum { + MODE_START_OF_FILE = 1, + MODE_SETTINGS = 2, + MODE_DESCRIPTION = 3, + MODE_ALIAS = 4, + MODE_ACTIONS = 5 + } mode; FILE *fp; struct url_actions *last_perm; struct url_actions *perm; - char buf[BUFFER_SIZE]; + char *buf; struct file_list *fs; struct action_spec * cur_action = NULL; int cur_action_used = 0; struct action_alias * alias_list = NULL; unsigned long linenum = 0; + mode = MODE_START_OF_FILE; if (!check_file_changed(current_actions_file[fileid], csp->config->actions_file[fileid], &fs)) { @@ -1353,7 +1205,9 @@ static int load_one_actions_file(struct client_state *csp, int fileid) return 1; /* never get here */ } - while (read_config_line(buf, sizeof(buf), fp, &linenum) != NULL) + log_error(LOG_LEVEL_INFO, "Loading actions file: %s", csp->config->actions_file[fileid]); + + while (read_config_line(fp, &linenum, &buf) != NULL) { if (*buf == '{') { @@ -1369,7 +1223,7 @@ static int load_one_actions_file(struct client_state *csp, int fileid) /* too short */ fclose(fp); log_error(LOG_LEVEL_FATAL, - "can't load actions file '%s': invalid line (%lu): %s", + "can't load actions file '%s': invalid line (%lu): %s", csp->config->actions_file[fileid], linenum, buf); return 1; /* never get here */ } @@ -1470,11 +1324,11 @@ static int load_one_actions_file(struct client_state *csp, int fileid) { /* It's an actions block */ - char actions_buf[BUFFER_SIZE]; + char *actions_buf; char * end; /* set mode */ - mode = MODE_ACTIONS; + mode = MODE_ACTIONS; /* free old action */ if (cur_action) @@ -1497,8 +1351,23 @@ static int load_one_actions_file(struct client_state *csp, int fileid) } init_action(cur_action); - /* trim { */ - strlcpy(actions_buf, buf + 1, sizeof(actions_buf)); + /* + * Copy the buffer before messing with it as we may need the + * unmodified version in for the fatal error messages. Given + * that this is not a common event, we could instead simply + * read the line again. + * + * buf + 1 to skip the leading '{' + */ + actions_buf = strdup(buf + 1); + if (actions_buf == NULL) + { + fclose(fp); + log_error(LOG_LEVEL_FATAL, + "can't load actions file '%s': out of memory", + csp->config->actions_file[fileid]); + return 1; /* never get here */ + } /* check we have a trailing } and then trim it */ end = actions_buf + strlen(actions_buf) - 1; @@ -1506,8 +1375,9 @@ static int load_one_actions_file(struct client_state *csp, int fileid) { /* No closing } */ fclose(fp); - log_error(LOG_LEVEL_FATAL, - "can't load actions file '%s': invalid line (%lu): %s", + freez(actions_buf); + log_error(LOG_LEVEL_FATAL, "can't load actions file '%s': " + "Missing trailing '}' in action section starting at line (%lu): %s", csp->config->actions_file[fileid], linenum, buf); return 1; /* never get here */ } @@ -1520,11 +1390,21 @@ static int load_one_actions_file(struct client_state *csp, int fileid) { /* error */ fclose(fp); - log_error(LOG_LEVEL_FATAL, - "can't load actions file '%s': invalid line (%lu): %s", + freez(actions_buf); + log_error(LOG_LEVEL_FATAL, "can't load actions file '%s': " + "can't completely parse the action section starting at line (%lu): %s", csp->config->actions_file[fileid], linenum, buf); return 1; /* never get here */ } + + if (action_spec_is_valid(csp, cur_action)) + { + log_error(LOG_LEVEL_ERROR, "Invalid action section in file '%s', " + "starting at line %lu: %s", + csp->config->actions_file[fileid], linenum, buf); + } + + freez(actions_buf); } } else if (mode == MODE_SETTINGS) @@ -1548,8 +1428,8 @@ static int load_one_actions_file(struct client_state *csp, int fileid) csp->config->actions_file[fileid]); return 1; /* never get here */ } - - num_fields = ssplit(version_string, ".", fields, 3, TRUE, FALSE); + + num_fields = ssplit(version_string, ".", fields, SZ(fields), TRUE, FALSE); if (num_fields < 1 || atoi(fields[0]) == 0) { @@ -1658,7 +1538,7 @@ static int load_one_actions_file(struct client_state *csp, int fileid) } else if (mode == MODE_ACTIONS) { - /* it's a URL pattern */ + /* it's an URL pattern */ /* allocate a new node */ if ((perm = zalloc(sizeof(*perm))) == NULL) @@ -1678,7 +1558,7 @@ static int load_one_actions_file(struct client_state *csp, int fileid) { fclose(fp); log_error(LOG_LEVEL_FATAL, - "can't load actions file '%s': line %lu: cannot create URL pattern from: %s", + "can't load actions file '%s': line %lu: cannot create URL or TAG pattern from: %s", csp->config->actions_file[fileid], linenum, buf); return 1; /* never get here */ } @@ -1692,7 +1572,7 @@ static int load_one_actions_file(struct client_state *csp, int fileid) /* oops - please have a {} line as 1st line in file. */ fclose(fp); log_error(LOG_LEVEL_FATAL, - "can't load actions file '%s': first needed line (%lu) is invalid: %s", + "can't load actions file '%s': line %lu should begin with a '{': %s", csp->config->actions_file[fileid], linenum, buf); return 1; /* never get here */ } @@ -1705,6 +1585,7 @@ static int load_one_actions_file(struct client_state *csp, int fileid) csp->config->actions_file[fileid], mode); return 1; /* never get here */ } + freez(buf); } fclose(fp); @@ -1738,7 +1619,7 @@ static int load_one_actions_file(struct client_state *csp, int fileid) * * Description : Converts a actionsfile entry from the internal * structure into a text line. The output is split - * into one line for each action with line continuation. + * into one line for each action with line continuation. * * Parameters : * 1 : action = The action to format. @@ -1823,7 +1704,7 @@ char * actions_to_text(const struct action_spec *action) * Function : actions_to_html * * Description : Converts a actionsfile entry from numeric form - * ("mask" and "add") to a
-seperated HTML string + * ("mask" and "add") to a
-separated HTML string * in which each action is linked to its chapter in * the user manual. * @@ -1929,12 +1810,12 @@ char * actions_to_html(const struct client_state *csp, * * Function : current_actions_to_html * - * Description : Converts a curren action spec to a
seperated HTML + * Description : Converts a curren action spec to a
separated HTML * text in which each action is linked to its chapter in * the user manual. * * Parameters : - * 1 : csp = Client state (for config) + * 1 : csp = Client state (for config) * 2 : action = Current action spec to be converted * * Returns : A string. Caller must free it. diff --git a/external/privoxy/actions.h b/external/privoxy/actions.h index 733a8534..8c1a57dd 100644 --- a/external/privoxy/actions.h +++ b/external/privoxy/actions.h @@ -1,6 +1,6 @@ #ifndef ACTIONS_H_INCLUDED #define ACTIONS_H_INCLUDED -#define ACTIONS_H_VERSION "$Id: actions.h,v 1.18 2008/03/30 14:52:00 fabiankeil Exp $" +#define ACTIONS_H_VERSION "$Id: actions.h,v 1.20 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/actions.h,v $ @@ -12,10 +12,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -33,87 +33,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: actions.h,v $ - * Revision 1.18 2008/03/30 14:52:00 fabiankeil - * Rename load_actions_file() and load_re_filterfile() - * as they load multiple files "now". - * - * Revision 1.17 2008/01/28 20:17:40 fabiankeil - * - Mark some parameters as immutable. - * - Hide update_action_bits_for_all_tags() while it's unused. - * - * Revision 1.16 2007/04/17 18:21:45 fabiankeil - * Split update_action_bits() into - * update_action_bits_for_all_tags() - * and update_action_bits_for_tag(). - * - * Revision 1.15 2007/04/15 16:39:20 fabiankeil - * Introduce tags as alternative way to specify which - * actions apply to a request. At the moment tags can be - * created based on client and server headers. - * - * Revision 1.14 2006/07/18 14:48:45 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.12 2002/05/06 07:56:50 oes - * Made actions_to_html independent of FEATURE_CGI_EDIT_ACTIONS - * - * Revision 1.11 2002/04/30 11:14:52 oes - * Made csp the first parameter in *action_to_html - * - * Revision 1.10 2002/04/26 12:53:33 oes - * - actions_to_html signature change - * - current_action_to_text: renamed to current_action_to_html - * and signature change - * - * Revision 1.9 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.8 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.7 2002/03/16 23:54:06 jongfoster - * Adding graceful termination feature, to help look for memory leaks. - * If you enable this (which, by design, has to be done by hand - * editing config.h) and then go to http://i.j.b/die, then the program - * will exit cleanly after the *next* request. It should free all the - * memory that was used. - * - * Revision 1.6 2001/10/23 21:30:30 jongfoster - * Adding error-checking to selected functions. - * - * Revision 1.5 2001/10/14 21:58:22 jongfoster - * Adding support for the CGI-based editor: - * - Exported get_actions() - * - Added new function free_alias_list() - * - Added support for {{settings}} and {{description}} blocks - * in the actions file. They are currently ignored. - * - Added restriction to only one {{alias}} block which must appear - * first in the file, to simplify the editor's rewriting rules. - * - Note that load_actions_file() is no longer used by the CGI-based - * editor, but some of the other routines in this file are. - * - * Revision 1.4 2001/09/16 15:47:37 jongfoster - * First version of CGI-based edit interface. This is very much a - * work-in-progress, and you can't actually use it to edit anything - * yet. You must #define FEATURE_CGI_EDIT_ACTIONS for these changes - * to have any effect. - * - * Revision 1.3 2001/09/14 00:17:32 jongfoster - * Tidying up memory allocation. New function init_action(). - * - * Revision 1.2 2001/07/29 19:01:11 jongfoster - * Changed _FILENAME_H to FILENAME_H_INCLUDED. - * Added forward declarations for needed structures. - * - * Revision 1.1 2001/05/31 21:16:46 jongfoster - * Moved functions to process the action list into this new file. - * - * *********************************************************************/ - + #ifdef __cplusplus extern "C" { @@ -135,27 +56,27 @@ struct action_alias }; -extern jb_err get_actions (char *line, +extern jb_err get_actions (char *line, struct action_alias * alias_list, struct action_spec *cur_action); extern void free_alias_list(struct action_alias *alias_list); extern void init_action(struct action_spec *dest); extern void free_action(struct action_spec *src); -extern jb_err merge_actions (struct action_spec *dest, +extern jb_err merge_actions (struct action_spec *dest, const struct action_spec *src); #if 0 extern int update_action_bits_for_all_tags(struct client_state *csp); #endif extern int update_action_bits_for_tag(struct client_state *csp, const char *tag); -extern jb_err copy_action (struct action_spec *dest, +extern jb_err copy_action (struct action_spec *dest, const struct action_spec *src); extern char * actions_to_text (const struct action_spec *action); extern char * actions_to_html (const struct client_state *csp, const struct action_spec *action); extern void init_current_action (struct current_action_spec *dest); extern void free_current_action (struct current_action_spec *src); -extern jb_err merge_current_action (struct current_action_spec *dest, +extern jb_err merge_current_action (struct current_action_spec *dest, const struct action_spec *src); extern char * current_action_to_html(const struct client_state *csp, const struct current_action_spec *action); diff --git a/external/privoxy/amiga.c b/external/privoxy/amiga.c index 68193fbd..f152a45b 100644 --- a/external/privoxy/amiga.c +++ b/external/privoxy/amiga.c @@ -1,4 +1,4 @@ -const char amiga_rcs[] = "$Id: amiga.c,v 1.12 2007/01/07 07:40:52 joergs Exp $"; +const char amiga_rcs[] = "$Id: amiga.c,v 1.14 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/amiga.c,v $ @@ -8,7 +8,7 @@ const char amiga_rcs[] = "$Id: amiga.c,v 1.12 2007/01/07 07:40:52 joergs Exp $"; * Copyright : Written by and Copyright (C) 2001 the SourceForge * Privoxy team. http://www.privoxy.org/ * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -26,66 +26,8 @@ const char amiga_rcs[] = "$Id: amiga.c,v 1.12 2007/01/07 07:40:52 joergs Exp $"; * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: amiga.c,v $ - * Revision 1.12 2007/01/07 07:40:52 joergs - * Added AmigaOS4 support and made it work on AmigaOS 3.x with current sources. - * - * Revision 1.11 2006/07/18 14:48:45 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.9 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.8 2002/03/25 19:32:15 joergs - * Name in version string changed from junkbuster to Privoxy. - * - * Revision 1.7 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.6 2002/03/09 20:03:52 jongfoster - * - Making various functions return int rather than size_t. - * (Undoing a recent change). Since size_t is unsigned on - * Windows, functions like read_socket that return -1 on - * error cannot return a size_t. - * - * THIS WAS A MAJOR BUG - it caused frequent, unpredictable - * crashes, and also frequently caused JB to jump to 100% - * CPU and stay there. (Because it thought it had just - * read ((unsigned)-1) == 4Gb of data...) - * - * - The signature of write_socket has changed, it now simply - * returns success=0/failure=nonzero. - * - * - Trying to get rid of a few warnings --with-debug on - * Windows, I've introduced a new type "jb_socket". This is - * used for the socket file descriptors. On Windows, this - * is SOCKET (a typedef for unsigned). Everywhere else, it's - * an int. The error value can't be -1 any more, so it's - * now JB_INVALID_SOCKET (which is -1 on UNIX, and in - * Windows it maps to the #define INVALID_SOCKET.) - * - * - The signature of bind_port has changed. - * - * Revision 1.5 2002/03/03 09:18:03 joergs - * Made jumbjuster work on AmigaOS again. - * - * Revision 1.4 2001/10/07 15:35:13 oes - * Replaced 6 boolean members of csp with one bitmap (csp->flags) - * - * Revision 1.3 2001/09/12 22:54:51 joergs - * Stacksize of main thread increased. - * - * Revision 1.2 2001/05/23 00:13:58 joergs - * AmigaOS support fixed. - * - * Revision 1.1.1.1 2001/05/15 13:58:46 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include "config.h" diff --git a/external/privoxy/amiga.h b/external/privoxy/amiga.h index 43ebda6e..093550dd 100644 --- a/external/privoxy/amiga.h +++ b/external/privoxy/amiga.h @@ -1,7 +1,7 @@ #ifdef AMIGA #ifndef AMIGA_H_INCLUDED #define AMIGA_H_INCLUDED -#define AMIGA_H_VERSION "$Id: amiga.h,v 1.12 2007/01/07 07:40:52 joergs Exp $" +#define AMIGA_H_VERSION "$Id: amiga.h,v 1.14 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/amiga.h,v $ @@ -11,7 +11,7 @@ * Copyright : Written by and Copyright (C) 2001 the SourceForge * Privoxy team. http://www.privoxy.org/ * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -29,47 +29,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: amiga.h,v $ - * Revision 1.12 2007/01/07 07:40:52 joergs - * Added AmigaOS4 support and made it work on AmigaOS 3.x with current sources. - * - * Revision 1.11 2006/07/18 14:48:45 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.9 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.8 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.7 2002/03/03 09:18:03 joergs - * Made jumbjuster work on AmigaOS again. - * - * Revision 1.6 2001/10/13 12:46:08 joergs - * Added #undef EINTR to avoid warnings - * - * Revision 1.5 2001/07/29 18:43:08 jongfoster - * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to - * ANSI C rules. - * - * Revision 1.4 2001/05/29 20:05:06 joergs - * Fixed exit() macro not exiting if called before InitAmiga() - * (junkbuster --help and --version). - * - * Revision 1.3 2001/05/25 21:53:27 jongfoster - * Fixing indentation - * - * Revision 1.2 2001/05/23 00:13:58 joergs - * AmigaOS support fixed. - * - * Revision 1.1.1.1 2001/05/15 13:58:46 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #define _KERNEL #include diff --git a/external/privoxy/autom4te.cache/output.0 b/external/privoxy/autom4te.cache/output.0 deleted file mode 100644 index e8eab94b..00000000 --- a/external/privoxy/autom4te.cache/output.0 +++ /dev/null @@ -1,7543 +0,0 @@ -@%:@! /bin/sh -@%:@ From configure.in Revision: 1.126 . -@%:@ Guess values for system-dependent variables and create Makefiles. -@%:@ Generated by GNU Autoconf 2.68. -@%:@ -@%:@ -@%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -@%:@ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -@%:@ Foundation, Inc. -@%:@ -@%:@ -@%:@ This configure script is free software; the Free Software Foundation -@%:@ gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in @%:@( - *posix*) : - set -o posix ;; @%:@( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in @%:@( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in @%:@(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in @%:@( - *posix*) : - set -o posix ;; @%:@( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in @%:@( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in @%:@ (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -@%:@ as_fn_unset VAR -@%:@ --------------- -@%:@ Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -@%:@ as_fn_set_status STATUS -@%:@ ----------------------- -@%:@ Set @S|@? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} @%:@ as_fn_set_status - -@%:@ as_fn_exit STATUS -@%:@ ----------------- -@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} @%:@ as_fn_exit - -@%:@ as_fn_mkdir_p -@%:@ ------------- -@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} @%:@ as_fn_mkdir_p -@%:@ as_fn_append VAR VALUE -@%:@ ---------------------- -@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take -@%:@ advantage of any shell optimizations that allow amortized linear growth over -@%:@ repeated appends, instead of the typical quadratic growth present in naive -@%:@ implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -@%:@ as_fn_arith ARG... -@%:@ ------------------ -@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the -@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments -@%:@ must be portable across @S|@(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] -@%:@ ---------------------------------------- -@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are -@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the -@%:@ script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} @%:@ as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in @%:@((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in @%:@( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in @%:@(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIB@&t@OBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= -PACKAGE_URL= - -ac_unique_file="jcc.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='LTLIBOBJS -LIB@&t@OBJS -PTHREAD_LIB -SPECIAL_CFLAGS -STATIC_PCRS_ONLY -STATIC_PCRE_ONLY -AMIGAOS_ONLY -SOCKET_LIB -PTHREAD_ONLY -EGREP -GREP -DKPREFIX -JADECAT -DOC_STATUS -MAN2HTML -JADEBIN -RPM_BASE -RPMBIN -DB2HTML -WDUMP -WIN_ONLY -GROUP -USER -ID -BGROUPS -GDB -AWK -SET_MAKE -LN_S -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -CPP -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -CODE_STATUS -VERSION_POINT -VERSION_MINOR -VERSION_MAJOR -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -with_docbook -with_db2html -with_debug -with_user -with_group -enable_mingw32 -enable_pthread -enable_toggle -enable_force -enable_fast_redirects -enable_stats -enable_ie_images -enable_image_blocking -enable_acl_files -enable_trust_files -enable_editor -enable_no_gifs -enable_graceful_termination -enable_extended_host_patterns -enable_dynamic_pcre -enable_zlib -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - @<:@@S|@ac_default_prefix@:>@ - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - @<:@PREFIX@:>@ - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root @<:@DATAROOTDIR/doc/PACKAGE@:>@ - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-mingw32 Use mingw32 for a Windows GUI - --disable-pthread Don't use POSIX threads (pthreads) - --disable-toggle Don't support temporary disable - --disable-force Don't allow single-page disable - --disable-fast-redirects Don't support fast redirects - --disable-stats Don't keep statistics - --enable-ie-images Enable a quick but not always reliable auto-detect whether requests from - MS Internet Explorer are for an image or not. - --disable-image-blocking Don't try to figure out whether a request is - for an image or HTML - assume HTML. - --disable-acl-files Prevents the use of ACL files to control access to - Privoxy by IP address. - --disable-trust-files Prevents the use of trust files. - --disable-editor Prevents the use of the web-based actions file - editor and web-based temporary disable setting. - --enable-no-gifs Use politically correct PNG format instead of GIF - for built-in images. May not work with all browsers. - --enable-graceful-termination Allow to shutdown Privoxy through the webinterface. - --enable-extended-host-patterns Allow extended regular expressions in host patterns. - --disable-dynamic-pcre Use the built-in, static pcre, even if libpcre is available - --disable-zlib Don't use zlib to decompress data before filtering. - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-docbook=yes|no|directory - Enable docbook documentation creation - (default = yes, for gnu and linux) - --with-db2html= - Set the location of the docbook to html converter - (default = search) - --with-debug Enable debug mode - --with-user=privoxy Set user under which privoxy will run - --with-group=privoxy Set group for privoxy - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to the package provider. -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -configure -generated by GNU Autoconf 2.68 - -Copyright (C) 2010 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -@%:@ ac_fn_c_try_compile LINENO -@%:@ -------------------------- -@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_compile - -@%:@ ac_fn_c_try_cpp LINENO -@%:@ ---------------------- -@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_cpp - -@%:@ ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -@%:@ ------------------------------------------------------- -@%:@ Tests whether HEADER exists, giving a warning if it cannot be compiled using -@%:@ the include files in INCLUDES and setting the cache variable VAR -@%:@ accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -@%:@include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_header_mongrel - -@%:@ ac_fn_c_try_run LINENO -@%:@ ---------------------- -@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes -@%:@ that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_run - -@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -@%:@ ------------------------------------------------------- -@%:@ Tests whether HEADER exists and can be compiled using the include files in -@%:@ INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -@%:@include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_header_compile - -@%:@ ac_fn_c_try_link LINENO -@%:@ ----------------------- -@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_link - -@%:@ ac_fn_c_check_func LINENO FUNC VAR -@%:@ ---------------------------------- -@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_func - -@%:@ ac_fn_c_check_type LINENO TYPE VAR INCLUDES -@%:@ ------------------------------------------- -@%:@ Tests whether TYPE exists after having included INCLUDES, setting cache -@%:@ variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_type - -@%:@ ac_fn_c_compute_int LINENO EXPR VAR INCLUDES -@%:@ -------------------------------------------- -@%:@ Tries to find the compile-time value of EXPR in a program that includes -@%:@ INCLUDES, setting VAR accordingly. Returns whether the value could be -@%:@ computed -ac_fn_c_compute_int () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array @<:@1 - 2 * !(($2) >= 0)@:>@; -test_array @<:@0@:>@ = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=0 ac_mid=0 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array @<:@1 - 2 * !(($2) <= $ac_mid)@:>@; -test_array @<:@0@:>@ = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid; break -else - as_fn_arith $ac_mid + 1 && ac_lo=$as_val - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array @<:@1 - 2 * !(($2) < 0)@:>@; -test_array @<:@0@:>@ = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=-1 ac_mid=-1 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array @<:@1 - 2 * !(($2) >= $ac_mid)@:>@; -test_array @<:@0@:>@ = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=$ac_mid; break -else - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - ac_lo= ac_hi= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array @<:@1 - 2 * !(($2) <= $ac_mid)@:>@; -test_array @<:@0@:>@ = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid -else - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in @%:@(( -?*) eval "$3=\$ac_lo"; ac_retval=0 ;; -'') ac_retval=1 ;; -esac - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } -@%:@include -@%:@include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (($2) < 0) - { - long int i = longval (); - if (i != ($2)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ($2)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - echo >>conftest.val; read $3 config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in @%:@(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -if test ! -f config.h.in; then - echo "You need to run autoheader first. " - echo -n "Shall I do this for you now? (y/n) " - read answer - if test "$answer" != "y"; then - exit 1 - else - autoheader - fi -fi - -ac_config_headers="$ac_config_headers config.h" - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - - -dodk=auto -DKPREFIX=none - -@%:@ Check whether --with-docbook was given. -if test "${with_docbook+set}" = set; then : - withval=$with_docbook; case "$with_docbook" in -yes) dodk=yes;; -no) dodk=no;; -*) - dodk=yes - DKPREFIX=$withval - ;; -esac - -fi - -DB2HTML=false - -@%:@ Check whether --with-db2html was given. -if test "${with_db2html+set}" = set; then : - withval=$with_db2html; DB2HTML=$withval - -fi - - - -VERSION_MAJOR=3 -VERSION_MINOR=0 -VERSION_POINT=12 -CODE_STATUS="stable" - - - - - - - - -cat >>confdefs.h <<_ACEOF -@%:@define VERSION_MAJOR ${VERSION_MAJOR} -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define VERSION_MINOR ${VERSION_MINOR} -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define VERSION_POINT ${VERSION_POINT} -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_POINT}" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define CODE_STATUS "${CODE_STATUS}" -_ACEOF - - - -if test "X$CFLAGS" = "X"; then - CFLAGS=" " -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $@%:@ != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@ifdef __STDC__ -@%:@ include -@%:@else -@%:@ include -@%:@endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@ifdef __STDC__ -@%:@ include -@%:@else -@%:@ include -@%:@endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in @%:@(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - - -# Extract the first word of "gdb", so it can be a program name with args. -set dummy gdb; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_GDB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$GDB"; then - ac_cv_prog_GDB="$GDB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_GDB="yes" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_prog_GDB" && ac_cv_prog_GDB="no" -fi -fi -GDB=$ac_cv_prog_GDB -if test -n "$GDB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GDB" >&5 -$as_echo "$GDB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "groups", so it can be a program name with args. -set dummy groups; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BGROUPS+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BGROUPS in - [\\/]* | ?:[\\/]*) - ac_cv_path_BGROUPS="$BGROUPS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="/bin:/usr/bin:/usr/local/bin" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_BGROUPS="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_BGROUPS" && ac_cv_path_BGROUPS="no" - ;; -esac -fi -BGROUPS=$ac_cv_path_BGROUPS -if test -n "$BGROUPS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BGROUPS" >&5 -$as_echo "$BGROUPS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "id", so it can be a program name with args. -set dummy id; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ID+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ID in - [\\/]* | ?:[\\/]*) - ac_cv_path_ID="$ID" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="/bin:/usr/bin:/usr/local/bin" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ID="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_ID" && ac_cv_path_ID="no" - ;; -esac -fi -ID=$ac_cv_path_ID -if test -n "$ID"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ID" >&5 -$as_echo "$ID" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - - - - -@%:@ Check whether --with-debug was given. -if test "${with_debug+set}" = set; then : - withval=$with_debug; - if test "x$withval" != "xno" ; then - if test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - if test "$GDB"; then - CFLAGS="$CFLAGS -ggdb" - else - CFLAGS="$CFLAGS -g" - fi - CFLAGS="$CFLAGS -Wshadow -Wconversion" - else - CFLAGS="$CFLAGS -g" - fi - fi - fi - -else - - if test "X$CFLAGS" = "X "; then # if CFLAGS were unset (see above) - if test "$GCC" = yes; then - CFLAGS="-O2" - fi - fi - - -fi - - - - -if test "$EMXOS2" = yes; then - echo "Skipping user and group validity stuff."; - -else - - $ID privoxy >/dev/null 2>/dev/null - if test $? -ne 0 ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: There is no user 'privoxy' on this system" >&5 -$as_echo "$as_me: WARNING: There is no user 'privoxy' on this system" >&2;} - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for user" >&5 -$as_echo_n "checking for user... " >&6; } - -@%:@ Check whether --with-user was given. -if test "${with_user+set}" = set; then : - withval=$with_user; - if test "x$withval" != "xyes"; then - if test $ID = no ; then - as_fn_error $? "There is no 'id' program on this system" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_user" >&5 -$as_echo "$with_user" >&6; } - $ID $with_user 2>/dev/null >/dev/null - if test $? -eq 0 ; then - USER=$with_user; - else - as_fn_error $? "There is no user '$with_user' on this system" "$LINENO" 5 - fi - fi - else - as_fn_error $? "We need a user if you give me this parameter" "$LINENO" 5 - fi - -else - - if test $ID = no ; then - as_fn_error $? "There is no 'id' programm on this system" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none specified" >&5 -$as_echo "none specified" >&6; } - USER=$with_user - fi - - -fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for group" >&5 -$as_echo_n "checking for group... " >&6; } - -@%:@ Check whether --with-group was given. -if test "${with_group+set}" = set; then : - withval=$with_group; - if test "x$withval" != "xyes"; then - if test $BGROUPS = no ; then - as_fn_error $? "There is no 'groups' program on this system" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_group" >&5 -$as_echo "$with_group" >&6; } - $BGROUPS $USER >/dev/null - if test $? -eq 0 ; then - # FIXME: this fails if valid group, but not first group - # listed. - if test "$with_group" != "`$BGROUPS $USER | sed 's/.*: //' 2>/dev/null |$AWK '{print $1}'`" ; then - as_fn_error $? "The given value '$withval' does not match group entry" "$LINENO" 5 - else - GROUP=$with_group; - fi - else - as_fn_error $? "There is no group entry for user '$USER'" "$LINENO" 5 - fi - fi - else - as_fn_error $? "We need a group if you give me this parameter" "$LINENO" 5 - fi - -else - - if test $BGROUPS = no ; then - as_fn_error $? "There is no 'groups' programm on this system" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none specified" >&5 -$as_echo "none specified" >&6; } - GROUP=$with_group; - fi - - -fi - - - -fi - -if test "$GCC"; then - if test "$host" != "powerpc-unknown-amigaos"; then - CFLAGS="-pipe $CFLAGS" - fi -fi - - - - -case $host_os in - *mingw32* ) MINGW32=yes;; - * ) MINGW32=no;; -esac - - -case $host_os in - *cygwin* ) CYGWIN=yes;; - * ) CYGWIN=no;; -esac - - -if test "$MINGW32" = "yes"; then - target_type=mingw -else - if test "$CYGWIN" = "yes"; then - target_type=cygwin - else - target_type=unix - fi -fi - -if test $dodk = auto; then - dodk=no - if test $target_type = unix; then - case "$host_os" in - linux* | gnu*) - dodk=yes - ;; - esac - fi -fi - - -@%:@ Check whether --enable-mingw32 was given. -if test "${enable_mingw32+set}" = set; then : - enableval=$enable_mingw32; if test $enableval = yes; then - target_type=mingw -fi -fi - - -if test $target_type = mingw; then - WIN_ONLY= - SPECIAL_CFLAGS="-mwindows -mno-cygwin" - PTHREAD_LIB=-lpthreadGC - echo "Using mingw32 (Win32 GUI)" -else - WIN_ONLY=# - if test $target_type = cygwin; then - SPECIAL_CFLAGS="-mno-win32" - PTHREAD_LIB= - echo "Using Cygnus (Win32 command line)" - else - SPECIAL_CFLAGS= - PTHREAD_LIB=-lpthread - fi -fi - - -if test $dodk != no; then - for ac_prog in w3m lynx links -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_WDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$WDUMP"; then - ac_cv_prog_WDUMP="$WDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_WDUMP="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -WDUMP=$ac_cv_prog_WDUMP -if test -n "$WDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WDUMP" >&5 -$as_echo "$WDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$WDUMP" && break -done -test -n "$WDUMP" || WDUMP="false" - - if test "$WDUMP" = false; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You need some kind of text browser to build documentation \(w3m, lynx and links are supported\)" >&5 -$as_echo "$as_me: WARNING: You need some kind of text browser to build documentation \(w3m, lynx and links are supported\)" >&2;} - fi - if test $DB2HTML = false; then - DB2HTML="" - for ac_prog in db2html docbook2html -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DB2HTML+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DB2HTML"; then - ac_cv_prog_DB2HTML="$DB2HTML" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DB2HTML="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DB2HTML=$ac_cv_prog_DB2HTML -if test -n "$DB2HTML"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DB2HTML" >&5 -$as_echo "$DB2HTML" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DB2HTML" && break -done -test -n "$DB2HTML" || DB2HTML="false" - - fi -fi - - - -for ac_prog in rpm -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RPMBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RPMBIN"; then - ac_cv_prog_RPMBIN="$RPMBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RPMBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RPMBIN=$ac_cv_prog_RPMBIN -if test -n "$RPMBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RPMBIN" >&5 -$as_echo "$RPMBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$RPMBIN" && break -done -test -n "$RPMBIN" || RPMBIN="false" - -if test $RPMBIN != false; then - RPM_BASE=`rpm --eval "%{_topdir}"` - if test "$RPM_BASE" = ""; then - RPM_BASE=/usr/src/redhat - fi -fi - - -for ac_prog in jade openjade -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_JADEBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$JADEBIN"; then - ac_cv_prog_JADEBIN="$JADEBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_JADEBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -JADEBIN=$ac_cv_prog_JADEBIN -if test -n "$JADEBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JADEBIN" >&5 -$as_echo "$JADEBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$JADEBIN" && break -done -test -n "$JADEBIN" || JADEBIN="false" - - - -for ac_prog in man2html -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MAN2HTML+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MAN2HTML"; then - ac_cv_prog_MAN2HTML="$MAN2HTML" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_MAN2HTML="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MAN2HTML=$ac_cv_prog_MAN2HTML -if test -n "$MAN2HTML"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAN2HTML" >&5 -$as_echo "$MAN2HTML" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$MAN2HTML" && break -done -test -n "$MAN2HTML" || MAN2HTML="false" - - - -DOC_STATUS=p-not-stable -if test $CODE_STATUS = stable; then - DOC_STATUS="p-stable" -fi - - -JADECAT="" -if test $dodk = yes; then - if test $DKPREFIX = none; then - for i in /usr/share/sgml/docbook/dsssl-stylesheets \ - /usr/share/sgml/docbkdsl /usr/share/sgml/docbook-dsssl \ - /usr/local/share/sgml/docbook/dsssl/modular \ - /usr/share/sgml/docbook/stylesheet/dsssl/modular/ \ - ; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $i" >&5 -$as_echo_n "checking for $i... " >&6; } - if test -f $i/html/docbook.dsl; then - echo "yes" - DKPREFIX=$i - break - else - echo "no" - fi - done -# where are the catalogs? - for i in /usr/share/sgml/CATALOG.docbk30 \ - /usr/share/sgml/CATALOG.docbk31 \ - /usr/share/sgml/CATALOG.docbk31 \ - /usr/local/share/sgml/docbook/3.0/docbook.cat \ - /usr/local/share/sgml/docbook/3.1/docbook.cat \ - /usr/share/sgml/docbook/dtd/3.1/docbook.cat \ - ; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $i" >&5 -$as_echo_n "checking for $i... " >&6; } - if test -f $i; then - echo "yes" - JADECAT="$JADECAT -c $i" - else - echo "no" - fi - done - fi -fi - - - -old_CFLAGS_nospecial=$CFLAGS -CFLAGS="$CFLAGS $SPECIAL_CFLAGS" - -# Hack to force AutoConf to use the CFLAGS we just set -ac_cpp='$CPP $CPPFLAGS $SPECIAL_CFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : - have_pthread=yes -else - have_pthread=no -fi - - - -@%:@ Check whether --enable-pthread was given. -if test "${enable_pthread+set}" = set; then : - enableval=$enable_pthread; if test $enableval = no; then - # Disable pthreads - if test $have_pthread = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pthreads seem to be available but you are using --disable-pthread." >&5 -$as_echo "$as_me: WARNING: pthreads seem to be available but you are using --disable-pthread." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This is almost always a mistake and can render Privoxy unacceptable slow." >&5 -$as_echo "$as_me: WARNING: This is almost always a mistake and can render Privoxy unacceptable slow." >&2;} - fi - have_pthread=no -fi -fi - - -if test $have_pthread = yes; then - PTHREAD_ONLY= - $as_echo "@%:@define FEATURE_PTHREAD 1" >>confdefs.h - - echo Using POSIX threads - if test "$GCC" = "yes"; then - # Set a GCC specific switch: - if test "$target_type" = "unix"; then - ac_jgf_save_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -pthread" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -void *p = pthread_create; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - # This compiler switch makes GCC on Linux thread-safe - # However, it's not supported on most other OS. - PTHREAD_LIB= - SPECIAL_CFLAGS="-pthread" - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ac_jgf_save_CFLAGS - fi - fi -else - PTHREAD_ONLY=# - echo Using native threads -fi - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 -$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } -if ${ac_cv_lib_nsl_gethostbyname+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnsl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gethostbyname (); -int -main () -{ -return gethostbyname (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_nsl_gethostbyname=yes -else - ac_cv_lib_nsl_gethostbyname=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 -$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } -if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_LIBNSL 1 -_ACEOF - - LIBS="-lnsl $LIBS" - -fi - - -ac_fn_c_check_func "$LINENO" "gethostbyaddr_r" "ac_cv_func_gethostbyaddr_r" -if test "x$ac_cv_func_gethostbyaddr_r" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking signature of gethostbyaddr_r" >&5 -$as_echo_n "checking signature of gethostbyaddr_r... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include - -int -main () -{ - - struct hostent *h, *hp; - char *a, *b; - int l, bl, t, e; - (void) gethostbyaddr_r(a, l, t, h, b, bl, &hp, &e) - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - $as_echo "@%:@define HAVE_GETHOSTBYADDR_R_8_ARGS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: 8 args" >&5 -$as_echo "8 args" >&6; } - -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include - -int -main () -{ - - struct hostent *h; - char *a, *b; - int l, bl, t, e; - (void) gethostbyaddr_r(a, l, t, h, b, bl, &e) - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - $as_echo "@%:@define HAVE_GETHOSTBYADDR_R_7_ARGS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: 7 args" >&5 -$as_echo "7 args" >&6; } - -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include - -int -main () -{ - - struct hostent_data *d; - struct hostent *h; - char a, - int l, t; - (void) gethostbyaddr_r(a, l, t, h, d) - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - $as_echo "@%:@define HAVE_GETHOSTBYADDR_R_5_ARGS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: 5 args" >&5 -$as_echo "5 args" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unrecognised" >&5 -$as_echo "unrecognised" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi - - -ac_fn_c_check_func "$LINENO" "gethostbyname_r" "ac_cv_func_gethostbyname_r" -if test "x$ac_cv_func_gethostbyname_r" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking signature of gethostbyname_r" >&5 -$as_echo_n "checking signature of gethostbyname_r... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include - -int -main () -{ - - struct hostent *h, *r; - char *n, *b; - int bl, e; - (void) gethostbyname_r(n, h, b, bl, &r, &e) - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - $as_echo "@%:@define HAVE_GETHOSTBYNAME_R_6_ARGS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: 6 args" >&5 -$as_echo "6 args" >&6; } - -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include - -int -main () -{ - - struct hostent *h; - char *n, *b; - int bl, e; - (void) gethostbyname_r(n, h, b, bl, &e) - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - $as_echo "@%:@define HAVE_GETHOSTBYNAME_R_5_ARGS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: 5 args" >&5 -$as_echo "5 args" >&6; } - -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include - -int -main () -{ - - struct hostent_data *d; - struct hostent *h; - char *n, - (void) gethostbyname_r(n, h, d) - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - $as_echo "@%:@define HAVE_GETHOSTBYNAME_R_3_ARGS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: 3 args" >&5 -$as_echo "3 args" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unrecognised" >&5 -$as_echo "unrecognised" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi - - -ac_fn_c_check_func "$LINENO" "gmtime_r" "ac_cv_func_gmtime_r" -if test "x$ac_cv_func_gmtime_r" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking signature of gmtime_r" >&5 -$as_echo_n "checking signature of gmtime_r... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include - -int -main () -{ - - struct time *t; - struct tm *tm; - (void) gmtime_r(t, tm) - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - $as_echo "@%:@define HAVE_GMTIME_R 1" >>confdefs.h - - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unrecognised" >&5 -$as_echo "unrecognised" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi - - -ac_fn_c_check_func "$LINENO" "localtime_r" "ac_cv_func_localtime_r" -if test "x$ac_cv_func_localtime_r" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking signature of localtime_r" >&5 -$as_echo_n "checking signature of localtime_r... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include - -int -main () -{ - - struct time *t; - struct tm *tm; - (void) localtime_r(t, tm) - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - $as_echo "@%:@define HAVE_LOCALTIME_R 1" >>confdefs.h - - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unrecognised" >&5 -$as_echo "unrecognised" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi - - - - -SOCKET_LIB= - -case "$host" in -*-solaris*) SOCKET_LIB="-lsocket -lnsl" - $as_echo "@%:@define __EXTENSIONS__ 1" >>confdefs.h - - if test "$GCC" = "yes"; then - # Set a GCC specific switch: - # This compiler switch makes Solaris thread-safe - PTHREAD_LIB= - SPECIAL_CFLAGS="-pthreads" - else - # What do we do without GCC? Guess this: - SPECIAL_CFLAGS="-D_REENTRANT" - fi -;; -esac - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5 -$as_echo_n "checking for socklen_t... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "socklen_t" >/dev/null 2>&1; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -$as_echo "@%:@define socklen_t int" >>confdefs.h - -fi -rm -f conftest* - - - - -case "$host" in -*-os2-emx*) SOCKET_LIB=-lsocket -;; -esac - - - - -case "$host" in -*-apple-darwin*) SPECIAL_CFLAGS="-Dunix" -;; -esac - - -case "$host" in -*-openbsd*) SPECIAL_CFLAGS="$SPECIAL_CFLAGS -Dunix" -;; -esac - - -AMIGAOS_ONLY=# - -case "$host" in -*-amigaos) AMIGAOS_ONLY= -;; -esac - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h - -fi - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 -$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if eval \${$as_ac_Header+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include <$ac_hdr> - -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_ac_Header=yes" -else - eval "$as_ac_Header=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_ac_Header - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -@%:@define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF - -ac_header_dirent=$ac_hdr; break -fi - -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dir; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : - break -fi -done -if ${ac_cv_search_opendir+:} false; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' x; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : - break -fi -done -if ${ac_cv_search_opendir+:} false; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if ${ac_cv_c_const+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset cs; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *pcpcc; - char **ppc; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - pcpcc = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++pcpcc; - ppc = (char**) pcpcc; - pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - if (s) return 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - if (!foo) return 0; - } - return !cs[0] && !zero.x; -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_const=yes -else - ac_cv_c_const=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } -if test $ac_cv_c_const = no; then - -$as_echo "@%:@define const /**/" >>confdefs.h - -fi - -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -@%:@define size_t unsigned int -_ACEOF - -fi - -ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -if test "x$ac_cv_type_pid_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -@%:@define pid_t int -_ACEOF - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if ${ac_cv_header_time+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_time=yes -else - ac_cv_header_time=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then - -$as_echo "@%:@define TIME_WITH_SYS_TIME 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 -$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if ${ac_cv_struct_tm+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include - -int -main () -{ -struct tm tm; - int *p = &tm.tm_sec; - return !p; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_struct_tm=time.h -else - ac_cv_struct_tm=sys/time.h -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 -$as_echo "$ac_cv_struct_tm" >&6; } -if test $ac_cv_struct_tm = sys/time.h; then - -$as_echo "@%:@define TM_IN_SYS_TIME 1" >>confdefs.h - -fi - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 -$as_echo_n "checking size of int... " >&6; } -if ${ac_cv_sizeof_int+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_int" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (int) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_int=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 -$as_echo "$ac_cv_sizeof_int" >&6; } - - - -cat >>confdefs.h <<_ACEOF -@%:@define SIZEOF_INT $ac_cv_sizeof_int -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char *" >&5 -$as_echo_n "checking size of char *... " >&6; } -if ${ac_cv_sizeof_char_p+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char *))" "ac_cv_sizeof_char_p" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_char_p" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (char *) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_char_p=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char_p" >&5 -$as_echo "$ac_cv_sizeof_char_p" >&6; } - - - -cat >>confdefs.h <<_ACEOF -@%:@define SIZEOF_CHAR_P $ac_cv_sizeof_char_p -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if ${ac_cv_sizeof_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (long) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_long=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } - - - -cat >>confdefs.h <<_ACEOF -@%:@define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 -$as_echo_n "checking size of long long... " >&6; } -if ${ac_cv_sizeof_long_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_long_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (long long) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_long_long=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 -$as_echo "$ac_cv_sizeof_long_long" >&6; } - - - -cat >>confdefs.h <<_ACEOF -@%:@define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 -$as_echo_n "checking size of size_t... " >&6; } -if ${ac_cv_sizeof_size_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_size_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (size_t) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_size_t=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 -$as_echo "$ac_cv_sizeof_size_t" >&6; } - - - -cat >>confdefs.h <<_ACEOF -@%:@define SIZEOF_SIZE_T $ac_cv_sizeof_size_t -_ACEOF - - - -for ac_header in OS.h arpa/inet.h errno.h fcntl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h sys/timeb.h sys/wait.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_func in strerror bcopy memmove -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -if test $ac_cv_c_compiler_gnu = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 -$as_echo_n "checking whether $CC needs -traditional... " >&6; } -if ${ac_cv_prog_gcc_traditional+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_pattern="Autoconf.*'x'" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -Autoconf TIOCGETP -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then : - ac_cv_prog_gcc_traditional=yes -else - ac_cv_prog_gcc_traditional=no -fi -rm -f conftest* - - - if test $ac_cv_prog_gcc_traditional = no; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -Autoconf TCGETA -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then : - ac_cv_prog_gcc_traditional=yes -fi -rm -f conftest* - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 -$as_echo "$ac_cv_prog_gcc_traditional" >&6; } - if test $ac_cv_prog_gcc_traditional = yes; then - CC="$CC -traditional" - fi -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5 -$as_echo_n "checking whether setpgrp takes no argument... " >&6; } -if ${ac_cv_func_setpgrp_void+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - as_fn_error $? "cannot check setpgrp when cross compiling" "$LINENO" 5 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -/* If this system has a BSD-style setpgrp which takes arguments, - setpgrp(1, 1) will fail with ESRCH and return -1, in that case - exit successfully. */ - return setpgrp (1,1) != -1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_setpgrp_void=no -else - ac_cv_func_setpgrp_void=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5 -$as_echo "$ac_cv_func_setpgrp_void" >&6; } -if test $ac_cv_func_setpgrp_void = yes; then - -$as_echo "@%:@define SETPGRP_VOID 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 -$as_echo_n "checking return type of signal handlers... " >&6; } -if ${ac_cv_type_signal+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include - -int -main () -{ -return *(signal (0, 0)) (0) == 1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_type_signal=int -else - ac_cv_type_signal=void -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 -$as_echo "$ac_cv_type_signal" >&6; } - -cat >>confdefs.h <<_ACEOF -@%:@define RETSIGTYPE $ac_cv_type_signal -_ACEOF - - -for ac_func in access atexit getcwd gethostbyaddr gethostbyaddr_r gethostbyname gethostbyname_r gettimeofday inet_ntoa localtime_r memchr memmove memset poll putenv random regcomp select setlocale snprintf socket strchr strdup strerror strftime strlcat strlcpy strptime strstr strtoul timegm tzset -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 -$as_echo_n "checking for pcre_compile in -lpcre... " >&6; } -if ${ac_cv_lib_pcre_pcre_compile+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpcre $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pcre_compile (); -int -main () -{ -return pcre_compile (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pcre_pcre_compile=yes -else - ac_cv_lib_pcre_pcre_compile=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 -$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } -if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : - - ac_fn_c_check_header_mongrel "$LINENO" "pcre.h" "ac_cv_header_pcre_h" "$ac_includes_default" -if test "x$ac_cv_header_pcre_h" = xyes; then : - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "pcre_fullinfo" >/dev/null 2>&1; then : - have_pcre=yes -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pcre old version installed" >&5 -$as_echo "$as_me: WARNING: pcre old version installed" >&2;}; have_pcre=no -fi -rm -f conftest* - - -else - - ac_fn_c_check_header_mongrel "$LINENO" "pcre/pcre.h" "ac_cv_header_pcre_pcre_h" "$ac_includes_default" -if test "x$ac_cv_header_pcre_pcre_h" = xyes; then : - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "pcre_fullinfo" >/dev/null 2>&1; then : - have_pcre=yes; $as_echo "@%:@define PCRE_H_IN_SUBDIR 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pcre old version installed" >&5 -$as_echo "$as_me: WARNING: pcre old version installed" >&2;}; have_pcre=no -fi -rm -f conftest* - - -else - have_pcre=no -fi - - - -fi - - - -else - have_pcre=no -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for regcomp in -lpcreposix" >&5 -$as_echo_n "checking for regcomp in -lpcreposix... " >&6; } -if ${ac_cv_lib_pcreposix_regcomp+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpcreposix -lpcre $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char regcomp (); -int -main () -{ -return regcomp (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pcreposix_regcomp=yes -else - ac_cv_lib_pcreposix_regcomp=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcreposix_regcomp" >&5 -$as_echo "$ac_cv_lib_pcreposix_regcomp" >&6; } -if test "x$ac_cv_lib_pcreposix_regcomp" = xyes; then : - - ac_fn_c_check_header_mongrel "$LINENO" "pcreposix.h" "ac_cv_header_pcreposix_h" "$ac_includes_default" -if test "x$ac_cv_header_pcreposix_h" = xyes; then : - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "pcreposix_regerror" >/dev/null 2>&1; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pcreposix old version installed" >&5 -$as_echo "$as_me: WARNING: pcreposix old version installed" >&2;}; have_pcreposix=no -else - have_pcreposix=yes -fi -rm -f conftest* - - -else - - ac_fn_c_check_header_mongrel "$LINENO" "pcre/pcreposix.h" "ac_cv_header_pcre_pcreposix_h" "$ac_includes_default" -if test "x$ac_cv_header_pcre_pcreposix_h" = xyes; then : - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "pcreposix_regerror" >/dev/null 2>&1; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pcreposix old version installed" >&5 -$as_echo "$as_me: WARNING: pcreposix old version installed" >&2;}; have_pcreposix=no -else - have_pcreposix=yes; $as_echo "@%:@define PCREPOSIX_H_IN_SUBDIR 1" >>confdefs.h - -fi -rm -f conftest* - - -else - have_pcreposix=no -fi - - - -fi - - - -else - have_pcreposix=no -fi - - - - -$as_echo "@%:@define __MT__ 1" >>confdefs.h - - - -@%:@ Check whether --enable-toggle was given. -if test "${enable_toggle+set}" = set; then : - enableval=$enable_toggle; if test $enableval = yes; then - $as_echo "@%:@define FEATURE_TOGGLE 1" >>confdefs.h - -fi -else - $as_echo "@%:@define FEATURE_TOGGLE 1" >>confdefs.h - -fi - - -@%:@ Check whether --enable-force was given. -if test "${enable_force+set}" = set; then : - enableval=$enable_force; if test $enableval = yes; then - $as_echo "@%:@define FEATURE_FORCE_LOAD 1" >>confdefs.h - -fi -else - $as_echo "@%:@define FEATURE_FORCE_LOAD 1" >>confdefs.h - -fi - - -@%:@ Check whether --enable-fast-redirects was given. -if test "${enable_fast_redirects+set}" = set; then : - enableval=$enable_fast_redirects; if test $enableval = yes; then - $as_echo "@%:@define FEATURE_FAST_REDIRECTS 1" >>confdefs.h - -fi -else - $as_echo "@%:@define FEATURE_FAST_REDIRECTS 1" >>confdefs.h - -fi - - -@%:@ Check whether --enable-stats was given. -if test "${enable_stats+set}" = set; then : - enableval=$enable_stats; if test $enableval = yes; then - $as_echo "@%:@define FEATURE_STATISTICS 1" >>confdefs.h - -fi -else - $as_echo "@%:@define FEATURE_STATISTICS 1" >>confdefs.h - -fi - - -@%:@ Check whether --enable-ie-images was given. -if test "${enable_ie_images+set}" = set; then : - enableval=$enable_ie_images; if test $enableval = yes; then - $as_echo "@%:@define FEATURE_IMAGE_DETECT_MSIE 1" >>confdefs.h - -fi -fi - - -@%:@ Check whether --enable-image-blocking was given. -if test "${enable_image_blocking+set}" = set; then : - enableval=$enable_image_blocking; if test $enableval = yes; then - $as_echo "@%:@define FEATURE_IMAGE_BLOCKING 1" >>confdefs.h - -fi -else - $as_echo "@%:@define FEATURE_IMAGE_BLOCKING 1" >>confdefs.h - -fi - - -@%:@ Check whether --enable-acl-files was given. -if test "${enable_acl_files+set}" = set; then : - enableval=$enable_acl_files; if test $enableval = yes; then - $as_echo "@%:@define FEATURE_ACL 1" >>confdefs.h - -fi -else - $as_echo "@%:@define FEATURE_ACL 1" >>confdefs.h - -fi - - -@%:@ Check whether --enable-trust-files was given. -if test "${enable_trust_files+set}" = set; then : - enableval=$enable_trust_files; if test $enableval = yes; then - $as_echo "@%:@define FEATURE_TRUST 1" >>confdefs.h - -fi -else - $as_echo "@%:@define FEATURE_TRUST 1" >>confdefs.h - -fi - - -@%:@ Check whether --enable-editor was given. -if test "${enable_editor+set}" = set; then : - enableval=$enable_editor; if test $enableval = yes; then - $as_echo "@%:@define FEATURE_CGI_EDIT_ACTIONS 1" >>confdefs.h - -fi -else - $as_echo "@%:@define FEATURE_CGI_EDIT_ACTIONS 1" >>confdefs.h - -fi - - -@%:@ Check whether --enable-no-gifs was given. -if test "${enable_no_gifs+set}" = set; then : - enableval=$enable_no_gifs; if test $enableval = yes; then - $as_echo "@%:@define FEATURE_NO_GIFS 1" >>confdefs.h - -fi -fi - - -@%:@ Check whether --enable-graceful-termination was given. -if test "${enable_graceful_termination+set}" = set; then : - enableval=$enable_graceful_termination; if test $enableval = yes; then - $as_echo "@%:@define FEATURE_GRACEFUL_TERMINATION 1" >>confdefs.h - -fi -fi - - -@%:@ Check whether --enable-extended-host-patterns was given. -if test "${enable_extended_host_patterns+set}" = set; then : - enableval=$enable_extended_host_patterns; if test $enableval = yes; then - $as_echo "@%:@define FEATURE_EXTENDED_HOST_PATTERNS 1" >>confdefs.h - -fi -fi - - - -@%:@ Check whether --enable-dynamic-pcre was given. -if test "${enable_dynamic_pcre+set}" = set; then : - enableval=$enable_dynamic_pcre; if test $enableval = "no"; then have_pcre=no; fi -fi - - - - -@%:@ Check whether --enable-zlib was given. -if test "${enable_zlib+set}" = set; then : - enableval=$enable_zlib; enableval2=$enableval -else - enableval2=yes -fi - -if test $enableval2 = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5 -$as_echo_n "checking for zlibVersion in -lz... " >&6; } -if ${ac_cv_lib_z_zlibVersion+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char zlibVersion (); -int -main () -{ -return zlibVersion (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_z_zlibVersion=yes -else - ac_cv_lib_z_zlibVersion=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_zlibVersion" >&5 -$as_echo "$ac_cv_lib_z_zlibVersion" >&6; } -if test "x$ac_cv_lib_z_zlibVersion" = xyes; then : - have_zlib="yes" -else - have_zlib="no" -fi - - if test $have_zlib = "yes"; then - LIBS="$LIBS -lz" - -$as_echo "@%:@define FEATURE_ZLIB 1" >>confdefs.h - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No zlib found. - Privoxy will not be able to filter compressed content. - This may become a fatal error in the future." >&5 -$as_echo "$as_me: WARNING: No zlib found. - Privoxy will not be able to filter compressed content. - This may become a fatal error in the future." >&2;} - fi -fi - - -# If we have libpcre and either we also have pcreposix or -# we don't need pcreposix, then link pcre dynamically; else -# build it and link statically -# -if test $have_pcre = "yes"; then - echo "using libpcre" - pcre_dyn=yes - STATIC_PCRE_ONLY=# - LIBS="$LIBS -lpcre -lpcreposix" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You are using the static PCRE code which is scheduled for removal, for details see: - https://sourceforge.net/mailarchive/message.php?msg_id=20080511195555.2dc6cfdc%40fabiankeil.de" >&5 -$as_echo "$as_me: WARNING: You are using the static PCRE code which is scheduled for removal, for details see: - https://sourceforge.net/mailarchive/message.php?msg_id=20080511195555.2dc6cfdc%40fabiankeil.de" >&2;} - pcre_dyn=no - $as_echo "@%:@define STATIC_PCRE 1" >>confdefs.h - - STATIC_PCRE_ONLY= -fi - -if test $have_pthread = "yes" -o $target_type = "mingw"; then - echo Enabling keep-alive support for outgoing connections. - $as_echo "@%:@define FEATURE_CONNECTION_KEEP_ALIVE 1" >>confdefs.h - -fi - - $as_echo "@%:@define STATIC_PCRS 1" >>confdefs.h - - STATIC_PCRS_ONLY= - - - - - -CFLAGS=$old_CFLAGS_nospecial - - - - -ac_config_files="$ac_config_files GNUmakefile doc/source/ldp.dsl" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIB@&t@OBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in @%:@( - *posix*) : - set -o posix ;; @%:@( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in @%:@( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in @%:@(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] -@%:@ ---------------------------------------- -@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are -@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the -@%:@ script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} @%:@ as_fn_error - - -@%:@ as_fn_set_status STATUS -@%:@ ----------------------- -@%:@ Set @S|@? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} @%:@ as_fn_set_status - -@%:@ as_fn_exit STATUS -@%:@ ----------------- -@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} @%:@ as_fn_exit - -@%:@ as_fn_unset VAR -@%:@ --------------- -@%:@ Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -@%:@ as_fn_append VAR VALUE -@%:@ ---------------------- -@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take -@%:@ advantage of any shell optimizations that allow amortized linear growth over -@%:@ repeated appends, instead of the typical quadratic growth present in naive -@%:@ implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -@%:@ as_fn_arith ARG... -@%:@ ------------------ -@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the -@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments -@%:@ must be portable across @S|@(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in @%:@((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -@%:@ as_fn_mkdir_p -@%:@ ------------- -@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} @%:@ as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in @%:@( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in @%:@(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Report bugs to the package provider." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.68, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2010 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX -@%:@@%:@ Running $as_me. @%:@@%:@ -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "GNUmakefile") CONFIG_FILES="$CONFIG_FILES GNUmakefile" ;; - "doc/source/ldp.dsl") CONFIG_FILES="$CONFIG_FILES doc/source/ldp.dsl" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi - ;; - - - esac - -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - diff --git a/external/privoxy/autom4te.cache/requests b/external/privoxy/autom4te.cache/requests deleted file mode 100644 index 8a4a5073..00000000 --- a/external/privoxy/autom4te.cache/requests +++ /dev/null @@ -1,75 +0,0 @@ -# This file was generated by Autom4te Sun Nov 6 20:57:04 UTC 2011. -# It contains the lists of macros which have been traced. -# It can be safely removed. - -@request = ( - bless( [ - '0', - 1, - [ - '/usr/share/autoconf' - ], - [ - '/usr/share/autoconf/autoconf/autoconf.m4f', - 'configure.in' - ], - { - 'AM_PROG_F77_C_O' => 1, - '_LT_AC_TAGCONFIG' => 1, - 'm4_pattern_forbid' => 1, - 'AC_INIT' => 1, - 'AC_CANONICAL_TARGET' => 1, - '_AM_COND_IF' => 1, - 'AC_CONFIG_LIBOBJ_DIR' => 1, - 'AC_SUBST' => 1, - 'AC_CANONICAL_HOST' => 1, - 'AC_FC_SRCEXT' => 1, - 'AC_PROG_LIBTOOL' => 1, - 'AM_INIT_AUTOMAKE' => 1, - 'AC_CONFIG_SUBDIRS' => 1, - 'AM_PATH_GUILE' => 1, - 'AM_AUTOMAKE_VERSION' => 1, - 'LT_CONFIG_LTDL_DIR' => 1, - 'AC_CONFIG_LINKS' => 1, - 'AC_REQUIRE_AUX_FILE' => 1, - 'LT_SUPPORTED_TAG' => 1, - 'm4_sinclude' => 1, - 'AM_MAINTAINER_MODE' => 1, - 'AM_NLS' => 1, - 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, - '_m4_warn' => 1, - 'AM_MAKEFILE_INCLUDE' => 1, - 'AM_PROG_CXX_C_O' => 1, - '_AM_MAKEFILE_INCLUDE' => 1, - '_AM_COND_ENDIF' => 1, - 'AM_ENABLE_MULTILIB' => 1, - 'AM_SILENT_RULES' => 1, - 'AM_PROG_MOC' => 1, - 'AC_CONFIG_FILES' => 1, - 'LT_INIT' => 1, - 'include' => 1, - 'AM_GNU_GETTEXT' => 1, - 'AM_PROG_AR' => 1, - 'AC_LIBSOURCE' => 1, - 'AC_CANONICAL_BUILD' => 1, - 'AM_PROG_FC_C_O' => 1, - 'AC_FC_FREEFORM' => 1, - 'AH_OUTPUT' => 1, - 'AC_CONFIG_AUX_DIR' => 1, - '_AM_SUBST_NOTMAKE' => 1, - 'm4_pattern_allow' => 1, - 'AM_PROG_CC_C_O' => 1, - 'sinclude' => 1, - 'AM_CONDITIONAL' => 1, - 'AC_CANONICAL_SYSTEM' => 1, - 'AM_XGETTEXT_OPTION' => 1, - 'AC_CONFIG_HEADERS' => 1, - 'AC_DEFINE_TRACE_LITERAL' => 1, - 'AM_POT_TOOLS' => 1, - 'm4_include' => 1, - '_AM_COND_ELSE' => 1, - 'AC_SUBST_TRACE' => 1 - } - ], 'Autom4te::Request' ) - ); - diff --git a/external/privoxy/autom4te.cache/traces.0 b/external/privoxy/autom4te.cache/traces.0 deleted file mode 100644 index e49e9055..00000000 --- a/external/privoxy/autom4te.cache/traces.0 +++ /dev/null @@ -1,726 +0,0 @@ -m4trace:configure.in:570: -1- AC_INIT([jcc.c]) -m4trace:configure.in:570: -1- m4_pattern_forbid([^_?A[CHUM]_]) -m4trace:configure.in:570: -1- m4_pattern_forbid([_AC_]) -m4trace:configure.in:570: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) -m4trace:configure.in:570: -1- m4_pattern_allow([^AS_FLAGS$]) -m4trace:configure.in:570: -1- m4_pattern_forbid([^_?m4_]) -m4trace:configure.in:570: -1- m4_pattern_forbid([^dnl$]) -m4trace:configure.in:570: -1- m4_pattern_forbid([^_?AS_]) -m4trace:configure.in:570: -1- AC_SUBST([SHELL]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([SHELL]) -m4trace:configure.in:570: -1- m4_pattern_allow([^SHELL$]) -m4trace:configure.in:570: -1- AC_SUBST([PATH_SEPARATOR]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) -m4trace:configure.in:570: -1- m4_pattern_allow([^PATH_SEPARATOR$]) -m4trace:configure.in:570: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([PACKAGE_NAME]) -m4trace:configure.in:570: -1- m4_pattern_allow([^PACKAGE_NAME$]) -m4trace:configure.in:570: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) -m4trace:configure.in:570: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) -m4trace:configure.in:570: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) -m4trace:configure.in:570: -1- m4_pattern_allow([^PACKAGE_VERSION$]) -m4trace:configure.in:570: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([PACKAGE_STRING]) -m4trace:configure.in:570: -1- m4_pattern_allow([^PACKAGE_STRING$]) -m4trace:configure.in:570: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) -m4trace:configure.in:570: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) -m4trace:configure.in:570: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([PACKAGE_URL]) -m4trace:configure.in:570: -1- m4_pattern_allow([^PACKAGE_URL$]) -m4trace:configure.in:570: -1- AC_SUBST([exec_prefix], [NONE]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([exec_prefix]) -m4trace:configure.in:570: -1- m4_pattern_allow([^exec_prefix$]) -m4trace:configure.in:570: -1- AC_SUBST([prefix], [NONE]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([prefix]) -m4trace:configure.in:570: -1- m4_pattern_allow([^prefix$]) -m4trace:configure.in:570: -1- AC_SUBST([program_transform_name], [s,x,x,]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([program_transform_name]) -m4trace:configure.in:570: -1- m4_pattern_allow([^program_transform_name$]) -m4trace:configure.in:570: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([bindir]) -m4trace:configure.in:570: -1- m4_pattern_allow([^bindir$]) -m4trace:configure.in:570: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([sbindir]) -m4trace:configure.in:570: -1- m4_pattern_allow([^sbindir$]) -m4trace:configure.in:570: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([libexecdir]) -m4trace:configure.in:570: -1- m4_pattern_allow([^libexecdir$]) -m4trace:configure.in:570: -1- AC_SUBST([datarootdir], ['${prefix}/share']) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([datarootdir]) -m4trace:configure.in:570: -1- m4_pattern_allow([^datarootdir$]) -m4trace:configure.in:570: -1- AC_SUBST([datadir], ['${datarootdir}']) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([datadir]) -m4trace:configure.in:570: -1- m4_pattern_allow([^datadir$]) -m4trace:configure.in:570: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([sysconfdir]) -m4trace:configure.in:570: -1- m4_pattern_allow([^sysconfdir$]) -m4trace:configure.in:570: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([sharedstatedir]) -m4trace:configure.in:570: -1- m4_pattern_allow([^sharedstatedir$]) -m4trace:configure.in:570: -1- AC_SUBST([localstatedir], ['${prefix}/var']) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([localstatedir]) -m4trace:configure.in:570: -1- m4_pattern_allow([^localstatedir$]) -m4trace:configure.in:570: -1- AC_SUBST([includedir], ['${prefix}/include']) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([includedir]) -m4trace:configure.in:570: -1- m4_pattern_allow([^includedir$]) -m4trace:configure.in:570: -1- AC_SUBST([oldincludedir], ['/usr/include']) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([oldincludedir]) -m4trace:configure.in:570: -1- m4_pattern_allow([^oldincludedir$]) -m4trace:configure.in:570: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], - ['${datarootdir}/doc/${PACKAGE_TARNAME}'], - ['${datarootdir}/doc/${PACKAGE}'])]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([docdir]) -m4trace:configure.in:570: -1- m4_pattern_allow([^docdir$]) -m4trace:configure.in:570: -1- AC_SUBST([infodir], ['${datarootdir}/info']) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([infodir]) -m4trace:configure.in:570: -1- m4_pattern_allow([^infodir$]) -m4trace:configure.in:570: -1- AC_SUBST([htmldir], ['${docdir}']) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([htmldir]) -m4trace:configure.in:570: -1- m4_pattern_allow([^htmldir$]) -m4trace:configure.in:570: -1- AC_SUBST([dvidir], ['${docdir}']) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([dvidir]) -m4trace:configure.in:570: -1- m4_pattern_allow([^dvidir$]) -m4trace:configure.in:570: -1- AC_SUBST([pdfdir], ['${docdir}']) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([pdfdir]) -m4trace:configure.in:570: -1- m4_pattern_allow([^pdfdir$]) -m4trace:configure.in:570: -1- AC_SUBST([psdir], ['${docdir}']) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([psdir]) -m4trace:configure.in:570: -1- m4_pattern_allow([^psdir$]) -m4trace:configure.in:570: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([libdir]) -m4trace:configure.in:570: -1- m4_pattern_allow([^libdir$]) -m4trace:configure.in:570: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([localedir]) -m4trace:configure.in:570: -1- m4_pattern_allow([^localedir$]) -m4trace:configure.in:570: -1- AC_SUBST([mandir], ['${datarootdir}/man']) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([mandir]) -m4trace:configure.in:570: -1- m4_pattern_allow([^mandir$]) -m4trace:configure.in:570: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) -m4trace:configure.in:570: -1- m4_pattern_allow([^PACKAGE_NAME$]) -m4trace:configure.in:570: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ -@%:@undef PACKAGE_NAME]) -m4trace:configure.in:570: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) -m4trace:configure.in:570: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) -m4trace:configure.in:570: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ -@%:@undef PACKAGE_TARNAME]) -m4trace:configure.in:570: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) -m4trace:configure.in:570: -1- m4_pattern_allow([^PACKAGE_VERSION$]) -m4trace:configure.in:570: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ -@%:@undef PACKAGE_VERSION]) -m4trace:configure.in:570: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) -m4trace:configure.in:570: -1- m4_pattern_allow([^PACKAGE_STRING$]) -m4trace:configure.in:570: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ -@%:@undef PACKAGE_STRING]) -m4trace:configure.in:570: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) -m4trace:configure.in:570: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) -m4trace:configure.in:570: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ -@%:@undef PACKAGE_BUGREPORT]) -m4trace:configure.in:570: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL]) -m4trace:configure.in:570: -1- m4_pattern_allow([^PACKAGE_URL$]) -m4trace:configure.in:570: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */ -@%:@undef PACKAGE_URL]) -m4trace:configure.in:570: -1- AC_SUBST([DEFS]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([DEFS]) -m4trace:configure.in:570: -1- m4_pattern_allow([^DEFS$]) -m4trace:configure.in:570: -1- AC_SUBST([ECHO_C]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([ECHO_C]) -m4trace:configure.in:570: -1- m4_pattern_allow([^ECHO_C$]) -m4trace:configure.in:570: -1- AC_SUBST([ECHO_N]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([ECHO_N]) -m4trace:configure.in:570: -1- m4_pattern_allow([^ECHO_N$]) -m4trace:configure.in:570: -1- AC_SUBST([ECHO_T]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([ECHO_T]) -m4trace:configure.in:570: -1- m4_pattern_allow([^ECHO_T$]) -m4trace:configure.in:570: -1- AC_SUBST([LIBS]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([LIBS]) -m4trace:configure.in:570: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.in:570: -1- AC_SUBST([build_alias]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([build_alias]) -m4trace:configure.in:570: -1- m4_pattern_allow([^build_alias$]) -m4trace:configure.in:570: -1- AC_SUBST([host_alias]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([host_alias]) -m4trace:configure.in:570: -1- m4_pattern_allow([^host_alias$]) -m4trace:configure.in:570: -1- AC_SUBST([target_alias]) -m4trace:configure.in:570: -1- AC_SUBST_TRACE([target_alias]) -m4trace:configure.in:570: -1- m4_pattern_allow([^target_alias$]) -m4trace:configure.in:583: -1- AC_CONFIG_HEADERS([config.h]) -m4trace:configure.in:584: -1- AC_CANONICAL_HOST -m4trace:configure.in:584: -1- AC_CANONICAL_BUILD -m4trace:configure.in:584: -1- AC_REQUIRE_AUX_FILE([config.sub]) -m4trace:configure.in:584: -1- AC_REQUIRE_AUX_FILE([config.guess]) -m4trace:configure.in:584: -1- AC_SUBST([build], [$ac_cv_build]) -m4trace:configure.in:584: -1- AC_SUBST_TRACE([build]) -m4trace:configure.in:584: -1- m4_pattern_allow([^build$]) -m4trace:configure.in:584: -1- AC_SUBST([build_cpu], [$[1]]) -m4trace:configure.in:584: -1- AC_SUBST_TRACE([build_cpu]) -m4trace:configure.in:584: -1- m4_pattern_allow([^build_cpu$]) -m4trace:configure.in:584: -1- AC_SUBST([build_vendor], [$[2]]) -m4trace:configure.in:584: -1- AC_SUBST_TRACE([build_vendor]) -m4trace:configure.in:584: -1- m4_pattern_allow([^build_vendor$]) -m4trace:configure.in:584: -1- AC_SUBST([build_os]) -m4trace:configure.in:584: -1- AC_SUBST_TRACE([build_os]) -m4trace:configure.in:584: -1- m4_pattern_allow([^build_os$]) -m4trace:configure.in:584: -1- AC_SUBST([host], [$ac_cv_host]) -m4trace:configure.in:584: -1- AC_SUBST_TRACE([host]) -m4trace:configure.in:584: -1- m4_pattern_allow([^host$]) -m4trace:configure.in:584: -1- AC_SUBST([host_cpu], [$[1]]) -m4trace:configure.in:584: -1- AC_SUBST_TRACE([host_cpu]) -m4trace:configure.in:584: -1- m4_pattern_allow([^host_cpu$]) -m4trace:configure.in:584: -1- AC_SUBST([host_vendor], [$[2]]) -m4trace:configure.in:584: -1- AC_SUBST_TRACE([host_vendor]) -m4trace:configure.in:584: -1- m4_pattern_allow([^host_vendor$]) -m4trace:configure.in:584: -1- AC_SUBST([host_os]) -m4trace:configure.in:584: -1- AC_SUBST_TRACE([host_os]) -m4trace:configure.in:584: -1- m4_pattern_allow([^host_os$]) -m4trace:configure.in:626: -1- AC_SUBST([VERSION_MAJOR]) -m4trace:configure.in:626: -1- AC_SUBST_TRACE([VERSION_MAJOR]) -m4trace:configure.in:626: -1- m4_pattern_allow([^VERSION_MAJOR$]) -m4trace:configure.in:627: -1- AC_SUBST([VERSION_MINOR]) -m4trace:configure.in:627: -1- AC_SUBST_TRACE([VERSION_MINOR]) -m4trace:configure.in:627: -1- m4_pattern_allow([^VERSION_MINOR$]) -m4trace:configure.in:628: -1- AC_SUBST([VERSION_POINT]) -m4trace:configure.in:628: -1- AC_SUBST_TRACE([VERSION_POINT]) -m4trace:configure.in:628: -1- m4_pattern_allow([^VERSION_POINT$]) -m4trace:configure.in:629: -1- AC_SUBST([CODE_STATUS]) -m4trace:configure.in:629: -1- AC_SUBST_TRACE([CODE_STATUS]) -m4trace:configure.in:629: -1- m4_pattern_allow([^CODE_STATUS$]) -m4trace:configure.in:632: -1- AC_DEFINE_TRACE_LITERAL([VERSION_MAJOR]) -m4trace:configure.in:632: -1- m4_pattern_allow([^VERSION_MAJOR$]) -m4trace:configure.in:633: -1- AC_DEFINE_TRACE_LITERAL([VERSION_MINOR]) -m4trace:configure.in:633: -1- m4_pattern_allow([^VERSION_MINOR$]) -m4trace:configure.in:634: -1- AC_DEFINE_TRACE_LITERAL([VERSION_POINT]) -m4trace:configure.in:634: -1- m4_pattern_allow([^VERSION_POINT$]) -m4trace:configure.in:635: -1- AC_DEFINE_TRACE_LITERAL([VERSION]) -m4trace:configure.in:635: -1- m4_pattern_allow([^VERSION$]) -m4trace:configure.in:636: -1- AC_DEFINE_TRACE_LITERAL([CODE_STATUS]) -m4trace:configure.in:636: -1- m4_pattern_allow([^CODE_STATUS$]) -m4trace:configure.in:647: -1- AC_SUBST([CC]) -m4trace:configure.in:647: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.in:647: -1- m4_pattern_allow([^CC$]) -m4trace:configure.in:647: -1- AC_SUBST([CFLAGS]) -m4trace:configure.in:647: -1- AC_SUBST_TRACE([CFLAGS]) -m4trace:configure.in:647: -1- m4_pattern_allow([^CFLAGS$]) -m4trace:configure.in:647: -1- AC_SUBST([LDFLAGS]) -m4trace:configure.in:647: -1- AC_SUBST_TRACE([LDFLAGS]) -m4trace:configure.in:647: -1- m4_pattern_allow([^LDFLAGS$]) -m4trace:configure.in:647: -1- AC_SUBST([LIBS]) -m4trace:configure.in:647: -1- AC_SUBST_TRACE([LIBS]) -m4trace:configure.in:647: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.in:647: -1- AC_SUBST([CPPFLAGS]) -m4trace:configure.in:647: -1- AC_SUBST_TRACE([CPPFLAGS]) -m4trace:configure.in:647: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.in:647: -1- AC_SUBST([CC]) -m4trace:configure.in:647: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.in:647: -1- m4_pattern_allow([^CC$]) -m4trace:configure.in:647: -1- AC_SUBST([CC]) -m4trace:configure.in:647: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.in:647: -1- m4_pattern_allow([^CC$]) -m4trace:configure.in:647: -1- AC_SUBST([CC]) -m4trace:configure.in:647: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.in:647: -1- m4_pattern_allow([^CC$]) -m4trace:configure.in:647: -1- AC_SUBST([CC]) -m4trace:configure.in:647: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.in:647: -1- m4_pattern_allow([^CC$]) -m4trace:configure.in:647: -1- AC_SUBST([ac_ct_CC]) -m4trace:configure.in:647: -1- AC_SUBST_TRACE([ac_ct_CC]) -m4trace:configure.in:647: -1- m4_pattern_allow([^ac_ct_CC$]) -m4trace:configure.in:647: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) -m4trace:configure.in:647: -1- AC_SUBST_TRACE([EXEEXT]) -m4trace:configure.in:647: -1- m4_pattern_allow([^EXEEXT$]) -m4trace:configure.in:647: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) -m4trace:configure.in:647: -1- AC_SUBST_TRACE([OBJEXT]) -m4trace:configure.in:647: -1- m4_pattern_allow([^OBJEXT$]) -m4trace:configure.in:648: -1- AC_SUBST([CPP]) -m4trace:configure.in:648: -1- AC_SUBST_TRACE([CPP]) -m4trace:configure.in:648: -1- m4_pattern_allow([^CPP$]) -m4trace:configure.in:648: -1- AC_SUBST([CPPFLAGS]) -m4trace:configure.in:648: -1- AC_SUBST_TRACE([CPPFLAGS]) -m4trace:configure.in:648: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.in:648: -1- AC_SUBST([CPP]) -m4trace:configure.in:648: -1- AC_SUBST_TRACE([CPP]) -m4trace:configure.in:648: -1- m4_pattern_allow([^CPP$]) -m4trace:configure.in:649: -1- AC_REQUIRE_AUX_FILE([install-sh]) -m4trace:configure.in:649: -1- AC_SUBST([INSTALL_PROGRAM]) -m4trace:configure.in:649: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) -m4trace:configure.in:649: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) -m4trace:configure.in:649: -1- AC_SUBST([INSTALL_SCRIPT]) -m4trace:configure.in:649: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) -m4trace:configure.in:649: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) -m4trace:configure.in:649: -1- AC_SUBST([INSTALL_DATA]) -m4trace:configure.in:649: -1- AC_SUBST_TRACE([INSTALL_DATA]) -m4trace:configure.in:649: -1- m4_pattern_allow([^INSTALL_DATA$]) -m4trace:configure.in:650: -1- AC_SUBST([LN_S], [$as_ln_s]) -m4trace:configure.in:650: -1- AC_SUBST_TRACE([LN_S]) -m4trace:configure.in:650: -1- m4_pattern_allow([^LN_S$]) -m4trace:configure.in:651: -1- AC_SUBST([SET_MAKE]) -m4trace:configure.in:651: -1- AC_SUBST_TRACE([SET_MAKE]) -m4trace:configure.in:651: -1- m4_pattern_allow([^SET_MAKE$]) -m4trace:configure.in:652: -1- AC_SUBST([AWK]) -m4trace:configure.in:652: -1- AC_SUBST_TRACE([AWK]) -m4trace:configure.in:652: -1- m4_pattern_allow([^AWK$]) -m4trace:configure.in:654: -1- AC_SUBST([GDB]) -m4trace:configure.in:654: -1- AC_SUBST_TRACE([GDB]) -m4trace:configure.in:654: -1- m4_pattern_allow([^GDB$]) -m4trace:configure.in:655: -1- AC_SUBST([BGROUPS]) -m4trace:configure.in:655: -1- AC_SUBST_TRACE([BGROUPS]) -m4trace:configure.in:655: -1- m4_pattern_allow([^BGROUPS$]) -m4trace:configure.in:656: -1- AC_SUBST([ID]) -m4trace:configure.in:656: -1- AC_SUBST_TRACE([ID]) -m4trace:configure.in:656: -1- m4_pattern_allow([^ID$]) -m4trace:configure.in:657: -1- AC_SUBST([ID]) -m4trace:configure.in:657: -1- AC_SUBST_TRACE([ID]) -m4trace:configure.in:657: -1- m4_pattern_allow([^ID$]) -m4trace:configure.in:658: -1- AC_SUBST([BGROUPS]) -m4trace:configure.in:658: -1- AC_SUBST_TRACE([BGROUPS]) -m4trace:configure.in:658: -1- m4_pattern_allow([^BGROUPS$]) -m4trace:configure.in:734: -1- AC_SUBST([USER]) -m4trace:configure.in:734: -1- AC_SUBST_TRACE([USER]) -m4trace:configure.in:734: -1- m4_pattern_allow([^USER$]) -m4trace:configure.in:771: -1- AC_SUBST([GROUP]) -m4trace:configure.in:771: -1- AC_SUBST_TRACE([GROUP]) -m4trace:configure.in:771: -1- m4_pattern_allow([^GROUP$]) -m4trace:configure.in:799: -1- _m4_warn([obsolete], [The macro `AC_MINGW32' is obsolete. -You should run autoupdate.], [../../lib/autoconf/specific.m4:345: AC_MINGW32 is expanded from... -configure.in:799: the top level]) -m4trace:configure.in:799: -1- AC_CANONICAL_HOST -m4trace:configure.in:800: -1- _m4_warn([obsolete], [The macro `AC_CYGWIN' is obsolete. -You should run autoupdate.], [../../lib/autoconf/specific.m4:317: AC_CYGWIN is expanded from... -configure.in:800: the top level]) -m4trace:configure.in:800: -1- AC_CANONICAL_HOST -m4trace:configure.in:849: -1- AC_SUBST([WIN_ONLY]) -m4trace:configure.in:849: -1- AC_SUBST_TRACE([WIN_ONLY]) -m4trace:configure.in:849: -1- m4_pattern_allow([^WIN_ONLY$]) -m4trace:configure.in:853: -1- AC_SUBST([WDUMP]) -m4trace:configure.in:853: -1- AC_SUBST_TRACE([WDUMP]) -m4trace:configure.in:853: -1- m4_pattern_allow([^WDUMP$]) -m4trace:configure.in:861: -1- AC_SUBST([DB2HTML]) -m4trace:configure.in:861: -1- AC_SUBST_TRACE([DB2HTML]) -m4trace:configure.in:861: -1- m4_pattern_allow([^DB2HTML$]) -m4trace:configure.in:864: -1- AC_SUBST([WDUMP]) -m4trace:configure.in:864: -1- AC_SUBST_TRACE([WDUMP]) -m4trace:configure.in:864: -1- m4_pattern_allow([^WDUMP$]) -m4trace:configure.in:865: -1- AC_SUBST([DB2HTML]) -m4trace:configure.in:865: -1- AC_SUBST_TRACE([DB2HTML]) -m4trace:configure.in:865: -1- m4_pattern_allow([^DB2HTML$]) -m4trace:configure.in:868: -1- AC_SUBST([RPMBIN]) -m4trace:configure.in:868: -1- AC_SUBST_TRACE([RPMBIN]) -m4trace:configure.in:868: -1- m4_pattern_allow([^RPMBIN$]) -m4trace:configure.in:875: -1- AC_SUBST([RPM_BASE]) -m4trace:configure.in:875: -1- AC_SUBST_TRACE([RPM_BASE]) -m4trace:configure.in:875: -1- m4_pattern_allow([^RPM_BASE$]) -m4trace:configure.in:878: -1- AC_SUBST([JADEBIN]) -m4trace:configure.in:878: -1- AC_SUBST_TRACE([JADEBIN]) -m4trace:configure.in:878: -1- m4_pattern_allow([^JADEBIN$]) -m4trace:configure.in:879: -1- AC_SUBST([JADEBIN]) -m4trace:configure.in:879: -1- AC_SUBST_TRACE([JADEBIN]) -m4trace:configure.in:879: -1- m4_pattern_allow([^JADEBIN$]) -m4trace:configure.in:882: -1- AC_SUBST([MAN2HTML]) -m4trace:configure.in:882: -1- AC_SUBST_TRACE([MAN2HTML]) -m4trace:configure.in:882: -1- m4_pattern_allow([^MAN2HTML$]) -m4trace:configure.in:883: -1- AC_SUBST([MAN2HTML]) -m4trace:configure.in:883: -1- AC_SUBST_TRACE([MAN2HTML]) -m4trace:configure.in:883: -1- m4_pattern_allow([^MAN2HTML$]) -m4trace:configure.in:890: -1- AC_SUBST([DOC_STATUS]) -m4trace:configure.in:890: -1- AC_SUBST_TRACE([DOC_STATUS]) -m4trace:configure.in:890: -1- m4_pattern_allow([^DOC_STATUS$]) -m4trace:configure.in:932: -1- AC_SUBST([JADECAT]) -m4trace:configure.in:932: -1- AC_SUBST_TRACE([JADECAT]) -m4trace:configure.in:932: -1- m4_pattern_allow([^JADECAT$]) -m4trace:configure.in:933: -1- AC_SUBST([DKPREFIX]) -m4trace:configure.in:933: -1- AC_SUBST_TRACE([DKPREFIX]) -m4trace:configure.in:933: -1- m4_pattern_allow([^DKPREFIX$]) -m4trace:configure.in:951: -1- AC_SUBST([GREP]) -m4trace:configure.in:951: -1- AC_SUBST_TRACE([GREP]) -m4trace:configure.in:951: -1- m4_pattern_allow([^GREP$]) -m4trace:configure.in:951: -1- AC_SUBST([EGREP]) -m4trace:configure.in:951: -1- AC_SUBST_TRACE([EGREP]) -m4trace:configure.in:951: -1- m4_pattern_allow([^EGREP$]) -m4trace:configure.in:951: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) -m4trace:configure.in:951: -1- m4_pattern_allow([^STDC_HEADERS$]) -m4trace:configure.in:951: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ -@%:@undef STDC_HEADERS]) -m4trace:configure.in:951: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_SYS_TYPES_H]) -m4trace:configure.in:951: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_SYS_STAT_H]) -m4trace:configure.in:951: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STDLIB_H]) -m4trace:configure.in:951: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STRING_H]) -m4trace:configure.in:951: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_MEMORY_H]) -m4trace:configure.in:951: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STRINGS_H]) -m4trace:configure.in:951: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_INTTYPES_H]) -m4trace:configure.in:951: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STDINT_H]) -m4trace:configure.in:951: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_UNISTD_H]) -m4trace:configure.in:966: -1- AC_DEFINE_TRACE_LITERAL([FEATURE_PTHREAD]) -m4trace:configure.in:966: -1- m4_pattern_allow([^FEATURE_PTHREAD$]) -m4trace:configure.in:973: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. -You should run autoupdate.], [../../lib/autoconf/general.m4:2688: AC_TRY_LINK is expanded from... -configure.in:973: the top level]) -m4trace:configure.in:989: -1- AC_SUBST([PTHREAD_ONLY]) -m4trace:configure.in:989: -1- AC_SUBST_TRACE([PTHREAD_ONLY]) -m4trace:configure.in:989: -1- m4_pattern_allow([^PTHREAD_ONLY$]) -m4trace:configure.in:997: -1- AH_OUTPUT([HAVE_LIBNSL], [/* Define to 1 if you have the `nsl\' library (-lnsl). */ -@%:@undef HAVE_LIBNSL]) -m4trace:configure.in:997: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBNSL]) -m4trace:configure.in:997: -1- m4_pattern_allow([^HAVE_LIBNSL$]) -m4trace:configure.in:999: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. -You should run autoupdate.], [../../lib/autoconf/general.m4:2615: AC_TRY_COMPILE is expanded from... -../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from... -../../lib/autoconf/functions.m4:60: AC_CHECK_FUNC is expanded from... -configure.in:999: the top level]) -m4trace:configure.in:999: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTBYADDR_R_8_ARGS]) -m4trace:configure.in:999: -1- m4_pattern_allow([^HAVE_GETHOSTBYADDR_R_8_ARGS$]) -m4trace:configure.in:999: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. -You should run autoupdate.], [../../lib/autoconf/general.m4:2615: AC_TRY_COMPILE is expanded from... -../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from... -../../lib/autoconf/general.m4:2591: _AC_COMPILE_IFELSE is expanded from... -../../lib/autoconf/general.m4:2607: AC_COMPILE_IFELSE is expanded from... -../../lib/autoconf/general.m4:2615: AC_TRY_COMPILE is expanded from... -../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from... -../../lib/autoconf/functions.m4:60: AC_CHECK_FUNC is expanded from... -configure.in:999: the top level]) -m4trace:configure.in:999: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTBYADDR_R_7_ARGS]) -m4trace:configure.in:999: -1- m4_pattern_allow([^HAVE_GETHOSTBYADDR_R_7_ARGS$]) -m4trace:configure.in:999: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. -You should run autoupdate.], [../../lib/autoconf/general.m4:2615: AC_TRY_COMPILE is expanded from... -../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from... -../../lib/autoconf/general.m4:2591: _AC_COMPILE_IFELSE is expanded from... -../../lib/autoconf/general.m4:2607: AC_COMPILE_IFELSE is expanded from... -../../lib/autoconf/general.m4:2615: AC_TRY_COMPILE is expanded from... -../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from... -../../lib/autoconf/general.m4:2591: _AC_COMPILE_IFELSE is expanded from... -../../lib/autoconf/general.m4:2607: AC_COMPILE_IFELSE is expanded from... -../../lib/autoconf/general.m4:2615: AC_TRY_COMPILE is expanded from... -../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from... -../../lib/autoconf/functions.m4:60: AC_CHECK_FUNC is expanded from... -configure.in:999: the top level]) -m4trace:configure.in:999: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTBYADDR_R_5_ARGS]) -m4trace:configure.in:999: -1- m4_pattern_allow([^HAVE_GETHOSTBYADDR_R_5_ARGS$]) -m4trace:configure.in:1043: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. -You should run autoupdate.], [../../lib/autoconf/general.m4:2615: AC_TRY_COMPILE is expanded from... -../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from... -../../lib/autoconf/functions.m4:60: AC_CHECK_FUNC is expanded from... -configure.in:1043: the top level]) -m4trace:configure.in:1043: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTBYNAME_R_6_ARGS]) -m4trace:configure.in:1043: -1- m4_pattern_allow([^HAVE_GETHOSTBYNAME_R_6_ARGS$]) -m4trace:configure.in:1043: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. -You should run autoupdate.], [../../lib/autoconf/general.m4:2615: AC_TRY_COMPILE is expanded from... -../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from... -../../lib/autoconf/general.m4:2591: _AC_COMPILE_IFELSE is expanded from... -../../lib/autoconf/general.m4:2607: AC_COMPILE_IFELSE is expanded from... -../../lib/autoconf/general.m4:2615: AC_TRY_COMPILE is expanded from... -../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from... -../../lib/autoconf/functions.m4:60: AC_CHECK_FUNC is expanded from... -configure.in:1043: the top level]) -m4trace:configure.in:1043: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTBYNAME_R_5_ARGS]) -m4trace:configure.in:1043: -1- m4_pattern_allow([^HAVE_GETHOSTBYNAME_R_5_ARGS$]) -m4trace:configure.in:1043: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. -You should run autoupdate.], [../../lib/autoconf/general.m4:2615: AC_TRY_COMPILE is expanded from... -../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from... -../../lib/autoconf/general.m4:2591: _AC_COMPILE_IFELSE is expanded from... -../../lib/autoconf/general.m4:2607: AC_COMPILE_IFELSE is expanded from... -../../lib/autoconf/general.m4:2615: AC_TRY_COMPILE is expanded from... -../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from... -../../lib/autoconf/general.m4:2591: _AC_COMPILE_IFELSE is expanded from... -../../lib/autoconf/general.m4:2607: AC_COMPILE_IFELSE is expanded from... -../../lib/autoconf/general.m4:2615: AC_TRY_COMPILE is expanded from... -../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from... -../../lib/autoconf/functions.m4:60: AC_CHECK_FUNC is expanded from... -configure.in:1043: the top level]) -m4trace:configure.in:1043: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTBYNAME_R_3_ARGS]) -m4trace:configure.in:1043: -1- m4_pattern_allow([^HAVE_GETHOSTBYNAME_R_3_ARGS$]) -m4trace:configure.in:1086: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. -You should run autoupdate.], [../../lib/autoconf/general.m4:2615: AC_TRY_COMPILE is expanded from... -../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from... -../../lib/autoconf/functions.m4:60: AC_CHECK_FUNC is expanded from... -configure.in:1086: the top level]) -m4trace:configure.in:1086: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GMTIME_R]) -m4trace:configure.in:1086: -1- m4_pattern_allow([^HAVE_GMTIME_R$]) -m4trace:configure.in:1104: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. -You should run autoupdate.], [../../lib/autoconf/general.m4:2615: AC_TRY_COMPILE is expanded from... -../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from... -../../lib/autoconf/functions.m4:60: AC_CHECK_FUNC is expanded from... -configure.in:1104: the top level]) -m4trace:configure.in:1104: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LOCALTIME_R]) -m4trace:configure.in:1104: -1- m4_pattern_allow([^HAVE_LOCALTIME_R$]) -m4trace:configure.in:1136: -1- AC_DEFINE_TRACE_LITERAL([__EXTENSIONS__]) -m4trace:configure.in:1136: -1- m4_pattern_allow([^__EXTENSIONS__$]) -m4trace:configure.in:1149: -1- AC_SUBST([SOCKET_LIB]) -m4trace:configure.in:1149: -1- AC_SUBST_TRACE([SOCKET_LIB]) -m4trace:configure.in:1149: -1- m4_pattern_allow([^SOCKET_LIB$]) -m4trace:configure.in:1158: -2- AC_DEFINE_TRACE_LITERAL([socklen_t]) -m4trace:configure.in:1158: -2- m4_pattern_allow([^socklen_t$]) -m4trace:configure.in:1158: -2- AH_OUTPUT([socklen_t], [/* Define to \'int\' if doesn\'t have it. */ -@%:@undef socklen_t]) -m4trace:configure.in:1171: -1- AC_SUBST([SOCKET_LIB]) -m4trace:configure.in:1171: -1- AC_SUBST_TRACE([SOCKET_LIB]) -m4trace:configure.in:1171: -1- m4_pattern_allow([^SOCKET_LIB$]) -m4trace:configure.in:1202: -1- AC_SUBST([AMIGAOS_ONLY]) -m4trace:configure.in:1202: -1- AC_SUBST_TRACE([AMIGAOS_ONLY]) -m4trace:configure.in:1202: -1- m4_pattern_allow([^AMIGAOS_ONLY$]) -m4trace:configure.in:1210: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) -m4trace:configure.in:1210: -1- m4_pattern_allow([^STDC_HEADERS$]) -m4trace:configure.in:1210: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ -@%:@undef STDC_HEADERS]) -m4trace:configure.in:1211: -1- AH_OUTPUT([HAVE_DIRENT_H], [/* Define to 1 if you have the header file, and it defines `DIR\'. - */ -@%:@undef HAVE_DIRENT_H]) -m4trace:configure.in:1211: -1- AH_OUTPUT([HAVE_SYS_NDIR_H], [/* Define to 1 if you have the header file, and it defines `DIR\'. - */ -@%:@undef HAVE_SYS_NDIR_H]) -m4trace:configure.in:1211: -1- AH_OUTPUT([HAVE_SYS_DIR_H], [/* Define to 1 if you have the header file, and it defines `DIR\'. - */ -@%:@undef HAVE_SYS_DIR_H]) -m4trace:configure.in:1211: -1- AH_OUTPUT([HAVE_NDIR_H], [/* Define to 1 if you have the header file, and it defines `DIR\'. */ -@%:@undef HAVE_NDIR_H]) -m4trace:configure.in:1212: -1- AC_DEFINE_TRACE_LITERAL([const]) -m4trace:configure.in:1212: -1- m4_pattern_allow([^const$]) -m4trace:configure.in:1212: -1- AH_OUTPUT([const], [/* Define to empty if `const\' does not conform to ANSI C. */ -@%:@undef const]) -m4trace:configure.in:1213: -1- AC_DEFINE_TRACE_LITERAL([size_t]) -m4trace:configure.in:1213: -1- m4_pattern_allow([^size_t$]) -m4trace:configure.in:1213: -1- AH_OUTPUT([size_t], [/* Define to `unsigned int\' if does not define. */ -@%:@undef size_t]) -m4trace:configure.in:1214: -1- AC_DEFINE_TRACE_LITERAL([pid_t]) -m4trace:configure.in:1214: -1- m4_pattern_allow([^pid_t$]) -m4trace:configure.in:1214: -1- AH_OUTPUT([pid_t], [/* Define to `int\' if does not define. */ -@%:@undef pid_t]) -m4trace:configure.in:1215: -1- AC_DEFINE_TRACE_LITERAL([TIME_WITH_SYS_TIME]) -m4trace:configure.in:1215: -1- m4_pattern_allow([^TIME_WITH_SYS_TIME$]) -m4trace:configure.in:1215: -1- AH_OUTPUT([TIME_WITH_SYS_TIME], [/* Define to 1 if you can safely include both and . */ -@%:@undef TIME_WITH_SYS_TIME]) -m4trace:configure.in:1216: -1- AC_DEFINE_TRACE_LITERAL([TM_IN_SYS_TIME]) -m4trace:configure.in:1216: -1- m4_pattern_allow([^TM_IN_SYS_TIME$]) -m4trace:configure.in:1216: -1- AH_OUTPUT([TM_IN_SYS_TIME], [/* Define to 1 if your declares `struct tm\'. */ -@%:@undef TM_IN_SYS_TIME]) -m4trace:configure.in:1217: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_INT]) -m4trace:configure.in:1217: -1- m4_pattern_allow([^SIZEOF_INT$]) -m4trace:configure.in:1217: -1- AH_OUTPUT([SIZEOF_INT], [/* The size of `int\', as computed by sizeof. */ -@%:@undef SIZEOF_INT]) -m4trace:configure.in:1218: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_CHAR_P]) -m4trace:configure.in:1218: -1- m4_pattern_allow([^SIZEOF_CHAR_P$]) -m4trace:configure.in:1218: -1- AH_OUTPUT([SIZEOF_CHAR_P], [/* The size of `char *\', as computed by sizeof. */ -@%:@undef SIZEOF_CHAR_P]) -m4trace:configure.in:1219: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG]) -m4trace:configure.in:1219: -1- m4_pattern_allow([^SIZEOF_LONG$]) -m4trace:configure.in:1219: -1- AH_OUTPUT([SIZEOF_LONG], [/* The size of `long\', as computed by sizeof. */ -@%:@undef SIZEOF_LONG]) -m4trace:configure.in:1220: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG_LONG]) -m4trace:configure.in:1220: -1- m4_pattern_allow([^SIZEOF_LONG_LONG$]) -m4trace:configure.in:1220: -1- AH_OUTPUT([SIZEOF_LONG_LONG], [/* The size of `long long\', as computed by sizeof. */ -@%:@undef SIZEOF_LONG_LONG]) -m4trace:configure.in:1221: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_SIZE_T]) -m4trace:configure.in:1221: -1- m4_pattern_allow([^SIZEOF_SIZE_T$]) -m4trace:configure.in:1221: -1- AH_OUTPUT([SIZEOF_SIZE_T], [/* The size of `size_t\', as computed by sizeof. */ -@%:@undef SIZEOF_SIZE_T]) -m4trace:configure.in:1226: -1- AH_OUTPUT([HAVE_OS_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_OS_H]) -m4trace:configure.in:1226: -1- AH_OUTPUT([HAVE_ARPA_INET_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_ARPA_INET_H]) -m4trace:configure.in:1226: -1- AH_OUTPUT([HAVE_ERRNO_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_ERRNO_H]) -m4trace:configure.in:1226: -1- AH_OUTPUT([HAVE_FCNTL_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_FCNTL_H]) -m4trace:configure.in:1226: -1- AH_OUTPUT([HAVE_LIMITS_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_LIMITS_H]) -m4trace:configure.in:1226: -1- AH_OUTPUT([HAVE_LOCALE_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_LOCALE_H]) -m4trace:configure.in:1226: -1- AH_OUTPUT([HAVE_NETDB_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_NETDB_H]) -m4trace:configure.in:1226: -1- AH_OUTPUT([HAVE_NETINET_IN_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_NETINET_IN_H]) -m4trace:configure.in:1226: -1- AH_OUTPUT([HAVE_STDDEF_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STDDEF_H]) -m4trace:configure.in:1226: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STDLIB_H]) -m4trace:configure.in:1226: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STRING_H]) -m4trace:configure.in:1226: -1- AH_OUTPUT([HAVE_SYS_IOCTL_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_SYS_IOCTL_H]) -m4trace:configure.in:1226: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_SYS_SOCKET_H]) -m4trace:configure.in:1226: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_SYS_TIME_H]) -m4trace:configure.in:1226: -1- AH_OUTPUT([HAVE_SYS_TIMEB_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_SYS_TIMEB_H]) -m4trace:configure.in:1226: -1- AH_OUTPUT([HAVE_SYS_WAIT_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_SYS_WAIT_H]) -m4trace:configure.in:1226: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_UNISTD_H]) -m4trace:configure.in:1232: -1- AH_OUTPUT([HAVE_STRERROR], [/* Define to 1 if you have the `strerror\' function. */ -@%:@undef HAVE_STRERROR]) -m4trace:configure.in:1232: -1- AH_OUTPUT([HAVE_BCOPY], [/* Define to 1 if you have the `bcopy\' function. */ -@%:@undef HAVE_BCOPY]) -m4trace:configure.in:1232: -1- AH_OUTPUT([HAVE_MEMMOVE], [/* Define to 1 if you have the `memmove\' function. */ -@%:@undef HAVE_MEMMOVE]) -m4trace:configure.in:1236: -1- AC_DEFINE_TRACE_LITERAL([SETPGRP_VOID]) -m4trace:configure.in:1236: -1- m4_pattern_allow([^SETPGRP_VOID$]) -m4trace:configure.in:1236: -1- AH_OUTPUT([SETPGRP_VOID], [/* Define to 1 if the `setpgrp\' function takes no argument. */ -@%:@undef SETPGRP_VOID]) -m4trace:configure.in:1237: -1- _m4_warn([obsolete], [The macro `AC_TYPE_SIGNAL' is obsolete. -You should run autoupdate.], [../../lib/autoconf/types.m4:738: AC_TYPE_SIGNAL is expanded from... -configure.in:1237: the top level]) -m4trace:configure.in:1237: -1- AC_DEFINE_TRACE_LITERAL([RETSIGTYPE]) -m4trace:configure.in:1237: -1- m4_pattern_allow([^RETSIGTYPE$]) -m4trace:configure.in:1237: -1- AH_OUTPUT([RETSIGTYPE], [/* Define as the return type of signal handlers (`int\' or `void\'). */ -@%:@undef RETSIGTYPE]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_ACCESS], [/* Define to 1 if you have the `access\' function. */ -@%:@undef HAVE_ACCESS]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_ATEXIT], [/* Define to 1 if you have the `atexit\' function. */ -@%:@undef HAVE_ATEXIT]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_GETCWD], [/* Define to 1 if you have the `getcwd\' function. */ -@%:@undef HAVE_GETCWD]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_GETHOSTBYADDR], [/* Define to 1 if you have the `gethostbyaddr\' function. */ -@%:@undef HAVE_GETHOSTBYADDR]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_GETHOSTBYADDR_R], [/* Define to 1 if you have the `gethostbyaddr_r\' function. */ -@%:@undef HAVE_GETHOSTBYADDR_R]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_GETHOSTBYNAME], [/* Define to 1 if you have the `gethostbyname\' function. */ -@%:@undef HAVE_GETHOSTBYNAME]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_GETHOSTBYNAME_R], [/* Define to 1 if you have the `gethostbyname_r\' function. */ -@%:@undef HAVE_GETHOSTBYNAME_R]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_GETTIMEOFDAY], [/* Define to 1 if you have the `gettimeofday\' function. */ -@%:@undef HAVE_GETTIMEOFDAY]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_INET_NTOA], [/* Define to 1 if you have the `inet_ntoa\' function. */ -@%:@undef HAVE_INET_NTOA]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_LOCALTIME_R], [/* Define to 1 if you have the `localtime_r\' function. */ -@%:@undef HAVE_LOCALTIME_R]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_MEMCHR], [/* Define to 1 if you have the `memchr\' function. */ -@%:@undef HAVE_MEMCHR]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_MEMMOVE], [/* Define to 1 if you have the `memmove\' function. */ -@%:@undef HAVE_MEMMOVE]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_MEMSET], [/* Define to 1 if you have the `memset\' function. */ -@%:@undef HAVE_MEMSET]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_POLL], [/* Define to 1 if you have the `poll\' function. */ -@%:@undef HAVE_POLL]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_PUTENV], [/* Define to 1 if you have the `putenv\' function. */ -@%:@undef HAVE_PUTENV]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_RANDOM], [/* Define to 1 if you have the `random\' function. */ -@%:@undef HAVE_RANDOM]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_REGCOMP], [/* Define to 1 if you have the `regcomp\' function. */ -@%:@undef HAVE_REGCOMP]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_SELECT], [/* Define to 1 if you have the `select\' function. */ -@%:@undef HAVE_SELECT]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_SETLOCALE], [/* Define to 1 if you have the `setlocale\' function. */ -@%:@undef HAVE_SETLOCALE]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_SNPRINTF], [/* Define to 1 if you have the `snprintf\' function. */ -@%:@undef HAVE_SNPRINTF]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_SOCKET], [/* Define to 1 if you have the `socket\' function. */ -@%:@undef HAVE_SOCKET]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_STRCHR], [/* Define to 1 if you have the `strchr\' function. */ -@%:@undef HAVE_STRCHR]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_STRDUP], [/* Define to 1 if you have the `strdup\' function. */ -@%:@undef HAVE_STRDUP]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_STRERROR], [/* Define to 1 if you have the `strerror\' function. */ -@%:@undef HAVE_STRERROR]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_STRFTIME], [/* Define to 1 if you have the `strftime\' function. */ -@%:@undef HAVE_STRFTIME]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_STRLCAT], [/* Define to 1 if you have the `strlcat\' function. */ -@%:@undef HAVE_STRLCAT]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_STRLCPY], [/* Define to 1 if you have the `strlcpy\' function. */ -@%:@undef HAVE_STRLCPY]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_STRPTIME], [/* Define to 1 if you have the `strptime\' function. */ -@%:@undef HAVE_STRPTIME]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_STRSTR], [/* Define to 1 if you have the `strstr\' function. */ -@%:@undef HAVE_STRSTR]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_STRTOUL], [/* Define to 1 if you have the `strtoul\' function. */ -@%:@undef HAVE_STRTOUL]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_TIMEGM], [/* Define to 1 if you have the `timegm\' function. */ -@%:@undef HAVE_TIMEGM]) -m4trace:configure.in:1240: -1- AH_OUTPUT([HAVE_TZSET], [/* Define to 1 if you have the `tzset\' function. */ -@%:@undef HAVE_TZSET]) -m4trace:configure.in:1249: -1- AC_DEFINE_TRACE_LITERAL([PCRE_H_IN_SUBDIR]) -m4trace:configure.in:1249: -1- m4_pattern_allow([^PCRE_H_IN_SUBDIR$]) -m4trace:configure.in:1259: -1- AC_DEFINE_TRACE_LITERAL([PCREPOSIX_H_IN_SUBDIR]) -m4trace:configure.in:1259: -1- m4_pattern_allow([^PCREPOSIX_H_IN_SUBDIR$]) -m4trace:configure.in:1284: -1- AC_DEFINE_TRACE_LITERAL([__MT__]) -m4trace:configure.in:1284: -1- m4_pattern_allow([^__MT__$]) -m4trace:configure.in:1294: -2- AC_DEFINE_TRACE_LITERAL([FEATURE_TOGGLE]) -m4trace:configure.in:1294: -2- m4_pattern_allow([^FEATURE_TOGGLE$]) -m4trace:configure.in:1290: -1- AC_DEFINE_TRACE_LITERAL([FEATURE_TOGGLE]) -m4trace:configure.in:1290: -1- m4_pattern_allow([^FEATURE_TOGGLE$]) -m4trace:configure.in:1300: -2- AC_DEFINE_TRACE_LITERAL([FEATURE_FORCE_LOAD]) -m4trace:configure.in:1300: -2- m4_pattern_allow([^FEATURE_FORCE_LOAD$]) -m4trace:configure.in:1296: -1- AC_DEFINE_TRACE_LITERAL([FEATURE_FORCE_LOAD]) -m4trace:configure.in:1296: -1- m4_pattern_allow([^FEATURE_FORCE_LOAD$]) -m4trace:configure.in:1306: -2- AC_DEFINE_TRACE_LITERAL([FEATURE_FAST_REDIRECTS]) -m4trace:configure.in:1306: -2- m4_pattern_allow([^FEATURE_FAST_REDIRECTS$]) -m4trace:configure.in:1302: -1- AC_DEFINE_TRACE_LITERAL([FEATURE_FAST_REDIRECTS]) -m4trace:configure.in:1302: -1- m4_pattern_allow([^FEATURE_FAST_REDIRECTS$]) -m4trace:configure.in:1312: -2- AC_DEFINE_TRACE_LITERAL([FEATURE_STATISTICS]) -m4trace:configure.in:1312: -2- m4_pattern_allow([^FEATURE_STATISTICS$]) -m4trace:configure.in:1308: -1- AC_DEFINE_TRACE_LITERAL([FEATURE_STATISTICS]) -m4trace:configure.in:1308: -1- m4_pattern_allow([^FEATURE_STATISTICS$]) -m4trace:configure.in:1314: -1- AC_DEFINE_TRACE_LITERAL([FEATURE_IMAGE_DETECT_MSIE]) -m4trace:configure.in:1314: -1- m4_pattern_allow([^FEATURE_IMAGE_DETECT_MSIE$]) -m4trace:configure.in:1327: -2- AC_DEFINE_TRACE_LITERAL([FEATURE_IMAGE_BLOCKING]) -m4trace:configure.in:1327: -2- m4_pattern_allow([^FEATURE_IMAGE_BLOCKING$]) -m4trace:configure.in:1321: -1- AC_DEFINE_TRACE_LITERAL([FEATURE_IMAGE_BLOCKING]) -m4trace:configure.in:1321: -1- m4_pattern_allow([^FEATURE_IMAGE_BLOCKING$]) -m4trace:configure.in:1335: -2- AC_DEFINE_TRACE_LITERAL([FEATURE_ACL]) -m4trace:configure.in:1335: -2- m4_pattern_allow([^FEATURE_ACL$]) -m4trace:configure.in:1329: -1- AC_DEFINE_TRACE_LITERAL([FEATURE_ACL]) -m4trace:configure.in:1329: -1- m4_pattern_allow([^FEATURE_ACL$]) -m4trace:configure.in:1342: -2- AC_DEFINE_TRACE_LITERAL([FEATURE_TRUST]) -m4trace:configure.in:1342: -2- m4_pattern_allow([^FEATURE_TRUST$]) -m4trace:configure.in:1337: -1- AC_DEFINE_TRACE_LITERAL([FEATURE_TRUST]) -m4trace:configure.in:1337: -1- m4_pattern_allow([^FEATURE_TRUST$]) -m4trace:configure.in:1350: -2- AC_DEFINE_TRACE_LITERAL([FEATURE_CGI_EDIT_ACTIONS]) -m4trace:configure.in:1350: -2- m4_pattern_allow([^FEATURE_CGI_EDIT_ACTIONS$]) -m4trace:configure.in:1344: -1- AC_DEFINE_TRACE_LITERAL([FEATURE_CGI_EDIT_ACTIONS]) -m4trace:configure.in:1344: -1- m4_pattern_allow([^FEATURE_CGI_EDIT_ACTIONS$]) -m4trace:configure.in:1352: -1- AC_DEFINE_TRACE_LITERAL([FEATURE_NO_GIFS]) -m4trace:configure.in:1352: -1- m4_pattern_allow([^FEATURE_NO_GIFS$]) -m4trace:configure.in:1359: -1- AC_DEFINE_TRACE_LITERAL([FEATURE_GRACEFUL_TERMINATION]) -m4trace:configure.in:1359: -1- m4_pattern_allow([^FEATURE_GRACEFUL_TERMINATION$]) -m4trace:configure.in:1365: -1- AC_DEFINE_TRACE_LITERAL([FEATURE_EXTENDED_HOST_PATTERNS]) -m4trace:configure.in:1365: -1- m4_pattern_allow([^FEATURE_EXTENDED_HOST_PATTERNS$]) -m4trace:configure.in:1400: -1- AC_DEFINE_TRACE_LITERAL([FEATURE_ZLIB]) -m4trace:configure.in:1400: -1- m4_pattern_allow([^FEATURE_ZLIB$]) -m4trace:configure.in:1400: -1- AH_OUTPUT([FEATURE_ZLIB], [/* Define to 1 to use compression through the zlib library. */ -@%:@undef FEATURE_ZLIB]) -m4trace:configure.in:1422: -1- AC_DEFINE_TRACE_LITERAL([STATIC_PCRE]) -m4trace:configure.in:1422: -1- m4_pattern_allow([^STATIC_PCRE$]) -m4trace:configure.in:1428: -1- AC_DEFINE_TRACE_LITERAL([FEATURE_CONNECTION_KEEP_ALIVE]) -m4trace:configure.in:1428: -1- m4_pattern_allow([^FEATURE_CONNECTION_KEEP_ALIVE$]) -m4trace:configure.in:1445: -1- AC_DEFINE_TRACE_LITERAL([STATIC_PCRS]) -m4trace:configure.in:1445: -1- m4_pattern_allow([^STATIC_PCRS$]) -m4trace:configure.in:1449: -1- AC_SUBST([STATIC_PCRE_ONLY]) -m4trace:configure.in:1449: -1- AC_SUBST_TRACE([STATIC_PCRE_ONLY]) -m4trace:configure.in:1449: -1- m4_pattern_allow([^STATIC_PCRE_ONLY$]) -m4trace:configure.in:1450: -1- AC_SUBST([STATIC_PCRS_ONLY]) -m4trace:configure.in:1450: -1- AC_SUBST_TRACE([STATIC_PCRS_ONLY]) -m4trace:configure.in:1450: -1- m4_pattern_allow([^STATIC_PCRS_ONLY$]) -m4trace:configure.in:1459: -1- AC_SUBST([SPECIAL_CFLAGS]) -m4trace:configure.in:1459: -1- AC_SUBST_TRACE([SPECIAL_CFLAGS]) -m4trace:configure.in:1459: -1- m4_pattern_allow([^SPECIAL_CFLAGS$]) -m4trace:configure.in:1461: -1- AC_SUBST([PTHREAD_LIB]) -m4trace:configure.in:1461: -1- AC_SUBST_TRACE([PTHREAD_LIB]) -m4trace:configure.in:1461: -1- m4_pattern_allow([^PTHREAD_LIB$]) -m4trace:configure.in:1463: -1- AC_CONFIG_FILES([GNUmakefile doc/source/ldp.dsl]) -m4trace:configure.in:1463: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments. -You should run autoupdate.], []) -m4trace:configure.in:1463: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) -m4trace:configure.in:1463: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) -m4trace:configure.in:1463: -1- m4_pattern_allow([^LIB@&t@OBJS$]) -m4trace:configure.in:1463: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) -m4trace:configure.in:1463: -1- AC_SUBST_TRACE([LTLIBOBJS]) -m4trace:configure.in:1463: -1- m4_pattern_allow([^LTLIBOBJS$]) -m4trace:configure.in:1463: -1- AC_SUBST_TRACE([top_builddir]) -m4trace:configure.in:1463: -1- AC_SUBST_TRACE([top_build_prefix]) -m4trace:configure.in:1463: -1- AC_SUBST_TRACE([srcdir]) -m4trace:configure.in:1463: -1- AC_SUBST_TRACE([abs_srcdir]) -m4trace:configure.in:1463: -1- AC_SUBST_TRACE([top_srcdir]) -m4trace:configure.in:1463: -1- AC_SUBST_TRACE([abs_top_srcdir]) -m4trace:configure.in:1463: -1- AC_SUBST_TRACE([builddir]) -m4trace:configure.in:1463: -1- AC_SUBST_TRACE([abs_builddir]) -m4trace:configure.in:1463: -1- AC_SUBST_TRACE([abs_top_builddir]) -m4trace:configure.in:1463: -1- AC_SUBST_TRACE([INSTALL]) diff --git a/external/privoxy/cgi.c b/external/privoxy/cgi.c index 61ff0697..d0792675 100644 --- a/external/privoxy/cgi.c +++ b/external/privoxy/cgi.c @@ -1,4 +1,4 @@ -const char cgi_rcs[] = "$Id: cgi.c,v 1.116 2009/03/15 14:59:34 fabiankeil Exp $"; +const char cgi_rcs[] = "$Id: cgi.c,v 1.145 2011/10/08 17:31:05 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgi.c,v $ @@ -7,18 +7,18 @@ const char cgi_rcs[] = "$Id: cgi.c,v 1.116 2009/03/15 14:59:34 fabiankeil Exp $" * html or gif answers, and to compose HTTP resonses. * This only contains the framework functions, the * actual handler functions are declared elsewhere. - * + * * Functions declared include: - * + * * * Copyright : Written by and Copyright (C) 2001-2004, 2006-2008 * the SourceForge Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -36,618 +36,8 @@ const char cgi_rcs[] = "$Id: cgi.c,v 1.116 2009/03/15 14:59:34 fabiankeil Exp $" * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: cgi.c,v $ - * Revision 1.116 2009/03/15 14:59:34 fabiankeil - * Cosmetics. - * - * Revision 1.115 2009/03/01 18:28:23 fabiankeil - * Help clang understand that we aren't dereferencing - * NULL pointers here. - * - * Revision 1.114 2008/12/04 18:15:04 fabiankeil - * Fix some cparser warnings. - * - * Revision 1.113 2008/09/04 08:13:58 fabiankeil - * Prepare for critical sections on Windows by adding a - * layer of indirection before the pthread mutex functions. - * - * Revision 1.112 2008/08/31 16:08:12 fabiankeil - * "View the request headers" isn't more equal than the other - * menu items and thus doesn't need a trailing dot either. - * - * Revision 1.111 2008/08/31 15:59:02 fabiankeil - * There's no reason to let remote toggling support depend - * on FEATURE_CGI_EDIT_ACTIONS, so make sure it doesn't. - * - * Revision 1.110 2008/08/31 14:55:43 fabiankeil - * Add a @date@ symbol to include a date(1)-like time string - * in templates. Modified version of the patch Endre Szabo - * submitted in #2026468. - * - * Revision 1.109 2008/07/26 09:40:27 fabiankeil - * Remove the unconditional block in get_http_time(). - * It's pointless now that it's no longer used to limit - * dummy's scope. While at it, remove obvious comments - * and a trailing space. - * - * Revision 1.108 2008/05/26 17:30:53 fabiankeil - * Provide an OpenSearch Description to access the - * show-url-info page through "search engine plugins". - * - * Revision 1.107 2008/05/26 16:23:19 fabiankeil - * - Fix spelling in template-not-found message. - * - Declare referrer_is_safe()'s alternative_prefix[] static. - * - * Revision 1.106 2008/05/21 15:24:38 fabiankeil - * Mark csp as immutable for a bunch of functions. - * - * Revision 1.105 2008/04/17 14:40:47 fabiankeil - * Provide get_http_time() with the buffer size so it doesn't - * have to blindly assume that the buffer is big enough. - * - * Revision 1.104 2008/03/26 18:07:06 fabiankeil - * Add hostname directive. Closes PR#1918189. - * - * Revision 1.103 2008/03/21 11:13:57 fabiankeil - * Only gather host information if it's actually needed. - * Also move the code out of accept_connection() so it's less likely - * to delay other incoming connections if the host is misconfigured. - * - * Revision 1.102 2008/02/23 16:33:43 fabiankeil - * Let forward_url() use the standard parameter ordering - * and mark its second parameter immutable. - * - * Revision 1.101 2008/02/03 15:45:06 fabiankeil - * Add SOCKS5 support for "Forwarding failure" CGI page. - * - * Revision 1.100 2007/10/17 18:40:53 fabiankeil - * - Send CGI pages as HTTP/1.1 unless the client asked for HTTP/1.0. - * - White space fix. - * - * Revision 1.99 2007/08/05 13:42:22 fabiankeil - * #1763173 from Stefan Huehner: declare some more functions static. - * - * Revision 1.98 2007/05/14 10:33:51 fabiankeil - * - Use strlcpy() and strlcat() instead of strcpy() and strcat(). - * - * Revision 1.97 2007/04/09 18:11:35 fabiankeil - * Don't mistake VC++'s _snprintf() for a snprintf() replacement. - * - * Revision 1.96 2007/03/08 17:41:05 fabiankeil - * Use sizeof() more often. - * - * Revision 1.95 2007/02/10 17:01:37 fabiankeil - * Don't overlook map result for the forwarding-type. - * - * Revision 1.94 2007/02/08 19:44:49 fabiankeil - * Use a transparent background for the PNG replacement pattern. - * - * Revision 1.93 2007/02/07 10:45:22 fabiankeil - * - Save the reason for generating http_responses. - * - Fix --disable-toggle (again). - * - Use TBL birthday hack for 403 responses as well. - * - Uglify the @menu@ again to fix JavaScript - * errors on the "blocked" template. - * - Escape an ampersand in cgi_error_unknown(). - * - * Revision 1.92 2007/01/28 13:41:17 fabiankeil - * - Add HEAD support to finish_http_response. - * - Add error favicon to internal HTML error messages. - * - * Revision 1.91 2007/01/27 13:09:16 fabiankeil - * Add new config option "templdir" to - * change the templates directory. - * - * Revision 1.90 2007/01/25 13:47:26 fabiankeil - * Added "forwarding-failed" template support for error_response(). - * - * Revision 1.89 2007/01/23 15:51:16 fabiankeil - * Add favicon delivery functions. - * - * Revision 1.88 2007/01/23 13:14:32 fabiankeil - * - Map variables that aren't guaranteed to be - * pure ASCII html_encoded. - * - Use CGI_PREFIX to generate URL for user manual - * CGI page to make sure CGI_SITE_2_PATH is included. - * - * Revision 1.87 2007/01/22 15:34:13 fabiankeil - * - "Protect" against a rather lame JavaScript-based - * Privoxy detection "attack" and check the referrer - * before delivering the CGI style sheet. - * - Move referrer check for unsafe CGI pages into - * referrer_is_safe() and log the result. - * - Map @url@ in cgi-error-disabled page. - * It's required for the "go there anyway" link. - * - Mark *csp as immutable for grep_cgi_referrer(). - * - * Revision 1.86 2007/01/09 11:54:26 fabiankeil - * Fix strdup() error handling in cgi_error_unknown() - * and cgi_error_no_template(). Reported by Markus Elfring. - * - * Revision 1.85 2007/01/05 14:19:02 fabiankeil - * Handle pcrs_execute() errors in template_fill() properly. - * - * Revision 1.84 2006/12/28 17:54:22 fabiankeil - * Fixed gcc43 conversion warnings and replaced sprintf - * calls with snprintf to give OpenBSD's gcc one less reason - * to complain. - * - * Revision 1.83 2006/12/17 19:35:19 fabiankeil - * Escape ampersand in Privoxy menu. - * - * Revision 1.82 2006/12/17 17:53:39 fabiankeil - * Suppress the toggle link if remote toggling is disabled. - * - * Revision 1.81 2006/12/09 13:49:16 fabiankeil - * Fix configure option --disable-toggle. - * Thanks to Peter Thoenen for reporting this. - * - * Revision 1.80 2006/12/08 14:45:32 fabiankeil - * Don't lose the FORCE_PREFIX in case of - * connection problems. Fixes #612235. - * - * Revision 1.79 2006/11/13 19:05:50 fabiankeil - * Make pthread mutex locking more generic. Instead of - * checking for OSX and OpenBSD, check for FEATURE_PTHREAD - * and use mutex locking unless there is an _r function - * available. Better safe than sorry. - * - * Fixes "./configure --disable-pthread" and should result - * in less threading-related problems on pthread-using platforms, - * but it still doesn't fix BR#1122404. - * - * Revision 1.78 2006/09/21 19:22:07 fabiankeil - * Use CGI_PREFIX to check the referrer. - * The check for "http://config.privoxy.org/" fails - * if the user modified CGI_SITE_2_HOST. - * - * Revision 1.77 2006/09/21 15:17:23 fabiankeil - * Adjusted headers for Privoxy's cgi responses: - * Don't set Last-Modified, Expires and Cache-Control - * headers for redirects; always set "Connection: close". - * - * Revision 1.76 2006/09/07 14:06:38 fabiankeil - * Only predate the Last-Modified header for cgi responses - * that are delivered with status code 404 or 503. - * - * Revision 1.75 2006/09/07 11:56:39 fabiankeil - * Mark cgi_send_user_manual as harmless, - * to fix the access denied problem Hal spotted. - * The manual has no secret content, therefore we - * don't have to care about "secure" referrers. - * - * Revision 1.74 2006/09/06 18:45:03 fabiankeil - * Incorporate modified version of Roland Rosenfeld's patch to - * optionally access the user-manual via Privoxy. Closes patch 679075. - * - * Formatting changed to Privoxy style, added call to - * cgi_error_no_template if the requested file doesn't - * exist and modified check whether or not Privoxy itself - * should serve the manual. Should work cross-platform now. - * - * Revision 1.73 2006/08/03 02:46:41 david__schmidt - * Incorporate Fabian Keil's patch work: http://www.fabiankeil.de/sourcecode/privoxy/ - * - * Revision 1.72 2006/07/18 14:48:45 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.70.2.13 2004/02/17 13:30:23 oes - * Moved cgi_error_disabled() from cgiedit.c to - * cgi.c to re-enable build with --disable-editor. - * Fixes Bug #892744. Thanks to Matthew Fischer - * for spotting. - * - * Revision 1.70.2.12 2003/12/17 16:33:16 oes - * - Added new function cgi_redirect to handle creation of - * HTTP redirect messages formerly repeated in the code. - * - Send cgi_error_disabled instead of cgi_error_404 when - * referrer check fails - * - Dynamic content now gets Expires header field with date - * in the past - * - * Revision 1.70.2.11 2003/10/23 12:29:26 oes - * Bugfix: Transparent PNG was not transparent. Thanks to - * Dan Razzell of Starfish Systems for notice and new PNG. - * - * Revision 1.70.2.10 2003/06/06 07:54:25 oes - * Security fix: dspatch_known_cgi no longer considers an empty - * referrer safe for critical CGIs, since malicious links could - * reside on https:// locations which browsers don't advertize as - * referrers. Closes bug #749916, thanks to Jeff Epler for the - * hint. Goodbye One-Click[tm] toggling :-( - * - * Revision 1.70.2.9 2003/05/08 15:11:31 oes - * Nit - * - * Revision 1.70.2.8 2003/04/29 13:33:51 oes - * Killed a compiler warning on OSX - * - * Revision 1.70.2.7 2003/04/03 13:50:58 oes - * - Don't call cgi_error_disabled ifndef FEATURE_CGI_EDIT_ACTIONS - * (fixes bug #710056) - * - Show toggle info only if we have it - * - * Revision 1.70.2.6 2003/03/12 01:26:25 david__schmidt - * Move declaration of struct tm dummy outside of a control block so it is - * accessible later on during snprintf in get_http_time. - * - * Revision 1.70.2.5 2003/03/11 11:53:58 oes - * Cosmetic: Renamed cryptic variable - * - * Revision 1.70.2.4 2003/03/07 03:41:03 david__schmidt - * Wrapping all *_r functions (the non-_r versions of them) with mutex semaphores for OSX. Hopefully this will take care of all of those pesky crash reports. - * - * Revision 1.70.2.3 2002/11/28 18:14:32 oes - * Disable access to critical CGIs via untrusted referrers. - * This prevents users from being tricked by malicious websites - * into making unintentional configuration changes: - * - * - Added flag to each cgi_dispatcher that allows or denies - * external linking - * - Introduced proviorical function that greps for the - * referrer header before regular header parsing happens - * - Added safety check to dispatch_known_cgi. CGI is called - * if (cgi harmless || no referrer || we are referrer). - * Else a) toggle calls are modified not to change status and - * b) all other calls are denied. - * - * Revision 1.70.2.2 2002/11/12 16:20:37 oes - * Added missing #ifdef FEATURE_TOGGLE around g_bToggleIJB; fixes bug #636651 - * - * Revision 1.70.2.1 2002/08/05 11:17:46 oes - * Fixed Bug #587820, i.e. added workaround for IE bug that includes fragment identifier in (cgi) query - * - * Revision 1.70 2002/05/19 11:33:20 jongfoster - * If a CGI error was not handled, and propogated back to - * dispatch_known_cgi(), then it was assumed to be "out of memory". - * This gave a very misleading error message. - * - * Now other errors will cause a simple message giving the error - * number and asking the user to report a bug. - * - * Bug report: - * http://sourceforge.net/tracker/index.php?func=detail - * &aid=557905&group_id=11118&atid=111118 - * - * Revision 1.69 2002/05/14 21:28:40 oes - * - Fixed add_help_link to link to the (now split) actions - * part of the config chapter - * - Renamed helplink export to actions-help-prefix - * - * Revision 1.68 2002/05/12 21:36:29 jongfoster - * Correcting function comments - * - * Revision 1.67 2002/04/30 12:02:07 oes - * Nit: updated a comment - * - * Revision 1.66 2002/04/26 18:32:57 jongfoster - * Fixing a memory leak on error - * - * Revision 1.65 2002/04/26 12:53:51 oes - * - New function add_help_link - * - default_exports now exports links to the user manual - * and a prefix for links into the config chapter - * - * Revision 1.64 2002/04/24 02:17:21 oes - * - Better descriptions for CGIs - * - Hide edit-actions, more shortcuts - * - Moved get_char_param, get_string_param and get_number_param here - * from cgiedit.c - * - * Revision 1.63 2002/04/15 19:06:43 jongfoster - * Typos - * - * Revision 1.62 2002/04/10 19:59:46 jongfoster - * Fixes to #include in templates: - * - Didn't close main file if loading an included template fails. - * - I'm paranoid and want to disallow "#include /etc/passwd". - * - * Revision 1.61 2002/04/10 13:37:48 oes - * Made templates modular: template_load now recursive with max depth 1 - * - * Revision 1.60 2002/04/08 20:50:25 swa - * fixed JB spelling - * - * Revision 1.59 2002/04/05 15:51:51 oes - * - added send-stylesheet CGI - * - bugfix: error-pages now get correct request protocol - * - fixed - * - kludged CGI descriptions and menu not to break JS syntax - * - * Revision 1.58 2002/03/29 03:33:13 david__schmidt - * Fix Mac OSX compiler warnings - * - * Revision 1.57 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.56 2002/03/24 17:50:46 jongfoster - * Fixing compile error if actions file editor disabled - * - * Revision 1.55 2002/03/24 16:55:06 oes - * Making GIF checkerboard transparent - * - * Revision 1.54 2002/03/24 16:18:15 jongfoster - * Removing old logo - * - * Revision 1.53 2002/03/24 16:06:00 oes - * Correct transparency for checkerboard PNG. Thanks, Magnus! - * - * Revision 1.52 2002/03/24 15:23:33 jongfoster - * Name changes - * - * Revision 1.51 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.50 2002/03/16 23:54:06 jongfoster - * Adding graceful termination feature, to help look for memory leaks. - * If you enable this (which, by design, has to be done by hand - * editing config.h) and then go to http://i.j.b/die, then the program - * will exit cleanly after the *next* request. It should free all the - * memory that was used. - * - * Revision 1.49 2002/03/13 00:27:04 jongfoster - * Killing warnings - * - * Revision 1.48 2002/03/08 17:47:07 jongfoster - * Adding comments - * - * Revision 1.47 2002/03/08 16:41:33 oes - * Added GIF images again - * - * Revision 1.46 2002/03/07 03:48:38 oes - * - Changed built-in images from GIF to PNG - * (with regard to Unisys patent issue) - * - Added a 4x4 pattern PNG which is less intrusive - * than the logo but also clearly marks the deleted banners - * - * Revision 1.45 2002/03/06 22:54:35 jongfoster - * Automated function-comment nitpicking. - * - * Revision 1.44 2002/03/05 22:43:45 david__schmidt - * - Better error reporting on OS/2 - * - Fix double-slash comment (oops) - * - * Revision 1.43 2002/03/05 21:33:45 david__schmidt - * - Re-enable OS/2 building after new parms were added - * - Fix false out of memory report when resolving CGI templates when no IP - * address is available of failed attempt (a la no such domain) - * - * Revision 1.42 2002/01/21 00:33:20 jongfoster - * Replacing strsav() with the safer string_append() or string_join(). - * Adding map_block_keep() to save a few bytes in the edit-actions-list HTML. - * Adding missing html_encode() to error message generators. - * Adding edit-actions-section-swap and many "shortcuts" to the list of CGIs. - * - * Revision 1.41 2002/01/17 20:56:22 jongfoster - * Replacing hard references to the URL of the config interface - * with #defines from project.h - * - * Revision 1.40 2002/01/09 14:26:46 oes - * Added support for thread-safe gmtime_r call. - * - * Revision 1.39 2001/11/16 00:48:13 jongfoster - * Fixing a compiler warning - * - * Revision 1.38 2001/11/13 00:31:21 jongfoster - * - Adding new CGIs for use by non-JavaScript browsers: - * edit-actions-url-form - * edit-actions-add-url-form - * edit-actions-remove-url-form - * - Fixing make_menu()'s HTML generation - it now quotes the href parameter. - * - Fixing || bug. - * - * Revision 1.37 2001/11/01 14:28:47 david__schmidt - * Show enablement/disablement status in almost all templates. - * There is a little trickiness here: apparent recursive resolution of - * @if-enabled-then@ caused the toggle template to show status out-of-phase with - * the actual enablement status. So a similar construct, - * @if-enabled-display-then@, is used to resolve the status display on non-'toggle' - * templates. - * - * Revision 1.36 2001/10/26 17:33:27 oes - * marginal bugfix - * - * Revision 1.35 2001/10/23 21:48:19 jongfoster - * Cleaning up error handling in CGI functions - they now send back - * a HTML error page and should never cause a FATAL error. (Fixes one - * potential source of "denial of service" attacks). - * - * CGI actions file editor that works and is actually useful. - * - * Ability to toggle Junkbuster remotely using a CGI call. - * - * You can turn off both the above features in the main configuration - * file, e.g. if you are running a multi-user proxy. - * - * Revision 1.34 2001/10/18 22:22:09 david__schmidt - * Only show "Local support" on templates conditionally: - * - if either 'admin-address' or 'proxy-info-url' are uncommented in config - * - if not, no Local support section appears - * - * Revision 1.33 2001/10/14 22:28:41 jongfoster - * Fixing stupid typo. - * - * Revision 1.32 2001/10/14 22:20:18 jongfoster - * - Changes to CGI dispatching method to match CGI names exactly, - * rather than doing a prefix match. - * - No longer need to count the length of the CGI handler names by hand. - * - Adding new handler for 404 error when disptching a CGI, if none of - * the handlers match. - * - Adding new handlers for CGI actionsfile editor. - * - * Revision 1.31 2001/10/10 10:56:39 oes - * Failiure to load template now fatal. Before, the user got a hard-to-understand assertion failure from cgi.c - * - * Revision 1.30 2001/10/02 15:30:57 oes - * Introduced show-request cgi - * - * Revision 1.29 2001/09/20 15:47:44 steudten - * - * Fix BUG: Modify int size to size_t size in fill_template() - * - removes big trouble on machines where sizeof(int) != sizeof(size_t). - * - * Revision 1.28 2001/09/19 18:00:37 oes - * - Deletef time() FIXME (Can't fail under Linux either, if - * the argument is guaranteed to be in out address space, - * which it is.) - * - Fixed comments - * - Pointer notation cosmetics - * - Fixed a minor bug in template_fill(): Failiure of - * pcrs_execute() now secure. - * - * Revision 1.27 2001/09/16 17:08:54 jongfoster - * Moving simple CGI functions from cgi.c to new file cgisimple.c - * - * Revision 1.26 2001/09/16 15:47:37 jongfoster - * First version of CGI-based edit interface. This is very much a - * work-in-progress, and you can't actually use it to edit anything - * yet. You must #define FEATURE_CGI_EDIT_ACTIONS for these changes - * to have any effect. - * - * Revision 1.25 2001/09/16 15:02:35 jongfoster - * Adding i.j.b/robots.txt. - * Inlining add_stats() since it's only ever called from one place. - * - * Revision 1.24 2001/09/16 11:38:01 jongfoster - * Splitting fill_template() into 2 functions: - * template_load() loads the file - * template_fill() performs the PCRS regexps. - * This is because the CGI edit interface has a "table row" - * template which is used many times in the page - this - * change means it's only loaded from disk once. - * - * Revision 1.23 2001/09/16 11:16:05 jongfoster - * Better error handling in dispatch_cgi() and parse_cgi_parameters() - * - * Revision 1.22 2001/09/16 11:00:10 jongfoster - * New function alloc_http_response, for symmetry with free_http_response - * - * Revision 1.21 2001/09/13 23:53:03 jongfoster - * Support for both static and dynamically generated CGI pages. - * Correctly setting Last-Modified: and Expires: HTTP headers. - * - * Revision 1.20 2001/09/13 23:40:36 jongfoster - * (Cosmetic only) Indentation correction - * - * Revision 1.19 2001/09/13 23:31:25 jongfoster - * Moving image data to cgi.c rather than cgi.h. - * - * Revision 1.18 2001/08/05 16:06:20 jongfoster - * Modifiying "struct map" so that there are now separate header and - * "map_entry" structures. This means that functions which modify a - * map no longer need to return a pointer to the modified map. - * Also, it no longer reverses the order of the entries (which may be - * important with some advanced template substitutions). - * - * Revision 1.17 2001/08/05 15:57:38 oes - * Adapted finish_http_response to new list_to_text - * - * Revision 1.16 2001/08/01 21:33:18 jongfoster - * Changes to fill_template() that reduce memory usage without having - * an impact on performance. I also renamed some variables so as not - * to clash with the C++ keywords "new" and "template". - * - * Revision 1.15 2001/08/01 21:19:22 jongfoster - * Moving file version information to a separate CGI page. - * - * Revision 1.14 2001/08/01 00:19:03 jongfoster - * New function: map_conditional() for an if-then-else syntax. - * Changing to use new version of show_defines() - * - * Revision 1.13 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.12 2001/07/29 18:47:05 jongfoster - * Adding missing #include "loadcfg.h" - * - * Revision 1.11 2001/07/18 17:24:37 oes - * Changed to conform to new pcrs interface - * - * Revision 1.10 2001/07/13 13:53:13 oes - * Removed all #ifdef PCRS and related code - * - * Revision 1.9 2001/06/29 21:45:41 oes - * Indentation, CRLF->LF, Tab-> Space - * - * Revision 1.8 2001/06/29 13:21:46 oes - * - Cosmetics: renamed and reordered functions, variables, - * texts, improved comments etc - * - * - Removed ij_untrusted_url() The relevant - * info is now part of the "untrusted" page, - * which is generated by filters.c:trust_url() - * - * - Generators of content now call finish_http_response() - * themselves, making jcc.c:chat() a little less - * cluttered - * - * - Removed obsolete "Pragma: no-cache" from our headers - * - * - http_responses now know their head length - * - * - fill_template now uses the new interface to pcrs, so that - * - long jobs (like whole files) no longer have to be assembled - * in a fixed size buffer - * - the new T (trivial) option is used, and the replacement may - * contain Perl syntax backrefs without confusing pcrs - * - * - Introduced default_exports() which generates a set of exports - * common to all CGIs and other content generators - * - * - Introduced convenience function map_block_killer() - * - * - Introduced convenience function make_menu() - * - * - Introduced CGI-like function error_response() which generates - * the "No such domain" and "Connect failed" messages using the - * CGI platform - * - * - cgi_show_url_info: - * - adapted to new CGI features - * - form and answers now generated from same template - * - http:// prefix in URL now OK - * - * - cgi_show_status: - * - adapted to new CGI features - * - no longer uses csp->init_proxy_args - * - * - cgi_default: - * - moved menu generation to make_menu() - * - * - add_stats now writes single export map entries instead - * of a fixed string - * - * - Moved redirect_url() to filters.c - * - * - Fixed mem leak in free_http_response(), map_block_killer(), - * - * - Removed logentry from cancelled commit - * - * Revision 1.7 2001/06/09 10:51:58 jongfoster - * Changing "show URL info" handler to new style. - * Changing BUFSIZ ==> BUFFER_SIZE - * - * Revision 1.6 2001/06/07 23:05:19 jongfoster - * Removing code related to old forward and ACL files. - * - * Revision 1.5 2001/06/05 19:59:16 jongfoster - * Fixing multiline character string (a GCC-only "feature"), and snprintf (it's _snprintf under VC++). - * - * Revision 1.4 2001/06/04 10:41:52 swa - * show version string of cgi.h and cgi.c - * - * Revision 1.3 2001/06/03 19:12:16 oes - * introduced new cgi handling - * - * No revisions before 1.3 - * **********************************************************************/ - + #include "config.h" @@ -659,6 +49,10 @@ const char cgi_rcs[] = "$Id: cgi.c,v 1.116 2009/03/15 14:59:34 fabiankeil Exp $" #include #include +#ifdef FEATURE_COMPRESSION +#include +#endif + #include "project.h" #include "cgi.h" #include "list.h" @@ -672,12 +66,12 @@ const char cgi_rcs[] = "$Id: cgi.c,v 1.116 2009/03/15 14:59:34 fabiankeil Exp $" #if defined(FEATURE_CGI_EDIT_ACTIONS) || defined(FEATURE_TOGGLE) #include "cgiedit.h" #endif /* defined(FEATURE_CGI_EDIT_ACTIONS) || defined (FEATURE_TOGGLE) */ -#include "loadcfg.h" + /* loadcfg.h is for global_toggle_state only */ -#ifdef FEATURE_PTHREAD -#include "jcc.h" +#include "loadcfg.h" /* jcc.h is for mutex semaphore globals only */ -#endif /* def FEATURE_PTHREAD */ +#include "jcc.h" + const char cgi_h_rcs[] = CGI_H_VERSION; /* @@ -691,126 +85,126 @@ static const struct cgi_dispatcher cgi_dispatchers[] = { "Privoxy main page", TRUE }, #ifdef FEATURE_GRACEFUL_TERMINATION - { "die", - cgi_die, + { "die", + cgi_die, "Shut down - Do not deploy this build in a production environment, " "this is a one click Denial Of Service attack!!!", - FALSE }, + FALSE }, #endif - { "show-status", - cgi_show_status, + { "show-status", + cgi_show_status, #ifdef FEATURE_CGI_EDIT_ACTIONS "View & change the current configuration", #else "View the current configuration", #endif - TRUE }, - { "show-version", - cgi_show_version, + TRUE }, + { "show-version", + cgi_show_version, "View the source code version numbers", - TRUE }, - { "show-request", - cgi_show_request, + TRUE }, + { "show-request", + cgi_show_request, "View the request headers", - TRUE }, + TRUE }, { "show-url-info", - cgi_show_url_info, + cgi_show_url_info, "Look up which actions apply to a URL and why", TRUE }, #ifdef FEATURE_TOGGLE { "toggle", - cgi_toggle, + cgi_toggle, "Toggle Privoxy on or off", FALSE }, #endif /* def FEATURE_TOGGLE */ #ifdef FEATURE_CGI_EDIT_ACTIONS { "edit-actions", /* Edit the actions list */ - cgi_edit_actions, + cgi_edit_actions, NULL, FALSE }, { "eaa", /* Shortcut for edit-actions-add-url-form */ - cgi_edit_actions_add_url_form, + cgi_edit_actions_add_url_form, NULL, FALSE }, { "eau", /* Shortcut for edit-actions-url-form */ - cgi_edit_actions_url_form, + cgi_edit_actions_url_form, NULL, FALSE }, { "ear", /* Shortcut for edit-actions-remove-url-form */ - cgi_edit_actions_remove_url_form, + cgi_edit_actions_remove_url_form, NULL, FALSE }, { "eal", /* Shortcut for edit-actions-list */ - cgi_edit_actions_list, + cgi_edit_actions_list, NULL, FALSE }, { "eafu", /* Shortcut for edit-actions-for-url */ - cgi_edit_actions_for_url, + cgi_edit_actions_for_url, NULL, FALSE }, { "eas", /* Shortcut for edit-actions-submit */ - cgi_edit_actions_submit, + cgi_edit_actions_submit, NULL, FALSE }, { "easa", /* Shortcut for edit-actions-section-add */ - cgi_edit_actions_section_add, + cgi_edit_actions_section_add, NULL, FALSE }, { "easr", /* Shortcut for edit-actions-section-remove */ - cgi_edit_actions_section_remove, + cgi_edit_actions_section_remove, NULL, FALSE }, { "eass", /* Shortcut for edit-actions-section-swap */ - cgi_edit_actions_section_swap, + cgi_edit_actions_section_swap, NULL, FALSE }, { "edit-actions-for-url", - cgi_edit_actions_for_url, + cgi_edit_actions_for_url, NULL, FALSE /* Edit the actions for (a) specified URL(s) */ }, { "edit-actions-list", - cgi_edit_actions_list, + cgi_edit_actions_list, NULL, TRUE /* Edit the actions list */ }, { "edit-actions-submit", - cgi_edit_actions_submit, + cgi_edit_actions_submit, NULL, FALSE /* Change the actions for (a) specified URL(s) */ }, { "edit-actions-url", - cgi_edit_actions_url, + cgi_edit_actions_url, NULL, FALSE /* Change a URL pattern in the actionsfile */ }, { "edit-actions-url-form", - cgi_edit_actions_url_form, + cgi_edit_actions_url_form, NULL, FALSE /* Form to change a URL pattern in the actionsfile */ }, { "edit-actions-add-url", - cgi_edit_actions_add_url, + cgi_edit_actions_add_url, NULL, FALSE /* Add a URL pattern to the actionsfile */ }, { "edit-actions-add-url-form", - cgi_edit_actions_add_url_form, + cgi_edit_actions_add_url_form, NULL, FALSE /* Form to add a URL pattern to the actionsfile */ }, { "edit-actions-remove-url", - cgi_edit_actions_remove_url, + cgi_edit_actions_remove_url, NULL, FALSE /* Remove a URL pattern from the actionsfile */ }, { "edit-actions-remove-url-form", - cgi_edit_actions_remove_url_form, + cgi_edit_actions_remove_url_form, NULL, FALSE /* Form to remove a URL pattern from the actionsfile */ }, { "edit-actions-section-add", - cgi_edit_actions_section_add, + cgi_edit_actions_section_add, NULL, FALSE /* Remove a section from the actionsfile */ }, { "edit-actions-section-remove", - cgi_edit_actions_section_remove, + cgi_edit_actions_section_remove, NULL, FALSE /* Remove a section from the actionsfile */ }, { "edit-actions-section-swap", - cgi_edit_actions_section_swap, + cgi_edit_actions_section_swap, NULL, FALSE /* Swap two sections in the actionsfile */ }, #endif /* def FEATURE_CGI_EDIT_ACTIONS */ - { "error-favicon.ico", - cgi_send_error_favicon, + { "error-favicon.ico", + cgi_send_error_favicon, NULL, TRUE /* Sends the favicon image for error pages. */ }, - { "favicon.ico", - cgi_send_default_favicon, + { "favicon.ico", + cgi_send_default_favicon, NULL, TRUE /* Sends the default favicon image. */ }, - { "robots.txt", - cgi_robots_txt, - NULL, TRUE /* Sends a robots.txt file to tell robots to go away. */ }, + { "robots.txt", + cgi_robots_txt, + NULL, TRUE /* Sends a robots.txt file to tell robots to go away. */ }, { "send-banner", - cgi_send_banner, + cgi_send_banner, NULL, TRUE /* Send a built-in image */ }, { "send-stylesheet", - cgi_send_stylesheet, + cgi_send_stylesheet, NULL, FALSE /* Send templates/cgi-style.css */ }, { "t", - cgi_transparent_image, + cgi_transparent_image, NULL, TRUE /* Send a transparent image (short name) */ }, { "url-info-osd.xml", - cgi_send_url_info_osd, + cgi_send_url_info_osd, NULL, TRUE /* Send templates/url-info-osd.xml */ }, { "user-manual", cgi_send_user_manual, @@ -877,6 +271,13 @@ const char image_blank_data[] = const size_t image_pattern_length = sizeof(image_pattern_data) - 1; const size_t image_blank_length = sizeof(image_blank_data) - 1; +#ifdef FEATURE_COMPRESSION +/* + * Minimum length which a buffer has to reach before + * we bother to (re-)compress it. Completely arbitrary. + */ +const size_t LOWER_LENGTH_LIMIT_FOR_COMPRESSION = 1024U; +#endif static struct http_response cgi_error_memory_response[1]; @@ -886,7 +287,7 @@ static struct map *parse_cgi_parameters(char *argstring); /********************************************************************* - * + * * Function : dispatch_cgi * * Description : Checks if a request URL has either the magical @@ -948,7 +349,7 @@ struct http_response *dispatch_cgi(struct client_state *csp) return NULL; } - /* + /* * This is a CGI call. */ @@ -993,7 +394,7 @@ static char *grep_cgi_referrer(const struct client_state *csp) /********************************************************************* - * + * * Function : referrer_is_safe * * Description : Decides whether we trust the Referer for @@ -1041,7 +442,7 @@ static int referrer_is_safe(const struct client_state *csp) } /********************************************************************* - * + * * Function : dispatch_known_cgi * * Description : Processes a CGI once dispatch_cgi has determined that @@ -1079,7 +480,7 @@ static struct http_response *dispatch_known_cgi(struct client_state * csp, { query_args_start++; } - if (*query_args_start == '/') + if (*query_args_start == '/') { *query_args_start++ = '\0'; if ((param_list = new_map())) @@ -1114,7 +515,7 @@ static struct http_response *dispatch_known_cgi(struct client_state * csp, return cgi_error_memory(); } - /* + /* * Find and start the right CGI function */ d = cgi_dispatchers; @@ -1157,13 +558,15 @@ static struct http_response *dispatch_known_cgi(struct client_state * csp, if (err && (err != JB_ERR_MEMORY)) { /* Unexpected error! Shouldn't get here */ - log_error(LOG_LEVEL_ERROR, "Unexpected CGI error %d in top-level handler. Please file a bug report!", err); + log_error(LOG_LEVEL_ERROR, + "Unexpected CGI error %d in top-level handler. " + "Please file a bug report!", err); err = cgi_error_unknown(csp, rsp, err); } if (!err) { /* It worked */ - rsp->reason = RSP_REASON_CGI_CALL; + rsp->crunch_reason = CGI_CALL; return finish_http_response(csp, rsp); } else @@ -1176,8 +579,8 @@ static struct http_response *dispatch_known_cgi(struct client_state * csp, d++; } } - - + + /********************************************************************* * * Function : parse_cgi_parameters @@ -1203,7 +606,7 @@ static struct map *parse_cgi_parameters(char *argstring) return NULL; } - /* + /* * IE 5 does, of course, violate RFC 2316 Sect 4.1 and sends * the fragment identifier along with the request, so we must * cut it off here, so it won't pollute the CGI params: @@ -1372,7 +775,7 @@ jb_err get_number_param(struct client_state *csp, assert(name); assert(pvalue); - *pvalue = 0; + *pvalue = 0; param = lookup(parameters, name); if (!*param) @@ -1425,15 +828,13 @@ jb_err get_number_param(struct client_state *csp, * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) * 2 : templatename = Which template should be used for the answer - * 3 : sys_err = system error number * * Returns : A http_response. If we run out of memory, this * will be cgi_error_memory(). * *********************************************************************/ struct http_response *error_response(struct client_state *csp, - const char *templatename, - int sys_err) + const char *templatename) { jb_err err; struct http_response *rsp; @@ -1466,8 +867,7 @@ struct http_response *error_response(struct client_state *csp, if (!err) err = map(exports, "host", 1, html_encode(csp->http->host), 0); if (!err) err = map(exports, "hostport", 1, html_encode(csp->http->hostport), 0); if (!err) err = map(exports, "path", 1, html_encode_and_free_original(path), 0); - if (!err) err = map(exports, "error", 1, html_encode_and_free_original(safe_strerror(sys_err)), 0); - if (!err) err = map(exports, "protocol", 1, csp->http->ssl ? "https://" : "http://", 1); + if (!err) err = map(exports, "protocol", 1, csp->http->ssl ? "https://" : "http://", 1); if (!err) { err = map(exports, "host-ip", 1, html_encode(csp->http->host_ip_addr_str), 0); @@ -1489,13 +889,7 @@ struct http_response *error_response(struct client_state *csp, if (!strcmp(templatename, "no-such-domain")) { rsp->status = strdup("404 No such domain"); - if (rsp->status == NULL) - { - free_map(exports); - free_http_response(rsp); - return cgi_error_memory(); - } - rsp->reason = RSP_REASON_NO_SUCH_DOMAIN; + rsp->crunch_reason = NO_SUCH_DOMAIN; } else if (!strcmp(templatename, "forwarding-failed")) { @@ -1549,26 +943,37 @@ struct http_response *error_response(struct client_state *csp, if (!err) err = map(exports, "forwarding-type", 1, socks_type, 1); if (!err) err = map(exports, "error-message", 1, html_encode(csp->error_message), 0); - - if (!err) rsp->status = strdup("503 Forwarding failure"); - if ((rsp->status == NULL) || (NULL == csp->error_message) || err) + if ((NULL == csp->error_message) || err) { free_map(exports); free_http_response(rsp); return cgi_error_memory(); } - rsp->reason = RSP_REASON_FORWARDING_FAILED; + + rsp->status = strdup("503 Forwarding failure"); + rsp->crunch_reason = FORWARDING_FAILED; } else if (!strcmp(templatename, "connect-failed")) { rsp->status = strdup("503 Connect failed"); - if (rsp->status == NULL) - { - free_map(exports); - free_http_response(rsp); - return cgi_error_memory(); - } - rsp->reason = RSP_REASON_CONNECT_FAILED; + rsp->crunch_reason = CONNECT_FAILED; + } + else if (!strcmp(templatename, "connection-timeout")) + { + rsp->status = strdup("504 Connection timeout"); + rsp->crunch_reason = CONNECTION_TIMEOUT; + } + else if (!strcmp(templatename, "no-server-data")) + { + rsp->status = strdup("502 No data received from server or forwarder"); + rsp->crunch_reason = NO_SERVER_DATA; + } + + if (rsp->status == NULL) + { + free_map(exports); + free_http_response(rsp); + return cgi_error_memory(); } err = template_fill_for_cgi(csp, templatename, exports, rsp); @@ -1645,23 +1050,23 @@ void cgi_init_error_messages(void) "Content-Type: text/html\r\n" "\r\n"; cgi_error_memory_response->body = - "\r\n" - "\r\n" - " 500 Internal Privoxy Error\r\n" + "\n" + "\n" + " 500 Internal Privoxy Error\n" " " - "\r\n" - "\r\n" - "

500 Internal Privoxy Error

\r\n" - "

Privoxy ran out of memory while processing your request.

\r\n" - "

Please contact your proxy administrator, or try again later

\r\n" - "\r\n" - "\r\n"; + "\n" + "\n" + "

500 Internal Privoxy Error

\n" + "

Privoxy ran out of memory while processing your request.

\n" + "

Please contact your proxy administrator, or try again later

\n" + "\n" + "\n"; cgi_error_memory_response->head_length = strlen(cgi_error_memory_response->head); cgi_error_memory_response->content_length = strlen(cgi_error_memory_response->body); - cgi_error_memory_response->reason = RSP_REASON_OUT_OF_MEMORY; + cgi_error_memory_response->crunch_reason = OUT_OF_MEMORY; } @@ -1693,7 +1098,7 @@ struct http_response *cgi_error_memory(void) * * Description : Almost-CGI function that is called if a template * cannot be loaded. Note this is not a true CGI, - * it takes a template name rather than a map of + * it takes a template name rather than a map of * parameters. * * Parameters : @@ -1703,7 +1108,7 @@ struct http_response *cgi_error_memory(void) * be loaded. * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_error_no_template(const struct client_state *csp, @@ -1713,18 +1118,18 @@ jb_err cgi_error_no_template(const struct client_state *csp, static const char status[] = "500 Internal Privoxy Error"; static const char body_prefix[] = - "\r\n" - "\r\n" - " 500 Internal Privoxy Error\r\n" + "\n" + "\n" + " 500 Internal Privoxy Error\n" " " - "\r\n" - "\r\n" - "

500 Internal Privoxy Error

\r\n" - "

Privoxy encountered an error while processing your request:

\r\n" + "\n" + "\n" + "

500 Internal Privoxy Error

\n" + "

Privoxy encountered an error while processing your request:

\n" "

Could not load template file "; static const char body_suffix[] = - " or one of its included components.

\r\n" - "

Please contact your proxy administrator.

\r\n" + " or one of its included components.

\n" + "

Please contact your proxy administrator.

\n" "

If you are the proxy administrator, please put the required file(s)" "in the (confdir)/templates directory. The " "location of the (confdir) directory " @@ -1733,9 +1138,9 @@ jb_err cgi_error_no_template(const struct client_state *csp, #ifndef _WIN32 ", or /etc/privoxy/" #endif /* ndef _WIN32 */ - ").

\r\n" - "\r\n" - "\r\n"; + ").

\n" + "\n" + "\n"; const size_t body_size = strlen(body_prefix) + strlen(template_name) + strlen(body_suffix) + 1; assert(csp); @@ -1790,7 +1195,7 @@ jb_err cgi_error_no_template(const struct client_state *csp, * 3 : error_to_report = Error code to report. * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_error_unknown(const struct client_state *csp, @@ -1800,28 +1205,24 @@ jb_err cgi_error_unknown(const struct client_state *csp, static const char status[] = "500 Internal Privoxy Error"; static const char body_prefix[] = - "\r\n" - "\r\n" - " 500 Internal Privoxy Error\r\n" + "\n" + "\n" + " 500 Internal Privoxy Error\n" " " - "\r\n" - "\r\n" - "

500 Internal Privoxy Error

\r\n" - "

Privoxy encountered an error while processing your request:

\r\n" + "\n" + "\n" + "

500 Internal Privoxy Error

\n" + "

Privoxy encountered an error while processing your request:

\n" "

Unexpected internal error: "; static const char body_suffix[] = - "

\r\n" + "

\n" "

Please " "" - "file a bug report.

\r\n" - "\r\n" - "\r\n"; - char errnumbuf[30]; - /* - * Due to sizeof(errnumbuf), body_size will be slightly - * bigger than necessary but it doesn't really matter. - */ - const size_t body_size = strlen(body_prefix) + sizeof(errnumbuf) + strlen(body_suffix) + 1; + "file a bug report.

\n" + "\n" + "\n"; + /* Includes room for larger error numbers in the future. */ + const size_t body_size = sizeof(body_prefix) + sizeof(body_suffix) + 5; assert(csp); assert(rsp); @@ -1832,18 +1233,15 @@ jb_err cgi_error_unknown(const struct client_state *csp, rsp->content_length = 0; rsp->head_length = 0; rsp->is_static = 0; - rsp->reason = RSP_REASON_INTERNAL_ERROR; - - snprintf(errnumbuf, sizeof(errnumbuf), "%d", error_to_report); + rsp->crunch_reason = INTERNAL_ERROR; rsp->body = malloc(body_size); if (rsp->body == NULL) { return JB_ERR_MEMORY; } - strlcpy(rsp->body, body_prefix, body_size); - strlcat(rsp->body, errnumbuf, body_size); - strlcat(rsp->body, body_suffix, body_size); + + snprintf(rsp->body, body_size, "%s%d%s", body_prefix, error_to_report, body_suffix); rsp->status = strdup(status); if (rsp->status == NULL) @@ -1861,7 +1259,7 @@ jb_err cgi_error_unknown(const struct client_state *csp, * * Description : CGI function that is called if the parameters * (query string) for a CGI were wrong. - * + * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) * 2 : rsp = http_response data structure for output @@ -1869,7 +1267,7 @@ jb_err cgi_error_unknown(const struct client_state *csp, * CGI Parameters : none * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_error_bad_param(const struct client_state *csp, @@ -1891,7 +1289,7 @@ jb_err cgi_error_bad_param(const struct client_state *csp, /********************************************************************* * - * Function : cgi_redirect + * Function : cgi_redirect * * Description : CGI support function to generate a HTTP redirect * message @@ -1903,7 +1301,7 @@ jb_err cgi_error_bad_param(const struct client_state *csp, * CGI Parameters : None * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_redirect (struct http_response * rsp, const char *target) @@ -1938,8 +1336,8 @@ jb_err cgi_redirect (struct http_response * rsp, const char *target) * FIXME: I currently only work for actions, and would * like to be generalized for other topics. * - * Parameters : - * 1 : item = item (will NOT be free()d.) + * Parameters : + * 1 : item = item (will NOT be free()d.) * It is assumed to be HTML-safe. * 2 : config = The current configuration. * @@ -1970,7 +1368,7 @@ char *add_help_link(const char *item, string_join (&result, string_toupper(item)); string_append(&result, "\">"); string_append(&result, item); - string_append(&result, " "); + string_append(&result, ""); return result; } @@ -1984,7 +1382,7 @@ char *add_help_link(const char *item, * HTTP header - e.g.: * "Sun, 06 Nov 1994 08:49:37 GMT" * - * Parameters : + * Parameters : * 1 : time_offset = Time returned will be current time * plus this number of seconds. * 2 : buf = Destination for result. @@ -1997,12 +1395,6 @@ char *add_help_link(const char *item, *********************************************************************/ void get_http_time(int time_offset, char *buf, size_t buffer_size) { - static const char day_names[7][4] = - { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; - static const char month_names[12][4] = - { "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; - struct tm *t; time_t current_time; #if defined(HAVE_GMTIME_R) @@ -2019,7 +1411,7 @@ void get_http_time(int time_offset, char *buf, size_t buffer_size) /* get and save the gmt */ #if HAVE_GMTIME_R t = gmtime_r(¤t_time, &dummy); -#elif FEATURE_PTHREAD +#elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&gmtime_mutex); t = gmtime(¤t_time); privoxy_mutex_unlock(&gmtime_mutex); @@ -2027,17 +1419,7 @@ void get_http_time(int time_offset, char *buf, size_t buffer_size) t = gmtime(¤t_time); #endif - /* Format: "Sun, 06 Nov 1994 08:49:37 GMT" */ - snprintf(buf, buffer_size, - "%s, %02d %s %4d %02d:%02d:%02d GMT", - day_names[t->tm_wday], - t->tm_mday, - month_names[t->tm_mon], - t->tm_year + 1900, - t->tm_hour, - t->tm_min, - t->tm_sec - ); + strftime(buf, buffer_size, "%a, %d %b %Y %H:%M:%S GMT", t); } @@ -2075,7 +1457,7 @@ static void get_locale_time(char *buf, size_t buffer_size) #if HAVE_LOCALTIME_R timeptr = localtime_r(¤t_time, &dummy); -#elif FEATURE_PTHREAD +#elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&localtime_mutex); timeptr = localtime(¤t_time); privoxy_mutex_unlock(&localtime_mutex); @@ -2087,6 +1469,63 @@ static void get_locale_time(char *buf, size_t buffer_size) } + +#ifdef FEATURE_COMPRESSION +/********************************************************************* + * + * Function : compress_buffer + * + * Description : Compresses the content of a buffer with zlib's deflate + * Allocates a new buffer for the result, free'ing it is + * up to the caller. + * + * Parameters : + * 1 : buffer = buffer whose content should be compressed + * 2 : buffer_length = length of the buffer + * 3 : compression_level = compression level for compress2() + * + * Returns : NULL on error, otherwise a pointer to the compressed + * content of the input buffer. + * + *********************************************************************/ +char *compress_buffer(char *buffer, size_t *buffer_length, int compression_level) +{ + char *compressed_buffer; + uLongf new_length; + assert(-1 <= compression_level && compression_level <= 9); + + /* Let zlib figure out the maximum length of the compressed data */ + new_length = compressBound((uLongf)*buffer_length); + + compressed_buffer = malloc(new_length); + if (NULL == compressed_buffer) + { + log_error(LOG_LEVEL_FATAL, + "Out of memory allocation compression buffer."); + } + + if (Z_OK != compress2((Bytef *)compressed_buffer, &new_length, + (Bytef *)buffer, *buffer_length, compression_level)) + { + log_error(LOG_LEVEL_ERROR, + "compress2() failed. Buffer size: %d, compression level: %d.", + new_length, compression_level); + freez(compressed_buffer); + return NULL; + } + + log_error(LOG_LEVEL_RE_FILTER, + "Compressed content from %d to %d bytes. Compression level: %d", + *buffer_length, new_length, compression_level); + + *buffer_length = (size_t)new_length; + + return compressed_buffer; + +} +#endif + + /********************************************************************* * * Function : finish_http_response @@ -2116,7 +1555,7 @@ struct http_response *finish_http_response(const struct client_state *csp, struc return rsp; } - /* + /* * Fill in the HTTP Status, using HTTP/1.1 * unless the client asked for HTTP/1.0. */ @@ -2125,13 +1564,31 @@ struct http_response *finish_http_response(const struct client_state *csp, struc rsp->status ? rsp->status : "200 OK"); err = enlist_first(rsp->headers, buf); - /* + /* * Set the Content-Length */ if (rsp->content_length == 0) { rsp->content_length = rsp->body ? strlen(rsp->body) : 0; } + +#ifdef FEATURE_COMPRESSION + if (!err && (csp->flags & CSP_FLAG_CLIENT_SUPPORTS_DEFLATE) + && (rsp->content_length > LOWER_LENGTH_LIMIT_FOR_COMPRESSION)) + { + char *compressed_content; + + compressed_content = compress_buffer(rsp->body, &rsp->content_length, + csp->config->compression_level); + if (NULL != compressed_content) + { + freez(rsp->body); + rsp->body = compressed_content; + err = enlist_unique_header(rsp->headers, "Content-Encoding", "deflate"); + } + } +#endif + if (!err) { snprintf(buf, sizeof(buf), "Content-Length: %d", (int)rsp->content_length); @@ -2173,7 +1630,7 @@ struct http_response *finish_http_response(const struct client_state *csp, struc * Last-Modified: set to date/time the page was last changed. * Expires: set to date/time page next needs reloading. * Cache-Control: set to "no-cache" if applicable. - * + * * See http://www.w3.org/Protocols/rfc2068/rfc2068 */ if (rsp->is_static) @@ -2230,7 +1687,9 @@ struct http_response *finish_http_response(const struct client_state *csp, struc if (!err) err = enlist_unique_header(rsp->headers, "Date", buf); if (!strncmpic(rsp->status, "403", 3) || !strncmpic(rsp->status, "404", 3) - || !strncmpic(rsp->status, "503", 3)) + || !strncmpic(rsp->status, "502", 3) + || !strncmpic(rsp->status, "503", 3) + || !strncmpic(rsp->status, "504", 3)) { if (!err) err = enlist_unique_header(rsp->headers, "Last-Modified", "Wed, 08 Jun 1955 12:00:00 GMT"); } @@ -2242,15 +1701,12 @@ struct http_response *finish_http_response(const struct client_state *csp, struc if (!err) err = enlist_unique_header(rsp->headers, "Pragma", "no-cache"); } - /* - * Quoting RFC 2616: - * - * HTTP/1.1 applications that do not support persistent connections MUST - * include the "close" connection option in every message. - */ - if (!err) err = enlist_unique_header(rsp->headers, "Connection", "close"); + if (!err && !(csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE)) + { + err = enlist_unique_header(rsp->headers, "Connection", "close"); + } - /* + /* * Write the head */ if (err || (NULL == (rsp->head = list_to_text(rsp->headers)))) @@ -2330,11 +1786,11 @@ void free_http_response(struct http_response *rsp) * following an #include statament * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * JB_ERR_FILE if the template file cannot be read * *********************************************************************/ -jb_err template_load(const struct client_state *csp, char **template_ptr, +jb_err template_load(const struct client_state *csp, char **template_ptr, const char *templatename, int recursive) { jb_err err; @@ -2416,7 +1872,7 @@ jb_err template_load(const struct client_state *csp, char **template_ptr, } free(full_path); - /* + /* * Read the file, ignoring comments, and honoring #include * statements, unless we're already called recursively. * @@ -2471,7 +1927,7 @@ jb_err template_load(const struct client_state *csp, char **template_ptr, * HTML template by replacing @name@ with value using * pcrs, for each item in the output map. * - * Note that a leading '$' charachter in the export map's + * Note that a leading '$' character in the export map's * values will be stripped and toggle on backreference * interpretation. * @@ -2504,7 +1960,7 @@ jb_err template_fill(char **template_ptr, const struct map *exports) file_buffer = *template_ptr; size = strlen(file_buffer) + 1; - /* + /* * Assemble pcrs joblist from exports map */ for (m = exports->first; m != NULL; m = m->next) @@ -2522,7 +1978,7 @@ jb_err template_fill(char **template_ptr, const struct map *exports) else { /* - * Treat the "replace with" text as a literal string - + * Treat the "replace with" text as a literal string - * no quoting needed, no backreferences allowed. * ("Trivial" ['T'] flag). */ @@ -2536,7 +1992,7 @@ jb_err template_fill(char **template_ptr, const struct map *exports) /* Make and run job. */ job = pcrs_compile(buf, m->value, flags, &error); - if (job == NULL) + if (job == NULL) { if (error == PCRS_ERR_NOMEM) { @@ -2563,10 +2019,10 @@ jb_err template_fill(char **template_ptr, const struct map *exports) if (error < 0) { - /* + /* * Substitution failed, keep the original buffer, * log the problem and ignore it. - * + * * The user might see some unresolved @CGI_VARIABLES@, * but returning a special CGI error page seems unreasonable * and could mask more important error messages. @@ -2618,7 +2074,7 @@ jb_err template_fill_for_cgi(const struct client_state *csp, struct http_response *rsp) { jb_err err; - + assert(csp); assert(templatename); assert(exports); @@ -2663,6 +2119,7 @@ struct map *default_exports(const struct client_state *csp, const char *caller) struct map * exports; int local_help_exists = 0; char *ip_address = NULL; + char *port = NULL; char *hostname = NULL; assert(csp); @@ -2675,12 +2132,12 @@ struct map *default_exports(const struct client_state *csp, const char *caller) if (csp->config->hostname) { - get_host_information(csp->cfd, &ip_address, NULL); + get_host_information(csp->cfd, &ip_address, &port, NULL); hostname = strdup(csp->config->hostname); } else { - get_host_information(csp->cfd, &ip_address, &hostname); + get_host_information(csp->cfd, &ip_address, &port, &hostname); } err = map(exports, "version", 1, html_encode(VERSION), 0); @@ -2688,6 +2145,8 @@ struct map *default_exports(const struct client_state *csp, const char *caller) if (!err) err = map(exports, "time", 1, html_encode(buf), 0); if (!err) err = map(exports, "my-ip-address", 1, html_encode(ip_address ? ip_address : "unknown"), 0); freez(ip_address); + if (!err) err = map(exports, "my-port", 1, html_encode(port ? port : "unkown"), 0); + freez(port); if (!err) err = map(exports, "my-hostname", 1, html_encode(hostname ? hostname : "unknown"), 0); freez(hostname); if (!err) err = map(exports, "homepage", 1, html_encode(HOME_PAGE_URL), 0); @@ -2712,9 +2171,6 @@ struct map *default_exports(const struct client_state *csp, const char *caller) if (!err) err = map_block_killer(exports, "can-toggle"); #endif - snprintf(buf, sizeof(buf), "%d", csp->config->hport); - if (!err) err = map(exports, "my-port", 1, buf, 1); - if(!strcmp(CODE_STATUS, "stable")) { if (!err) err = map_block_killer(exports, "unstable"); @@ -2765,12 +2221,12 @@ struct map *default_exports(const struct client_state *csp, const char *caller) * "if--start.*if--end" to the given * export list. * - * Parameters : + * Parameters : * 1 : exports = map to extend * 2 : name = name of conditional block * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err map_block_killer(struct map *exports, const char *name) @@ -2794,12 +2250,12 @@ jb_err map_block_killer(struct map *exports, const char *name) * by map-block-killer, to save a few bytes. * i.e. removes "@if--start@" and "@if--end@" * - * Parameters : + * Parameters : * 1 : exports = map to extend * 2 : name = name of conditional block * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err map_block_keep(struct map *exports, const char *name) @@ -2840,13 +2296,13 @@ jb_err map_block_keep(struct map *exports, const char *name) * The control structure and one of the alternatives * will be hidden. * - * Parameters : + * Parameters : * 1 : exports = map to extend * 2 : name = name of conditional block * 3 : choose_first = nonzero for first, zero for second. * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err map_conditional(struct map *exports, const char *name, int choose_first) @@ -2878,7 +2334,7 @@ jb_err map_conditional(struct map *exports, const char *name, int choose_first) * * Function : make_menu * - * Description : Returns an HTML-formatted menu of the available + * Description : Returns an HTML-formatted menu of the available * unhidden CGIs, excluding the one given in * and the toggle CGI if toggling is disabled. * @@ -2886,7 +2342,7 @@ jb_err map_conditional(struct map *exports, const char *name, int choose_first) * 1 : self = name of CGI to leave out, can be NULL for * complete listing. * 2 : feature_flags = feature bitmap from csp->config - * + * * * Returns : menu string, or NULL on out-of-memory error. * @@ -2927,7 +2383,7 @@ char *make_menu(const char *self, const unsigned feature_flags) html_encoded_prefix = html_encode(CGI_PREFIX); if (html_encoded_prefix == NULL) { - return NULL; + return NULL; } else { diff --git a/external/privoxy/cgi.h b/external/privoxy/cgi.h index 6228b329..aedaa91a 100644 --- a/external/privoxy/cgi.h +++ b/external/privoxy/cgi.h @@ -1,24 +1,24 @@ #ifndef CGI_H_INCLUDED #define CGI_H_INCLUDED -#define CGI_H_VERSION "$Id: cgi.h,v 1.35 2008/05/21 15:24:37 fabiankeil Exp $" +#define CGI_H_VERSION "$Id: cgi.h,v 1.41 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgi.h,v $ * * Purpose : Declares functions to intercept request, generate * html or gif answers, and to compose HTTP resonses. - * - * Functions declared include: - * * - * Copyright : Written by and Copyright (C) 2001-2007 the SourceForge + * Functions declared include: + * + * + * Copyright : Written by and Copyright (C) 2001-2009 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -36,161 +36,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: cgi.h,v $ - * Revision 1.35 2008/05/21 15:24:37 fabiankeil - * Mark csp as immutable for a bunch of functions. - * - * Revision 1.34 2008/04/17 14:40:48 fabiankeil - * Provide get_http_time() with the buffer size so it doesn't - * have to blindly assume that the buffer is big enough. - * - * Revision 1.33 2007/01/28 13:41:17 fabiankeil - * - Add HEAD support to finish_http_response. - * - Add error favicon to internal HTML error messages. - * - * Revision 1.32 2006/12/17 17:53:39 fabiankeil - * Suppress the toggle link if remote toggling is disabled. - * - * Revision 1.31 2006/07/18 14:48:45 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.29.2.2 2004/02/17 13:30:23 oes - * Moved cgi_error_disabled() from cgiedit.c to - * cgi.c to re-enable build with --disable-editor. - * Fixes Bug #892744. Thanks to Matthew Fischer - * for spotting. - * - * Revision 1.29.2.1 2003/12/17 16:33:28 oes - * Added prototype of new function cgi_redirect - * - * Revision 1.29 2002/05/19 11:33:21 jongfoster - * If a CGI error was not handled, and propogated back to - * dispatch_known_cgi(), then it was assumed to be "out of memory". - * This gave a very misleading error message. - * - * Now other errors will cause a simple message giving the error - * number and asking the user to report a bug. - * - * Bug report: - * http://sourceforge.net/tracker/index.php?func=detail - * &aid=557905&group_id=11118&atid=111118 - * - * Revision 1.28 2002/04/26 12:54:03 oes - * New function add_help_link - * - * Revision 1.27 2002/04/24 02:16:51 oes - * Moved get_char_param, get_string_param and get_number_param here from cgiedit.c - * - * Revision 1.26 2002/04/10 13:38:35 oes - * load_template signature changed - * - * Revision 1.25 2002/04/08 20:50:25 swa - * fixed JB spelling - * - * Revision 1.24 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.23 2002/03/24 16:18:15 jongfoster - * Removing old logo - * - * Revision 1.22 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.21 2002/03/07 03:48:38 oes - * - Changed built-in images from GIF to PNG - * (with regard to Unisys patent issue) - * - Added a 4x4 pattern PNG which is less intrusive - * than the logo but also clearly marks the deleted banners - * - * Revision 1.20 2002/03/04 17:53:22 oes - * Fixed compiled warning - * - * Revision 1.19 2002/01/21 00:33:52 jongfoster - * Adding map_block_keep() to save a few bytes in the edit-actions-list HTML. - * - * Revision 1.18 2001/11/16 00:46:31 jongfoster - * Fixing compiler warnings - * - * Revision 1.17 2001/10/23 21:48:19 jongfoster - * Cleaning up error handling in CGI functions - they now send back - * a HTML error page and should never cause a FATAL error. (Fixes one - * potential source of "denial of service" attacks). - * - * CGI actions file editor that works and is actually useful. - * - * Ability to toggle Junkbuster remotely using a CGI call. - * - * You can turn off both the above features in the main configuration - * file, e.g. if you are running a multi-user proxy. - * - * Revision 1.16 2001/09/16 17:08:54 jongfoster - * Moving simple CGI functions from cgi.c to new file cgisimple.c - * - * Revision 1.15 2001/09/16 15:02:35 jongfoster - * Adding i.j.b/robots.txt. - * Inlining add_stats() since it's only ever called from one place. - * - * Revision 1.14 2001/09/16 11:38:02 jongfoster - * Splitting fill_template() into 2 functions: - * template_load() loads the file - * template_fill() performs the PCRS regexps. - * This is because the CGI edit interface has a "table row" - * template which is used many times in the page - this - * change means it's only loaded from disk once. - * - * Revision 1.13 2001/09/16 11:00:10 jongfoster - * New function alloc_http_response, for symmetry with free_http_response - * - * Revision 1.12 2001/09/13 23:31:25 jongfoster - * Moving image data to cgi.c rather than cgi.h. - * - * Revision 1.11 2001/08/05 16:06:20 jongfoster - * Modifiying "struct map" so that there are now separate header and - * "map_entry" structures. This means that functions which modify a - * map no longer need to return a pointer to the modified map. - * Also, it no longer reverses the order of the entries (which may be - * important with some advanced template substitutions). - * - * Revision 1.10 2001/08/01 21:19:22 jongfoster - * Moving file version information to a separate CGI page. - * - * Revision 1.9 2001/08/01 00:17:54 jongfoster - * Adding prototype for map_conditional - * - * Revision 1.8 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.7 2001/07/29 18:43:08 jongfoster - * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to - * ANSI C rules. - * - * Revision 1.6 2001/06/29 21:45:41 oes - * Indentation, CRLF->LF, Tab-> Space - * - * Revision 1.5 2001/06/29 13:22:44 oes - * - Cleaned up - * - Added new functions: default_exports(), make_menu(), - * error_response() etc, ranamed others and changed - * param and return types. - * - Removed HTTP/HTML snipplets - * - Removed logentry from cancelled commit - * - * Revision 1.4 2001/06/09 10:50:58 jongfoster - * Changing "show URL info" handler to new style. - * Adding "extern" to some function prototypes. - * - * Revision 1.3 2001/06/03 19:12:16 oes - * introduced new cgi handling - * - * No revisions before 1.3 - * **********************************************************************/ - + #include "project.h" @@ -204,9 +51,8 @@ extern "C" { extern struct http_response *dispatch_cgi(struct client_state *csp); /* Not exactly a CGI */ -extern struct http_response * error_response(struct client_state *csp, - const char *templatename, - int err); +extern struct http_response *error_response(struct client_state *csp, + const char *templatename); /* * CGI support functions @@ -223,7 +69,7 @@ extern jb_err map_block_killer (struct map *exports, const char *name); extern jb_err map_block_keep (struct map *exports, const char *name); extern jb_err map_conditional (struct map *exports, const char *name, int choose_first); -extern jb_err template_load(const struct client_state *csp, char ** template_ptr, +extern jb_err template_load(const struct client_state *csp, char ** template_ptr, const char *templatename, int recursive); extern jb_err template_fill(char ** template_ptr, const struct map *exports); extern jb_err template_fill_for_cgi(const struct client_state *csp, @@ -255,6 +101,14 @@ extern jb_err get_string_param(const struct map *parameters, const char **pparam); extern char get_char_param(const struct map *parameters, const char *param_name); +#ifdef FEATURE_COMPRESSION +/* + * Minimum length which a buffer has to reach before + * we bother to (re-)compress it. Completely arbitrary. + */ +extern const size_t LOWER_LENGTH_LIMIT_FOR_COMPRESSION; +extern char *compress_buffer(char *buffer, size_t *buffer_length, int compression_level); +#endif /* * Text generators diff --git a/external/privoxy/cgiedit.c b/external/privoxy/cgiedit.c index 6fca21fc..68b8965f 100644 --- a/external/privoxy/cgiedit.c +++ b/external/privoxy/cgiedit.c @@ -1,4 +1,4 @@ -const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.65 2009/03/08 14:19:22 fabiankeil Exp $"; +const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.71 2011/11/18 16:47:08 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgiedit.c,v $ @@ -40,361 +40,8 @@ const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.65 2009/03/08 14:19:22 fabiankeil * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: cgiedit.c,v $ - * Revision 1.65 2009/03/08 14:19:22 fabiankeil - * Fix justified (but harmless) compiler warnings - * on platforms where sizeof(int) < sizeof(long). - * - * Revision 1.64 2009/03/01 18:43:09 fabiankeil - * Fix cparser warnings. - * - * Revision 1.63 2008/12/04 18:15:38 fabiankeil - * Fix some cparser warnings. - * - * Revision 1.62 2008/08/31 15:59:02 fabiankeil - * There's no reason to let remote toggling support depend - * on FEATURE_CGI_EDIT_ACTIONS, so make sure it doesn't. - * - * Revision 1.61 2008/03/24 18:12:52 fabiankeil - * Use sizeof() more often. - * - * Revision 1.60 2008/03/15 14:52:35 fabiankeil - * Add CGI editor support for the "disable all filters of this type" - * directives "-client-header-filter", "-server-header-filter", - * "-client-header-tagger" and "-server-header-tagger". - * - * Revision 1.59 2008/03/08 16:25:56 fabiankeil - * After three file modification time mismatches, turn the CGI editor off. - * - * Revision 1.58 2007/11/28 17:57:01 fabiankeil - * Fix double free in cgi_edit_actions_list(). - * Reported by adlab in BR#1840145. - * - * Revision 1.57 2007/10/27 13:32:23 fabiankeil - * Plug minor 5-year-old memory leak. Spotted by - * Valgrind and triggered by Privoxy-Regression-Test. - * - * Revision 1.56 2007/08/05 13:47:03 fabiankeil - * #1763173 from Stefan Huehner: s@const static@static const@. - * - * Revision 1.55 2007/05/31 11:50:20 fabiankeil - * Re-enable support for old-school URLs like - * http://config.privoxy.org/edit-actions-list?f=default - * in the action editor. - * - * They are no longer used by the CGI pages, but make it easier - * to reach the editor directly, without knowing the requested - * file's index in csp->config->actions_file[]. - * - * Revision 1.54 2007/05/14 10:33:51 fabiankeil - * - Use strlcpy() and strlcat() instead of strcpy() and strcat(). - * - * Revision 1.53 2007/04/15 16:39:20 fabiankeil - * Introduce tags as alternative way to specify which - * actions apply to a request. At the moment tags can be - * created based on client and server headers. - * - * Revision 1.52 2007/04/12 10:41:23 fabiankeil - * - Don't mistake VC++'s _snprintf() for a snprintf() replacement. - * - Move some cgi_edit_actions_for_url() variables into structs. - * - Remove bogus comment. - * - * Revision 1.51 2007/04/08 13:21:05 fabiankeil - * Reference action files in CGI URLs by id instead - * of using the first part of the file name. - * Fixes BR 1694250 and BR 1590556. - * - * Revision 1.50 2007/03/29 11:40:34 fabiankeil - * Divide @filter-params@ into @client-header-filter-params@ - * @content-filter-params@ and @server-header-filter-params@. - * - * Revision 1.49 2007/03/20 15:16:34 fabiankeil - * Use dedicated header filter actions instead of abusing "filter". - * Replace "filter-client-headers" and "filter-client-headers" - * with "server-header-filter" and "client-header-filter". - * - * Revision 1.48 2007/02/13 14:35:25 fabiankeil - * Replace hash escaping code to prevent - * crashes, memory and file corruption. - * - * Revision 1.47 2006/12/28 18:04:25 fabiankeil - * Fixed gcc43 conversion warnings. - * - * Revision 1.46 2006/12/27 18:44:52 fabiankeil - * Stop shadowing string.h's index(). - * - * Revision 1.45 2006/12/21 12:57:48 fabiankeil - * Add config option "split-large-forms" - * to work around the browser bug reported - * in BR #1570678. - * - * Revision 1.44 2006/12/09 13:49:16 fabiankeil - * Fix configure option --disable-toggle. - * Thanks to Peter Thoenen for reporting this. - * - * Revision 1.43 2006/07/18 14:48:45 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.41.2.12 2006/01/30 15:16:25 david__schmidt - * Remove a little residual debugging info - * - * Revision 1.41.2.11 2006/01/29 23:10:56 david__schmidt - * Multiple filter file support - * - * Revision 1.41.2.10 2005/07/04 03:13:43 david__schmidt - * Undo some damaging memory leak patches - * - * Revision 1.41.2.9 2005/07/04 00:31:04 david__schmidt - * Removing a double free - * - * Revision 1.41.2.8 2005/05/07 21:50:54 david__schmidt - * A few memory leaks plugged (mostly on error paths) - * - * Revision 1.41.2.7 2004/02/17 13:30:23 oes - * Moved cgi_error_disabled() from cgiedit.c to - * cgi.c to re-enable build with --disable-editor. - * Fixes Bug #892744. Thanks to Matthew Fischer - * for spotting. - * - * Revision 1.41.2.6 2003/12/18 08:13:48 oes - * One line lost in last commit - * - * Revision 1.41.2.5 2003/12/17 16:33:47 oes - * - All edit functions that redirect back to the list page - * now use cgi_redirect - * - All redirects now contain useless parameter "foo", whose - * value are raw seconds since epoch, in order to force - * Opera and Konqueror to properly reload the list. Closes - * bug #859993 - * - * Revision 1.41.2.4 2003/03/11 11:53:59 oes - * Cosmetic: Renamed cryptic variable - * - * Revision 1.41.2.3 2002/11/12 15:01:41 oes - * Fix: Don't free uninitialized struct editable_file - * - * Revision 1.41.2.2 2002/08/05 20:02:59 oes - * Bugfix: "Insert new section at top" did not work properly if first non-comment line in file was of type FILE_LINE_ACTION - * - * Revision 1.41.2.1 2002/08/02 12:43:14 oes - * Fixed bug #588514: first_time now set on a per-string basis in actions_from_radio; javascriptify now called on copies - * - * Revision 1.41 2002/05/21 19:09:45 oes - * - Made Add/Edit/Remove URL Submit and Cancel - * buttons jump back to relevant section in eal - * - Bugfix: remove-url-form needs p export - * - * Revision 1.40 2002/05/19 11:34:35 jongfoster - * Handling read-only actions files better - report the actual - * error, not "Out of memory"! - * - * Bug report: - * http://sourceforge.net/tracker/index.php?func=detail - * &aid=557905&group_id=11118&atid=111118 - * - * Revision 1.39 2002/05/12 21:39:15 jongfoster - * - Adding Doxygen-style comments to structures and #defines. - * - Correcting function comments - * - * Revision 1.38 2002/05/03 23:00:38 jongfoster - * Support for templates for "standard actions" buttons. - * See bug #549871 - * - * Revision 1.37 2002/04/30 11:14:52 oes - * Made csp the first parameter in *action_to_html - * - * Revision 1.36 2002/04/26 21:53:30 jongfoster - * Fixing a memory leak. (Near, but not caused by, my earlier commit). - * - * Revision 1.35 2002/04/26 21:50:02 jongfoster - * Honouring default exports in edit-actions-for-url-filter template. - * - * Revision 1.34 2002/04/26 12:54:17 oes - * Adaptions to changes in actions.c - * - * Revision 1.33 2002/04/24 02:17:47 oes - * - Moved get_char_param, get_string_param and get_number_param to cgi.c - * - Comments - * - Activated Jon's code for editing multiple AFs - * - cgi_edit_list_actions now provides context-sensitive - * help, looks up all action sets from standard.action and - * makes buttons for them in the catchall section - * - cgi_edit_action_submit now honors a p parameter, looks up - * the corresponding action set, and sets the catchall pattern's - * actions accordingly. - * - * Revision 1.32 2002/04/19 16:55:31 jongfoster - * Fixing newline problems. If we do our own text file newline - * mangling, we don't want the library to do any, so we need to - * open the files in *binary* mode. - * - * Revision 1.31 2002/04/18 19:21:08 jongfoster - * Added code to detect "conventional" action files, that start - * with a set of actions for all URLs (the pattern "/"). - * These are special-cased in the "edit-actions-list" CGI, so - * that a special UI can be written for them. - * - * Revision 1.30 2002/04/10 13:38:35 oes - * load_template signature changed - * - * Revision 1.29 2002/04/08 16:59:08 oes - * Fixed comment - * - * Revision 1.28 2002/03/27 12:30:29 oes - * Deleted unsused variable - * - * Revision 1.27 2002/03/26 23:06:04 jongfoster - * Removing duplicate @ifs on the toggle page - * - * Revision 1.26 2002/03/26 22:59:17 jongfoster - * Fixing /toggle to display status consistently. - * - * Revision 1.25 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.24 2002/03/24 15:23:33 jongfoster - * Name changes - * - * Revision 1.23 2002/03/24 13:32:41 swa - * name change related issues - * - * Revision 1.22 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.21 2002/03/22 18:02:48 jongfoster - * Fixing remote toggle - * - * Revision 1.20 2002/03/16 20:28:34 oes - * Added descriptions to the filters so users will know what they select in the cgi editor - * - * Revision 1.19 2002/03/16 18:38:14 jongfoster - * Stopping stupid or malicious users from breaking the actions - * file using the web-based editor. - * - * Revision 1.18 2002/03/16 14:57:44 jongfoster - * Full support for enabling/disabling modular filters. - * - * Revision 1.17 2002/03/16 14:26:42 jongfoster - * First version of modular filters support - READ ONLY! - * Fixing a double-free bug in the out-of-memory handling in map_radio(). - * - * Revision 1.16 2002/03/07 03:46:17 oes - * Fixed compiler warnings - * - * Revision 1.15 2002/03/06 22:54:35 jongfoster - * Automated function-comment nitpicking. - * - * Revision 1.14 2002/03/05 00:24:51 jongfoster - * Patch to always edit the current actions file. - * - * Revision 1.13 2002/03/04 02:07:59 david__schmidt - * Enable web editing of actions file on OS/2 (it had been broken all this time!) - * - * Revision 1.12 2002/03/03 09:18:03 joergs - * Made jumbjuster work on AmigaOS again. - * - * Revision 1.11 2002/01/23 01:03:31 jongfoster - * Fixing gcc [CygWin] compiler warnings - * - * Revision 1.10 2002/01/23 00:22:59 jongfoster - * Adding new function cgi_edit_actions_section_swap(), to reorder - * the actions file. - * - * Adding get_url_spec_param() to get a validated URL pattern. - * - * Moving edit_read_line() out of this file and into loaders.c. - * - * Adding missing html_encode() to many CGI functions. - * - * Moving the functions that #include actionlist.h to the end of the file, - * because the Visual C++ 97 debugger gets extremely confused if you try - * to debug any code that comes after them in the file. - * - * Major optimizations in cgi_edit_actions_list() to reduce the size of - * the generated HTML (down 40% from 550k to 304k), with major side-effects - * throughout the editor and templates. In particular, the length of the - * URLs throughout the editor has been drastically reduced, by cutting - * paramater names down to 1 character and CGI names down to 3-4 - * characters, by removing all non-essential CGI paramaters even at the - * expense of having to re-read the actions file for the most trivial - * page, and by using relative rather than absolute URLs. This means - * that this (typical example): - * - * - * - * is now this: - * - * - * - * Revision 1.9 2002/01/17 20:56:22 jongfoster - * Replacing hard references to the URL of the config interface - * with #defines from project.h - * - * Revision 1.8 2001/11/30 23:35:51 jongfoster - * Renaming actionsfile to ijb.action - * - * Revision 1.7 2001/11/13 00:28:24 jongfoster - * - Renaming parameters from edit-actions-for-url so that they only - * contain legal JavaScript characters. If we wanted to write - * JavaScript that worked with Netscape 4, this is nessacery. - * (Note that at the moment the JavaScript doesn't actually work - * with Netscape 4, but now this is purely a template issue, not - * one affecting code). - * - Adding new CGIs for use by non-JavaScript browsers: - * edit-actions-url-form - * edit-actions-add-url-form - * edit-actions-remove-url-form - * - Fixing || bug. - * - * Revision 1.6 2001/10/29 03:48:09 david__schmidt - * OS/2 native needed a snprintf() routine. Added one to miscutil, brackedted - * by and __OS2__ ifdef. - * - * Revision 1.5 2001/10/25 03:40:48 david__schmidt - * Change in porting tactics: OS/2's EMX porting layer doesn't allow multiple - * threads to call select() simultaneously. So, it's time to do a real, live, - * native OS/2 port. See defines for __EMX__ (the porting layer) vs. __OS2__ - * (native). Both versions will work, but using __OS2__ offers multi-threading. - * - * Revision 1.4 2001/10/23 21:48:19 jongfoster - * Cleaning up error handling in CGI functions - they now send back - * a HTML error page and should never cause a FATAL error. (Fixes one - * potential source of "denial of service" attacks). - * - * CGI actions file editor that works and is actually useful. - * - * Ability to toggle JunkBuster remotely using a CGI call. - * - * You can turn off both the above features in the main configuration - * file, e.g. if you are running a multi-user proxy. - * - * Revision 1.3 2001/10/14 22:12:49 jongfoster - * New version of CGI-based actionsfile editor. - * Major changes, including: - * - Completely new file parser and file output routines - * - edit-actions CGI renamed edit-actions-for-url - * - All CGIs now need a filename parameter, except for... - * - New CGI edit-actions which doesn't need a filename, - * to allow you to start the editor up. - * - edit-actions-submit now works, and now automatically - * redirects you back to the main edit-actions-list handler. - * - * Revision 1.2 2001/09/16 17:05:14 jongfoster - * Removing unused #include showarg.h - * - * Revision 1.1 2001/09/16 15:47:37 jongfoster - * First version of CGI-based edit interface. This is very much a - * work-in-progress, and you can't actually use it to edit anything - * yet. You must #define FEATURE_CGI_EDIT_ACTIONS for these changes - * to have any effect. - * - * **********************************************************************/ - + #include "config.h" @@ -438,10 +85,10 @@ struct file_line { /** Next entry in the linked list */ struct file_line * next; - + /** The raw data, to write out if this line is unmodified. */ char * raw; - + /** Comments and/or whitespace to put before this line if it's modified and then written out. */ char * prefix; @@ -450,7 +97,7 @@ struct file_line are performed on the data read from file before it's stored here, so it will be a single line of data. */ char * unprocessed; - + /** The type of data on this line. One of the FILE_LINE_xxx constants. */ int type; @@ -674,15 +321,10 @@ static jb_err actions_from_radio(const struct map * parameters, static jb_err map_copy_parameter_html(struct map *out, const struct map *in, const char *name); -#if 0 /* unused function */ -static jb_err map_copy_parameter_url(struct map *out, - const struct map *in, - const char *name); -#endif /* unused function */ -static jb_err get_file_name_param(struct client_state *csp, - const struct map *parameters, - const char *param_name, +static jb_err get_file_name_param(struct client_state *csp, + const struct map *parameters, + const char *param_name, const char **pfilename); /* Internal convenience functions */ @@ -786,56 +428,6 @@ static jb_err map_copy_parameter_html(struct map *out, } -#if 0 /* unused function */ -/********************************************************************* - * - * Function : map_copy_parameter_url - * - * Description : Copy a CGI parameter from one map to another, URL - * encoding it. - * - * Parameters : - * 1 : out = target map - * 2 : in = source map - * 3 : name = name of cgi parameter to copy - * - * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory - * JB_ERR_CGI_PARAMS if the parameter doesn't exist - * in the source map - * - *********************************************************************/ -static jb_err map_copy_parameter_url(struct map *out, - const struct map *in, - const char *name) -{ - const char * value; - jb_err err; - - assert(out); - assert(in); - assert(name); - - value = lookup(in, name); - err = map(out, name, 1, url_encode(value), 0); - - if (err) - { - /* Out of memory */ - return err; - } - else if (*value == '\0') - { - return JB_ERR_CGI_PARAMS; - } - else - { - return JB_ERR_OK; - } -} -#endif /* 0 - unused function */ - - /********************************************************************* * * Function : cgi_edit_actions_url_form @@ -1060,7 +652,7 @@ jb_err cgi_edit_actions_remove_url_form(struct client_state *csp, if (cur_line->type == FILE_LINE_ACTION) { section_start_line_number = line_number; - } + } cur_line = cur_line->next; } @@ -1836,7 +1428,7 @@ jb_err edit_read_file_lines(FILE *fp, struct file_line ** pfile, int *newline) if (rval) { /* Out of memory or empty file. */ - /* Note that empty file is not an error we propogate up */ + /* Note that empty file is not an error we propagate up */ free(cur_line); return ((rval == JB_ERR_FILE) ? JB_ERR_OK : rval); } @@ -1941,7 +1533,7 @@ jb_err edit_read_file(struct client_state *csp, * Probably an old-school URL like * http://config.privoxy.org/edit-actions-list?f=default */ - err = get_file_name_param(csp, parameters, "f", &filename); + get_file_name_param(csp, parameters, "f", &filename); } if (NULL == filename || stat(filename, statbuf) < 0) @@ -2087,7 +1679,7 @@ jb_err edit_read_actions_file(struct client_state *csp, { log_error(LOG_LEVEL_INFO, "Timestamp mismatch limit reached, turning CGI editor off. " - "Reload the configuration file to reenable it."); + "Reload the configuration file to re-enable it."); csp->config->feature_flags &= ~RUNTIME_FEATURE_CGI_EDIT_ACTIONS; } } @@ -3226,7 +2818,7 @@ jb_err cgi_edit_actions_for_url(struct client_state *csp, if (!err) err = actions_to_radio(exports, cur_line->data.action); /* - * XXX: Some browsers (at least IE6 and IE7) have an artifical URL + * XXX: Some browsers (at least IE6 and IE7) have an artificial URL * length limitation and ignore clicks on the Submit buttons if * the resulting GET URL would be longer than their limit. * @@ -3235,7 +2827,7 @@ jb_err cgi_edit_actions_for_url(struct client_state *csp, * browsers (BR #1570678). * * The config option split-large-forms works around this browser - * bug (HTTP has no URL lenght limitation) by deviding the action + * bug (HTTP has no URL length limitation) by deviding the action * list form into multiple smaller ones. It means the URLs are shorter * and work in broken browsers as well, but the user can no longer change * all actions with one submit. @@ -3768,7 +3360,7 @@ jb_err cgi_edit_actions_url(struct client_state *csp, if (cur_line->type == FILE_LINE_ACTION) { section_start_line_number = line_number; - } + } cur_line = cur_line->next; line_number++; } @@ -4536,7 +4128,7 @@ jb_err cgi_edit_actions_section_swap(struct client_state *csp, * * Description : Converts a string into a form JavaScript will like. * - * Netscape 4's JavaScript sucks - it doesn't use + * Netscape 4's JavaScript sucks - it doesn't use * "id" parameters, so you have to set the "name" * used to submit a form element to something JavaScript * will like. (Or access the elements by index in an diff --git a/external/privoxy/cgiedit.h b/external/privoxy/cgiedit.h index ceb5248a..917d5ecd 100644 --- a/external/privoxy/cgiedit.h +++ b/external/privoxy/cgiedit.h @@ -1,23 +1,23 @@ #ifndef CGIEDIT_H_INCLUDED #define CGIEDIT_H_INCLUDED -#define CGIEDIT_H_VERSION "$Id: cgiedit.h,v 1.10 2008/08/31 15:59:03 fabiankeil Exp $" +#define CGIEDIT_H_VERSION "$Id: cgiedit.h,v 1.12 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgiedit.h,v $ * * Purpose : CGI-based actionsfile editor. - * + * * Functions declared include: - * + * * * Copyright : Written by and Copyright (C) 2001 the SourceForge * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -35,72 +35,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: cgiedit.h,v $ - * Revision 1.10 2008/08/31 15:59:03 fabiankeil - * There's no reason to let remote toggling support depend - * on FEATURE_CGI_EDIT_ACTIONS, so make sure it doesn't. - * - * Revision 1.9 2006/07/18 14:48:45 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.7.2.2 2004/02/17 13:30:23 oes - * Moved cgi_error_disabled() from cgiedit.c to - * cgi.c to re-enable build with --disable-editor. - * Fixes Bug #892744. Thanks to Matthew Fischer - * for spotting. - * - * Revision 1.7.2.1 2002/11/28 18:15:17 oes - * Added cgi_error_disabled - * - * Revision 1.7 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.6 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.5 2002/01/22 23:24:48 jongfoster - * Adding edit-actions-section-swap - * - * Revision 1.4 2001/11/13 00:28:51 jongfoster - * Adding new CGIs for use by non-JavaScript browsers: - * edit-actions-url-form - * edit-actions-add-url-form - * edit-actions-remove-url-form - * - * Revision 1.3 2001/10/23 21:48:19 jongfoster - * Cleaning up error handling in CGI functions - they now send back - * a HTML error page and should never cause a FATAL error. (Fixes one - * potential source of "denial of service" attacks). - * - * CGI actions file editor that works and is actually useful. - * - * Ability to toggle JunkBuster remotely using a CGI call. - * - * You can turn off both the above features in the main configuration - * file, e.g. if you are running a multi-user proxy. - * - * Revision 1.2 2001/10/14 22:12:49 jongfoster - * New version of CGI-based actionsfile editor. - * Major changes, including: - * - Completely new file parser and file output routines - * - edit-actions CGI renamed edit-actions-for-url - * - All CGIs now need a filename parameter, except for... - * - New CGI edit-actions which doesn't need a filename, - * to allow you to start the editor up. - * - edit-actions-submit now works, and now automatically - * redirects you back to the main edit-actions-list handler. - * - * Revision 1.1 2001/09/16 15:47:37 jongfoster - * First version of CGI-based edit interface. This is very much a - * work-in-progress, and you can't actually use it to edit anything - * yet. You must #define FEATURE_CGI_EDIT_ACTIONS for these changes - * to have any effect. - * - * **********************************************************************/ - + #include "project.h" diff --git a/external/privoxy/cgisimple.c b/external/privoxy/cgisimple.c index 35436114..6f75f662 100644 --- a/external/privoxy/cgisimple.c +++ b/external/privoxy/cgisimple.c @@ -1,22 +1,22 @@ -const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.91 2009/03/08 14:19:23 fabiankeil Exp $"; +const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.111 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $ * * Purpose : Simple CGIs to get information about Privoxy's * status. - * - * Functions declared include: - * * - * Copyright : Written by and Copyright (C) 2001-2008 the SourceForge + * Functions declared include: + * + * + * Copyright : Written by and Copyright (C) 2001-2011 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -34,415 +34,8 @@ const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.91 2009/03/08 14:19:23 fabian * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: cgisimple.c,v $ - * Revision 1.91 2009/03/08 14:19:23 fabiankeil - * Fix justified (but harmless) compiler warnings - * on platforms where sizeof(int) < sizeof(long). - * - * Revision 1.90 2009/03/01 18:43:09 fabiankeil - * Fix cparser warnings. - * - * Revision 1.89 2008/10/11 11:31:14 fabiankeil - * Add FEATURE_CONNECTION_KEEP_ALIVE to the list - * of conditional defines on the show-status page. - * - * Revision 1.88 2008/08/30 12:03:07 fabiankeil - * Remove FEATURE_COOKIE_JAR. - * - * Revision 1.87 2008/08/29 15:59:22 fabiankeil - * Fix two comments. - * - * Revision 1.86 2008/06/28 14:19:05 fabiankeil - * Protocol detection is done case-insensitive, fix assertion - * to do the same. Yay for Privoxy-Regression-Test and zzuf. - * - * Revision 1.85 2008/05/26 17:30:55 fabiankeil - * Provide an OpenSearch Description to access the - * show-url-info page through "search engine plugins". - * - * Revision 1.84 2008/05/26 16:16:55 fabiankeil - * Spell error correctly. - * - * Revision 1.83 2008/05/12 14:51:30 fabiankeil - * Don't complain about an invalid URL if show-url-info is requested - * without parameters. Regression introduced in 1.81 by yours truly. - * - * Revision 1.82 2008/05/10 20:01:47 fabiankeil - * Fix an assertion that could erroneously - * trigger in case of memory shortage. - * - * Revision 1.81 2008/05/05 09:54:39 fabiankeil - * In cgi_show_url_info(), make sure ftp URLs are - * declared invalid. Also simplify the code that adds - * "http://" if no protocol has been specified. - * - * Revision 1.80 2008/05/04 16:18:32 fabiankeil - * Provide parse_http_url() with a third parameter to specify - * whether or not URLs without protocol are acceptable. - * - * Revision 1.79 2008/05/04 13:30:56 fabiankeil - * Streamline parse_http_url()'s prototype. - * - * Revision 1.78 2008/05/03 16:50:11 fabiankeil - * Leverage content_filters_enabled() in cgi_show_url_info(). - * - * Revision 1.77 2008/05/02 09:47:48 fabiankeil - * In cgi_show_url_info, pass an initialized http structure - * to parse_http_url() as that will be required soonish and - * assert that https URLs are recognized correctly. - * - * Revision 1.76 2008/04/28 09:13:30 fabiankeil - * In load_file(), remember the error reason and fclose() - * and return later on instead of right away. - * - * Revision 1.75 2008/04/27 13:52:52 fabiankeil - * Move CGI file loading code into load_file() and - * add checks for unexpected errors. - * - * Revision 1.74 2008/04/26 15:50:56 fabiankeil - * Fix macro name in cgi_show_file() error path. - * - * Revision 1.73 2008/04/26 12:21:55 fabiankeil - * Forget about JB_ERR_PARSE. JB_ERR_CGI_PARAMS to the rescue. - * - * Revision 1.72 2008/04/26 10:34:15 fabiankeil - * If zlib support is unavailable and there are content filters active - * but the prevent-compression action is disabled, include a warning - * on the show-url-info page that compression might prevent filtering. - * - * Revision 1.71 2008/04/25 13:33:56 fabiankeil - * - Factor cgi_show_file() out of cgi_show_status(). - * - Adjust cgi_show_status()'s parameter description to match reality. - * - * Revision 1.70 2008/04/24 16:12:38 fabiankeil - * In cgi_show_status(), load the requested file at once. - * Using string_join() for every line really doesn't scale. - * - * Revision 1.69 2008/04/17 14:40:48 fabiankeil - * Provide get_http_time() with the buffer size so it doesn't - * have to blindly assume that the buffer is big enough. - * - * Revision 1.68 2008/03/27 18:27:21 fabiankeil - * Remove kill-popups action. - * - * Revision 1.67 2008/03/27 17:00:05 fabiankeil - * Turn the favicon blobs into locals. - * - * Revision 1.66 2008/02/23 16:57:12 fabiankeil - * Rename url_actions() to get_url_actions() and let it - * use the standard parameter ordering. - * - * Revision 1.65 2008/02/23 16:33:43 fabiankeil - * Let forward_url() use the standard parameter ordering - * and mark its second parameter immutable. - * - * Revision 1.64 2008/02/03 13:56:07 fabiankeil - * Add SOCKS5 support for show-url-info CGI page. - * - * Revision 1.63 2008/02/01 06:04:31 fabiankeil - * If edit buttons on the show-url-info CGI page are hidden, explain why. - * - * Revision 1.62 2008/02/01 05:52:40 fabiankeil - * Hide edit buttons on the show-url-info CGI page if enable-edit-action - * is disabled. Patch by Lee with additional white space adjustments. - * - * Revision 1.61 2008/01/26 11:13:25 fabiankeil - * If enable-edit-actions is disabled, hide the edit buttons and explain why. - * - * Revision 1.60 2007/10/27 13:12:13 fabiankeil - * Finish 1.49 and check write access before - * showing edit buttons on show-url-info page. - * - * Revision 1.59 2007/10/19 16:42:36 fabiankeil - * Plug memory leak I introduced five months ago. - * Yay Valgrind and Privoxy-Regression-Test. - * - * Revision 1.58 2007/07/21 12:19:50 fabiankeil - * If show-url-info is called with an URL that Privoxy - * would reject as invalid, don't show unresolved forwarding - * variables, "final matches" or claim the site's secure. - * - * Revision 1.57 2007/06/01 16:53:05 fabiankeil - * Adjust cgi_show_url_info() to show what forward-override{} - * would do with the requested URL (instead of showing how the - * request for the CGI page would be forwarded if it wasn't a - * CGI request). - * - * Revision 1.56 2007/05/21 10:50:35 fabiankeil - * - Use strlcpy() instead of strcpy(). - * - Stop treating actions files special. Expect a complete file name - * (with or without path) like it's done for the rest of the files. - * Closes FR#588084. - * - Don't rerun sed() in cgi_show_request(). - * - * Revision 1.55 2007/04/13 13:36:46 fabiankeil - * Reference action files in CGI URLs by id instead - * of using the first part of the file name. - * Fixes BR 1694250 and BR 1590556. - * - * Revision 1.54 2007/04/09 18:11:35 fabiankeil - * Don't mistake VC++'s _snprintf() for a snprintf() replacement. - * - * Revision 1.53 2007/04/08 13:21:04 fabiankeil - * Reference action files in CGI URLs by id instead - * of using the first part of the file name. - * Fixes BR 1694250 and BR 1590556. - * - * Revision 1.52 2007/02/13 15:10:26 fabiankeil - * Apparently fopen()ing in "binary" mode doesn't require - * #ifdefs, it's already done without them in cgiedit.c. - * - * Revision 1.51 2007/02/10 16:55:22 fabiankeil - * - Show forwarding settings on the show-url-info page - * - Fix some HTML syntax errors. - * - * Revision 1.50 2007/01/23 15:51:17 fabiankeil - * Add favicon delivery functions. - * - * Revision 1.49 2007/01/20 16:29:38 fabiankeil - * Suppress edit buttons for action files if Privoxy has - * no write access. Suggested by Roland in PR 1564026. - * - * Revision 1.48 2007/01/20 15:31:31 fabiankeil - * Display warning if show-url-info CGI page - * is used while Privoxy is toggled off. - * - * Revision 1.47 2007/01/12 15:07:10 fabiankeil - * Use zalloc in cgi_send_user_manual. - * - * Revision 1.46 2007/01/02 12:49:46 fabiankeil - * Add FEATURE_ZLIB to the list of conditional - * defines at the show-status page. - * - * Revision 1.45 2006/12/28 18:16:41 fabiankeil - * Fixed gcc43 compiler warnings, zero out cgi_send_user_manual's - * body memory before using it, replaced sprintf calls with snprintf. - * - * Revision 1.44 2006/12/22 14:19:27 fabiankeil - * Removed checks whether or not AF_FILES have - * data structures associated with them in cgi_show_status. - * It doesn't matter as we're only interested in the file names. - * - * For the action files the checks were always true, - * but they prevented empty filter files from being - * listed. Fixes parts of BR 1619208. - * - * Revision 1.43 2006/12/17 17:57:56 fabiankeil - * - Added FEATURE_GRACEFUL_TERMINATION to the - * "conditional #defines" section - * - Escaped ampersands in generated HTML. - * - Renamed re-filter-filename to re-filter-filenames - * - * Revision 1.42 2006/11/21 15:43:12 fabiankeil - * Add special treatment for WIN32 to make sure - * cgi_send_user_manual opens the files in binary mode. - * Fixes BR 1600411 and unbreaks image delivery. - * - * Remove outdated comment. - * - * Revision 1.41 2006/10/09 19:18:28 roro - * Redirect http://p.p/user-manual (without trailing slash) to - * http://p.p/user-manual/ (with trailing slash), otherwise links will be broken. - * - * Revision 1.40 2006/09/09 13:05:33 fabiankeil - * Modified cgi_send_user_manual to serve binary - * content without destroying it first. Should also be - * faster now. Added ".jpg" check for Content-Type guessing. - * - * Revision 1.39 2006/09/08 09:49:23 fabiankeil - * Deliver documents in the user-manual directory - * with "Content-Type text/css" if their filename - * ends with ".css". - * - * Revision 1.38 2006/09/06 18:45:03 fabiankeil - * Incorporate modified version of Roland Rosenfeld's patch to - * optionally access the user-manual via Privoxy. Closes patch 679075. - * - * Formatting changed to Privoxy style, added call to - * cgi_error_no_template if the requested file doesn't - * exist and modified check whether or not Privoxy itself - * should serve the manual. Should work cross-platform now. - * - * Revision 1.37 2006/07/18 14:48:45 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.35.2.7 2006/01/29 23:10:56 david__schmidt - * Multiple filter file support - * - * Revision 1.35.2.6 2005/07/04 03:13:43 david__schmidt - * Undo some damaging memory leak patches - * - * Revision 1.35.2.5 2005/05/07 21:50:55 david__schmidt - * A few memory leaks plugged (mostly on error paths) - * - * Revision 1.35.2.4 2005/04/04 02:21:24 david__schmidt - * Another instance of: - * Don't show "Edit" buttons #ifndef FEATURE_CGI_EDIT_ACTIONS - * Thanks to Magnus Holmgren for the patch - * - * Revision 1.35.2.3 2003/12/17 16:34:15 oes - * - Prevent line wrap beween "View/Edit" link buttons on status page - * - Some (mostly irrelevant) fixes for Out-of-mem-case handling - * - * Revision 1.35.2.2 2003/04/03 13:48:28 oes - * Don't show "Edit" buttons #ifndef FEATURE_CGI_EDIT_ACTIONS - * - * Revision 1.35.2.1 2002/07/04 15:02:38 oes - * Added ability to send redirects to send-banner CGI, so that it can completely mimic the image blocking action if called with type=auto - * - * Revision 1.35.2.1 2002/07/01 17:32:04 morcego - * Applying patch from Andreas as provided by Hal on the list. - * Message-ID: <20020701121218.V1606@feenix.burgiss.net> - * - * Revision 1.35 2002/05/12 21:44:44 jongfoster - * Adding amiga.[ch] revision information, if on an amiga. - * - * Revision 1.34 2002/04/30 12:06:12 oes - * Deleted unused code from default_cgi - * - * Revision 1.33 2002/04/30 11:14:52 oes - * Made csp the first parameter in *action_to_html - * - * Revision 1.32 2002/04/26 18:29:13 jongfoster - * Fixing this Visual C++ warning: - * cgisimple.c(775) : warning C4018: '<' : signed/unsigned mismatch - * - * Revision 1.31 2002/04/26 12:54:36 oes - * - Kill obsolete REDIRECT_URL code - * - Error handling fixes - * - Style sheet related HTML snipplet changes - * - cgi_show_url_info: - * - Matches now in table, actions on single lines, - * linked to help - * - standard.action suppressed - * - Buttons to View and Edit AFs - * - * Revision 1.30 2002/04/24 02:18:08 oes - * - show-status is now the starting point for editing - * the actions files, generate list of all AFs with buttons - * for viewing and editing, new look for file list (Jon: - * buttons now aligned ;-P ), view mode now supports multiple - * AFs, name changes, no view links for unspecified files, - * no edit link for standard.action. - * - * - Jon's multiple AF patch: cgi_show_url_info now uses all - * AFs and marks the output accordingly - * - * Revision 1.29 2002/04/10 13:38:35 oes - * load_template signature changed - * - * Revision 1.28 2002/04/07 15:42:12 jongfoster - * Fixing send-banner?type=auto when the image-blocker is - * a redirect to send-banner - * - * Revision 1.27 2002/04/05 15:50:48 oes - * added send-stylesheet CGI - * - * Revision 1.26 2002/04/04 00:36:36 gliptak - * always use pcre for matching - * - * Revision 1.25 2002/04/03 22:28:03 gliptak - * Removed references to gnu_regex - * - * Revision 1.24 2002/04/02 16:12:47 oes - * Fix: moving misplaced lines into #ifdef FEATURE_FORCE - * - * Revision 1.23 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.22 2002/03/24 16:18:15 jongfoster - * Removing old logo - * - * Revision 1.21 2002/03/24 15:23:33 jongfoster - * Name changes - * - * Revision 1.20 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.19 2002/03/16 23:54:06 jongfoster - * Adding graceful termination feature, to help look for memory leaks. - * If you enable this (which, by design, has to be done by hand - * editing config.h) and then go to http://i.j.b/die, then the program - * will exit cleanly after the *next* request. It should free all the - * memory that was used. - * - * Revision 1.18 2002/03/12 01:44:49 oes - * Changed default for "blocked" image from jb logo to checkboard pattern - * - * Revision 1.17 2002/03/08 16:43:18 oes - * Added choice beween GIF and PNG built-in images - * - * Revision 1.16 2002/03/07 03:48:38 oes - * - Changed built-in images from GIF to PNG - * (with regard to Unisys patent issue) - * - Added a 4x4 pattern PNG which is less intrusive - * than the logo but also clearly marks the deleted banners - * - * Revision 1.15 2002/03/06 22:54:35 jongfoster - * Automated function-comment nitpicking. - * - * Revision 1.14 2002/03/02 04:14:50 david__schmidt - * Clean up a little CRLF unpleasantness that suddenly appeared - * - * Revision 1.13 2002/02/21 00:10:37 jongfoster - * Adding send-banner?type=auto option - * - * Revision 1.12 2002/01/23 01:03:32 jongfoster - * Fixing gcc [CygWin] compiler warnings - * - * Revision 1.11 2002/01/23 00:01:04 jongfoster - * Adding cgi_transparent_gif() for http://i.j.b/t - * Adding missing html_encode() to many CGI functions. - * Adding urlmatch.[ch] to http://i.j.b/show-version - * - * Revision 1.10 2002/01/17 21:10:37 jongfoster - * Changes to cgi_show_url_info to use new matching code from urlmatch.c. - * Also fixing a problem in the same function with improperly quoted URLs - * in output HTML, and adding code to handle https:// URLs correctly. - * - * Revision 1.9 2001/11/30 23:09:15 jongfoster - * Now reports on FEATURE_CGI_EDIT_ACTIONS - * Removing FEATURE_DENY_GZIP from template - * - * Revision 1.8 2001/11/13 00:14:07 jongfoster - * Fixing stupid bug now I've figured out what || means. - * (It always returns 0 or 1, not one of it's paramaters.) - * - * Revision 1.7 2001/10/23 21:48:19 jongfoster - * Cleaning up error handling in CGI functions - they now send back - * a HTML error page and should never cause a FATAL error. (Fixes one - * potential source of "denial of service" attacks). - * - * CGI actions file editor that works and is actually useful. - * - * Ability to toggle JunkBuster remotely using a CGI call. - * - * You can turn off both the above features in the main configuration - * file, e.g. if you are running a multi-user proxy. - * - * Revision 1.6 2001/10/14 22:00:32 jongfoster - * Adding support for a 404 error when an invalid CGI page is requested. - * - * Revision 1.5 2001/10/07 15:30:41 oes - * Removed FEATURE_DENY_GZIP - * - * Revision 1.4 2001/10/02 15:31:12 oes - * Introduced show-request cgi - * - * Revision 1.3 2001/09/22 16:34:44 jongfoster - * Removing unneeded #includes - * - * Revision 1.2 2001/09/19 18:01:11 oes - * Fixed comments; cosmetics - * - * Revision 1.1 2001/09/16 17:08:54 jongfoster - * Moving simple CGI functions from cgi.c to new file cgisimple.c - * - * **********************************************************************/ - + #include "config.h" @@ -487,7 +80,7 @@ static jb_err load_file(const char *filename, char **buffer, size_t *length); * Description : CGI function that is called for the CGI_SITE_1_HOST * and CGI_SITE_2_HOST/CGI_SITE_2_PATH base URLs. * Boring - only exports the default exports. - * + * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) * 2 : rsp = http_response data structure for output @@ -525,7 +118,7 @@ jb_err cgi_default(struct client_state *csp, * * Description : CGI function that is called if an unknown action was * given. - * + * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) * 2 : rsp = http_response data structure for output @@ -534,7 +127,7 @@ jb_err cgi_default(struct client_state *csp, * CGI Parameters : none * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_error_404(struct client_state *csp, @@ -572,7 +165,7 @@ jb_err cgi_error_404(struct client_state *csp, * NOTE: Turning this on in a production build * would be a BAD idea. An EXTREMELY BAD idea. * In short, don't do it. - * + * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) * 2 : rsp = http_response data structure for output @@ -581,13 +174,27 @@ jb_err cgi_error_404(struct client_state *csp, * CGI Parameters : none * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_die (struct client_state *csp, struct http_response *rsp, const struct map *parameters) { + static const char status[] = "200 OK Privoxy shutdown request received"; + static const char body[] = + "\n" + "\n" + " Privoxy shutdown request received\n" + " \n" + " \n" + "\n" + "\n" + "

Privoxy shutdown request received

\n" + "

Privoxy is going to shut down after the next request.

\n" + "\n" + "\n"; + assert(csp); assert(rsp); assert(parameters); @@ -595,12 +202,21 @@ jb_err cgi_die (struct client_state *csp, /* quit */ g_terminate = 1; - /* - * I don't really care what gets sent back to the browser. - * Take the easy option - "out of memory" page. - */ + csp->flags &= ~CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE; - return JB_ERR_MEMORY; + rsp->content_length = 0; + rsp->head_length = 0; + rsp->is_static = 0; + + rsp->body = strdup(body); + rsp->status = strdup(status); + + if ((rsp->body == NULL) || (rsp->status == NULL)) + { + return JB_ERR_MEMORY; + } + + return JB_ERR_OK; } #endif /* def FEATURE_GRACEFUL_TERMINATION */ @@ -611,7 +227,7 @@ jb_err cgi_die (struct client_state *csp, * * Description : Show the client's request and what sed() would have * made of it. - * + * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) * 2 : rsp = http_response data structure for output @@ -620,7 +236,7 @@ jb_err cgi_die (struct client_state *csp, * CGI Parameters : none * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_show_request(struct client_state *csp, @@ -638,7 +254,7 @@ jb_err cgi_show_request(struct client_state *csp, { return JB_ERR_MEMORY; } - + /* * Repair the damage done to the IOB by get_header() */ @@ -673,7 +289,7 @@ jb_err cgi_show_request(struct client_state *csp, * * Function : cgi_send_banner * - * Description : CGI function that returns a banner. + * Description : CGI function that returns a banner. * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) @@ -688,7 +304,7 @@ jb_err cgi_show_request(struct client_state *csp, * equivalent). * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_send_banner(struct client_state *csp, @@ -701,7 +317,7 @@ jb_err cgi_send_banner(struct client_state *csp, * If type is auto, then determine the right thing * to do from the set-image-blocker action */ - if (imagetype == 'a') + if (imagetype == 'a') { /* * Default to pattern @@ -752,14 +368,14 @@ jb_err cgi_send_banner(struct client_state *csp, } #endif /* def FEATURE_IMAGE_BLOCKING */ } - + /* * Now imagetype is either the non-auto type we were called with, * or it was auto and has since been determined. In any case, we * can proceed to actually answering the request by sending a redirect * or an image as appropriate: */ - if (imagetype == 'r') + if (imagetype == 'r') { rsp->status = strdup("302 Local Redirect from Privoxy"); if (rsp->status == NULL) @@ -774,7 +390,7 @@ jb_err cgi_send_banner(struct client_state *csp, } else { - if ((imagetype == 'b') || (imagetype == 't')) + if ((imagetype == 'b') || (imagetype == 't')) { rsp->body = bindup(image_blank_data, image_blank_length); rsp->content_length = image_blank_length; @@ -816,7 +432,7 @@ jb_err cgi_send_banner(struct client_state *csp, * CGI Parameters : None * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_transparent_image(struct client_state *csp, @@ -860,7 +476,7 @@ jb_err cgi_transparent_image(struct client_state *csp, * CGI Parameters : None * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_send_default_favicon(struct client_state *csp, @@ -921,7 +537,7 @@ jb_err cgi_send_default_favicon(struct client_state *csp, * CGI Parameters : None * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_send_error_favicon(struct client_state *csp, @@ -983,7 +599,7 @@ jb_err cgi_send_error_favicon(struct client_state *csp, * CGI Parameters : None * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_send_stylesheet(struct client_state *csp, @@ -991,7 +607,7 @@ jb_err cgi_send_stylesheet(struct client_state *csp, const struct map *parameters) { jb_err err; - + assert(csp); assert(rsp); @@ -1037,7 +653,7 @@ jb_err cgi_send_stylesheet(struct client_state *csp, * CGI Parameters : None * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_send_url_info_osd(struct client_state *csp, @@ -1065,6 +681,48 @@ jb_err cgi_send_url_info_osd(struct client_state *csp, } +/********************************************************************* + * + * Function : get_content_type + * + * Description : Use the file extension to guess the content type + * header we should use to serve the file. + * + * Parameters : + * 1 : filename = Name of the file whose content type + * we care about + * + * Returns : The guessed content type. + * + *********************************************************************/ +static const char *get_content_type(const char *filename) +{ + int i; + struct content_type + { + const char *extension; + const char *content_type; + }; + static const struct content_type content_types[] = + { + {".css", "text/css"}, + {".jpg", "image/jpeg"}, + {".jpeg", "image/jpeg"}, + {".png", "image/png"}, + }; + + for (i = 0; i < SZ(content_types); i++) + { + if (strstr(filename, content_types[i].extension)) + { + return content_types[i].content_type; + } + } + + /* No match by extension, default to html */ + return "text/html"; +} + /********************************************************************* * * Function : cgi_send_user_manual @@ -1081,22 +739,29 @@ jb_err cgi_send_url_info_osd(struct client_state *csp, * (relative to user-manual from config) * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_send_user_manual(struct client_state *csp, struct http_response *rsp, const struct map *parameters) { - const char * filename; + const char *filename; char *full_path; jb_err err = JB_ERR_OK; - size_t length; + const char *content_type; assert(csp); assert(rsp); assert(parameters); + if (0 == strncmpic(csp->config->usermanual, "http://", 7)) + { + log_error(LOG_LEVEL_CGI, "Request for local user-manual " + "received while user-manual delivery is disabled."); + return cgi_error_404(csp, rsp, parameters); + } + if (!parameters->first) { /* requested http://p.p/user-manual (without trailing slash) */ @@ -1104,17 +769,24 @@ jb_err cgi_send_user_manual(struct client_state *csp, } get_string_param(parameters, "file", &filename); - /* Check paramter for hack attempts */ - if (filename && strchr(filename, '/')) + if (filename == NULL) { - return JB_ERR_CGI_PARAMS; + /* It's '/' so serve the index.html if there is one. */ + filename = "index.html"; } - if (filename && strstr(filename, "..")) + else if (NULL != strchr(filename, '/') || NULL != strstr(filename, "..")) { + /* + * We currently only support a flat file + * hierarchy for the documentation. + */ + log_error(LOG_LEVEL_ERROR, + "Rejecting the request to serve '%s' as it contains '/' or '..'", + filename); return JB_ERR_CGI_PARAMS; } - full_path = make_path(csp->config->usermanual, filename ? filename : "index.html"); + full_path = make_path(csp->config->usermanual, filename); if (full_path == NULL) { return JB_ERR_MEMORY; @@ -1133,29 +805,12 @@ jb_err cgi_send_user_manual(struct client_state *csp, } freez(full_path); - /* Guess correct Content-Type based on the filename's ending */ - if (filename) - { - length = strlen(filename); - } - else - { - length = 0; - } - if((length>=4) && !strcmp(&filename[length-4], ".css")) - { - err = enlist(rsp->headers, "Content-Type: text/css"); - } - else if((length>=4) && !strcmp(&filename[length-4], ".jpg")) - { - err = enlist(rsp->headers, "Content-Type: image/jpeg"); - } - else - { - err = enlist(rsp->headers, "Content-Type: text/html"); - } + content_type = get_content_type(filename); + log_error(LOG_LEVEL_CGI, + "Content-Type guessed for %s: %s", filename, content_type); + + return enlist_unique_header(rsp->headers, "Content-Type", content_type); - return err; } @@ -1174,7 +829,7 @@ jb_err cgi_send_user_manual(struct client_state *csp, * CGI Parameters : none * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_show_version(struct client_state *csp, @@ -1223,7 +878,7 @@ jb_err cgi_show_version(struct client_state *csp, * Default is to show menu and other information. * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_show_status(struct client_state *csp, @@ -1269,7 +924,7 @@ jb_err cgi_show_status(struct client_state *csp, if (!err) err = map(exports, "options", 1, csp->config->proxy_args, 1); if (!err) err = show_defines(exports); - if (err) + if (err) { free_map(exports); return JB_ERR_MEMORY; @@ -1313,8 +968,8 @@ jb_err cgi_show_status(struct client_state *csp, #else /* ndef FEATURE_STATISTICS */ err = err || map_block_killer(exports, "statistics"); #endif /* ndef FEATURE_STATISTICS */ - - /* + + /* * List all action files in use, together with view and edit links, * except for standard.action, which should only be viewable. (Not * enforced in the editor itself) @@ -1355,7 +1010,7 @@ jb_err cgi_show_status(struct client_state *csp, if (!err) err = string_append(&s, "\n"); } } - if (*s != '\0') + if (*s != '\0') { if (!err) err = map(exports, "actions-filenames", 1, s, 0); } @@ -1364,7 +1019,7 @@ jb_err cgi_show_status(struct client_state *csp, if (!err) err = map(exports, "actions-filenames", 1, "None specified", 1); } - /* + /* * List all re_filterfiles in use, together with view options. * FIXME: Shouldn't include hardwired HTML here, use line template instead! */ @@ -1381,7 +1036,7 @@ jb_err cgi_show_status(struct client_state *csp, if (!err) err = string_append(&s, "\n"); } } - if (*s != '\0') + if (*s != '\0') { if (!err) err = map(exports, "re-filter-filenames", 1, s, 0); } @@ -1421,7 +1076,7 @@ jb_err cgi_show_status(struct client_state *csp, return template_fill_for_cgi(csp, "show-status", exports, rsp); } - + /********************************************************************* * * Function : cgi_show_url_info @@ -1442,7 +1097,7 @@ jb_err cgi_show_status(struct client_state *csp, * the template. * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_show_url_info(struct client_state *csp, @@ -1478,7 +1133,7 @@ jb_err cgi_show_url_info(struct client_state *csp, * 1) "http://" or "https://" prefix present and followed by URL - OK * 2) Only the "http://" or "https://" part is present, no URL - change * to empty string so it will be detected later as "no URL". - * 3) Parameter specified but doesn't contain "http(s?)://" - add a + * 3) Parameter specified but doesn't start with "http(s?)://" - add a * "http://" prefix. * 4) Parameter not specified or is empty string - let this fall through * for now, next block of code will handle it. @@ -1505,9 +1160,14 @@ jb_err cgi_show_url_info(struct client_state *csp, url_param[0] = '\0'; } } - else if ((url_param[0] != '\0') && (NULL == strstr(url_param, "://"))) + else if ((url_param[0] != '\0') + && ((NULL == strstr(url_param, "://") + || (strstr(url_param, "://") > strstr(url_param, "/"))))) { - /* No prefix - assume http:// */ + /* + * No prefix or at least no prefix before + * the first slash - assume http:// + */ char *url_param_prefixed = strdup("http://"); if (JB_ERR_OK != string_join(&url_param_prefixed, url_param)) @@ -1555,7 +1215,7 @@ jb_err cgi_show_url_info(struct client_state *csp, struct http_request url_to_query[1]; struct current_action_spec action[1]; int i; - + if (map(exports, "url", 1, html_encode(url_param), 0)) { free(url_param); @@ -1843,7 +1503,7 @@ jb_err cgi_show_url_info(struct client_state *csp, * CGI Parameters : None * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_robots_txt(struct client_state *csp, @@ -1891,13 +1551,19 @@ jb_err cgi_robots_txt(struct client_state *csp, * 1 : exports = map to extend * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ static jb_err show_defines(struct map *exports) { jb_err err = JB_ERR_OK; +#ifdef FEATURE_ACCEPT_FILTER + if (!err) err = map_conditional(exports, "FEATURE_ACCEPT_FILTER", 1); +#else /* ifndef FEATURE_ACCEPT_FILTER */ + if (!err) err = map_conditional(exports, "FEATURE_ACCEPT_FILTER", 0); +#endif /* ndef FEATURE_ACCEPT_FILTER */ + #ifdef FEATURE_ACL if (!err) err = map_conditional(exports, "FEATURE_ACL", 1); #else /* ifndef FEATURE_ACL */ @@ -1910,12 +1576,24 @@ static jb_err show_defines(struct map *exports) if (!err) err = map_conditional(exports, "FEATURE_CGI_EDIT_ACTIONS", 0); #endif /* ndef FEATURE_CGI_EDIT_ACTIONS */ +#ifdef FEATURE_COMPRESSION + if (!err) err = map_conditional(exports, "FEATURE_COMPRESSION", 1); +#else /* ifndef FEATURE_COMPRESSION */ + if (!err) err = map_conditional(exports, "FEATURE_COMPRESSION", 0); +#endif /* ndef FEATURE_COMPRESSION */ + #ifdef FEATURE_CONNECTION_KEEP_ALIVE if (!err) err = map_conditional(exports, "FEATURE_CONNECTION_KEEP_ALIVE", 1); -#else /* ifndef FEATURE_CGI_EDIT_ACTIONS */ +#else /* ifndef FEATURE_CONNECTION_KEEP_ALIVE */ if (!err) err = map_conditional(exports, "FEATURE_CONNECTION_KEEP_ALIVE", 0); #endif /* ndef FEATURE_CONNECTION_KEEP_ALIVE */ +#ifdef FEATURE_CONNECTION_SHARING + if (!err) err = map_conditional(exports, "FEATURE_CONNECTION_SHARING", 1); +#else /* ifndef FEATURE_CONNECTION_SHARING */ + if (!err) err = map_conditional(exports, "FEATURE_CONNECTION_SHARING", 0); +#endif /* ndef FEATURE_CONNECTION_SHARING */ + #ifdef FEATURE_FAST_REDIRECTS if (!err) err = map_conditional(exports, "FEATURE_FAST_REDIRECTS", 1); #else /* ifndef FEATURE_FAST_REDIRECTS */ @@ -1948,6 +1626,12 @@ static jb_err show_defines(struct map *exports) if (!err) err = map_conditional(exports, "FEATURE_IMAGE_DETECT_MSIE", 0); #endif /* ndef FEATURE_IMAGE_DETECT_MSIE */ +#ifdef HAVE_RFC2553 + if (!err) err = map_conditional(exports, "FEATURE_IPV6_SUPPORT", 1); +#else /* ifndef HAVE_RFC2553 */ + if (!err) err = map_conditional(exports, "FEATURE_IPV6_SUPPORT", 0); +#endif /* ndef HAVE_RFC2553 */ + #ifdef FEATURE_NO_GIFS if (!err) err = map_conditional(exports, "FEATURE_NO_GIFS", 1); #else /* ifndef FEATURE_NO_GIFS */ @@ -2117,7 +1801,7 @@ static char *show_rcs(void) * Default is to show menu and other information. * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ static jb_err cgi_show_file(struct client_state *csp, @@ -2211,7 +1895,7 @@ static jb_err cgi_show_file(struct client_state *csp, return JB_ERR_CGI_PARAMS; } - + /********************************************************************* * * Function : load_file @@ -2238,6 +1922,7 @@ static jb_err load_file(const char *filename, char **buffer, size_t *length) fp = fopen(filename, "rb"); if (NULL == fp) { + log_error(LOG_LEVEL_ERROR, "Failed to open %s: %E", filename); return JB_ERR_FILE; } diff --git a/external/privoxy/cgisimple.h b/external/privoxy/cgisimple.h index 2bce2142..05d6486a 100644 --- a/external/privoxy/cgisimple.h +++ b/external/privoxy/cgisimple.h @@ -1,24 +1,24 @@ #ifndef CGISIMPLE_H_INCLUDED #define CGISIMPLE_H_INCLUDED -#define CGISIMPLE_H_VERSION "$Id: cgisimple.h,v 1.16 2008/05/26 17:30:55 fabiankeil Exp $" +#define CGISIMPLE_H_VERSION "$Id: cgisimple.h,v 1.18 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgisimple.h,v $ * * Purpose : Declares functions to intercept request, generate * html or gif answers, and to compose HTTP resonses. - * + * * Functions declared include: - * + * * * Copyright : Written by and Copyright (C) 2001-2007 the SourceForge * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -36,78 +36,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: cgisimple.h,v $ - * Revision 1.16 2008/05/26 17:30:55 fabiankeil - * Provide an OpenSearch Description to access the - * show-url-info page through "search engine plugins". - * - * Revision 1.15 2007/01/23 15:51:17 fabiankeil - * Add favicon delivery functions. - * - * Revision 1.14 2006/09/06 18:45:03 fabiankeil - * Incorporate modified version of Roland Rosenfeld's patch to - * optionally access the user-manual via Privoxy. Closes patch 679075. - * - * Formatting changed to Privoxy style, added call to - * cgi_error_no_template if the requested file doesn't - * exist and modified check whether or not Privoxy itself - * should serve the manual. Should work cross-platform now. - * - * Revision 1.13 2006/07/18 14:48:45 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.11 2002/04/05 15:50:53 oes - * added send-stylesheet CGI - * - * Revision 1.10 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.9 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.8 2002/03/16 23:54:06 jongfoster - * Adding graceful termination feature, to help look for memory leaks. - * If you enable this (which, by design, has to be done by hand - * editing config.h) and then go to http://i.j.b/die, then the program - * will exit cleanly after the *next* request. It should free all the - * memory that was used. - * - * Revision 1.7 2002/03/08 16:43:59 oes - * Renamed cgi_transparent_png to cgi_transparent_image - * - * Revision 1.6 2002/03/07 03:48:59 oes - * - Changed built-in images from GIF to PNG - * (with regard to Unisys patent issue) - * - * Revision 1.5 2002/01/22 23:26:03 jongfoster - * Adding cgi_transparent_gif() for http://i.j.b/t - * - * Revision 1.4 2001/10/23 21:48:19 jongfoster - * Cleaning up error handling in CGI functions - they now send back - * a HTML error page and should never cause a FATAL error. (Fixes one - * potential source of "denial of service" attacks). - * - * CGI actions file editor that works and is actually useful. - * - * Ability to toggle JunkBuster remotely using a CGI call. - * - * You can turn off both the above features in the main configuration - * file, e.g. if you are running a multi-user proxy. - * - * Revision 1.3 2001/10/14 22:00:32 jongfoster - * Adding support for a 404 error when an invalid CGI page is requested. - * - * Revision 1.2 2001/10/02 15:31:20 oes - * Introduced show-request cgi - * - * Revision 1.1 2001/09/16 17:08:54 jongfoster - * Moving simple CGI functions from cgi.c to new file cgisimple.c - * - * **********************************************************************/ - + #include "project.h" diff --git a/external/privoxy/config b/external/privoxy/config index 741382a8..052f8a19 100644 --- a/external/privoxy/config +++ b/external/privoxy/config @@ -1,8 +1,8 @@ -# Sample Configuration File for Privoxy v3.0.12 +# Sample Configuration File for Privoxy v3.0.19 # -# $Id: config,v 1.76 2009/03/21 11:51:51 fabiankeil Exp $ +# $Id: config,v 1.98 2011/12/26 17:04:50 fabiankeil Exp $ # -# Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ +# Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/ # #################################################################### # # @@ -113,7 +113,6 @@ # # user-manual /usr/share/doc/privoxy/user-manual # -# # The User Manual is then available to anyone with # access to Privoxy, by following the built-in URL: # http://config.privoxy.org/user-manual/ (or the shortcut: @@ -124,7 +123,6 @@ # # user-manual http://example.com/privoxy/user-manual/ # -# # WARNING!!! # # If set, this option should be the first option in the config @@ -416,7 +414,7 @@ actionsfile user.action # User customizations # separate file, such as user.filter. # filterfile default.filter -#filterfile user.filter # User customizations +filterfile user.filter # User customizations # # # 2.6. logfile @@ -560,7 +558,7 @@ logfile logfile # debug 2 # show each connection status # debug 4 # show I/O status # debug 8 # show header parsing -# debug 16 # log all data written to the network into the logfile +# debug 16 # log all data written to the network # debug 32 # debug force feature # debug 64 # debug regular expression filters # debug 128 # debug redirects @@ -570,15 +568,16 @@ logfile logfile # debug 2048 # CGI user interface # debug 4096 # Startup banner and warnings. # debug 8192 # Non-fatal errors +# debug 32768 # log all data read from the network # # # To select multiple debug levels, you can either add them or # use multiple debug lines. # # A debug level of 1 is informative because it will show you each -# request as it happens. 1, 4096 and 8192 are recommended so that -# you will notice when things go wrong. The other levels are -# probably only of interest if you are hunting down a specific +# request as it happens. 1, 1024, 4096 and 8192 are recommended +# so that you will notice when things go wrong. The other levels +# are probably only of interest if you are hunting down a specific # problem. They can produce a hell of an output (especially 16). # # Privoxy used to ship with the debug levels recommended above @@ -682,22 +681,24 @@ logfile logfile # # Specifies: # -# The IP address and TCP port on which Privoxy will listen for +# The address and TCP port on which Privoxy will listen for # client requests. # # Type of value: # # [IP-Address]:Port # +# [Hostname]:Port +# # Default value: # # 127.0.0.1:8118 # # Effect if unset: # -# Bind to 127.0.0.1 (localhost), port 8118. This is suitable and -# recommended for home users who run Privoxy on the same machine -# as their browser. +# Bind to 127.0.0.1 (IPv4 localhost), port 8118. This is suitable +# and recommended for home users who run Privoxy on the same +# machine as their browser. # # Notes: # @@ -708,15 +709,56 @@ logfile logfile # if you want to serve requests from other machines (e.g. on your # local network) as well, you will need to override the default. # -# If you leave out the IP address, Privoxy will bind to all +# You can use this statement multiple times to make Privoxy listen +# on more ports or more IP addresses. Suitable if your operating +# system does not support sharing IPv6 and IPv4 protocols on the +# same socket. +# +# If a hostname is used instead of an IP address, Privoxy will +# try to resolve it to an IP address and if there are multiple, +# use the first one returned. +# +# If the address for the hostname isn't already known on the +# system (for example because it's in /etc/hostname), this may +# result in DNS traffic. +# +# If the specified address isn't available on the system, or if +# the hostname can't be resolved, Privoxy will fail to start. +# +# IPv6 addresses containing colons have to be quoted by +# brackets. They can only be used if Privoxy has been compiled +# with IPv6 support. If you aren't sure if your version supports +# it, have a look at http://config.privoxy.org/ show-status. +# +# Some operating systems will prefer IPv6 to IPv4 addresses even if +# the system has no IPv6 connectivity which is usually not expected +# by the user. Some even rely on DNS to resolve localhost which +# mean the "localhost" address used may not actually be local. +# +# It is therefore recommended to explicitly configure the intended +# IP address instead of relying on the operating system, unless +# there's a strong reason not to. +# +# If you leave out the address, Privoxy will bind to all IPv4 # interfaces (addresses) on your machine and may become reachable -# from the Internet. In that case, consider using access control -# lists (ACL's, see below), and/or a firewall. +# from the Internet and/ or the local network. Be aware that +# some GNU/Linux distributions modify that behaviour without +# updating the documentation. Check for non-standard patches if +# your Privoxyversion behaves differently. +# +# If you configure Privoxyto be reachable from the network, +# consider using access control lists (ACL's, see below), and/or +# a firewall. # # If you open Privoxy to untrusted users, you will also # want to make sure that the following actions are disabled: # enable-edit-actions and enable-remote-toggle # +# With the exception noted above, listening on multiple addresses +# is currently not supported by Privoxy directly. It can be done +# on most operating systems by letting a packet filter redirect +# request for certain addresses to Privoxy, though. +# # Example: # # Suppose you are running Privoxy on a machine which has the @@ -726,6 +768,10 @@ logfile logfile # # listen-address 192.168.0.1:8118 # +# Suppose you are running Privoxy on an IPv6-capable machine and +# you want it to listen on the IPv6 address of the loopback device: +# +# listen-address [::1]:8118 # listen-address 127.0.0.1:8118 # @@ -942,18 +988,28 @@ enforce-blocks 0 # # Type of value: # -# src_addr[/src_masklen] [dst_addr[/dst_masklen]] +# src_addr[:port][/src_masklen] [dst_addr[:port][/dst_masklen]] # -# Where src_addr and dst_addr are IP addresses in dotted decimal -# notation or valid DNS names, and src_masklen and dst_masklen are -# subnet masks in CIDR notation, i.e. integer values from 2 to 30 -# representing the length (in bits) of the network address. The -# masks and the whole destination part are optional. +# Where src_addr and dst_addr are IPv4 addresses in dotted +# decimal notation or valid DNS names, port is a port number, and +# src_masklen and dst_masklen are subnet masks in CIDR notation, +# i.e. integer values from 2 to 30 representing the length +# (in bits) of the network address. The masks and the whole +# destination part are optional. +# +# If your system implements RFC 3493, then src_addr and dst_addr +# can be IPv6 addresses delimeted by brackets, port can be a +# number or a service name, and src_masklen and dst_masklen can +# be a number from 0 to 128. # # Default value: # # Unset # +# If no port is specified, any port will match. If no src_masklen +# or src_masklen is given, the complete IP address has to match +# (i.e. 32 bits for IPv4 and 128 bits for IPv6). +# # Effect if unset: # # Don't restrict access further than implied by listen-address @@ -989,6 +1045,12 @@ enforce-blocks 0 # names. If a DNS name resolves to multiple IP addresses, only # the first one is used. # +# Some systems allow IPv4 clients to connect to IPv6 server +# sockets. Then the client's IPv4 address will be translated by the +# system into IPv6 address space with special prefix ::ffff:0:0/96 +# (so called IPv4 mapped IPv6 address). Privoxy can handle it +# and maps such ACL addresses automatically. +# # Denying access to particular sites by ACL may have undesired # side effects if the site in question is hosted on a machine # which also hosts other sites (most sites are). @@ -1016,6 +1078,16 @@ enforce-blocks 0 # permit-access 192.168.45.64/26 # deny-access 192.168.45.73 www.dirty-stuff.example.com # +# Allow access from the IPv4 network 192.0.2.0/24 even if listening +# on an IPv6 wild card address (not supported on all platforms): +# +# permit-access 192.0.2.0/24 +# +# +# This is equivalent to the following line even if listening on +# an IPv4 address (not supported on all platforms): +# +# permit-access [::ffff:192.0.2.0]/120 # # # 4.8. buffer-limit @@ -1093,7 +1165,7 @@ buffer-limit 4096 # to denote "all URLs". http_parent[:port] is the DNS name or # IP address of the parent HTTP proxy through which the requests # should be forwarded, optionally followed by its listening port -# (default: 8080). Use a single dot (.) to denote "no forwarding". +# (default: 8000). Use a single dot (.) to denote "no forwarding". # # Default value: # @@ -1108,6 +1180,13 @@ buffer-limit 4096 # If http_parent is ".", then requests are not forwarded to # another HTTP proxy but are made directly to the web servers. # +# http_parent can be a numerical IPv6 address (if RFC 3493 is +# implemented). To prevent clashes with the port delimiter, +# the whole IP address has to be put into brackets. On the other +# hand a target_pattern containing an IPv6 address has to be put +# into angle brackets (normal brackets are reserved for regular +# expressions already). +# # Multiple lines are OK, they are checked in sequence, and the # last match wins. # @@ -1127,6 +1206,16 @@ buffer-limit 4096 # forward .isp.example.net . # # +# Parent proxy specified by an IPv6 address: +# +# forward / [2001:DB8::1]:8000 +# +# +# Suppose your parent proxy doesn't support IPv6: +# +# forward / parent-proxy.example.org:8000 +# forward ipv6-server.example.org . +# forward <[2-3][0-9a-f][0-9a-f][0-9a-f]:*> . # # # 5.2. forward-socks4, forward-socks4a and forward-socks5 @@ -1169,6 +1258,13 @@ buffer-limit 4096 # With forward-socks5 the DNS resolution will happen on the remote # server as well. # +# socks_proxy and http_parent can be a numerical IPv6 address +# (if RFC 3493 is implemented). To prevent clashes with the port +# delimiter, the whole IP address has to be put into brackets. On +# the other hand a target_pattern containing an IPv6 address has +# to be put into angle brackets (normal brackets are reserved +# for regular expressions already). +# # If http_parent is ".", then requests are not forwarded to another # HTTP proxy but are made (HTTP-wise) directly to the web servers, # albeit through a SOCKS proxy. @@ -1193,7 +1289,7 @@ buffer-limit 4096 # To chain Privoxy and Tor, both running on the same system, # you would use something like: # -# forward-socks4a / 127.0.0.1:9050 . +# forward-socks5 / 127.0.0.1:9050 . # # # The public Tor network can't be used to reach your local network, @@ -1219,7 +1315,6 @@ buffer-limit 4096 # # # -# # 5.3. forwarded-connect-retries # =============================== # @@ -1260,6 +1355,9 @@ buffer-limit 4096 # manually. Start with a small value and check Privoxy's logfile # from time to time, to see how many retries are usually needed. # +# Due to a bug, this option currently also causes Privoxy to +# retry in case of certain problems with direct connections. +# # Examples: # # forwarded-connect-retries 1 @@ -1267,7 +1365,10 @@ buffer-limit 4096 forwarded-connect-retries 0 # # -# 5.4. accept-intercepted-requests +# 6. MISCELLANEOUS +# ================= +# +# 6.1. accept-intercepted-requests # ================================= # # Specifies: @@ -1306,7 +1407,7 @@ forwarded-connect-retries 0 accept-intercepted-requests 0 # # -# 5.5. allow-cgi-request-crunching +# 6.2. allow-cgi-request-crunching # ================================= # # Specifies: @@ -1344,7 +1445,7 @@ accept-intercepted-requests 0 allow-cgi-request-crunching 0 # # -# 5.6. split-large-forms +# 6.3. split-large-forms # ======================= # # Specifies: @@ -1386,7 +1487,7 @@ allow-cgi-request-crunching 0 split-large-forms 0 # # -# 5.7. keep-alive-timeout +# 6.4. keep-alive-timeout # ======================== # # Specifies: @@ -1404,12 +1505,120 @@ split-large-forms 0 # # Effect if unset: # -# Connections are not reused. +# Connections are not kept alive. +# +# Notes: +# +# This option allows clients to keep the connection to Privoxy +# alive. If the server supports it, Privoxy will keep the +# connection to the server alive as well. Under certain +# circumstances this may result in speed-ups. +# +# By default, Privoxy will close the connection to the server if +# the client connection gets closed, or if the specified timeout +# has been reached without a new request coming in. This behaviour +# can be changed with the connection-sharing option. +# +# This option has no effect if Privoxy has been compiled without +# keep-alive support. +# +# Note that a timeout of five seconds as used in the default +# configuration file significantly decreases the number of +# connections that will be reused. The value is used because some +# browsers limit the number of connections they open to a single +# host and apply the same limit to proxies. This can result in a +# single website "grabbing" all the connections the browser allows, +# which means connections to other websites can't be opened until +# the connections currently in use time out. +# +# Several users have reported this as a Privoxy bug, so the default +# value has been reduced. Consider increasing it to 300 seconds +# or even more if you think your browser can handle it. If your +# browser appears to be hanging it can't. +# +# Examples: +# +# keep-alive-timeout 300 +# +keep-alive-timeout 5 +# +# +# 6.5. default-server-timeout +# ============================ +# +# Specifies: +# +# Assumed server-side keep-alive timeout if not specified by +# the server. +# +# Type of value: +# +# Time in seconds. +# +# Default value: +# +# None +# +# Effect if unset: +# +# Connections for which the server didn't specify the keep-alive +# timeout are not reused. +# +# Notes: +# +# Enabling this option significantly increases the number of +# connections that are reused, provided the keep-alive-timeout +# option is also enabled. +# +# While it also increases the number of connections problems when +# Privoxy tries to reuse a connection that already has been closed +# on the server side, or is closed while Privoxy is trying to +# reuse it, this should only be a problem if it happens for the +# first request sent by the client. If it happens for requests +# on reused client connections, Privoxy will simply close the +# connection and the client is supposed to retry the request +# without bothering the user. +# +# Enabling this option is therefore only recommended if the +# connection-sharing option is disabled. +# +# It is an error to specify a value larger than the +# keep-alive-timeout value. +# +# This option has no effect if Privoxy has been compiled without +# keep-alive support. +# +# Examples: +# +# default-server-timeout 60 +# +#default-server-timeout 60 +# +# +# 6.6. connection-sharing +# ======================== +# +# Specifies: +# +# Whether or not outgoing connections that have been kept alive +# should be shared between different incoming connections. +# +# Type of value: +# +# 0 or 1 +# +# Default value: +# +# None +# +# Effect if unset: +# +# Connections are not shared. # # Notes: # # This option has no effect if Privoxy has been compiled without -# keep-alive support. +# keep-alive support, or if it's disabled. # # Notes: # @@ -1417,23 +1626,47 @@ split-large-forms 0 # speedups. There are also a few privacy implications you should # be aware of. # -# Outgoing connections are shared between clients (if there are -# more than one) and closing the client that initiated the outgoing -# connection does not affect the connection between Privoxy and -# the server unless the client's request hasn't been completed -# yet. If the outgoing connection is idle, it will not be closed -# until either Privoxy's or the server's timeout is reached. While +# If this option is effective, outgoing connections are shared +# between clients (if there are more than one) and closing the +# browser that initiated the outgoing connection does no longer +# affect the connection between Privoxy and the server unless +# the client's request hasn't been completed yet. +# +# If the outgoing connection is idle, it will not be closed until +# either Privoxy's or the server's timeout is reached. While # it's open, the server knows that the system running Privoxy is # still there. # +# If there are more than one client (maybe even belonging to +# multiple users), they will be able to reuse each others +# connections. This is potentially dangerous in case of +# authentication schemes like NTLM where only the connection +# is authenticated, instead of requiring authentication for +# each request. +# +# If there is only a single client, and if said client can keep +# connections alive on its own, enabling this option has next to +# no effect. If the client doesn't support connection keep-alive, +# enabling this option may make sense as it allows Privoxy to keep +# outgoing connections alive even if the client itself doesn't +# support it. +# +# You should also be aware that enabling this option increases +# the likelihood of getting the "No server or forwarder data" +# error message, especially if you are using a slow connection +# to the Internet. +# +# This option should only be used by experienced users who +# understand the risks and can weight them against the benefits. +# # Examples: # -# keep-alive-timeout 300 +# connection-sharing 1 # -keep-alive-timeout 300 +#connection-sharing 1 # # -# 5.8. socket-timeout +# 6.7. socket-timeout # ==================== # # Specifies: @@ -1466,7 +1699,187 @@ keep-alive-timeout 300 socket-timeout 300 # # -# 6. WINDOWS GUI OPTIONS +# 6.8. max-client-connections +# ============================ +# +# Specifies: +# +# Maximum number of client connections that will be served. +# +# Type of value: +# +# Positive number. +# +# Default value: +# +# None +# +# Effect if unset: +# +# Connections are served until a resource limit is reached. +# +# Notes: +# +# Privoxy creates one thread (or process) for every incoming +# client connection that isn't rejected based on the access +# control settings. +# +# If the system is powerful enough, Privoxy can theoretically deal +# with several hundred (or thousand) connections at the same time, +# but some operating systems enforce resource limits by shutting +# down offending processes and their default limits may be below +# the ones Privoxy would require under heavy load. +# +# Configuring Privoxy to enforce a connection limit below the +# thread or process limit used by the operating system makes +# sure this doesn't happen. Simply increasing the operating +# system's limit would work too, but if Privoxy isn't the only +# application running on the system, you may actually want to +# limit the resources used by Privoxy. +# +# If Privoxy is only used by a single trusted user, limiting the +# number of client connections is probably unnecessary. If there +# are multiple possibly untrusted users you probably still want +# to additionally use a packet filter to limit the maximal number +# of incoming connections per client. Otherwise a malicious user +# could intentionally create a high number of connections to +# prevent other users from using Privoxy. +# +# Obviously using this option only makes sense if you choose a +# limit below the one enforced by the operating system. +# +# Examples: +# +# max-client-connections 256 +# +#max-client-connections 256 + +# +# 6.9. handle-as-empty-doc-returns-ok +# ==================================== +# +# Specifies: +# +# The status code Privoxy returns for pages blocked with +# +handle-as-empty-document. +# +# Type of value: +# +# 0 or 1 +# +# Default value: +# +# 0 +# +# Effect if unset: +# +# Privoxy returns a status 403(forbidden) for all blocked pages. +# +# Effect if set: +# +# Privoxy returns a status 200(OK) for pages blocked with +# +handle-as-empty-document and a status 403(Forbidden) for all +# other blocked pages. +# +# Notes: +# +# This is a work-around for Firefox bug 492459: " Websites are no +# longer rendered if SSL requests for JavaScripts are blocked by a +# proxy. " (https:/ /bugzilla.mozilla.org/show_bug.cgi?id=492459) +# As the bug has been fixed for quite some time this option +# should no longer be needed and will be removed in a future +# release. Please speak up if you have a reason why the option +# should be kept around. +# +#handle-as-empty-doc-returns-ok 1 +# +# +# 1.6.10. enable-compression +# +# Specifies: +# +# Whether or not buffered content is compressed before delivery. +# +# Type of value: +# +# 0 or 1 +# +# Default value: +# +# 0 +# +# Effect if unset: +# +# Privoxy does not compress buffered content. +# +# Effect if set: +# +# Privoxy compresses buffered content before delivering it to +# the client, provided the client supports it. +# +# Notes: +# +# This directive is only supported if Privoxy has been compiled +# with FEATURE_COMPRESSION, which should not to be confused +# with FEATURE_ZLIB. +# +# Compressing buffered content is mainly useful if Privoxy and the +# client are running on different systems. If they are running on +# the same system, enabling compression is likely to slow things +# down. If you didn't measure otherwise, you should assume that +# it does and keep this option disabled. +# +# Privoxy will not compress buffered content below a certain +# length. +# +#enable-compression 1 +# +# +# 1.6.11. compression-level +# +# Specifies: +# +# The compression level that is passed to the zlib library when +# compressing buffered content. +# +# Type of value: +# +# Positive number ranging from 0 to 9. +# +# Default value: +# +# 1 +# +# Notes: +# +# Compressing the data more takes usually longer than compressing +# it less or not compressing it at all. Which level is best +# depends on the connection between Privoxy and the client. If +# you can't be bothered to benchmark it for yourself, you should +# stick with the default and keep compression disabled. +# +# If compression is disabled, the compression level is irrelevant. +# +# Examples: +# +# # Best speed (compared to the other levels) +# compression-level 1 +# +# # Best compression +# compression-level 9 +# +# # No compression. Only useful for testing as the added header +# # slightly increases the amount of data that has to be sent. +# # If your benchmark shows that using this compression level +# # is superior to using no compression at all, the benchmark +# # is likely to be flawed. +# compression-level 0 +# +# +#compression-level 1 +# +# +# 7. WINDOWS GUI OPTIONS # ======================= # # Privoxy has a number of options specific to the Windows GUI diff --git a/external/privoxy/config.guess b/external/privoxy/config.guess old mode 100644 new mode 100755 index d622a44e..8152efd6 --- a/external/privoxy/config.guess +++ b/external/privoxy/config.guess @@ -2,9 +2,9 @@ # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# 2011 Free Software Foundation, Inc. -timestamp='2012-02-10' +timestamp='2011-11-11' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -17,7 +17,9 @@ timestamp='2012-02-10' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -55,8 +57,8 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -143,7 +145,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -861,13 +863,6 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; - aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -902,16 +897,16 @@ EOF echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo frv-unknown-linux-gnu exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo hexagon-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu @@ -953,7 +948,7 @@ EOF test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo or32-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu @@ -994,7 +989,7 @@ EOF echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -1325,9 +1320,6 @@ EOF i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; - x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx - exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff --git a/external/privoxy/config.h b/external/privoxy/config.h deleted file mode 100644 index 7b5a17c3..00000000 --- a/external/privoxy/config.h +++ /dev/null @@ -1,744 +0,0 @@ -/* config.h. Generated from config.h.in by configure. */ -/* config.h.in. Generated from configure.in by autoheader. */ -#ifndef CONFIG_H_INCLUDED -#define CONFIG_H_INCLUDED -/********************************************************************* - * - * File : $Source: /cvsroot/ijbswa/current/acconfig.h,v $ - * - * Purpose : This file should be the first thing included in every - * .c file. (Before even system headers). It contains - * #define statements for various features. It was - * introduced because the compile command line started - * getting ludicrously long with feature defines. - * - * Copyright : Written by and Copyright (C) 2001 the SourceForge - * Privoxy team. http://www.privoxy.org/ - * - * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and - * Junkbusters Corporation. http://www.junkbusters.com - * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General - * Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will - * be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * The GNU General Public License should be included with - * this file. If not, you can view it at - * http://www.gnu.org/copyleft/gpl.html - * or write to the Free Software Foundation, Inc., 59 - * Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Revisions : - * $Log: acconfig.h,v $ - * Revision 1.36 2008/10/18 11:17:52 fabiankeil - * Connection keep-alive support is ready for testing, - * allow enabling it through the configure script. - * - * Revision 1.35 2008/04/06 15:18:33 fabiankeil - * Oh well, rename the --enable-pcre-host-patterns option to - * --enable-extended-host-patterns as it's not really PCRE syntax. - * - * Revision 1.34 2008/04/06 14:54:26 fabiankeil - * Use PCRE syntax in host patterns when configured - * with --enable-pcre-host-patterns. - * - * Revision 1.33 2006/12/17 19:15:26 fabiankeil - * Added ./configure switch for FEATURE_GRACEFUL_TERMINATION. - * - * Revision 1.32 2006/07/18 14:48:45 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.27.2.4 2003/12/17 16:34:40 oes - * Cosmetics - * - * Revision 1.27.2.3 2003/03/27 16:03:19 oes - * Another shot at Bug #707467 - * - * Revision 1.27.2.2 2003/03/21 14:39:12 oes - * Presumably fixed Bug #707467 by defining unix ifdef __unix__ - * - * Revision 1.27.2.1 2002/08/10 11:22:31 oes - * - Add two AC_DEFINEs that indicate if the pcre*.h headers - * are located in a pcre/ subdir to the include path. - * - * Revision 1.27 2002/04/25 19:13:57 morcego - * Removed RPM release number declaration on configure.in - * Changed makefile to use given value for RPM_PACKAGEV when on uploading - * targets (will produce an error, explaining who to do it, if no value - * if provided). - * - * Revision 1.26 2002/04/11 11:00:21 oes - * Applied Moritz' fix for socklen_t on Solaris - * - * Revision 1.25 2002/04/06 20:38:01 jongfoster - * Renaming VC++ versions of config.h - * - * Revision 1.24 2002/04/04 00:36:36 gliptak - * always use pcre for matching - * - * Revision 1.23 2002/04/03 22:28:03 gliptak - * Removed references to gnu_regex - * - * Revision 1.22 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.21 2002/03/24 14:31:08 swa - * remove more crappy files. set RPM - * release version correctly. - * - * Revision 1.20 2002/03/24 13:46:44 swa - * name change related issue. - * - * Revision 1.19 2002/03/24 13:25:42 swa - * name change related issues - * - * Revision 1.18 2002/03/08 16:40:28 oes - * Added FEATURE_NO_GIFS - * - * Revision 1.17 2002/03/04 17:52:44 oes - * Deleted PID_FILE_PATH - * - * Revision 1.16 2002/01/10 12:36:18 oes - * Moved HAVE_*_R to acconfig.h, where they belong. - * - * Revision 1.15 2001/12/30 14:07:31 steudten - * - Add signal handling (unix) - * - Add SIGHUP handler (unix) - * - Add creation of pidfile (unix) - * - Add action 'top' in rc file (RH) - * - Add entry 'SIGNALS' to manpage - * - Add exit message to logfile (unix) - * - * Revision 1.14 2001/10/23 21:24:09 jongfoster - * Support for FEATURE_CGI_EDIT_ACTIONS - * - * Revision 1.13 2001/10/07 15:30:41 oes - * Removed FEATURE_DENY_GZIP - * - * Revision 1.12 2001/09/13 19:56:37 jongfoster - * Reverting to revision 1.10 - previous checking was majorly broken. - * - * Revision 1.10 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.9 2001/07/29 19:08:52 jongfoster - * Changing _CONFIG_H to CONFIG_H_INCLUDED. - * Also added protection against using a MinGW32 or CygWin version of - * config.h from within MS Visual C++ - * - * Revision 1.8 2001/07/29 17:09:17 jongfoster - * Major changes to build system in order to fix these bugs: - * - pthreads under Linux was broken - changed -lpthread to -pthread - * - Compiling in MinGW32 mode under CygWin now correctly detects - * which shared libraries are available - * - Solaris support (?) (Not tested under Solaris yet) - * - * Revision 1.7 2001/07/25 22:53:59 jongfoster - * Will #error if pthreads is enabled under BeOs - * - * Revision 1.6 2001/07/15 17:54:29 jongfoster - * Renaming #define STATIC to STATIC_PCRE - * Adding new #define FEATURE_PTHREAD that will be used to enable - * POSIX threads support. - * - * Revision 1.5 2001/07/13 13:48:37 oes - * - (Fix:) Copied CODE_STATUS #define from config.h.in - * - split REGEX #define into REGEX_GNU and REGEX_PCRE - * and removed PCRE. - * (REGEX = REGEX_GNU || REGEX_PCRE per project.h) - * - Moved STATIC (for pcre) here from Makefile.in - * - Introduced STATIC_PCRS #define to allow for dynaimc linking with - * libpcrs - * - Removed PCRS #define, since pcrs is now needed for CGI anyway - * - * Revision 1.4 2001/05/29 09:50:24 jongfoster - * Unified blocklist/imagelist/permissionslist. - * File format is still under discussion, but the internal changes - * are (mostly) done. - * - * Also modified interceptor behaviour: - * - We now intercept all URLs beginning with one of the following - * prefixes (and *only* these prefixes): - * * http://i.j.b/ - * * http://ijbswa.sf.net/config/ - * * http://ijbswa.sourceforge.net/config/ - * - New interceptors "home page" - go to http://i.j.b/ to see it. - * - Internal changes so that intercepted and fast redirect pages - * are not replaced with an image. - * - Interceptors now have the option to send a binary page direct - * to the client. (i.e. ijb-send-banner uses this) - * - Implemented show-url-info interceptor. (Which is why I needed - * the above interceptors changes - a typical URL is - * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". - * The previous mechanism would not have intercepted that, and - * if it had been intercepted then it then it would have replaced - * it with an image.) - * - * Revision 1.3 2001/05/26 01:26:34 jongfoster - * New #define, WIN_GUI_EDIT, enables the (embryonic) Win32 GUI editor. - * This #define cannot be set from ./configure - there's no point, it - * doesn't work yet. See feature request # 425722 - * - * Revision 1.2 2001/05/22 17:43:35 oes - * - * - Enabled filtering banners by size rather than URL - * by adding patterns that replace all standard banner - * sizes with the "Junkbuster" gif to the re_filterfile - * - * - Enabled filtering WebBugs by providing a pattern - * which kills all 1x1 images - * - * - Added support for PCRE_UNGREEDY behaviour to pcrs, - * which is selected by the (nonstandard and therefore - * capital) letter 'U' in the option string. - * It causes the quantifiers to be ungreedy by default. - * Appending a ? turns back to greedy (!). - * - * - Added a new interceptor ijb-send-banner, which - * sends back the "Junkbuster" gif. Without imagelist or - * MSIE detection support, or if tinygif = 1, or the - * URL isn't recognized as an imageurl, a lame HTML - * explanation is sent instead. - * - * - Added new feature, which permits blocking remote - * script redirects and firing back a local redirect - * to the browser. - * The feature is conditionally compiled, i.e. it - * can be disabled with --disable-fast-redirects, - * plus it must be activated by a "fast-redirects" - * line in the config file, has its own log level - * and of course wants to be displayed by show-proxy-args - * Note: Boy, all the #ifdefs in 1001 locations and - * all the fumbling with configure.in and acconfig.h - * were *way* more work than the feature itself :-( - * - * - Because a generic redirect template was needed for - * this, tinygif = 3 now uses the same. - * - * - Moved GIFs, and other static HTTP response templates - * to project.h - * - * - Many minor fixes - * - * - Removed some >400 CRs again (Jon, you really worked - * a lot! ;-) - * - * Revision 1.1.1.1 2001/05/15 13:58:45 oes - * Initial import of version 2.9.3 source tree - * - * - *********************************************************************/ - - -/* - * Version number - Major (X._._) - */ -#define VERSION_MAJOR 3 - -/* - * Version number - Minor (_.X._) - */ -#define VERSION_MINOR 0 - -/* - * Version number - Point (_._.X) - */ -#define VERSION_POINT 12 - -/* - * Version number, as a string - */ -#define VERSION "3.0.12" - -/* - * Status of the code: "alpha", "beta" or "stable". - */ -#define CODE_STATUS "stable" - -/* - * Should pcre be statically built in instead of linkling with libpcre? - * (This is determined by configure depending on the availiability of - * libpcre and user preferences). The name is ugly, but pcre needs it. - * Don't bother to change this here! Use configure instead. - */ -#define STATIC_PCRE 1 - -/* - * Should pcrs be statically built in instead of linkling with libpcrs? - * (This is determined by configure depending on the availiability of - * libpcrs and user preferences). - * Don't bother to change this here! Use configure instead. - */ -#define STATIC_PCRS 1 - -/* - * Allows the use of an ACL to control access to the proxy by IP address. - */ -#define FEATURE_ACL 1 - -/* - * Enables the web-based configuration (actionsfile) editor. If you - * have a shared proxy, you might want to turn this off. - */ -#define FEATURE_CGI_EDIT_ACTIONS 1 - -/* - * Allows the use of jar files to capture cookies. - */ -/* #undef FEATURE_COOKIE_JAR */ - -/* - * Locally redirect remote script-redirect URLs - */ -#define FEATURE_FAST_REDIRECTS 1 - -/* - * Bypass filtering for 1 page only - */ -#define FEATURE_FORCE_LOAD 1 - -/* - * Allow blocking using images as well as HTML. - * If you do not define this then everything is blocked as HTML. - * - * Note that this is required if you want to use FEATURE_IMAGE_DETECT_MSIE. - */ -#define FEATURE_IMAGE_BLOCKING 1 - -/* - * Detect image requests automatically for MSIE. Will fall back to - * other image-detection methods (i.e. "+image" permission) for other - * browsers. - * - * You must also define FEATURE_IMAGE_BLOCKING to use this feature. - * - * It detects the following header pair as an image request: - * - * User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) - * Accept: * / * - * - * And the following as a HTML request: - * - * User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) - * Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, * / * - * - * And no, I haven't got that backwards - IE is being wierd. - * - * Known limitations: - * 1) If you press shift-reload on a blocked HTML page, you get - * the image "blocked" page, not the HTML "blocked" page. - * 2) Once an image "blocked" page has been sent, viewing it - * in it's own browser window *should* bring up the HTML - * "blocked" page, but it doesn't. You need to clear the - * browser cache to get the HTML version again. - * - * These limitations are due to IE making inconsistent choices - * about which "Accept:" header to send. - */ -/* #undef FEATURE_IMAGE_DETECT_MSIE */ - -/* - * Kills JavaScript popups - window.open, onunload, etc. - */ -/* #undef FEATURE_KILL_POPUPS */ - -/* - * Use PNG instead of GIF for built-in images - */ -/* #undef FEATURE_NO_GIFS */ - -/* - * Allow to shutdown Privoxy through the webinterface. - */ -/* #undef FEATURE_GRACEFUL_TERMINATION */ - -/* - * Allow PCRE syntax in host patterns. - */ -/* #undef FEATURE_EXTENDED_HOST_PATTERNS */ - -/* - * Keep outgoing connections alive if possible. - */ -#define FEATURE_CONNECTION_KEEP_ALIVE 1 - -/* - * Use POSIX threads instead of native threads. - */ -#define FEATURE_PTHREAD 1 - -/* - * Enables statistics function. - */ -#define FEATURE_STATISTICS 1 - -/* - * Allow Privoxy to be "disabled" so it is just a normal non-blocking - * non-anonymizing proxy. This is useful if you're trying to access a - * blocked or broken site - just change the setting in the config file, - * or use the handy "Disable" menu option in the Windows GUI. - */ -#define FEATURE_TOGGLE 1 - -/* - * Allows the use of trust files. - */ -#define FEATURE_TRUST 1 - -/* - * Defined on Solaris only. Makes the system libraries thread safe. - */ -/* #undef _REENTRANT */ - -/* - * Defined on Solaris only. Without this, many important functions are not - * defined in the system headers. - */ -/* #undef __EXTENSIONS__ */ - -/* - * Defined always. - * FIXME: Don't know what it does or why we need it. - * (presumably something to do with MultiThreading?) - */ -#define __MT__ 1 - -/* If the (nonstandard and thread-safe) function gethostbyname_r - * is available, select which signature to use - */ -#define HAVE_GETHOSTBYNAME_R_6_ARGS 1 -/* #undef HAVE_GETHOSTBYNAME_R_5_ARGS */ -/* #undef HAVE_GETHOSTBYNAME_R_3_ARGS */ - -/* If the (nonstandard and thread-safe) function gethostbyaddr_r - * is available, select which signature to use - */ -/* #undef HAVE_GETHOSTBYADDR_R_8_ARGS */ -/* #undef HAVE_GETHOSTBYADDR_R_7_ARGS */ -/* #undef HAVE_GETHOSTBYADDR_R_5_ARGS */ - -/* Defined if you have gmtime_r and localtime_r with a signature - * of (struct time *, struct tm *) - */ -#define HAVE_GMTIME_R 1 -#define HAVE_LOCALTIME_R 1 - -/* Define to 'int' if doesn't have it. - */ -/* #undef socklen_t */ - -/* Define if pcre.h must be included as - */ -/* #undef PCRE_H_IN_SUBDIR */ - -/* Define if pcreposix.h must be included as - */ -/* #undef PCREPOSIX_H_IN_SUBDIR */ - - -/* Define to 1 to use compression through the zlib library. */ -#define FEATURE_ZLIB 1 - -/* Define to 1 if you have the `access' function. */ -#define HAVE_ACCESS 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ARPA_INET_H 1 - -/* Define to 1 if you have the `atexit' function. */ -#define HAVE_ATEXIT 1 - -/* Define to 1 if you have the `bcopy' function. */ -#define HAVE_BCOPY 1 - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#define HAVE_DIRENT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ERRNO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* Define to 1 if you have the `getcwd' function. */ -#define HAVE_GETCWD 1 - -/* Define to 1 if you have the `gethostbyaddr' function. */ -#define HAVE_GETHOSTBYADDR 1 - -/* Define to 1 if you have the `gethostbyaddr_r' function. */ -/* #undef HAVE_GETHOSTBYADDR_R */ - -/* Define to 1 if you have the `gethostbyname' function. */ -#define HAVE_GETHOSTBYNAME 1 - -/* Define to 1 if you have the `gethostbyname_r' function. */ -#define HAVE_GETHOSTBYNAME_R 1 - -/* Define to 1 if you have the `gettimeofday' function. */ -#define HAVE_GETTIMEOFDAY 1 - -/* Define to 1 if you have the `inet_ntoa' function. */ -#define HAVE_INET_NTOA 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the `nsl' library (-lnsl). */ -/* #undef HAVE_LIBNSL */ - -/* Define to 1 if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LOCALE_H 1 - -/* Define to 1 if you have the `localtime_r' function. */ -#define HAVE_LOCALTIME_R 1 - -/* Define to 1 if you have the `memchr' function. */ -#define HAVE_MEMCHR 1 - -/* Define to 1 if you have the `memmove' function. */ -#define HAVE_MEMMOVE 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the `memset' function. */ -#define HAVE_MEMSET 1 - -/* Define to 1 if you have the header file, and it defines `DIR'. */ -/* #undef HAVE_NDIR_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_NETDB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NETINET_IN_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_OS_H */ - -/* Define to 1 if you have the `poll' function. */ -#define HAVE_POLL 1 - -/* Define to 1 if you have the `putenv' function. */ -#define HAVE_PUTENV 1 - -/* Define to 1 if you have the `random' function. */ -/* #undef HAVE_RANDOM */ - -/* Define to 1 if you have the `regcomp' function. */ -#define HAVE_REGCOMP 1 - -/* Define to 1 if you have the `select' function. */ -#define HAVE_SELECT 1 - -/* Define to 1 if you have the `setlocale' function. */ -#define HAVE_SETLOCALE 1 - -/* Define to 1 if you have the `snprintf' function. */ -#define HAVE_SNPRINTF 1 - -/* Define to 1 if you have the `socket' function. */ -#define HAVE_SOCKET 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDDEF_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the `strchr' function. */ -#define HAVE_STRCHR 1 - -/* Define to 1 if you have the `strdup' function. */ -#define HAVE_STRDUP 1 - -/* Define to 1 if you have the `strerror' function. */ -#define HAVE_STRERROR 1 - -/* Define to 1 if you have the `strftime' function. */ -#define HAVE_STRFTIME 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the `strlcat' function. */ -#define HAVE_STRLCAT 1 - -/* Define to 1 if you have the `strlcpy' function. */ -#define HAVE_STRLCPY 1 - -/* Define to 1 if you have the `strptime' function. */ -#define HAVE_STRPTIME 1 - -/* Define to 1 if you have the `strstr' function. */ -#define HAVE_STRSTR 1 - -/* Define to 1 if you have the `strtoul' function. */ -#define HAVE_STRTOUL 1 - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -/* #undef HAVE_SYS_DIR_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_IOCTL_H 1 - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -/* #undef HAVE_SYS_NDIR_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SOCKET_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TIMEB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_WAIT_H 1 - -/* Define to 1 if you have the `timegm' function. */ -/* #undef HAVE_TIMEGM */ - -/* Define to 1 if you have the `tzset' function. */ -#define HAVE_TZSET 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define as the return type of signal handlers (`int' or `void'). */ -#define RETSIGTYPE void - -/* Define to 1 if the `setpgrp' function takes no argument. */ -#define SETPGRP_VOID 1 - -/* The size of `char *', as computed by sizeof. */ -#define SIZEOF_CHAR_P 4 - -/* The size of `int', as computed by sizeof. */ -#define SIZEOF_INT 4 - -/* The size of `long', as computed by sizeof. */ -#define SIZEOF_LONG 4 - -/* The size of `long long', as computed by sizeof. */ -#define SIZEOF_LONG_LONG 8 - -/* The size of `size_t', as computed by sizeof. */ -#define SIZEOF_SIZE_T 4 - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define to 1 if you can safely include both and . */ -#define TIME_WITH_SYS_TIME 1 - -/* Define to 1 if your declares `struct tm'. */ -/* #undef TM_IN_SYS_TIME */ - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define to `int' if does not define. */ -/* #undef pid_t */ - -/* Define to `unsigned int' if does not define. */ -/* #undef size_t */ - -/* Define to 'int' if doesn't have it. */ -/* #undef socklen_t */ - -/* - * Defined always. - * FIXME: Don't know what it does or why we need it. - * (presumably something to do with ANSI Standard C?) - */ -#ifndef __STDC__ -#define __STDC__ 1 -#endif /* ndef __STDC__ */ - -/* - * Need to set up this define only for the Pthreads library for - * Win32, available from http://sources.redhat.com/pthreads-win32/ - */ -#if defined(FEATURE_PTHREAD) && defined(_WIN32) -#define __CLEANUP_C -#endif /* defined(FEATURE_PTHREAD) && defined(_WIN32) */ - -/* - * BEOS does not currently support POSIX threads. - * This *should* be detected by ./configure, but let's be sure. - */ -#if defined(FEATURE_PTHREAD) && defined(__BEOS__) -#error BEOS does not support pthread - please run ./configure again with "--disable-pthread" - -#endif /* defined(FEATURE_PTHREAD) && defined(__BEOS__) */ - -/* - * On OpenBSD and maybe also FreeBSD, gcc doesn't define the cpp - * symbol unix; it defines __unix__ and sometimes not even that: - */ -#if ( defined(__unix__) || defined(__NetBSD__) ) && !defined(unix) -#define unix 1 -#endif - -/* - * It's too easy to accidentally use a Cygwin or MinGW32 version of config.h - * under VC++, and it usually gives many wierd error messages. Let's make - * the error messages understandable, by bailing out now. - */ -#ifdef _MSC_VER -#error For MS VC++, please use vc_config_winthreads.h or vc_config_pthreads.h. You can usually do this by selecting the "Build", "Clean" menu option. -#endif /* def _MSC_VER */ - -#endif /* CONFIG_H_INCLUDED */ diff --git a/external/privoxy/config.h.in b/external/privoxy/config.h.in deleted file mode 100644 index e8c87903..00000000 --- a/external/privoxy/config.h.in +++ /dev/null @@ -1,743 +0,0 @@ -/* config.h.in. Generated from configure.in by autoheader. */ -#ifndef CONFIG_H_INCLUDED -#define CONFIG_H_INCLUDED -/********************************************************************* - * - * File : $Source: /cvsroot/ijbswa/current/acconfig.h,v $ - * - * Purpose : This file should be the first thing included in every - * .c file. (Before even system headers). It contains - * #define statements for various features. It was - * introduced because the compile command line started - * getting ludicrously long with feature defines. - * - * Copyright : Written by and Copyright (C) 2001 the SourceForge - * Privoxy team. http://www.privoxy.org/ - * - * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and - * Junkbusters Corporation. http://www.junkbusters.com - * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General - * Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will - * be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * The GNU General Public License should be included with - * this file. If not, you can view it at - * http://www.gnu.org/copyleft/gpl.html - * or write to the Free Software Foundation, Inc., 59 - * Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Revisions : - * $Log: acconfig.h,v $ - * Revision 1.36 2008/10/18 11:17:52 fabiankeil - * Connection keep-alive support is ready for testing, - * allow enabling it through the configure script. - * - * Revision 1.35 2008/04/06 15:18:33 fabiankeil - * Oh well, rename the --enable-pcre-host-patterns option to - * --enable-extended-host-patterns as it's not really PCRE syntax. - * - * Revision 1.34 2008/04/06 14:54:26 fabiankeil - * Use PCRE syntax in host patterns when configured - * with --enable-pcre-host-patterns. - * - * Revision 1.33 2006/12/17 19:15:26 fabiankeil - * Added ./configure switch for FEATURE_GRACEFUL_TERMINATION. - * - * Revision 1.32 2006/07/18 14:48:45 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.27.2.4 2003/12/17 16:34:40 oes - * Cosmetics - * - * Revision 1.27.2.3 2003/03/27 16:03:19 oes - * Another shot at Bug #707467 - * - * Revision 1.27.2.2 2003/03/21 14:39:12 oes - * Presumably fixed Bug #707467 by defining unix ifdef __unix__ - * - * Revision 1.27.2.1 2002/08/10 11:22:31 oes - * - Add two AC_DEFINEs that indicate if the pcre*.h headers - * are located in a pcre/ subdir to the include path. - * - * Revision 1.27 2002/04/25 19:13:57 morcego - * Removed RPM release number declaration on configure.in - * Changed makefile to use given value for RPM_PACKAGEV when on uploading - * targets (will produce an error, explaining who to do it, if no value - * if provided). - * - * Revision 1.26 2002/04/11 11:00:21 oes - * Applied Moritz' fix for socklen_t on Solaris - * - * Revision 1.25 2002/04/06 20:38:01 jongfoster - * Renaming VC++ versions of config.h - * - * Revision 1.24 2002/04/04 00:36:36 gliptak - * always use pcre for matching - * - * Revision 1.23 2002/04/03 22:28:03 gliptak - * Removed references to gnu_regex - * - * Revision 1.22 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.21 2002/03/24 14:31:08 swa - * remove more crappy files. set RPM - * release version correctly. - * - * Revision 1.20 2002/03/24 13:46:44 swa - * name change related issue. - * - * Revision 1.19 2002/03/24 13:25:42 swa - * name change related issues - * - * Revision 1.18 2002/03/08 16:40:28 oes - * Added FEATURE_NO_GIFS - * - * Revision 1.17 2002/03/04 17:52:44 oes - * Deleted PID_FILE_PATH - * - * Revision 1.16 2002/01/10 12:36:18 oes - * Moved HAVE_*_R to acconfig.h, where they belong. - * - * Revision 1.15 2001/12/30 14:07:31 steudten - * - Add signal handling (unix) - * - Add SIGHUP handler (unix) - * - Add creation of pidfile (unix) - * - Add action 'top' in rc file (RH) - * - Add entry 'SIGNALS' to manpage - * - Add exit message to logfile (unix) - * - * Revision 1.14 2001/10/23 21:24:09 jongfoster - * Support for FEATURE_CGI_EDIT_ACTIONS - * - * Revision 1.13 2001/10/07 15:30:41 oes - * Removed FEATURE_DENY_GZIP - * - * Revision 1.12 2001/09/13 19:56:37 jongfoster - * Reverting to revision 1.10 - previous checking was majorly broken. - * - * Revision 1.10 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.9 2001/07/29 19:08:52 jongfoster - * Changing _CONFIG_H to CONFIG_H_INCLUDED. - * Also added protection against using a MinGW32 or CygWin version of - * config.h from within MS Visual C++ - * - * Revision 1.8 2001/07/29 17:09:17 jongfoster - * Major changes to build system in order to fix these bugs: - * - pthreads under Linux was broken - changed -lpthread to -pthread - * - Compiling in MinGW32 mode under CygWin now correctly detects - * which shared libraries are available - * - Solaris support (?) (Not tested under Solaris yet) - * - * Revision 1.7 2001/07/25 22:53:59 jongfoster - * Will #error if pthreads is enabled under BeOs - * - * Revision 1.6 2001/07/15 17:54:29 jongfoster - * Renaming #define STATIC to STATIC_PCRE - * Adding new #define FEATURE_PTHREAD that will be used to enable - * POSIX threads support. - * - * Revision 1.5 2001/07/13 13:48:37 oes - * - (Fix:) Copied CODE_STATUS #define from config.h.in - * - split REGEX #define into REGEX_GNU and REGEX_PCRE - * and removed PCRE. - * (REGEX = REGEX_GNU || REGEX_PCRE per project.h) - * - Moved STATIC (for pcre) here from Makefile.in - * - Introduced STATIC_PCRS #define to allow for dynaimc linking with - * libpcrs - * - Removed PCRS #define, since pcrs is now needed for CGI anyway - * - * Revision 1.4 2001/05/29 09:50:24 jongfoster - * Unified blocklist/imagelist/permissionslist. - * File format is still under discussion, but the internal changes - * are (mostly) done. - * - * Also modified interceptor behaviour: - * - We now intercept all URLs beginning with one of the following - * prefixes (and *only* these prefixes): - * * http://i.j.b/ - * * http://ijbswa.sf.net/config/ - * * http://ijbswa.sourceforge.net/config/ - * - New interceptors "home page" - go to http://i.j.b/ to see it. - * - Internal changes so that intercepted and fast redirect pages - * are not replaced with an image. - * - Interceptors now have the option to send a binary page direct - * to the client. (i.e. ijb-send-banner uses this) - * - Implemented show-url-info interceptor. (Which is why I needed - * the above interceptors changes - a typical URL is - * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". - * The previous mechanism would not have intercepted that, and - * if it had been intercepted then it then it would have replaced - * it with an image.) - * - * Revision 1.3 2001/05/26 01:26:34 jongfoster - * New #define, WIN_GUI_EDIT, enables the (embryonic) Win32 GUI editor. - * This #define cannot be set from ./configure - there's no point, it - * doesn't work yet. See feature request # 425722 - * - * Revision 1.2 2001/05/22 17:43:35 oes - * - * - Enabled filtering banners by size rather than URL - * by adding patterns that replace all standard banner - * sizes with the "Junkbuster" gif to the re_filterfile - * - * - Enabled filtering WebBugs by providing a pattern - * which kills all 1x1 images - * - * - Added support for PCRE_UNGREEDY behaviour to pcrs, - * which is selected by the (nonstandard and therefore - * capital) letter 'U' in the option string. - * It causes the quantifiers to be ungreedy by default. - * Appending a ? turns back to greedy (!). - * - * - Added a new interceptor ijb-send-banner, which - * sends back the "Junkbuster" gif. Without imagelist or - * MSIE detection support, or if tinygif = 1, or the - * URL isn't recognized as an imageurl, a lame HTML - * explanation is sent instead. - * - * - Added new feature, which permits blocking remote - * script redirects and firing back a local redirect - * to the browser. - * The feature is conditionally compiled, i.e. it - * can be disabled with --disable-fast-redirects, - * plus it must be activated by a "fast-redirects" - * line in the config file, has its own log level - * and of course wants to be displayed by show-proxy-args - * Note: Boy, all the #ifdefs in 1001 locations and - * all the fumbling with configure.in and acconfig.h - * were *way* more work than the feature itself :-( - * - * - Because a generic redirect template was needed for - * this, tinygif = 3 now uses the same. - * - * - Moved GIFs, and other static HTTP response templates - * to project.h - * - * - Many minor fixes - * - * - Removed some >400 CRs again (Jon, you really worked - * a lot! ;-) - * - * Revision 1.1.1.1 2001/05/15 13:58:45 oes - * Initial import of version 2.9.3 source tree - * - * - *********************************************************************/ - - -/* - * Version number - Major (X._._) - */ -#undef VERSION_MAJOR - -/* - * Version number - Minor (_.X._) - */ -#undef VERSION_MINOR - -/* - * Version number - Point (_._.X) - */ -#undef VERSION_POINT - -/* - * Version number, as a string - */ -#undef VERSION - -/* - * Status of the code: "alpha", "beta" or "stable". - */ -#undef CODE_STATUS - -/* - * Should pcre be statically built in instead of linkling with libpcre? - * (This is determined by configure depending on the availiability of - * libpcre and user preferences). The name is ugly, but pcre needs it. - * Don't bother to change this here! Use configure instead. - */ -#undef STATIC_PCRE - -/* - * Should pcrs be statically built in instead of linkling with libpcrs? - * (This is determined by configure depending on the availiability of - * libpcrs and user preferences). - * Don't bother to change this here! Use configure instead. - */ -#undef STATIC_PCRS - -/* - * Allows the use of an ACL to control access to the proxy by IP address. - */ -#undef FEATURE_ACL - -/* - * Enables the web-based configuration (actionsfile) editor. If you - * have a shared proxy, you might want to turn this off. - */ -#undef FEATURE_CGI_EDIT_ACTIONS - -/* - * Allows the use of jar files to capture cookies. - */ -#undef FEATURE_COOKIE_JAR - -/* - * Locally redirect remote script-redirect URLs - */ -#undef FEATURE_FAST_REDIRECTS - -/* - * Bypass filtering for 1 page only - */ -#undef FEATURE_FORCE_LOAD - -/* - * Allow blocking using images as well as HTML. - * If you do not define this then everything is blocked as HTML. - * - * Note that this is required if you want to use FEATURE_IMAGE_DETECT_MSIE. - */ -#undef FEATURE_IMAGE_BLOCKING - -/* - * Detect image requests automatically for MSIE. Will fall back to - * other image-detection methods (i.e. "+image" permission) for other - * browsers. - * - * You must also define FEATURE_IMAGE_BLOCKING to use this feature. - * - * It detects the following header pair as an image request: - * - * User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) - * Accept: * / * - * - * And the following as a HTML request: - * - * User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) - * Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, * / * - * - * And no, I haven't got that backwards - IE is being wierd. - * - * Known limitations: - * 1) If you press shift-reload on a blocked HTML page, you get - * the image "blocked" page, not the HTML "blocked" page. - * 2) Once an image "blocked" page has been sent, viewing it - * in it's own browser window *should* bring up the HTML - * "blocked" page, but it doesn't. You need to clear the - * browser cache to get the HTML version again. - * - * These limitations are due to IE making inconsistent choices - * about which "Accept:" header to send. - */ -#undef FEATURE_IMAGE_DETECT_MSIE - -/* - * Kills JavaScript popups - window.open, onunload, etc. - */ -#undef FEATURE_KILL_POPUPS - -/* - * Use PNG instead of GIF for built-in images - */ -#undef FEATURE_NO_GIFS - -/* - * Allow to shutdown Privoxy through the webinterface. - */ -#undef FEATURE_GRACEFUL_TERMINATION - -/* - * Allow PCRE syntax in host patterns. - */ -#undef FEATURE_EXTENDED_HOST_PATTERNS - -/* - * Keep outgoing connections alive if possible. - */ -#undef FEATURE_CONNECTION_KEEP_ALIVE - -/* - * Use POSIX threads instead of native threads. - */ -#undef FEATURE_PTHREAD - -/* - * Enables statistics function. - */ -#undef FEATURE_STATISTICS - -/* - * Allow Privoxy to be "disabled" so it is just a normal non-blocking - * non-anonymizing proxy. This is useful if you're trying to access a - * blocked or broken site - just change the setting in the config file, - * or use the handy "Disable" menu option in the Windows GUI. - */ -#undef FEATURE_TOGGLE - -/* - * Allows the use of trust files. - */ -#undef FEATURE_TRUST - -/* - * Defined on Solaris only. Makes the system libraries thread safe. - */ -#undef _REENTRANT - -/* - * Defined on Solaris only. Without this, many important functions are not - * defined in the system headers. - */ -#undef __EXTENSIONS__ - -/* - * Defined always. - * FIXME: Don't know what it does or why we need it. - * (presumably something to do with MultiThreading?) - */ -#undef __MT__ - -/* If the (nonstandard and thread-safe) function gethostbyname_r - * is available, select which signature to use - */ -#undef HAVE_GETHOSTBYNAME_R_6_ARGS -#undef HAVE_GETHOSTBYNAME_R_5_ARGS -#undef HAVE_GETHOSTBYNAME_R_3_ARGS - -/* If the (nonstandard and thread-safe) function gethostbyaddr_r - * is available, select which signature to use - */ -#undef HAVE_GETHOSTBYADDR_R_8_ARGS -#undef HAVE_GETHOSTBYADDR_R_7_ARGS -#undef HAVE_GETHOSTBYADDR_R_5_ARGS - -/* Defined if you have gmtime_r and localtime_r with a signature - * of (struct time *, struct tm *) - */ -#undef HAVE_GMTIME_R -#undef HAVE_LOCALTIME_R - -/* Define to 'int' if doesn't have it. - */ -#undef socklen_t - -/* Define if pcre.h must be included as - */ -#undef PCRE_H_IN_SUBDIR - -/* Define if pcreposix.h must be included as - */ -#undef PCREPOSIX_H_IN_SUBDIR - - -/* Define to 1 to use compression through the zlib library. */ -#undef FEATURE_ZLIB - -/* Define to 1 if you have the `access' function. */ -#undef HAVE_ACCESS - -/* Define to 1 if you have the header file. */ -#undef HAVE_ARPA_INET_H - -/* Define to 1 if you have the `atexit' function. */ -#undef HAVE_ATEXIT - -/* Define to 1 if you have the `bcopy' function. */ -#undef HAVE_BCOPY - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_DIRENT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ERRNO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if you have the `getcwd' function. */ -#undef HAVE_GETCWD - -/* Define to 1 if you have the `gethostbyaddr' function. */ -#undef HAVE_GETHOSTBYADDR - -/* Define to 1 if you have the `gethostbyaddr_r' function. */ -#undef HAVE_GETHOSTBYADDR_R - -/* Define to 1 if you have the `gethostbyname' function. */ -#undef HAVE_GETHOSTBYNAME - -/* Define to 1 if you have the `gethostbyname_r' function. */ -#undef HAVE_GETHOSTBYNAME_R - -/* Define to 1 if you have the `gettimeofday' function. */ -#undef HAVE_GETTIMEOFDAY - -/* Define to 1 if you have the `inet_ntoa' function. */ -#undef HAVE_INET_NTOA - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `nsl' library (-lnsl). */ -#undef HAVE_LIBNSL - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LOCALE_H - -/* Define to 1 if you have the `localtime_r' function. */ -#undef HAVE_LOCALTIME_R - -/* Define to 1 if you have the `memchr' function. */ -#undef HAVE_MEMCHR - -/* Define to 1 if you have the `memmove' function. */ -#undef HAVE_MEMMOVE - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `memset' function. */ -#undef HAVE_MEMSET - -/* Define to 1 if you have the header file, and it defines `DIR'. */ -#undef HAVE_NDIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETDB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_OS_H - -/* Define to 1 if you have the `poll' function. */ -#undef HAVE_POLL - -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV - -/* Define to 1 if you have the `random' function. */ -#undef HAVE_RANDOM - -/* Define to 1 if you have the `regcomp' function. */ -#undef HAVE_REGCOMP - -/* Define to 1 if you have the `select' function. */ -#undef HAVE_SELECT - -/* Define to 1 if you have the `setlocale' function. */ -#undef HAVE_SETLOCALE - -/* Define to 1 if you have the `snprintf' function. */ -#undef HAVE_SNPRINTF - -/* Define to 1 if you have the `socket' function. */ -#undef HAVE_SOCKET - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDDEF_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - -/* Define to 1 if you have the `strdup' function. */ -#undef HAVE_STRDUP - -/* Define to 1 if you have the `strerror' function. */ -#undef HAVE_STRERROR - -/* Define to 1 if you have the `strftime' function. */ -#undef HAVE_STRFTIME - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strlcat' function. */ -#undef HAVE_STRLCAT - -/* Define to 1 if you have the `strlcpy' function. */ -#undef HAVE_STRLCPY - -/* Define to 1 if you have the `strptime' function. */ -#undef HAVE_STRPTIME - -/* Define to 1 if you have the `strstr' function. */ -#undef HAVE_STRSTR - -/* Define to 1 if you have the `strtoul' function. */ -#undef HAVE_STRTOUL - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_DIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_IOCTL_H - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_NDIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SOCKET_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIMEB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_WAIT_H - -/* Define to 1 if you have the `timegm' function. */ -#undef HAVE_TIMEGM - -/* Define to 1 if you have the `tzset' function. */ -#undef HAVE_TZSET - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define as the return type of signal handlers (`int' or `void'). */ -#undef RETSIGTYPE - -/* Define to 1 if the `setpgrp' function takes no argument. */ -#undef SETPGRP_VOID - -/* The size of `char *', as computed by sizeof. */ -#undef SIZEOF_CHAR_P - -/* The size of `int', as computed by sizeof. */ -#undef SIZEOF_INT - -/* The size of `long', as computed by sizeof. */ -#undef SIZEOF_LONG - -/* The size of `long long', as computed by sizeof. */ -#undef SIZEOF_LONG_LONG - -/* The size of `size_t', as computed by sizeof. */ -#undef SIZEOF_SIZE_T - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Define to 1 if your declares `struct tm'. */ -#undef TM_IN_SYS_TIME - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `int' if does not define. */ -#undef pid_t - -/* Define to `unsigned int' if does not define. */ -#undef size_t - -/* Define to 'int' if doesn't have it. */ -#undef socklen_t - -/* - * Defined always. - * FIXME: Don't know what it does or why we need it. - * (presumably something to do with ANSI Standard C?) - */ -#ifndef __STDC__ -#define __STDC__ 1 -#endif /* ndef __STDC__ */ - -/* - * Need to set up this define only for the Pthreads library for - * Win32, available from http://sources.redhat.com/pthreads-win32/ - */ -#if defined(FEATURE_PTHREAD) && defined(_WIN32) -#define __CLEANUP_C -#endif /* defined(FEATURE_PTHREAD) && defined(_WIN32) */ - -/* - * BEOS does not currently support POSIX threads. - * This *should* be detected by ./configure, but let's be sure. - */ -#if defined(FEATURE_PTHREAD) && defined(__BEOS__) -#error BEOS does not support pthread - please run ./configure again with "--disable-pthread" - -#endif /* defined(FEATURE_PTHREAD) && defined(__BEOS__) */ - -/* - * On OpenBSD and maybe also FreeBSD, gcc doesn't define the cpp - * symbol unix; it defines __unix__ and sometimes not even that: - */ -#if ( defined(__unix__) || defined(__NetBSD__) ) && !defined(unix) -#define unix 1 -#endif - -/* - * It's too easy to accidentally use a Cygwin or MinGW32 version of config.h - * under VC++, and it usually gives many wierd error messages. Let's make - * the error messages understandable, by bailing out now. - */ -#ifdef _MSC_VER -#error For MS VC++, please use vc_config_winthreads.h or vc_config_pthreads.h. You can usually do this by selecting the "Build", "Clean" menu option. -#endif /* def _MSC_VER */ - -#endif /* CONFIG_H_INCLUDED */ diff --git a/external/privoxy/config.orig b/external/privoxy/config.orig deleted file mode 100644 index 176dd5f6..00000000 --- a/external/privoxy/config.orig +++ /dev/null @@ -1,1530 +0,0 @@ -# Sample Configuration File for Privoxy v3.0.12 -# -# $Id: config,v 1.75 2009/03/21 11:35:37 hal9 Exp $ -# -# Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ -# -#################################################################### -# # -# Table of Contents # -# # -# I. INTRODUCTION # -# II. FORMAT OF THE CONFIGURATION FILE # -# # -# 1. LOCAL SET-UP DOCUMENTATION # -# 2. CONFIGURATION AND LOG FILE LOCATIONS # -# 3. DEBUGGING # -# 4. ACCESS CONTROL AND SECURITY # -# 5. FORWARDING # -# 6. WINDOWS GUI OPTIONS # -# # -#################################################################### -# -# -# I. INTRODUCTION -# =============== -# -# This file holds Privoxy's main configuration. Privoxy detects -# configuration changes automatically, so you don't have to restart -# it unless you want to load a different configuration file. -# -# The configuration will be reloaded with the first request after -# the change was done, this request itself will still use the old -# configuration, though. In other words: it takes two requests before -# you see the result of your changes. Requests that are dropped due -# to ACL don't trigger reloads. -# -# When starting Privoxy on Unix systems, give the location of this -# file as last argument. On Windows systems, Privoxy will look for -# this file with the name 'config.txt' in the current working directory -# of the Privoxy process. -# -# -# II. FORMAT OF THE CONFIGURATION FILE -# ==================================== -# -# Configuration lines consist of an initial keyword followed by a -# list of values, all separated by whitespace (any number of spaces -# or tabs). For example, -# -# actionsfile default.action -# -# Indicates that the actionsfile is named 'default.action'. -# -# The '#' indicates a comment. Any part of a line following a '#' -# is ignored, except if the '#' is preceded by a '\'. -# -# Thus, by placing a # at the start of an existing configuration -# line, you can make it a comment and it will be treated as if it -# weren't there. This is called "commenting out" an option and can -# be useful. Removing the # again is called "uncommenting". -# -# Note that commenting out an option and leaving it at its default -# are two completely different things! Most options behave very -# differently when unset. See the "Effect if unset" explanation in -# each option's description for details. -# -# Long lines can be continued on the next line by using a `\' as the -# last character. -# -# -# -# 1. LOCAL SET-UP DOCUMENTATION -# ============================== -# -# If you intend to operate Privoxy for more users than just yourself, -# it might be a good idea to let them know how to reach you, what -# you block and why you do that, your policies, etc. -# -# -# -# 1.1. user-manual -# ================= -# -# Specifies: -# -# Location of the Privoxy User Manual. -# -# Type of value: -# -# A fully qualified URI -# -# Default value: -# -# Unset -# -# Effect if unset: -# -# http://www.privoxy.org/version/user-manual/ will be used, -# where version is the Privoxy version. -# -# Notes: -# -# The User Manual URI is the single best source of information on -# Privoxy, and is used for help links from some of the internal -# CGI pages. The manual itself is normally packaged with the -# binary distributions, so you probably want to set this to a -# locally installed copy. -# -# Examples: -# -# The best all purpose solution is simply to put the full local -# PATH to where the User Manual is located: -# -# user-manual /usr/share/doc/privoxy/user-manual -# -# -# The User Manual is then available to anyone with -# access to Privoxy, by following the built-in URL: -# http://config.privoxy.org/user-manual/ (or the shortcut: -# http://p.p/user-manual/). -# -# If the documentation is not on the local system, it can be -# accessed from a remote server, as: -# -# user-manual http://example.com/privoxy/user-manual/ -# -# -# WARNING!!! -# -# If set, this option should be the first option in the config -# file, because it is used while the config file is being read. -# -user-manual /home/halb/privoxy/share/doc/privoxy/user-manual/ -# -# -# 1.2. trust-info-url -# ==================== -# -# Specifies: -# -# A URL to be displayed in the error page that users will see if -# access to an untrusted page is denied. -# -# Type of value: -# -# URL -# -# Default value: -# -# Unset -# -# Effect if unset: -# -# No links are displayed on the "untrusted" error page. -# -# Notes: -# -# The value of this option only matters if the experimental trust -# mechanism has been activated. (See trustfile below.) -# -# If you use the trust mechanism, it is a good idea to write -# up some on-line documentation about your trust policy and to -# specify the URL(s) here. Use multiple times for multiple URLs. -# -# The URL(s) should be added to the trustfile as well, so users -# don't end up locked out from the information on why they were -# locked out in the first place! -# -#trust-info-url http://www.example.com/why_we_block.html -#trust-info-url http://www.example.com/what_we_allow.html -# -# -# 1.3. admin-address -# =================== -# -# Specifies: -# -# An email address to reach the Privoxy administrator. -# -# Type of value: -# -# Email address -# -# Default value: -# -# Unset -# -# Effect if unset: -# -# No email address is displayed on error pages and the CGI user -# interface. -# -# Notes: -# -# If both admin-address and proxy-info-url are unset, the whole -# "Local Privoxy Support" box on all generated pages will not -# be shown. -# -#admin-address privoxy-admin@example.com -# -# -# 1.4. proxy-info-url -# ==================== -# -# Specifies: -# -# A URL to documentation about the local Privoxy setup, -# configuration or policies. -# -# Type of value: -# -# URL -# -# Default value: -# -# Unset -# -# Effect if unset: -# -# No link to local documentation is displayed on error pages and -# the CGI user interface. -# -# Notes: -# -# If both admin-address and proxy-info-url are unset, the whole -# "Local Privoxy Support" box on all generated pages will not -# be shown. -# -# This URL shouldn't be blocked ;-) -# -#proxy-info-url http://www.example.com/proxy-service.html -# -# -# 2. CONFIGURATION AND LOG FILE LOCATIONS -# ======================================== -# -# Privoxy can (and normally does) use a number of other files for -# additional configuration, help and logging. This section of the -# configuration file tells Privoxy where to find those other files. -# -# The user running Privoxy, must have read permission for all -# configuration files, and write permission to any files that would -# be modified, such as log files and actions files. -# -# -# -# 2.1. confdir -# ============= -# -# Specifies: -# -# The directory where the other configuration files are located. -# -# Type of value: -# -# Path name -# -# Default value: -# -# /etc/privoxy (Unix) or Privoxy installation dir (Windows) -# -# Effect if unset: -# -# Mandatory -# -# Notes: -# -# No trailing "/", please. -# -confdir /home/halb/privoxy/etc -# -# -# 2.2. templdir -# ============== -# -# Specifies: -# -# An alternative directory where the templates are loaded from. -# -# Type of value: -# -# Path name -# -# Default value: -# -# unset -# -# Effect if unset: -# -# The templates are assumed to be located in confdir/template. -# -# Notes: -# -# Privoxy's original templates are usually overwritten with each -# update. Use this option to relocate customized templates that -# should be kept. As template variables might change between -# updates, you shouldn't expect templates to work with Privoxy -# releases other than the one they were part of, though. -# -#templdir . -# -# -# 2.3. logdir -# ============ -# -# Specifies: -# -# The directory where all logging takes place (i.e. where the -# logfile is located). -# -# Type of value: -# -# Path name -# -# Default value: -# -# /var/log/privoxy (Unix) or Privoxy installation dir (Windows) -# -# Effect if unset: -# -# Mandatory -# -# Notes: -# -# No trailing "/", please. -# -logdir /home/halb/privoxy/var/log/privoxy -# -# -# 2.4. actionsfile -# ================= -# -# Specifies: -# -# The actions file(s) to use -# -# Type of value: -# -# Complete file name, relative to confdir -# -# Default values: -# -# match-all.action # Actions that are applied to all sites and maybe overruled later on. -# -# default.action # Main actions file -# -# user.action # User customizations -# -# Effect if unset: -# -# No actions are taken at all. More or less neutral proxying. -# -# Notes: -# -# Multiple actionsfile lines are permitted, and are in fact -# recommended! -# -# The default values are default.action, which is the "main" -# actions file maintained by the developers, and user.action, -# where you can make your personal additions. -# -# Actions files contain all the per site and per URL configuration -# for ad blocking, cookie management, privacy considerations, -# etc. There is no point in using Privoxy without at least one -# actions file. -# -# Note that since Privoxy 3.0.7, the complete filename, including -# the ".action" extension has to be specified. The syntax change -# was necessary to be consistent with the other file options and -# to allow previously forbidden characters. -# -actionsfile match-all.action # Actions that are applied to all sites and maybe overruled later on. -actionsfile default.action # Main actions file -actionsfile user.action # User customizations -# -# -# 2.5. filterfile -# ================ -# -# Specifies: -# -# The filter file(s) to use -# -# Type of value: -# -# File name, relative to confdir -# -# Default value: -# -# default.filter (Unix) or default.filter.txt (Windows) -# -# Effect if unset: -# -# No textual content filtering takes place, i.e. all +filter{name} -# actions in the actions files are turned neutral. -# -# Notes: -# -# Multiple filterfile lines are permitted. -# -# The filter files contain content modification rules that use -# regular expressions. These rules permit powerful changes on the -# content of Web pages, and optionally the headers as well, e.g., -# you could try to disable your favorite JavaScript annoyances, -# re-write the actual displayed text, or just have some fun -# playing buzzword bingo with web pages. -# -# The +filter{name} actions rely on the relevant filter (name) -# to be defined in a filter file! -# -# A pre-defined filter file called default.filter that contains a -# number of useful filters for common problems is included in the -# distribution. See the section on the filter action for a list. -# -# It is recommended to place any locally adapted filters into a -# separate file, such as user.filter. -# -filterfile default.filter -#filterfile user.filter # User customizations -# -# -# 2.6. logfile -# ============= -# -# Specifies: -# -# The log file to use -# -# Type of value: -# -# File name, relative to logdir -# -# Default value: -# -# Unset (commented out). When activated: logfile (Unix) or -# privoxy.log (Windows). -# -# Effect if unset: -# -# No logfile is written. -# -# Notes: -# -# The logfile is where all logging and error messages are -# written. The level of detail and number of messages are set with -# the debug option (see below). The logfile can be useful for -# tracking down a problem with Privoxy (e.g., it's not blocking -# an ad you think it should block) and it can help you to monitor -# what your browser is doing. -# -# Depending on the debug options below, the logfile may be a -# privacy risk if third parties can get access to it. As most -# users will never look at it, Privoxy 3.0.7 and later only log -# fatal errors by default. -# -# For most troubleshooting purposes, you will have to change that, -# please refer to the debugging section for details. -# -# Your logfile will grow indefinitely, and you will probably -# want to periodically remove it. On Unix systems, you can do -# this with a cron job (see "man cron"). For Red Hat based Linux -# distributions, a logrotate script has been included. -# -# Any log files must be writable by whatever user Privoxy is -# being run as (on Unix, default user id is "privoxy"). -# -logfile logfile -# -# -# 2.7. trustfile -# =============== -# -# Specifies: -# -# The name of the trust file to use -# -# Type of value: -# -# File name, relative to confdir -# -# Default value: -# -# Unset (commented out). When activated: trust (Unix) or trust.txt -# (Windows) -# -# Effect if unset: -# -# The entire trust mechanism is disabled. -# -# Notes: -# -# The trust mechanism is an experimental feature for building -# white-lists and should be used with care. It is NOT recommended -# for the casual user. -# -# If you specify a trust file, Privoxy will only allow access to -# sites that are specified in the trustfile. Sites can be listed -# in one of two ways: -# -# Prepending a ~ character limits access to this site only (and -# any sub-paths within this site), e.g. ~www.example.com allows -# access to ~www.example.com/ features/news.html, etc. -# -# Or, you can designate sites as trusted referrers, by prepending -# the name with a + character. The effect is that access to -# untrusted sites will be granted -- but only if a link from -# this trusted referrer was used to get there. The link target -# will then be added to the "trustfile" so that future, direct -# accesses will be granted. Sites added via this mechanism do -# not become trusted referrers themselves (i.e. they are added -# with a ~ designation). There is a limit of 512 such entries, -# after which new entries will not be made. -# -# If you use the + operator in the trust file, it may grow -# considerably over time. -# -# It is recommended that Privoxy be compiled with the -# --disable-force, --disable-toggle and --disable-editor options, -# if this feature is to be used. -# -# Possible applications include limiting Internet access for -# children. -# -#trustfile trust -# -# -# 3. DEBUGGING -# ============= -# -# These options are mainly useful when tracing a problem. Note that -# you might also want to invoke Privoxy with the --no-daemon command -# line option when debugging. -# -# -# -# 3.1. debug -# =========== -# -# Specifies: -# -# Key values that determine what information gets logged. -# -# Type of value: -# -# Integer values -# -# Default value: -# -# 0 (i.e.: only fatal errors (that cause Privoxy to exit) are logged) -# -# Effect if unset: -# -# Default value is used (see above). -# -# Notes: -# -# The available debug levels are: -# -# debug 1 # Log the destination for each request Privoxy let through. See also debug 1024. -# debug 2 # show each connection status -# debug 4 # show I/O status -# debug 8 # show header parsing -# debug 16 # log all data written to the network into the logfile -# debug 32 # debug force feature -# debug 64 # debug regular expression filters -# debug 128 # debug redirects -# debug 256 # debug GIF de-animation -# debug 512 # Common Log Format -# debug 1024 # Log the destination for requests Privoxy didn't let through, and the reason why. -# debug 2048 # CGI user interface -# debug 4096 # Startup banner and warnings. -# debug 8192 # Non-fatal errors -# -# -# To select multiple debug levels, you can either add them or -# use multiple debug lines. -# -# A debug level of 1 is informative because it will show you each -# request as it happens. 1, 4096 and 8192 are recommended so that -# you will notice when things go wrong. The other levels are -# probably only of interest if you are hunting down a specific -# problem. They can produce a hell of an output (especially 16). -# -# Privoxy used to ship with the debug levels recommended above -# enabled by default, but due to privacy concerns 3.0.7 and later -# are configured to only log fatal errors. -# -# If you are used to the more verbose settings, simply enable -# the debug lines below again. -# -# If you want to use pure CLF (Common Log Format), you should set -# "debug 512" ONLY and not enable anything else. -# -# Privoxy has a hard-coded limit for the length of log messages. If -# it's reached, messages are logged truncated and marked with -# "... [too long, truncated]". -# -# Please don't file any support requests without trying to -# reproduce the problem with increased debug level first. Once -# you read the log messages, you may even be able to solve the -# problem on your own. -# -#debug 1 # Log the destination for each request Privoxy let through. -#debug 1024 # Log the destination for requests Privoxy didn't let through, and the reason why. -#debug 4096 # Startup banner and warnings -#debug 8192 # Non-fatal errors -# -# -# 3.2. single-threaded -# ===================== -# -# Specifies: -# -# Whether to run only one server thread. -# -# Type of value: -# -# None -# -# Default value: -# -# Unset -# -# Effect if unset: -# -# Multi-threaded (or, where unavailable: forked) operation, -# i.e. the ability to serve multiple requests simultaneously. -# -# Notes: -# -# This option is only there for debugging purposes. It will -# drastically reduce performance. -# -#single-threaded -# -# -# 3.3. hostname -# ============== -# -# Specifies: -# -# The hostname shown on the CGI pages. -# -# Type of value: -# -# Text -# -# Default value: -# -# Unset -# -# Effect if unset: -# -# The hostname provided by the operating system is used. -# -# Notes: -# -# On some misconfigured systems resolving the hostname fails or -# takes too much time and slows Privoxy down. Setting a fixed -# hostname works around the problem. -# -# In other circumstances it might be desirable to show a hostname -# other than the one returned by the operating system. For example -# if the system has several different hostnames and you don't -# want to use the first one. -# -# Note that Privoxy does not validate the specified hostname value. -# -#hostname hostname.example.org -# -# -# 4. ACCESS CONTROL AND SECURITY -# =============================== -# -# This section of the config file controls the security-relevant -# aspects of Privoxy's configuration. -# -# -# -# 4.1. listen-address -# ==================== -# -# Specifies: -# -# The IP address and TCP port on which Privoxy will listen for -# client requests. -# -# Type of value: -# -# [IP-Address]:Port -# -# Default value: -# -# 127.0.0.1:8118 -# -# Effect if unset: -# -# Bind to 127.0.0.1 (localhost), port 8118. This is suitable and -# recommended for home users who run Privoxy on the same machine -# as their browser. -# -# Notes: -# -# You will need to configure your browser(s) to this proxy address -# and port. -# -# If you already have another service running on port 8118, or -# if you want to serve requests from other machines (e.g. on your -# local network) as well, you will need to override the default. -# -# If you leave out the IP address, Privoxy will bind to all -# interfaces (addresses) on your machine and may become reachable -# from the Internet. In that case, consider using access control -# lists (ACL's, see below), and/or a firewall. -# -# If you open Privoxy to untrusted users, you will also -# want to make sure that the following actions are disabled: -# enable-edit-actions and enable-remote-toggle -# -# Example: -# -# Suppose you are running Privoxy on a machine which has the -# address 192.168.0.1 on your local private network (192.168.0.0) -# and has another outside connection with a different address. You -# want it to serve requests from inside only: -# -# listen-address 192.168.0.1:8118 -# -# -listen-address 127.0.0.1:8118 -# -# -# 4.2. toggle -# ============ -# -# Specifies: -# -# Initial state of "toggle" status -# -# Type of value: -# -# 1 or 0 -# -# Default value: -# -# 1 -# -# Effect if unset: -# -# Act as if toggled on -# -# Notes: -# -# If set to 0, Privoxy will start in "toggled off" mode, -# i.e. mostly behave like a normal, content-neutral proxy -# with both ad blocking and content filtering disabled. See -# enable-remote-toggle below. -# -# The windows version will only display the toggle icon in the -# system tray if this option is present. -# -toggle 1 -# -# -# 4.3. enable-remote-toggle -# ========================== -# -# Specifies: -# -# Whether or not the web-based toggle feature may be used -# -# Type of value: -# -# 0 or 1 -# -# Default value: -# -# 0 -# -# Effect if unset: -# -# The web-based toggle feature is disabled. -# -# Notes: -# -# When toggled off, Privoxy mostly acts like a normal, -# content-neutral proxy, i.e. doesn't block ads or filter content. -# -# Access to the toggle feature can not be controlled separately by -# "ACLs" or HTTP authentication, so that everybody who can access -# Privoxy (see "ACLs" and listen-address above) can toggle it -# for all users. So this option is not recommended for multi-user -# environments with untrusted users. -# -# Note that malicious client side code (e.g Java) is also capable -# of using this option. -# -# As a lot of Privoxy users don't read documentation, this feature -# is disabled by default. -# -# Note that you must have compiled Privoxy with support for this -# feature, otherwise this option has no effect. -# -enable-remote-toggle 0 -# -# -# 4.4. enable-remote-http-toggle -# =============================== -# -# Specifies: -# -# Whether or not Privoxy recognizes special HTTP headers to change -# its behaviour. -# -# Type of value: -# -# 0 or 1 -# -# Default value: -# -# 0 -# -# Effect if unset: -# -# Privoxy ignores special HTTP headers. -# -# Notes: -# -# When toggled on, the client can change Privoxy's behaviour by -# setting special HTTP headers. Currently the only supported -# special header is "X-Filter: No", to disable filtering for -# the ongoing request, even if it is enabled in one of the -# action files. -# -# This feature is disabled by default. If you are using Privoxy in -# a environment with trusted clients, you may enable this feature -# at your discretion. Note that malicious client side code (e.g -# Java) is also capable of using this feature. -# -# This option will be removed in future releases as it has been -# obsoleted by the more general header taggers. -# -enable-remote-http-toggle 0 -# -# -# 4.5. enable-edit-actions -# ========================= -# -# Specifies: -# -# Whether or not the web-based actions file editor may be used -# -# Type of value: -# -# 0 or 1 -# -# Default value: -# -# 0 -# -# Effect if unset: -# -# The web-based actions file editor is disabled. -# -# Notes: -# -# Access to the editor can not be controlled separately by -# "ACLs" or HTTP authentication, so that everybody who can access -# Privoxy (see "ACLs" and listen-address above) can modify its -# configuration for all users. -# -# This option is not recommended for environments with untrusted -# users and as a lot of Privoxy users don't read documentation, -# this feature is disabled by default. -# -# Note that malicious client side code (e.g Java) is also capable -# of using the actions editor and you shouldn't enable this -# options unless you understand the consequences and are sure -# your browser is configured correctly. -# -# Note that you must have compiled Privoxy with support for this -# feature, otherwise this option has no effect. -# -enable-edit-actions 0 -# -# -# 4.6. enforce-blocks -# ==================== -# -# Specifies: -# -# Whether the user is allowed to ignore blocks and can "go there -# anyway". -# -# Type of value: -# -# 0 or 1 -# -# Default value: -# -# 0 -# -# Effect if unset: -# -# Blocks are not enforced. -# -# Notes: -# -# Privoxy is mainly used to block and filter requests as a service -# to the user, for example to block ads and other junk that clogs -# the pipes. Privoxy's configuration isn't perfect and sometimes -# innocent pages are blocked. In this situation it makes sense to -# allow the user to enforce the request and have Privoxy ignore -# the block. -# -# In the default configuration Privoxy's "Blocked" page contains -# a "go there anyway" link to adds a special string (the force -# prefix) to the request URL. If that link is used, Privoxy -# will detect the force prefix, remove it again and let the -# request pass. -# -# Of course Privoxy can also be used to enforce a network -# policy. In that case the user obviously should not be able to -# bypass any blocks, and that's what the "enforce-blocks" option -# is for. If it's enabled, Privoxy hides the "go there anyway" -# link. If the user adds the force prefix by hand, it will not -# be accepted and the circumvention attempt is logged. -# -# Examples: -# -# enforce-blocks 1 -# -enforce-blocks 0 -# -# -# 4.7. ACLs: permit-access and deny-access -# ========================================= -# -# Specifies: -# -# Who can access what. -# -# Type of value: -# -# src_addr[/src_masklen] [dst_addr[/dst_masklen]] -# -# Where src_addr and dst_addr are IP addresses in dotted decimal -# notation or valid DNS names, and src_masklen and dst_masklen are -# subnet masks in CIDR notation, i.e. integer values from 2 to 30 -# representing the length (in bits) of the network address. The -# masks and the whole destination part are optional. -# -# Default value: -# -# Unset -# -# Effect if unset: -# -# Don't restrict access further than implied by listen-address -# -# Notes: -# -# Access controls are included at the request of ISPs and systems -# administrators, and are not usually needed by individual -# users. For a typical home user, it will normally suffice to -# ensure that Privoxy only listens on the localhost (127.0.0.1) -# or internal (home) network address by means of the listen-address -# option. -# -# Please see the warnings in the FAQ that Privoxy is not intended -# to be a substitute for a firewall or to encourage anyone to -# defer addressing basic security weaknesses. -# -# Multiple ACL lines are OK. If any ACLs are specified, Privoxy -# only talks to IP addresses that match at least one permit-access -# line and don't match any subsequent deny-access line. In other -# words, the last match wins, with the default being deny-access. -# -# If Privoxy is using a forwarder (see forward below) for a -# particular destination URL, the dst_addr that is examined is -# the address of the forwarder and NOT the address of the ultimate -# target. This is necessary because it may be impossible for the -# local Privoxy to determine the IP address of the ultimate target -# (that's often what gateways are used for). -# -# You should prefer using IP addresses over DNS names, because -# the address lookups take time. All DNS names must resolve! You -# can not use domain patterns like "*.org" or partial domain -# names. If a DNS name resolves to multiple IP addresses, only -# the first one is used. -# -# Denying access to particular sites by ACL may have undesired -# side effects if the site in question is hosted on a machine -# which also hosts other sites (most sites are). -# -# Examples: -# -# Explicitly define the default behavior if no ACL and -# listen-address are set: "localhost" is OK. The absence of a -# dst_addr implies that all destination addresses are OK: -# -# permit-access localhost -# -# -# Allow any host on the same class C subnet as www.privoxy.org -# access to nothing but www.example.com (or other domains hosted -# on the same system): -# -# permit-access www.privoxy.org/24 www.example.com/32 -# -# -# Allow access from any host on the 26-bit subnet 192.168.45.64 to -# anywhere, with the exception that 192.168.45.73 may not access -# the IP address behind www.dirty-stuff.example.com: -# -# permit-access 192.168.45.64/26 -# deny-access 192.168.45.73 www.dirty-stuff.example.com -# -# -# -# 4.8. buffer-limit -# ================== -# -# Specifies: -# -# Maximum size of the buffer for content filtering. -# -# Type of value: -# -# Size in Kbytes -# -# Default value: -# -# 4096 -# -# Effect if unset: -# -# Use a 4MB (4096 KB) limit. -# -# Notes: -# -# For content filtering, i.e. the +filter and +deanimate-gif -# actions, it is necessary that Privoxy buffers the entire document -# body. This can be potentially dangerous, since a server could -# just keep sending data indefinitely and wait for your RAM to -# exhaust -- with nasty consequences. Hence this option. -# -# When a document buffer size reaches the buffer-limit, it is -# flushed to the client unfiltered and no further attempt to filter -# the rest of the document is made. Remember that there may be -# multiple threads running, which might require up to buffer-limit -# Kbytes each, unless you have enabled "single-threaded" above. -# -buffer-limit 4096 -# -# -# 5. FORWARDING -# ============== -# -# This feature allows routing of HTTP requests through a chain of -# multiple proxies. -# -# Forwarding can be used to chain Privoxy with a caching proxy to -# speed up browsing. Using a parent proxy may also be necessary if -# the machine that Privoxy runs on has no direct Internet access. -# -# Note that parent proxies can severely decrease your privacy -# level. For example a parent proxy could add your IP address to the -# request headers and if it's a caching proxy it may add the "Etag" -# header to revalidation requests again, even though you configured -# Privoxy to remove it. It may also ignore Privoxy's header time -# randomization and use the original values which could be used by -# the server as cookie replacement to track your steps between visits. -# -# Also specified here are SOCKS proxies. Privoxy supports the SOCKS -# 4 and SOCKS 4A protocols. -# -# -# -# 5.1. forward -# ============= -# -# Specifies: -# -# To which parent HTTP proxy specific requests should be routed. -# -# Type of value: -# -# target_pattern http_parent[:port] -# -# where target_pattern is a URL pattern that specifies to which -# requests (i.e. URLs) this forward rule shall apply. Use / -# to denote "all URLs". http_parent[:port] is the DNS name or -# IP address of the parent HTTP proxy through which the requests -# should be forwarded, optionally followed by its listening port -# (default: 8080). Use a single dot (.) to denote "no forwarding". -# -# Default value: -# -# Unset -# -# Effect if unset: -# -# Don't use parent HTTP proxies. -# -# Notes: -# -# If http_parent is ".", then requests are not forwarded to -# another HTTP proxy but are made directly to the web servers. -# -# Multiple lines are OK, they are checked in sequence, and the -# last match wins. -# -# Examples: -# -# Everything goes to an example parent proxy, except SSL on port -# 443 (which it doesn't handle): -# -# forward / parent-proxy.example.org:8080 -# forward :443 . -# -# -# Everything goes to our example ISP's caching proxy, except for -# requests to that ISP's sites: -# -# forward / caching-proxy.isp.example.net:8000 -# forward .isp.example.net . -# -# -# -# -# 5.2. forward-socks4, forward-socks4a and forward-socks5 -# ======================================================== -# -# Specifies: -# -# Through which SOCKS proxy (and optionally to which parent HTTP -# proxy) specific requests should be routed. -# -# Type of value: -# -# target_pattern socks_proxy[:port] http_parent[:port] -# -# where target_pattern is a URL pattern that specifies to which -# requests (i.e. URLs) this forward rule shall apply. Use / to -# denote "all URLs". http_parent and socks_proxy are IP addresses -# in dotted decimal notation or valid DNS names (http_parent may -# be "." to denote "no HTTP forwarding"), and the optional port -# parameters are TCP ports, i.e. integer values from 1 to 65535 -# -# Default value: -# -# Unset -# -# Effect if unset: -# -# Don't use SOCKS proxies. -# -# Notes: -# -# Multiple lines are OK, they are checked in sequence, and the -# last match wins. -# -# The difference between forward-socks4 and forward-socks4a -# is that in the SOCKS 4A protocol, the DNS resolution of the -# target hostname happens on the SOCKS server, while in SOCKS 4 -# it happens locally. -# -# With forward-socks5 the DNS resolution will happen on the remote -# server as well. -# -# If http_parent is ".", then requests are not forwarded to another -# HTTP proxy but are made (HTTP-wise) directly to the web servers, -# albeit through a SOCKS proxy. -# -# Examples: -# -# From the company example.com, direct connections are made to all -# "internal" domains, but everything outbound goes through their -# ISP's proxy by way of example.com's corporate SOCKS 4A gateway -# to the Internet. -# -# forward-socks4a / socks-gw.example.com:1080 www-cache.isp.example.net:8080 -# forward .example.com . -# -# -# A rule that uses a SOCKS 4 gateway for all destinations but no -# HTTP parent looks like this: -# -# forward-socks4 / socks-gw.example.com:1080 . -# -# -# To chain Privoxy and Tor, both running on the same system, -# you would use something like: -# -# forward-socks4a / 127.0.0.1:9050 . -# -# -# The public Tor network can't be used to reach your local network, -# if you need to access local servers you therefore might want -# to make some exceptions: -# -# forward 192.168.*.*/ . -# forward 10.*.*.*/ . -# forward 127.*.*.*/ . -# -# -# Unencrypted connections to systems in these address ranges will -# be as (un) secure as the local network is, but the alternative -# is that you can't reach the local network through Privoxy at -# all. Of course this may actually be desired and there is no -# reason to make these exceptions if you aren't sure you need them. -# -# If you also want to be able to reach servers in your local -# network by using their names, you will need additional exceptions -# that look like this: -# -# forward localhost/ . -# -# -# -# -# 5.3. forwarded-connect-retries -# =============================== -# -# Specifies: -# -# How often Privoxy retries if a forwarded connection request -# fails. -# -# Type of value: -# -# Number of retries. -# -# Default value: -# -# 0 -# -# Effect if unset: -# -# Connections forwarded through other proxies are treated like -# direct connections and no retry attempts are made. -# -# Notes: -# -# forwarded-connect-retries is mainly interesting for socks4a -# connections, where Privoxy can't detect why the connections -# failed. The connection might have failed because of a DNS timeout -# in which case a retry makes sense, but it might also have failed -# because the server doesn't exist or isn't reachable. In this -# case the retry will just delay the appearance of Privoxy's -# error message. -# -# Note that in the context of this option, "forwarded connections" -# includes all connections that Privoxy forwards through other -# proxies. This option is not limited to the HTTP CONNECT method. -# -# Only use this option, if you are getting lots of -# forwarding-related error messages that go away when you try again -# manually. Start with a small value and check Privoxy's logfile -# from time to time, to see how many retries are usually needed. -# -# Examples: -# -# forwarded-connect-retries 1 -# -forwarded-connect-retries 0 -# -# -# 5.4. accept-intercepted-requests -# ================================= -# -# Specifies: -# -# Whether intercepted requests should be treated as valid. -# -# Type of value: -# -# 0 or 1 -# -# Default value: -# -# 0 -# -# Effect if unset: -# -# Only proxy requests are accepted, intercepted requests are -# treated as invalid. -# -# Notes: -# -# If you don't trust your clients and want to force them to use -# Privoxy, enable this option and configure your packet filter -# to redirect outgoing HTTP connections into Privoxy. -# -# Make sure that Privoxy's own requests aren't redirected as well. -# Additionally take care that Privoxy can't intentionally connect -# to itself, otherwise you could run into redirection loops if -# Privoxy's listening port is reachable by the outside or an -# attacker has access to the pages you visit. -# -# Examples: -# -# accept-intercepted-requests 1 -# -accept-intercepted-requests 0 -# -# -# 5.5. allow-cgi-request-crunching -# ================================= -# -# Specifies: -# -# Whether requests to Privoxy's CGI pages can be blocked or -# redirected. -# -# Type of value: -# -# 0 or 1 -# -# Default value: -# -# 0 -# -# Effect if unset: -# -# Privoxy ignores block and redirect actions for its CGI pages. -# -# Notes: -# -# By default Privoxy ignores block or redirect actions for -# its CGI pages. Intercepting these requests can be useful in -# multi-user setups to implement fine-grained access control, -# but it can also render the complete web interface useless and -# make debugging problems painful if done without care. -# -# Don't enable this option unless you're sure that you really -# need it. -# -# Examples: -# -# allow-cgi-request-crunching 1 -# -allow-cgi-request-crunching 0 -# -# -# 5.6. split-large-forms -# ======================= -# -# Specifies: -# -# Whether the CGI interface should stay compatible with broken -# HTTP clients. -# -# Type of value: -# -# 0 or 1 -# -# Default value: -# -# 0 -# -# Effect if unset: -# -# The CGI form generate long GET URLs. -# -# Notes: -# -# Privoxy's CGI forms can lead to rather long URLs. This isn't -# a problem as far as the HTTP standard is concerned, but it can -# confuse clients with arbitrary URL length limitations. -# -# Enabling split-large-forms causes Privoxy to divide big forms -# into smaller ones to keep the URL length down. It makes editing -# a lot less convenient and you can no longer submit all changes -# at once, but at least it works around this browser bug. -# -# If you don't notice any editing problems, there is no reason -# to enable this option, but if one of the submit buttons appears -# to be broken, you should give it a try. -# -# Examples: -# -# split-large-forms 1 -# -split-large-forms 0 -# -# -# 5.7. keep-alive-timeout -# ======================== -# -# Specifies: -# -# Number of seconds after which an open connection will no longer -# be reused. -# -# Type of value: -# -# Time in seconds. -# -# Default value: -# -# None -# -# Effect if unset: -# -# Connections are not reused. -# -# Notes: -# -# This option has no effect if Privoxy has been compiled without -# keep-alive support. -# -# Notes: -# -# Note that reusing connections doesn't necessary cause -# speedups. There are also a few privacy implications you should -# be aware of. -# -# Outgoing connections are shared between clients (if there are -# more than one) and closing the client that initiated the outgoing -# connection does not affect the connection between Privoxy and -# the server unless the client's request hasn't been completed -# yet. If the outgoing connection is idle, it will not be closed -# until either Privoxy's or the server's timeout is reached. While -# it's open, the server knows that the system running Privoxy is -# still there. -# -# Examples: -# -# keep-alive-timeout 300 -# -keep-alive-timeout 300 -# -# -# 5.8. socket-timeout -# ==================== -# -# Specifies: -# -# Number of seconds after which a socket times out if no data -# is received. -# -# Type of value: -# -# Time in seconds. -# -# Default value: -# -# None -# -# Effect if unset: -# -# A default value of 300 seconds is used. -# -# Notes: -# -# For SOCKS requests the timeout currently doesn't start until -# the SOCKS server accepted the request. This will be fixed in -# the next release. -# -# Examples: -# -# socket-timeout 300 -# -socket-timeout 300 -# -# -# 6. WINDOWS GUI OPTIONS -# ======================= -# -# Privoxy has a number of options specific to the Windows GUI -# interface: -# -# -# If "activity-animation" is set to 1, the Privoxy icon will animate -# when "Privoxy" is active. To turn off, set to 0. -# -#activity-animation 1 -# -# If "log-messages" is set to 1, Privoxy will log messages to the -# console window: -# -#log-messages 1 -# -# If "log-buffer-size" is set to 1, the size of the log buffer, -# i.e. the amount of memory used for the log messages displayed in -# the console window, will be limited to "log-max-lines" (see below). -# -# Warning: Setting this to 0 will result in the buffer to grow -# infinitely and eat up all your memory! -# -#log-buffer-size 1 -# -# log-max-lines is the maximum number of lines held in the log -# buffer. See above. -# -#log-max-lines 200 -# -# If "log-highlight-messages" is set to 1, Privoxy will highlight -# portions of the log messages with a bold-faced font: -# -#log-highlight-messages 1 -# -# The font used in the console window: -# -#log-font-name Comic Sans MS -# -# Font size used in the console window: -# -#log-font-size 8 -# -# "show-on-task-bar" controls whether or not Privoxy will appear as -# a button on the Task bar when minimized: -# -#show-on-task-bar 0 -# -# If "close-button-minimizes" is set to 1, the Windows close button -# will minimize Privoxy instead of closing the program (close with -# the exit option on the File menu). -# -#close-button-minimizes 1 -# -# The "hide-console" option is specific to the MS-Win console version -# of Privoxy. If this option is used, Privoxy will disconnect from -# and hide the command console. -# -#hide-console -# -# diff --git a/external/privoxy/config.sub b/external/privoxy/config.sub old mode 100644 new mode 100755 index c894da45..e76eaf47 --- a/external/privoxy/config.sub +++ b/external/privoxy/config.sub @@ -2,9 +2,9 @@ # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# 2011 Free Software Foundation, Inc. -timestamp='2012-02-10' +timestamp='2011-11-11' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,7 +21,9 @@ timestamp='2012-02-10' # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -74,8 +76,8 @@ version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -130,10 +132,6 @@ case $maybe_os in os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -249,7 +247,6 @@ case $basic_machine in # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ - | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ @@ -322,7 +319,8 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | picochip) + # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; @@ -335,10 +333,7 @@ case $basic_machine in strongarm | thumb | xscale) basic_machine=arm-unknown ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none - ;; + xscaleeb) basic_machine=armeb-unknown ;; @@ -361,7 +356,6 @@ case $basic_machine in # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ - | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ @@ -725,6 +719,7 @@ case $basic_machine in i370-ibm* | ibm*) basic_machine=i370-ibm ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 @@ -1564,6 +1559,9 @@ case $basic_machine in ;; m68000-sun) os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 ;; m68*-cisco) os=-aout diff --git a/external/privoxy/configure b/external/privoxy/configure deleted file mode 100755 index a9e76f6e..00000000 --- a/external/privoxy/configure +++ /dev/null @@ -1,7543 +0,0 @@ -#! /bin/sh -# From configure.in Revision: 1.126 . -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68. -# -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= -PACKAGE_URL= - -ac_unique_file="jcc.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='LTLIBOBJS -LIBOBJS -PTHREAD_LIB -SPECIAL_CFLAGS -STATIC_PCRS_ONLY -STATIC_PCRE_ONLY -AMIGAOS_ONLY -SOCKET_LIB -PTHREAD_ONLY -EGREP -GREP -DKPREFIX -JADECAT -DOC_STATUS -MAN2HTML -JADEBIN -RPM_BASE -RPMBIN -DB2HTML -WDUMP -WIN_ONLY -GROUP -USER -ID -BGROUPS -GDB -AWK -SET_MAKE -LN_S -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -CPP -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -CODE_STATUS -VERSION_POINT -VERSION_MINOR -VERSION_MAJOR -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -with_docbook -with_db2html -with_debug -with_user -with_group -enable_mingw32 -enable_pthread -enable_toggle -enable_force -enable_fast_redirects -enable_stats -enable_ie_images -enable_image_blocking -enable_acl_files -enable_trust_files -enable_editor -enable_no_gifs -enable_graceful_termination -enable_extended_host_patterns -enable_dynamic_pcre -enable_zlib -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-mingw32 Use mingw32 for a Windows GUI - --disable-pthread Don't use POSIX threads (pthreads) - --disable-toggle Don't support temporary disable - --disable-force Don't allow single-page disable - --disable-fast-redirects Don't support fast redirects - --disable-stats Don't keep statistics - --enable-ie-images Enable a quick but not always reliable auto-detect whether requests from - MS Internet Explorer are for an image or not. - --disable-image-blocking Don't try to figure out whether a request is - for an image or HTML - assume HTML. - --disable-acl-files Prevents the use of ACL files to control access to - Privoxy by IP address. - --disable-trust-files Prevents the use of trust files. - --disable-editor Prevents the use of the web-based actions file - editor and web-based temporary disable setting. - --enable-no-gifs Use politically correct PNG format instead of GIF - for built-in images. May not work with all browsers. - --enable-graceful-termination Allow to shutdown Privoxy through the webinterface. - --enable-extended-host-patterns Allow extended regular expressions in host patterns. - --disable-dynamic-pcre Use the built-in, static pcre, even if libpcre is available - --disable-zlib Don't use zlib to decompress data before filtering. - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-docbook=yes|no|directory - Enable docbook documentation creation - (default = yes, for gnu and linux) - --with-db2html= - Set the location of the docbook to html converter - (default = search) - --with-debug Enable debug mode - --with-user=privoxy Set user under which privoxy will run - --with-group=privoxy Set group for privoxy - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to the package provider. -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -configure -generated by GNU Autoconf 2.68 - -Copyright (C) 2010 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_func - -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_type - -# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES -# -------------------------------------------- -# Tries to find the compile-time value of EXPR in a program that includes -# INCLUDES, setting VAR accordingly. Returns whether the value could be -# computed -ac_fn_c_compute_int () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=0 ac_mid=0 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid; break -else - as_fn_arith $ac_mid + 1 && ac_lo=$as_val - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=-1 ac_mid=-1 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=$ac_mid; break -else - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - ac_lo= ac_hi= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid -else - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in #(( -?*) eval "$3=\$ac_lo"; ac_retval=0 ;; -'') ac_retval=1 ;; -esac - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (($2) < 0) - { - long int i = longval (); - if (i != ($2)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ($2)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - echo >>conftest.val; read $3 config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -if test ! -f config.h.in; then - echo "You need to run autoheader first. " - echo -n "Shall I do this for you now? (y/n) " - read answer - if test "$answer" != "y"; then - exit 1 - else - autoheader - fi -fi - -ac_config_headers="$ac_config_headers config.h" - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - - -dodk=auto -DKPREFIX=none - -# Check whether --with-docbook was given. -if test "${with_docbook+set}" = set; then : - withval=$with_docbook; case "$with_docbook" in -yes) dodk=yes;; -no) dodk=no;; -*) - dodk=yes - DKPREFIX=$withval - ;; -esac - -fi - -DB2HTML=false - -# Check whether --with-db2html was given. -if test "${with_db2html+set}" = set; then : - withval=$with_db2html; DB2HTML=$withval - -fi - - - -VERSION_MAJOR=3 -VERSION_MINOR=0 -VERSION_POINT=12 -CODE_STATUS="stable" - - - - - - - - -cat >>confdefs.h <<_ACEOF -#define VERSION_MAJOR ${VERSION_MAJOR} -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define VERSION_MINOR ${VERSION_MINOR} -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define VERSION_POINT ${VERSION_POINT} -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_POINT}" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define CODE_STATUS "${CODE_STATUS}" -_ACEOF - - - -if test "X$CFLAGS" = "X"; then - CFLAGS=" " -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - - -# Extract the first word of "gdb", so it can be a program name with args. -set dummy gdb; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_GDB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$GDB"; then - ac_cv_prog_GDB="$GDB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_GDB="yes" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_prog_GDB" && ac_cv_prog_GDB="no" -fi -fi -GDB=$ac_cv_prog_GDB -if test -n "$GDB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GDB" >&5 -$as_echo "$GDB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "groups", so it can be a program name with args. -set dummy groups; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BGROUPS+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BGROUPS in - [\\/]* | ?:[\\/]*) - ac_cv_path_BGROUPS="$BGROUPS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="/bin:/usr/bin:/usr/local/bin" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_BGROUPS="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_BGROUPS" && ac_cv_path_BGROUPS="no" - ;; -esac -fi -BGROUPS=$ac_cv_path_BGROUPS -if test -n "$BGROUPS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BGROUPS" >&5 -$as_echo "$BGROUPS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "id", so it can be a program name with args. -set dummy id; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ID+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ID in - [\\/]* | ?:[\\/]*) - ac_cv_path_ID="$ID" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="/bin:/usr/bin:/usr/local/bin" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ID="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_ID" && ac_cv_path_ID="no" - ;; -esac -fi -ID=$ac_cv_path_ID -if test -n "$ID"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ID" >&5 -$as_echo "$ID" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - - - - -# Check whether --with-debug was given. -if test "${with_debug+set}" = set; then : - withval=$with_debug; - if test "x$withval" != "xno" ; then - if test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - if test "$GDB"; then - CFLAGS="$CFLAGS -ggdb" - else - CFLAGS="$CFLAGS -g" - fi - CFLAGS="$CFLAGS -Wshadow -Wconversion" - else - CFLAGS="$CFLAGS -g" - fi - fi - fi - -else - - if test "X$CFLAGS" = "X "; then # if CFLAGS were unset (see above) - if test "$GCC" = yes; then - CFLAGS="-O2" - fi - fi - - -fi - - - - -if test "$EMXOS2" = yes; then - echo "Skipping user and group validity stuff."; - -else - - $ID privoxy >/dev/null 2>/dev/null - if test $? -ne 0 ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: There is no user 'privoxy' on this system" >&5 -$as_echo "$as_me: WARNING: There is no user 'privoxy' on this system" >&2;} - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for user" >&5 -$as_echo_n "checking for user... " >&6; } - -# Check whether --with-user was given. -if test "${with_user+set}" = set; then : - withval=$with_user; - if test "x$withval" != "xyes"; then - if test $ID = no ; then - as_fn_error $? "There is no 'id' program on this system" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_user" >&5 -$as_echo "$with_user" >&6; } - $ID $with_user 2>/dev/null >/dev/null - if test $? -eq 0 ; then - USER=$with_user; - else - as_fn_error $? "There is no user '$with_user' on this system" "$LINENO" 5 - fi - fi - else - as_fn_error $? "We need a user if you give me this parameter" "$LINENO" 5 - fi - -else - - if test $ID = no ; then - as_fn_error $? "There is no 'id' programm on this system" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none specified" >&5 -$as_echo "none specified" >&6; } - USER=$with_user - fi - - -fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for group" >&5 -$as_echo_n "checking for group... " >&6; } - -# Check whether --with-group was given. -if test "${with_group+set}" = set; then : - withval=$with_group; - if test "x$withval" != "xyes"; then - if test $BGROUPS = no ; then - as_fn_error $? "There is no 'groups' program on this system" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_group" >&5 -$as_echo "$with_group" >&6; } - $BGROUPS $USER >/dev/null - if test $? -eq 0 ; then - # FIXME: this fails if valid group, but not first group - # listed. - if test "$with_group" != "`$BGROUPS $USER | sed 's/.*: //' 2>/dev/null |$AWK '{print $1}'`" ; then - as_fn_error $? "The given value '$withval' does not match group entry" "$LINENO" 5 - else - GROUP=$with_group; - fi - else - as_fn_error $? "There is no group entry for user '$USER'" "$LINENO" 5 - fi - fi - else - as_fn_error $? "We need a group if you give me this parameter" "$LINENO" 5 - fi - -else - - if test $BGROUPS = no ; then - as_fn_error $? "There is no 'groups' programm on this system" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none specified" >&5 -$as_echo "none specified" >&6; } - GROUP=$with_group; - fi - - -fi - - - -fi - -if test "$GCC"; then - if test "$host" != "powerpc-unknown-amigaos"; then - CFLAGS="-pipe $CFLAGS" - fi -fi - - - - -case $host_os in - *mingw32* ) MINGW32=yes;; - * ) MINGW32=no;; -esac - - -case $host_os in - *cygwin* ) CYGWIN=yes;; - * ) CYGWIN=no;; -esac - - -if test "$MINGW32" = "yes"; then - target_type=mingw -else - if test "$CYGWIN" = "yes"; then - target_type=cygwin - else - target_type=unix - fi -fi - -if test $dodk = auto; then - dodk=no - if test $target_type = unix; then - case "$host_os" in - linux* | gnu*) - dodk=yes - ;; - esac - fi -fi - - -# Check whether --enable-mingw32 was given. -if test "${enable_mingw32+set}" = set; then : - enableval=$enable_mingw32; if test $enableval = yes; then - target_type=mingw -fi -fi - - -if test $target_type = mingw; then - WIN_ONLY= - SPECIAL_CFLAGS="-mwindows -mno-cygwin" - PTHREAD_LIB=-lpthreadGC - echo "Using mingw32 (Win32 GUI)" -else - WIN_ONLY=# - if test $target_type = cygwin; then - SPECIAL_CFLAGS="-mno-win32" - PTHREAD_LIB= - echo "Using Cygnus (Win32 command line)" - else - SPECIAL_CFLAGS= - #PTHREAD_LIB=-lpthread - fi -fi - - -if test $dodk != no; then - for ac_prog in w3m lynx links -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_WDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$WDUMP"; then - ac_cv_prog_WDUMP="$WDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_WDUMP="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -WDUMP=$ac_cv_prog_WDUMP -if test -n "$WDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WDUMP" >&5 -$as_echo "$WDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$WDUMP" && break -done -test -n "$WDUMP" || WDUMP="false" - - if test "$WDUMP" = false; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You need some kind of text browser to build documentation \(w3m, lynx and links are supported\)" >&5 -$as_echo "$as_me: WARNING: You need some kind of text browser to build documentation \(w3m, lynx and links are supported\)" >&2;} - fi - if test $DB2HTML = false; then - DB2HTML="" - for ac_prog in db2html docbook2html -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DB2HTML+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DB2HTML"; then - ac_cv_prog_DB2HTML="$DB2HTML" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DB2HTML="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DB2HTML=$ac_cv_prog_DB2HTML -if test -n "$DB2HTML"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DB2HTML" >&5 -$as_echo "$DB2HTML" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DB2HTML" && break -done -test -n "$DB2HTML" || DB2HTML="false" - - fi -fi - - - -for ac_prog in rpm -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RPMBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RPMBIN"; then - ac_cv_prog_RPMBIN="$RPMBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RPMBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RPMBIN=$ac_cv_prog_RPMBIN -if test -n "$RPMBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RPMBIN" >&5 -$as_echo "$RPMBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$RPMBIN" && break -done -test -n "$RPMBIN" || RPMBIN="false" - -if test $RPMBIN != false; then - RPM_BASE=`rpm --eval "%{_topdir}"` - if test "$RPM_BASE" = ""; then - RPM_BASE=/usr/src/redhat - fi -fi - - -for ac_prog in jade openjade -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_JADEBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$JADEBIN"; then - ac_cv_prog_JADEBIN="$JADEBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_JADEBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -JADEBIN=$ac_cv_prog_JADEBIN -if test -n "$JADEBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JADEBIN" >&5 -$as_echo "$JADEBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$JADEBIN" && break -done -test -n "$JADEBIN" || JADEBIN="false" - - - -for ac_prog in man2html -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MAN2HTML+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MAN2HTML"; then - ac_cv_prog_MAN2HTML="$MAN2HTML" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_MAN2HTML="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MAN2HTML=$ac_cv_prog_MAN2HTML -if test -n "$MAN2HTML"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAN2HTML" >&5 -$as_echo "$MAN2HTML" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$MAN2HTML" && break -done -test -n "$MAN2HTML" || MAN2HTML="false" - - - -DOC_STATUS=p-not-stable -if test $CODE_STATUS = stable; then - DOC_STATUS="p-stable" -fi - - -JADECAT="" -if test $dodk = yes; then - if test $DKPREFIX = none; then - for i in /usr/share/sgml/docbook/dsssl-stylesheets \ - /usr/share/sgml/docbkdsl /usr/share/sgml/docbook-dsssl \ - /usr/local/share/sgml/docbook/dsssl/modular \ - /usr/share/sgml/docbook/stylesheet/dsssl/modular/ \ - ; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $i" >&5 -$as_echo_n "checking for $i... " >&6; } - if test -f $i/html/docbook.dsl; then - echo "yes" - DKPREFIX=$i - break - else - echo "no" - fi - done -# where are the catalogs? - for i in /usr/share/sgml/CATALOG.docbk30 \ - /usr/share/sgml/CATALOG.docbk31 \ - /usr/share/sgml/CATALOG.docbk31 \ - /usr/local/share/sgml/docbook/3.0/docbook.cat \ - /usr/local/share/sgml/docbook/3.1/docbook.cat \ - /usr/share/sgml/docbook/dtd/3.1/docbook.cat \ - ; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $i" >&5 -$as_echo_n "checking for $i... " >&6; } - if test -f $i; then - echo "yes" - JADECAT="$JADECAT -c $i" - else - echo "no" - fi - done - fi -fi - - - -old_CFLAGS_nospecial=$CFLAGS -CFLAGS="$CFLAGS $SPECIAL_CFLAGS" - -# Hack to force AutoConf to use the CFLAGS we just set -ac_cpp='$CPP $CPPFLAGS $SPECIAL_CFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : - have_pthread=yes -else - have_pthread=no -fi - - - -# Check whether --enable-pthread was given. -if test "${enable_pthread+set}" = set; then : - enableval=$enable_pthread; if test $enableval = no; then - # Disable pthreads - if test $have_pthread = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pthreads seem to be available but you are using --disable-pthread." >&5 -$as_echo "$as_me: WARNING: pthreads seem to be available but you are using --disable-pthread." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This is almost always a mistake and can render Privoxy unacceptable slow." >&5 -$as_echo "$as_me: WARNING: This is almost always a mistake and can render Privoxy unacceptable slow." >&2;} - fi - have_pthread=no -fi -fi - - -if test $have_pthread = yes; then - PTHREAD_ONLY= - $as_echo "#define FEATURE_PTHREAD 1" >>confdefs.h - - echo Using POSIX threads - if test "$GCC" = "yes"; then - # Set a GCC specific switch: - if test "$target_type" = "unix"; then - ac_jgf_save_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -pthread" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -void *p = pthread_create; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - # This compiler switch makes GCC on Linux thread-safe - # However, it's not supported on most other OS. - PTHREAD_LIB= - SPECIAL_CFLAGS="-pthread" - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ac_jgf_save_CFLAGS - fi - fi -else - PTHREAD_ONLY=# - echo Using native threads -fi - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 -$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } -if ${ac_cv_lib_nsl_gethostbyname+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnsl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gethostbyname (); -int -main () -{ -return gethostbyname (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_nsl_gethostbyname=yes -else - ac_cv_lib_nsl_gethostbyname=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 -$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } -if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBNSL 1 -_ACEOF - - LIBS="-lnsl $LIBS" - -fi - - -ac_fn_c_check_func "$LINENO" "gethostbyaddr_r" "ac_cv_func_gethostbyaddr_r" -if test "x$ac_cv_func_gethostbyaddr_r" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking signature of gethostbyaddr_r" >&5 -$as_echo_n "checking signature of gethostbyaddr_r... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include - -int -main () -{ - - struct hostent *h, *hp; - char *a, *b; - int l, bl, t, e; - (void) gethostbyaddr_r(a, l, t, h, b, bl, &hp, &e) - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - $as_echo "#define HAVE_GETHOSTBYADDR_R_8_ARGS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: 8 args" >&5 -$as_echo "8 args" >&6; } - -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include - -int -main () -{ - - struct hostent *h; - char *a, *b; - int l, bl, t, e; - (void) gethostbyaddr_r(a, l, t, h, b, bl, &e) - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - $as_echo "#define HAVE_GETHOSTBYADDR_R_7_ARGS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: 7 args" >&5 -$as_echo "7 args" >&6; } - -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include - -int -main () -{ - - struct hostent_data *d; - struct hostent *h; - char a, - int l, t; - (void) gethostbyaddr_r(a, l, t, h, d) - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - $as_echo "#define HAVE_GETHOSTBYADDR_R_5_ARGS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: 5 args" >&5 -$as_echo "5 args" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unrecognised" >&5 -$as_echo "unrecognised" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi - - -ac_fn_c_check_func "$LINENO" "gethostbyname_r" "ac_cv_func_gethostbyname_r" -if test "x$ac_cv_func_gethostbyname_r" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking signature of gethostbyname_r" >&5 -$as_echo_n "checking signature of gethostbyname_r... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include - -int -main () -{ - - struct hostent *h, *r; - char *n, *b; - int bl, e; - (void) gethostbyname_r(n, h, b, bl, &r, &e) - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - $as_echo "#define HAVE_GETHOSTBYNAME_R_6_ARGS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: 6 args" >&5 -$as_echo "6 args" >&6; } - -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include - -int -main () -{ - - struct hostent *h; - char *n, *b; - int bl, e; - (void) gethostbyname_r(n, h, b, bl, &e) - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - $as_echo "#define HAVE_GETHOSTBYNAME_R_5_ARGS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: 5 args" >&5 -$as_echo "5 args" >&6; } - -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include - -int -main () -{ - - struct hostent_data *d; - struct hostent *h; - char *n, - (void) gethostbyname_r(n, h, d) - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - $as_echo "#define HAVE_GETHOSTBYNAME_R_3_ARGS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: 3 args" >&5 -$as_echo "3 args" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unrecognised" >&5 -$as_echo "unrecognised" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi - - -ac_fn_c_check_func "$LINENO" "gmtime_r" "ac_cv_func_gmtime_r" -if test "x$ac_cv_func_gmtime_r" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking signature of gmtime_r" >&5 -$as_echo_n "checking signature of gmtime_r... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include - -int -main () -{ - - struct time *t; - struct tm *tm; - (void) gmtime_r(t, tm) - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - $as_echo "#define HAVE_GMTIME_R 1" >>confdefs.h - - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unrecognised" >&5 -$as_echo "unrecognised" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi - - -ac_fn_c_check_func "$LINENO" "localtime_r" "ac_cv_func_localtime_r" -if test "x$ac_cv_func_localtime_r" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking signature of localtime_r" >&5 -$as_echo_n "checking signature of localtime_r... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include - -int -main () -{ - - struct time *t; - struct tm *tm; - (void) localtime_r(t, tm) - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - $as_echo "#define HAVE_LOCALTIME_R 1" >>confdefs.h - - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unrecognised" >&5 -$as_echo "unrecognised" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi - - - - -SOCKET_LIB= - -case "$host" in -*-solaris*) SOCKET_LIB="-lsocket -lnsl" - $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h - - if test "$GCC" = "yes"; then - # Set a GCC specific switch: - # This compiler switch makes Solaris thread-safe - PTHREAD_LIB= - SPECIAL_CFLAGS="-pthreads" - else - # What do we do without GCC? Guess this: - SPECIAL_CFLAGS="-D_REENTRANT" - fi -;; -esac - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5 -$as_echo_n "checking for socklen_t... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "socklen_t" >/dev/null 2>&1; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -$as_echo "#define socklen_t int" >>confdefs.h - -fi -rm -f conftest* - - - - -case "$host" in -*-os2-emx*) SOCKET_LIB=-lsocket -;; -esac - - - - -case "$host" in -*-apple-darwin*) SPECIAL_CFLAGS="-Dunix" -;; -esac - - -case "$host" in -*-openbsd*) SPECIAL_CFLAGS="$SPECIAL_CFLAGS -Dunix" -;; -esac - - -AMIGAOS_ONLY=# - -case "$host" in -*-amigaos) AMIGAOS_ONLY= -;; -esac - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 -$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if eval \${$as_ac_Header+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include <$ac_hdr> - -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_ac_Header=yes" -else - eval "$as_ac_Header=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_ac_Header - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF - -ac_header_dirent=$ac_hdr; break -fi - -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dir; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : - break -fi -done -if ${ac_cv_search_opendir+:} false; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' x; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : - break -fi -done -if ${ac_cv_search_opendir+:} false; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if ${ac_cv_c_const+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset cs; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *pcpcc; - char **ppc; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - pcpcc = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++pcpcc; - ppc = (char**) pcpcc; - pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - if (s) return 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - if (!foo) return 0; - } - return !cs[0] && !zero.x; -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_const=yes -else - ac_cv_c_const=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } -if test $ac_cv_c_const = no; then - -$as_echo "#define const /**/" >>confdefs.h - -fi - -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF - -fi - -ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -if test "x$ac_cv_type_pid_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define pid_t int -_ACEOF - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if ${ac_cv_header_time+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_time=yes -else - ac_cv_header_time=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then - -$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 -$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if ${ac_cv_struct_tm+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include - -int -main () -{ -struct tm tm; - int *p = &tm.tm_sec; - return !p; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_struct_tm=time.h -else - ac_cv_struct_tm=sys/time.h -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 -$as_echo "$ac_cv_struct_tm" >&6; } -if test $ac_cv_struct_tm = sys/time.h; then - -$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h - -fi - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 -$as_echo_n "checking size of int... " >&6; } -if ${ac_cv_sizeof_int+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_int" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (int) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_int=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 -$as_echo "$ac_cv_sizeof_int" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT $ac_cv_sizeof_int -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char *" >&5 -$as_echo_n "checking size of char *... " >&6; } -if ${ac_cv_sizeof_char_p+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char *))" "ac_cv_sizeof_char_p" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_char_p" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (char *) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_char_p=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char_p" >&5 -$as_echo "$ac_cv_sizeof_char_p" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_CHAR_P $ac_cv_sizeof_char_p -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if ${ac_cv_sizeof_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (long) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_long=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 -$as_echo_n "checking size of long long... " >&6; } -if ${ac_cv_sizeof_long_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_long_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (long long) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_long_long=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 -$as_echo "$ac_cv_sizeof_long_long" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 -$as_echo_n "checking size of size_t... " >&6; } -if ${ac_cv_sizeof_size_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_size_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (size_t) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_size_t=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 -$as_echo "$ac_cv_sizeof_size_t" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t -_ACEOF - - - -for ac_header in OS.h arpa/inet.h errno.h fcntl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h sys/timeb.h sys/wait.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_func in strerror bcopy memmove -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -if test $ac_cv_c_compiler_gnu = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 -$as_echo_n "checking whether $CC needs -traditional... " >&6; } -if ${ac_cv_prog_gcc_traditional+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_pattern="Autoconf.*'x'" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -Autoconf TIOCGETP -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then : - ac_cv_prog_gcc_traditional=yes -else - ac_cv_prog_gcc_traditional=no -fi -rm -f conftest* - - - if test $ac_cv_prog_gcc_traditional = no; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -Autoconf TCGETA -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then : - ac_cv_prog_gcc_traditional=yes -fi -rm -f conftest* - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 -$as_echo "$ac_cv_prog_gcc_traditional" >&6; } - if test $ac_cv_prog_gcc_traditional = yes; then - CC="$CC -traditional" - fi -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5 -$as_echo_n "checking whether setpgrp takes no argument... " >&6; } -if ${ac_cv_func_setpgrp_void+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - as_fn_error $? "cannot check setpgrp when cross compiling" "$LINENO" 5 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -/* If this system has a BSD-style setpgrp which takes arguments, - setpgrp(1, 1) will fail with ESRCH and return -1, in that case - exit successfully. */ - return setpgrp (1,1) != -1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_setpgrp_void=no -else - ac_cv_func_setpgrp_void=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5 -$as_echo "$ac_cv_func_setpgrp_void" >&6; } -if test $ac_cv_func_setpgrp_void = yes; then - -$as_echo "#define SETPGRP_VOID 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 -$as_echo_n "checking return type of signal handlers... " >&6; } -if ${ac_cv_type_signal+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include - -int -main () -{ -return *(signal (0, 0)) (0) == 1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_type_signal=int -else - ac_cv_type_signal=void -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 -$as_echo "$ac_cv_type_signal" >&6; } - -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF - - -for ac_func in access atexit getcwd gethostbyaddr gethostbyaddr_r gethostbyname gethostbyname_r gettimeofday inet_ntoa localtime_r memchr memmove memset poll putenv random regcomp select setlocale snprintf socket strchr strdup strerror strftime strlcat strlcpy strptime strstr strtoul timegm tzset -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 -$as_echo_n "checking for pcre_compile in -lpcre... " >&6; } -if ${ac_cv_lib_pcre_pcre_compile+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpcre $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pcre_compile (); -int -main () -{ -return pcre_compile (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pcre_pcre_compile=yes -else - ac_cv_lib_pcre_pcre_compile=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 -$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } -if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : - - ac_fn_c_check_header_mongrel "$LINENO" "pcre.h" "ac_cv_header_pcre_h" "$ac_includes_default" -if test "x$ac_cv_header_pcre_h" = xyes; then : - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "pcre_fullinfo" >/dev/null 2>&1; then : - have_pcre=yes -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pcre old version installed" >&5 -$as_echo "$as_me: WARNING: pcre old version installed" >&2;}; have_pcre=no -fi -rm -f conftest* - - -else - - ac_fn_c_check_header_mongrel "$LINENO" "pcre/pcre.h" "ac_cv_header_pcre_pcre_h" "$ac_includes_default" -if test "x$ac_cv_header_pcre_pcre_h" = xyes; then : - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "pcre_fullinfo" >/dev/null 2>&1; then : - have_pcre=yes; $as_echo "#define PCRE_H_IN_SUBDIR 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pcre old version installed" >&5 -$as_echo "$as_me: WARNING: pcre old version installed" >&2;}; have_pcre=no -fi -rm -f conftest* - - -else - have_pcre=no -fi - - - -fi - - - -else - have_pcre=no -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for regcomp in -lpcreposix" >&5 -$as_echo_n "checking for regcomp in -lpcreposix... " >&6; } -if ${ac_cv_lib_pcreposix_regcomp+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpcreposix -lpcre $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char regcomp (); -int -main () -{ -return regcomp (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pcreposix_regcomp=yes -else - ac_cv_lib_pcreposix_regcomp=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcreposix_regcomp" >&5 -$as_echo "$ac_cv_lib_pcreposix_regcomp" >&6; } -if test "x$ac_cv_lib_pcreposix_regcomp" = xyes; then : - - ac_fn_c_check_header_mongrel "$LINENO" "pcreposix.h" "ac_cv_header_pcreposix_h" "$ac_includes_default" -if test "x$ac_cv_header_pcreposix_h" = xyes; then : - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "pcreposix_regerror" >/dev/null 2>&1; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pcreposix old version installed" >&5 -$as_echo "$as_me: WARNING: pcreposix old version installed" >&2;}; have_pcreposix=no -else - have_pcreposix=yes -fi -rm -f conftest* - - -else - - ac_fn_c_check_header_mongrel "$LINENO" "pcre/pcreposix.h" "ac_cv_header_pcre_pcreposix_h" "$ac_includes_default" -if test "x$ac_cv_header_pcre_pcreposix_h" = xyes; then : - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "pcreposix_regerror" >/dev/null 2>&1; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pcreposix old version installed" >&5 -$as_echo "$as_me: WARNING: pcreposix old version installed" >&2;}; have_pcreposix=no -else - have_pcreposix=yes; $as_echo "#define PCREPOSIX_H_IN_SUBDIR 1" >>confdefs.h - -fi -rm -f conftest* - - -else - have_pcreposix=no -fi - - - -fi - - - -else - have_pcreposix=no -fi - - - - -$as_echo "#define __MT__ 1" >>confdefs.h - - - -# Check whether --enable-toggle was given. -if test "${enable_toggle+set}" = set; then : - enableval=$enable_toggle; if test $enableval = yes; then - $as_echo "#define FEATURE_TOGGLE 1" >>confdefs.h - -fi -else - $as_echo "#define FEATURE_TOGGLE 1" >>confdefs.h - -fi - - -# Check whether --enable-force was given. -if test "${enable_force+set}" = set; then : - enableval=$enable_force; if test $enableval = yes; then - $as_echo "#define FEATURE_FORCE_LOAD 1" >>confdefs.h - -fi -else - $as_echo "#define FEATURE_FORCE_LOAD 1" >>confdefs.h - -fi - - -# Check whether --enable-fast-redirects was given. -if test "${enable_fast_redirects+set}" = set; then : - enableval=$enable_fast_redirects; if test $enableval = yes; then - $as_echo "#define FEATURE_FAST_REDIRECTS 1" >>confdefs.h - -fi -else - $as_echo "#define FEATURE_FAST_REDIRECTS 1" >>confdefs.h - -fi - - -# Check whether --enable-stats was given. -if test "${enable_stats+set}" = set; then : - enableval=$enable_stats; if test $enableval = yes; then - $as_echo "#define FEATURE_STATISTICS 1" >>confdefs.h - -fi -else - $as_echo "#define FEATURE_STATISTICS 1" >>confdefs.h - -fi - - -# Check whether --enable-ie-images was given. -if test "${enable_ie_images+set}" = set; then : - enableval=$enable_ie_images; if test $enableval = yes; then - $as_echo "#define FEATURE_IMAGE_DETECT_MSIE 1" >>confdefs.h - -fi -fi - - -# Check whether --enable-image-blocking was given. -if test "${enable_image_blocking+set}" = set; then : - enableval=$enable_image_blocking; if test $enableval = yes; then - $as_echo "#define FEATURE_IMAGE_BLOCKING 1" >>confdefs.h - -fi -else - $as_echo "#define FEATURE_IMAGE_BLOCKING 1" >>confdefs.h - -fi - - -# Check whether --enable-acl-files was given. -if test "${enable_acl_files+set}" = set; then : - enableval=$enable_acl_files; if test $enableval = yes; then - $as_echo "#define FEATURE_ACL 1" >>confdefs.h - -fi -else - $as_echo "#define FEATURE_ACL 1" >>confdefs.h - -fi - - -# Check whether --enable-trust-files was given. -if test "${enable_trust_files+set}" = set; then : - enableval=$enable_trust_files; if test $enableval = yes; then - $as_echo "#define FEATURE_TRUST 1" >>confdefs.h - -fi -else - $as_echo "#define FEATURE_TRUST 1" >>confdefs.h - -fi - - -# Check whether --enable-editor was given. -if test "${enable_editor+set}" = set; then : - enableval=$enable_editor; if test $enableval = yes; then - $as_echo "#define FEATURE_CGI_EDIT_ACTIONS 1" >>confdefs.h - -fi -else - $as_echo "#define FEATURE_CGI_EDIT_ACTIONS 1" >>confdefs.h - -fi - - -# Check whether --enable-no-gifs was given. -if test "${enable_no_gifs+set}" = set; then : - enableval=$enable_no_gifs; if test $enableval = yes; then - $as_echo "#define FEATURE_NO_GIFS 1" >>confdefs.h - -fi -fi - - -# Check whether --enable-graceful-termination was given. -if test "${enable_graceful_termination+set}" = set; then : - enableval=$enable_graceful_termination; if test $enableval = yes; then - $as_echo "#define FEATURE_GRACEFUL_TERMINATION 1" >>confdefs.h - -fi -fi - - -# Check whether --enable-extended-host-patterns was given. -if test "${enable_extended_host_patterns+set}" = set; then : - enableval=$enable_extended_host_patterns; if test $enableval = yes; then - $as_echo "#define FEATURE_EXTENDED_HOST_PATTERNS 1" >>confdefs.h - -fi -fi - - - -# Check whether --enable-dynamic-pcre was given. -if test "${enable_dynamic_pcre+set}" = set; then : - enableval=$enable_dynamic_pcre; if test $enableval = "no"; then have_pcre=no; fi -fi - - - - -# Check whether --enable-zlib was given. -if test "${enable_zlib+set}" = set; then : - enableval=$enable_zlib; enableval2=$enableval -else - enableval2=yes -fi - -if test $enableval2 = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5 -$as_echo_n "checking for zlibVersion in -lz... " >&6; } -if ${ac_cv_lib_z_zlibVersion+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char zlibVersion (); -int -main () -{ -return zlibVersion (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_z_zlibVersion=yes -else - ac_cv_lib_z_zlibVersion=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_zlibVersion" >&5 -$as_echo "$ac_cv_lib_z_zlibVersion" >&6; } -if test "x$ac_cv_lib_z_zlibVersion" = xyes; then : - have_zlib="yes" -else - have_zlib="no" -fi - - if test $have_zlib = "yes"; then - LIBS="$LIBS -lz" - -$as_echo "#define FEATURE_ZLIB 1" >>confdefs.h - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No zlib found. - Privoxy will not be able to filter compressed content. - This may become a fatal error in the future." >&5 -$as_echo "$as_me: WARNING: No zlib found. - Privoxy will not be able to filter compressed content. - This may become a fatal error in the future." >&2;} - fi -fi - - -# If we have libpcre and either we also have pcreposix or -# we don't need pcreposix, then link pcre dynamically; else -# build it and link statically -# -if test $have_pcre = "yes"; then - echo "using libpcre" - pcre_dyn=yes - STATIC_PCRE_ONLY=# - LIBS="$LIBS -lpcre -lpcreposix" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You are using the static PCRE code which is scheduled for removal, for details see: - https://sourceforge.net/mailarchive/message.php?msg_id=20080511195555.2dc6cfdc%40fabiankeil.de" >&5 -$as_echo "$as_me: WARNING: You are using the static PCRE code which is scheduled for removal, for details see: - https://sourceforge.net/mailarchive/message.php?msg_id=20080511195555.2dc6cfdc%40fabiankeil.de" >&2;} - pcre_dyn=no - $as_echo "#define STATIC_PCRE 1" >>confdefs.h - - STATIC_PCRE_ONLY= -fi - -if test $have_pthread = "yes" -o $target_type = "mingw"; then - echo Enabling keep-alive support for outgoing connections. - $as_echo "#define FEATURE_CONNECTION_KEEP_ALIVE 1" >>confdefs.h - -fi - - $as_echo "#define STATIC_PCRS 1" >>confdefs.h - - STATIC_PCRS_ONLY= - - - - - -CFLAGS=$old_CFLAGS_nospecial - - - - -ac_config_files="$ac_config_files GNUmakefile doc/source/ldp.dsl" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Report bugs to the package provider." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.68, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2010 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "GNUmakefile") CONFIG_FILES="$CONFIG_FILES GNUmakefile" ;; - "doc/source/ldp.dsl") CONFIG_FILES="$CONFIG_FILES doc/source/ldp.dsl" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi - ;; - - - esac - -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - diff --git a/external/privoxy/configure.in b/external/privoxy/configure.in index 6c6ce39c..1f2dcae4 100644 --- a/external/privoxy/configure.in +++ b/external/privoxy/configure.in @@ -1,572 +1,38 @@ dnl Process this file with autoconf to produce a configure script. -dnl -dnl $Id: configure.in,v 1.126 2009/03/21 10:45:06 fabiankeil Exp $ -dnl -dnl Written by and Copyright (C) 2001-2009 the +dnl +dnl $Id: configure.in,v 1.166 2011/12/26 17:03:31 fabiankeil Exp $ +dnl +dnl Written by and Copyright (C) 2001-2010 the dnl Privoxy team. http://www.privoxy.org/ dnl dnl Based on the Internet Junkbuster originally written -dnl by and Copyright (C) 1997 Anonymous Coders and +dnl by and Copyright (C) 1997 Anonymous Coders and dnl Junkbusters Corporation. http://www.junkbusters.com dnl -dnl This program is free software; you can redistribute it +dnl This program is free software; you can redistribute it dnl and/or modify it under the terms of the GNU General dnl Public License as published by the Free Software dnl Foundation; either version 2 of the License, or (at dnl your option) any later version. -dnl +dnl dnl This program is distributed in the hope that it will dnl be useful, but WITHOUT ANY WARRANTY; without even the dnl implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. See the GNU General Public dnl License for more details. -dnl +dnl dnl The GNU General Public License should be included with dnl this file. If not, you can view it at dnl http://www.gnu.org/copyleft/gpl.html dnl or write to the Free Software Foundation, Inc., 59 dnl Temple Place - Suite 330, Boston, MA 02111-1307, USA. -dnl -dnl $Log: configure.in,v $ -dnl Revision 1.126 2009/03/21 10:45:06 fabiankeil -dnl Declare the code stable. dnl -dnl Revision 1.125 2009/02/25 16:58:03 fabiankeil -dnl And the journey continues. Bump version to 3.0.12 UNRELEASED. -dnl -dnl Revision 1.124 2009/02/12 15:42:00 fabiankeil -dnl Declare the code stable. -dnl -dnl Revision 1.123 2009/02/06 18:17:32 fabiankeil -dnl Boldly enable keep-alive support where possible. -dnl -dnl Revision 1.122 2008/10/18 11:17:52 fabiankeil -dnl Connection keep-alive support is ready for testing, -dnl allow enabling it through the configure script. -dnl -dnl Revision 1.121 2008/08/30 12:03:07 fabiankeil -dnl Remove FEATURE_COOKIE_JAR. -dnl -dnl Revision 1.120 2008/08/21 17:19:50 fabiankeil -dnl Change version to 3.0.11 UNRELEASED. -dnl -dnl Revision 1.119 2008/08/13 16:53:50 fabiankeil -dnl Change version to 3.0.10 stable. -dnl -dnl Revision 1.118 2008/06/27 12:50:44 fabiankeil -dnl Here's looking at you, Gentoo Linux: Show a warning if -dnl --disable-pthread is used even though pthreads are available. -dnl -dnl Revision 1.117 2008/06/14 12:47:30 fabiankeil -dnl Set CODE_STATUS to beta. -dnl -dnl Revision 1.116 2008/06/08 11:55:09 fabiankeil -dnl - Show a warning if the soon-to-be-removed static PCRE code is used. -dnl - Hide the "using built-in static pcrs" message. With dynamic linking -dnl against PCRS disabled, the message isn't particularly useful. -dnl -dnl Revision 1.115 2008/05/25 15:50:14 fabiankeil -dnl Try to use zlib by default, but just show a warning if it's -dnl unavailable. Remove --enable-zlib, add --disable-zlib. -dnl -dnl Revision 1.114 2008/04/06 15:18:33 fabiankeil -dnl Oh well, rename the --enable-pcre-host-patterns option to -dnl --enable-extended-host-patterns as it's not really PCRE syntax. -dnl -dnl Revision 1.113 2008/04/06 14:54:26 fabiankeil -dnl Use PCRE syntax in host patterns when configured -dnl with --enable-pcre-host-patterns. -dnl -dnl Revision 1.112 2008/03/27 18:27:22 fabiankeil -dnl Remove kill-popups action. -dnl -dnl Revision 1.111 2008/02/03 14:40:47 fabiankeil -dnl Remove unused OSX_DARWIN macro. Reported by Mark Miller in #1852529. -dnl -dnl Revision 1.110 2008/01/26 10:52:13 fabiankeil -dnl Change version to 3.0.9 UNRELEASED. -dnl -dnl Revision 1.109 2008/01/20 14:07:09 fabiankeil -dnl Set CODE_STATUS to stable. -dnl -dnl Revision 1.108 2007/12/10 02:30:00 hal9 -dnl Change versioning for > 3.0.7 && < 3.0.8 -dnl -dnl Revision 1.107 2007/11/15 02:50:14 hal9 -dnl Setting to "beta" (for doc builds, etc). -dnl -dnl Revision 1.106 2007/05/11 11:49:41 fabiankeil -dnl Check for strlcat(). -dnl -dnl Revision 1.105 2007/04/09 17:34:58 fabiankeil -dnl Check for snprintf(). -dnl -dnl Revision 1.104 2007/03/31 13:35:11 fabiankeil -dnl Add checks for gettimeofday() and strlcpy(). -dnl -dnl Revision 1.103 2007/01/20 16:29:38 fabiankeil -dnl Suppress edit buttons for action files if Privoxy has -dnl no write access. Suggested by Roland in PR 1564026. -dnl -dnl Revision 1.102 2007/01/18 14:55:45 fabiankeil -dnl Check for tzset() and putenv() to make sure the -dnl replacement timegm() isn't included on systems -dnl where it fails to compile. -dnl -dnl Revision 1.101 2007/01/12 15:20:17 fabiankeil -dnl Temporarily ignore external libpcrs to prevent -dnl problems that are fixed in Privoxy's own version. -dnl -dnl Revision 1.100 2007/01/07 07:38:10 joergs -dnl Disabled -pipe for AmigaOS4. -dnl -dnl Revision 1.99 2007/01/01 19:36:37 fabiankeil -dnl Integrate a modified version of Wil Mahan's -dnl zlib patch (PR #895531). -dnl -dnl Revision 1.98 2006/12/17 19:15:26 fabiankeil -dnl Added ./configure switch for FEATURE_GRACEFUL_TERMINATION. -dnl -dnl Revision 1.97 2006/11/21 18:32:46 hal9 -dnl Setting version to 3.0.7 UNRELEASED for lack of a better setting. -dnl -dnl Revision 1.96 2006/11/18 14:42:51 fabiankeil -dnl Mark as stable. -dnl -dnl Revision 1.95 2006/11/14 02:08:59 hal9 -dnl Setting version string to 3.0.6 UNRELEASED. This needs to be reset to 3.0.6 -dnl stable just before CVS is tagged for release. -dnl -dnl Revision 1.94 2006/11/13 19:05:50 fabiankeil -dnl Make pthread mutex locking more generic. Instead of -dnl checking for OSX and OpenBSD, check for FEATURE_PTHREAD -dnl and use mutex locking unless there is an _r function -dnl available. Better safe than sorry. -dnl -dnl Fixes "./configure --disable-pthread" and should result -dnl in less threading-related problems on pthread-using platforms, -dnl but it still doesn't fix BR#1122404. -dnl -dnl Revision 1.93 2006/09/22 01:26:20 hal9 -dnl Set version to 3.0.5 BETA for hopefully release this weekend. -dnl -dnl Revision 1.92 2006/08/17 17:09:49 fabiankeil -dnl Added check for timegm(). -dnl -dnl Revision 1.91 2006/08/13 22:01:51 fabiankeil -dnl Added checks for strptime() and random() -dnl -dnl Revision 1.90 2006/07/18 14:48:45 david__schmidt -dnl Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) -dnl with what was really the latest development (the v_3_0_branch branch) -dnl -dnl Revision 1.68.2.20 2004/01/31 16:31:46 oes -dnl Resetting version info to 0.0.0 UNRELEASED -dnl -dnl Revision 1.68.2.19 2004/01/30 09:26:03 oes -dnl Added docbook paths for debian sarge; set status for release -dnl -dnl Revision 1.68.2.18 2003/12/08 15:10:29 oes -dnl Bugfix: --with-docbook now correctly accepts its path parameter. Thanks, Roland! -dnl -dnl Revision 1.68.2.17 2003/10/18 18:41:26 david__schmidt -dnl Update to remain buildable on OS/2 - remove the failures -dnl due to missing unixisms -dnl -dnl Revision 1.68.2.16 2003/03/26 16:05:14 oes -dnl Marked as 0.0.0 UNRELEASED -dnl -dnl Revision 1.68.2.15 2003/03/26 00:25:00 oes -dnl Bump version for 3.0.2 -dnl -dnl Revision 1.68.2.14 2003/03/25 13:27:12 hal9 -dnl Manually apply Docbook/FreeBSD patch #708081 from a.go at tiscali.nl. -dnl -dnl Revision 1.68.2.13 2003/03/18 19:38:57 oes -dnl Set version info for 3.0.1 release -dnl -dnl Revision 1.68.2.12 2003/03/07 03:41:04 david__schmidt -dnl Wrapping all *_r functions (the non-_r versions of them) with mutex semaphores for OSX. Hopefully this will take care of all of those pesky crash reports. -dnl -dnl Revision 1.68.2.11 2003/03/06 15:22:37 oes -dnl Fixed minor shell syntax bug -dnl -dnl Revision 1.68.2.10 2003/01/08 16:39:41 oes -dnl Changing default to exclude FEATURE_IMAGE_DETECT_MSIE because of problem reports with recent IEs -dnl -dnl Revision 1.68.2.9 2002/12/13 23:47:45 hal9 -dnl Add openbsd $specialflags per gunner at styx2002.no-ip.org -dnl -dnl Revision 1.68.2.8 2002/11/27 12:55:26 oes -dnl Fixed broken handling of pre-set CFLAGS -dnl -dnl Revision 1.68.2.7 2002/10/25 02:44:22 hal9 -dnl Port of make install, etc from main trunk. Needs testing! Add Slackware -dnl support, and other related changes. Update related docs. -dnl -dnl Revision 1.68.2.6 2002/09/25 15:35:15 oes -dnl Marking as non-release -dnl -dnl Revision 1.68.2.5 2002/08/25 23:37:00 hal9 -dnl Getting ready for 3.0 release. -dnl -dnl Revision 1.68.2.4 2002/08/10 11:21:57 oes -dnl - Set Version to 2.9.20 (beta) -dnl - Add two AC_DEFINEs that indicate if the pcre*.h headers -dnl are located in a pcre/ subdir to the include path. -dnl -dnl Revision 1.68.2.3 2002/08/06 11:29:36 oes -dnl Fixed detection/inclusion of pcre.h, which is in a pcre subdir on RH -dnl -dnl Revision 1.68.2.2 2002/07/30 19:36:09 hal9 -dnl Bump version to 2.9.17. -dnl -dnl Revision 1.68.2.1 2002/07/26 15:21:12 oes -dnl Bumped version number for 2.9.16 freeze -dnl -dnl Revision 1.68 2002/05/25 16:54:54 jongfoster -dnl Detect if the compiler supports -pthread. -dnl Hopefully this will fix bug 560442. (I don't have a HP PA-RISC -dnl machine to test this!) -dnl -dnl Revision 1.67 2002/05/03 14:33:59 oes -dnl Generate doc/soucre/ldp.dsl -dnl -dnl Revision 1.66 2002/05/03 00:41:56 oes -dnl Set version to 2.9.15 to comply with new versioning scheme -dnl -dnl Revision 1.65 2002/04/25 19:13:57 morcego -dnl Removed RPM release number declaration on configure.in -dnl Changed makefile to use given value for RPM_PACKAGEV when on uploading -dnl targets (will produce an error, explaining who to do it, if no value -dnl if provided). -dnl -dnl Revision 1.64 2002/04/22 16:32:31 morcego -dnl configure.in, *.spec: Bumping release to 2 (2.9.14-2) -dnl -rh.spec: uid and gid are now macros -dnl -suse.spec: Changing the header Copyright to License (Copyright is -dnl deprecable) -dnl -dnl Revision 1.63 2002/04/11 11:00:21 oes -dnl Applied Moritz' fix for socklen_t on Solaris -dnl -dnl Revision 1.62 2002/04/11 10:09:20 oes -dnl Version 2.9.14 -dnl -dnl Revision 1.61 2002/04/10 18:14:45 morcego -dnl - (privoxy-rh.spec only) Relisting template files on the %%files section -dnl - (configure.in, privoxy-rh.spec) Bumped package release to 5 -dnl -dnl Revision 1.60 2002/04/09 16:38:49 oes -dnl Added detection of missing config.h.in -dnl -dnl Revision 1.59 2002/04/06 20:23:55 jongfoster -dnl Removing unnessacery tests (C++, ranlib) -dnl -dnl Revision 1.58 2002/04/04 20:49:20 swa -dnl attempt to consolidate the -dnl different dokbook versions. -dnl -dnl Revision 1.57 2002/04/04 00:36:36 gliptak -dnl always use pcre for matching -dnl -dnl Revision 1.56 2002/04/03 22:28:03 gliptak -dnl Removed references to gnu_regex -dnl -dnl Revision 1.55 2002/04/03 03:54:38 gliptak -dnl Checking pcre version -dnl -dnl Revision 1.54 2002/04/01 00:54:24 gliptak -dnl More changes needed around regex support. -dnl -dnl Revision 1.53 2002/03/29 20:09:01 swa -dnl al's patch -dnl -dnl Revision 1.52 2002/03/29 19:51:40 gliptak -dnl Correcting compile problem with Debian -dnl -dnl Revision 1.51 2002/03/28 20:43:00 swa -dnl set make correctly -dnl -dnl Revision 1.50 2002/03/27 03:03:45 hal9 -dnl Add test for man2html -dnl -dnl Revision 1.49 2002/03/27 02:19:52 david__schmidt -dnl More Mac OSX support: -dnl - Get rid of extraneous, noisy -pthread warnings -dnl - Define unix so we get oes' unix-tagged changes -dnl -dnl Revision 1.48 2002/03/26 22:29:54 swa -dnl we have a new homepage! -dnl -dnl Revision 1.47 2002/03/26 16:41:00 hal9 -dnl Upped RPM Release to 3 (need to build new RH packages) -dnl -dnl Revision 1.46 2002/03/24 18:55:06 jongfoster -dnl Making Docbook work under Windows -dnl -dnl Revision 1.45 2002/03/24 14:19:55 swa -dnl set rpm package release in configure.in. nowhere else. -dnl -dnl Revision 1.44 2002/03/24 13:25:43 swa -dnl name change related issues -dnl -dnl Revision 1.43 2002/03/24 12:56:21 swa -dnl name change related issues. -dnl -dnl Revision 1.42 2002/03/22 18:11:37 jongfoster -dnl Bumping version number to 2.9.12 -dnl -dnl Revision 1.41 2002/03/19 19:30:04 morcego -dnl - Fixing stylesheet checking on configure. If it is found, no further checks -dnl should be done -dnl -dnl - configure will now check for db2html or docbook2html (should work now -dnl on SuSe without the docbktls package) -dnl -dnl Revision 1.40 2002/03/09 14:33:30 oes -dnl Fixing the (harmless) AC_CHECK_FILE warnings -dnl -dnl Revision 1.39 2002/03/08 16:46:13 oes -dnl Added --enable-no-gifs -dnl -dnl Revision 1.38 2002/03/08 14:13:50 morcego -dnl Fixing configure, to remove a command not found error. -dnl -dnl Revision 1.37 2002/03/08 12:58:21 oes -dnl Tiny bugfix in AC_ARG_WITH(debug) -dnl -dnl Revision 1.36 2002/03/06 23:50:36 morcego -dnl Will not test for a text browser if we are not using docbook. -dnl -dnl Revision 1.35 2002/03/06 21:55:52 morcego -dnl New configure option: --with-docbook=(yes|no|directory) -dnl Preliminary new platform detection code included. Will work with the -dnl old one for now. No use just trowing it away -dnl -dnl Revision 1.34 2002/03/06 20:57:00 morcego -dnl Fixing detection of stylesheets on SuSe. -dnl -dnl Revision 1.33 2002/03/05 17:31:11 morcego -dnl Search for docbook.dsl. Should solve portability problems for SuSe. -dnl -dnl Revision 1.32 2002/03/05 14:07:43 morcego -dnl configure now detects rpm topdir, and change GNUmakefile acordingly -dnl (based on sugestion by Sarantis Paskalis) -dnl -dnl Revision 1.31 2002/03/05 13:43:28 morcego -dnl Checking for text browser, so redhat-dok can work. -dnl -dnl Revision 1.30 2002/03/04 17:58:01 oes -dnl Deleted _DEBUG and PID_FILE_PATH -dnl -dnl Revision 1.29 2002/02/28 14:20:53 oes -dnl Fixed detection of gethost*_r functions on Solaris -dnl -dnl Revision 1.28 2002/02/27 15:02:38 oes -dnl Incremented version number -dnl -dnl Revision 1.27 2002/01/10 12:35:18 oes -dnl Added cross-compile defaults to the AC_CHECK_SIZEOF macros -dnl to silence autoconf warnings. Numbers are for Intel/Linux. -dnl Is there a better way? -dnl -dnl Revision 1.26 2002/01/09 14:29:49 oes -dnl - Added AC_CHECK_FUNC tests for the availability of -dnl gethostbyname_r, gethostbyaddr_r, gmtime_r and -dnl localtime_r, as well as AC_TRY_COMPILE tests to -dnl determine their signatures. -dnl -dnl - Fixed a bug with the init of CFLAGS that was -dnl reported by barsnick -dnl -dnl Revision 1.25 2002/01/04 15:27:18 oes -dnl Changed quoting of CODE_STATUS for use in make -dnl -dnl Revision 1.24 2001/12/30 14:07:31 steudten -dnl - Add signal handling (unix) -dnl - Add SIGHUP handler (unix) -dnl - Add creation of pidfile (unix) -dnl - Add action 'top' in rc file (RH) -dnl - Add entry 'SIGNALS' to manpage -dnl - Add exit message to logfile (unix) -dnl -dnl Revision 1.23 2001/12/09 20:24:42 david__schmidt -dnl Change from "alpha" to "beta" in configure.in -dnl -dnl Revision 1.22 2001/12/01 11:24:01 jongfoster -dnl Renaming Makefile.in to GNUmakefile.in so that non-GNU versions of -dnl make break in a more obvious way. -dnl -dnl Revision 1.21 2001/11/30 21:35:54 jongfoster -dnl Bumping version number to 2.9.10 -dnl -dnl Revision 1.20 2001/10/23 21:24:09 jongfoster -dnl Support for FEATURE_CGI_EDIT_ACTIONS -dnl -dnl Revision 1.19 2001/10/07 15:33:14 oes -dnl Removed FEATURE_DENY_GZIP -dnl Bumped up version number -dnl -dnl Revision 1.18 2001/09/13 13:10:24 steudten -dnl -dnl PreWork for Debug Interface. -dnl Add new option "--with-debug" to enable debugging (flags aso.) -dnl -dnl Revision 1.17 2001/09/12 23:44:55 david__schmidt -dnl Mac OSX (Darwin) support added. -dnl -dnl Revision 1.16 2001/09/12 22:55:45 joergs -dnl AmigaOS support added. -dnl -dnl Revision 1.15 2001/09/12 17:28:59 david__schmidt -dnl -dnl OS/2 port: update autoconf'd support for the platform. -dnl -dnl Revision 1.14 2001/07/30 22:12:11 jongfoster -dnl Fixing Solaris build (I hope) and tidying up #defines: -dnl - All feature #defines are now of the form FEATURE_xxx -dnl - Permanently turned off WIN_GUI_EDIT -dnl - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS -dnl -dnl Revision 1.13 2001/07/29 17:09:17 jongfoster -dnl Major changes to build system in order to fix these bugs: -dnl - pthreads under Linux was broken - changed -lpthread to -pthread -dnl - Compiling in MinGW32 mode under CygWin now correctly detects -dnl which shared libraries are available -dnl - Solaris support (?) (Not tested under Solaris yet) -dnl -dnl Revision 1.12 2001/07/25 19:16:27 oes -dnl Bumping version number to 2.9.8 -dnl -dnl Revision 1.11 2001/07/21 18:00:07 jongfoster -dnl Bumping version number to 2.9.7 -dnl -dnl Revision 1.10 2001/07/18 17:25:04 oes -dnl Fixed a typo -dnl -dnl Revision 1.9 2001/07/15 19:45:13 jongfoster -dnl Added support for linking with POSIX threads library -dnl -dnl Revision 1.8 2001/07/15 17:54:29 jongfoster -dnl Renaming #define STATIC to STATIC_PCRE -dnl Adding new #define FEATURE_PTHREAD that will be used to enable -dnl POSIX threads support. -dnl -dnl Revision 1.7 2001/07/13 13:58:05 oes -dnl Completely reorganized the selection scheme for -dnl pcre, pcreposix, pcrs and gnu_regex: -dnl -dnl The presence of shared pcre, pcreposix or pcrs -dnl libraried is now autodetected. Additionally, the -dnl user can enforce using the built-in static variants -dnl by specifying --disable-dynamic-(pcre|pcrs). -dnl Care is taken to avoid that pcre is dyn, while pcreposix -dnl is static, if both are used and that pcrs is static if -dnl pcrs is. -dnl -dnl The choice between pcre, gnu or no regex for actionsfile -dnl URL matching is now via -dnl --(enable|disable)-regex-matching[=(gnu|pcre|no)] with the -dnl default being pcre. -dnl -dnl Revision 1.6 2001/06/29 21:56:40 oes -dnl Version -> 2.9.5 -dnl -dnl Revision 1.5 2001/06/29 13:26:27 oes -dnl Introduced #define CODE_STATUS -dnl -dnl Revision 1.4 2001/05/29 09:50:24 jongfoster -dnl Unified blocklist/imagelist/permissionslist. -dnl File format is still under discussion, but the internal changes -dnl are (mostly) done. -dnl -dnl Also modified interceptor behaviour: -dnl - We now intercept all URLs beginning with one of the following -dnl prefixes (and *only* these prefixes): -dnl * http://i.j.b/ -dnl * http://ijbswa.sf.net/config/ -dnl * http://ijbswa.sourceforge.net/config/ -dnl - New interceptors "home page" - go to http://i.j.b/ to see it. -dnl - Internal changes so that intercepted and fast redirect pages -dnl are not replaced with an image. -dnl - Interceptors now have the option to send a binary page direct -dnl to the client. (i.e. ijb-send-banner uses this) -dnl - Implemented show-url-info interceptor. (Which is why I needed -dnl the above interceptors changes - a typical URL is -dnl "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". -dnl The previous mechanism would not have intercepted that, and -dnl if it had been intercepted then it then it would have replaced -dnl it with an image.) -dnl -dnl Revision 1.3 2001/05/22 18:46:04 oes -dnl -dnl - Enabled filtering banners by size rather than URL -dnl by adding patterns that replace all standard banner -dnl sizes with the "Junkbuster" gif to the re_filterfile -dnl -dnl - Enabled filtering WebBugs by providing a pattern -dnl which kills all 1x1 images -dnl -dnl - Added support for PCRE_UNGREEDY behaviour to pcrs, -dnl which is selected by the (nonstandard and therefore -dnl capital) letter 'U' in the option string. -dnl It causes the quantifiers to be ungreedy by default. -dnl Appending a ? turns back to greedy (!). -dnl -dnl - Added a new interceptor ijb-send-banner, which -dnl sends back the "Junkbuster" gif. Without imagelist or -dnl MSIE detection support, or if tinygif = 1, or the -dnl URL isn't recognized as an imageurl, a lame HTML -dnl explanation is sent instead. -dnl -dnl - Added new feature, which permits blocking remote -dnl script redirects and firing back a local redirect -dnl to the browser. -dnl The feature is conditionally compiled, i.e. it -dnl can be disabled with --disable-fast-redirects, -dnl plus it must be activated by a "fast-redirects" -dnl line in the config file, has its own log level -dnl and of course wants to be displayed by show-proxy-args -dnl Note: Boy, all the #ifdefs in 1001 locations and -dnl all the fumbling with configure.in and acconfig.h -dnl were *way* more work than the feature itself :-( -dnl -dnl - Because a generic redirect template was needed for -dnl this, tinygif = 3 now uses the same. -dnl -dnl - Moved GIFs, and other static HTTP response templates -dnl to project.h -dnl -dnl - Some minor fixes -dnl -dnl - Removed some >400 CRs again (Jon, you really worked -dnl a lot! ;-) -dnl -dnl Revision 1.2 2001/05/20 01:21:20 jongfoster -dnl Version 2.9.4 checkin. -dnl - Merged popupfile and cookiefile, and added control over PCRS -dnl filtering, in new "permissionsfile". -dnl - Implemented LOG_LEVEL_FATAL, so that if there is a configuration -dnl file error you now get a message box (in the Win32 GUI) rather -dnl than the program exiting with no explanation. -dnl - Made killpopup use the PCRS MIME-type checking and HTTP-header -dnl skipping. -dnl - Removed tabs from "config" -dnl - Moved duplicated url parsing code in "loaders.c" to a new funcition. -dnl - Bumped up version number. -dnl -dnl Revision 1.1.1.1 2001/05/15 13:58:50 oes -dnl Initial import of version 2.9.3 source tree -dnl -dnl - dnl ================================================================= dnl AutoConf Initialization dnl ================================================================= -AC_REVISION($Revision: 1.126 $) +AC_REVISION($Revision: 1.166 $) AC_INIT(jcc.c) if test ! -f config.h.in; then @@ -578,7 +44,7 @@ if test ! -f config.h.in; then else autoheader fi -fi +fi AC_CONFIG_HEADER([config.h]) AC_CANONICAL_HOST @@ -586,13 +52,13 @@ AC_CANONICAL_HOST dodk=auto DKPREFIX=none AC_ARG_WITH(docbook, dnl - --with-docbook=[[yes|no|directory]] - Enable docbook documentation creation + --with-docbook=[[yes|no|directory]] + Enable docbook documentation creation (default = yes, for gnu and linux),[dnl case "$with_docbook" in yes) dodk=yes;; no) dodk=no;; -*) +*) dodk=yes DKPREFIX=$withval ;; @@ -612,12 +78,13 @@ dnl ================================================================= VERSION_MAJOR=3 VERSION_MINOR=0 -VERSION_POINT=12 +VERSION_POINT=19 CODE_STATUS="stable" -dnl CODE_STATUS can be "alpha", "beta", or "stable", and will be -dnl used for CGI output. Set version to 0.0.0 and status to "UNRELEASED" -dnl whenever CVS in a stable branch differs from the last release. +dnl CODE_STATUS can be "alpha", "beta", "stable" or "UNRELEASED", +dnl and will be used for CGI output. Increment version number and +dnl set status to "UNRELEASED" whenever CVS differs from the last +dnl release and no new release is near. dnl ================================================================= dnl Substitute the version numbers @@ -652,13 +119,13 @@ AC_PROG_MAKE_SET AC_PROG_AWK AC_CHECK_PROG(GDB,gdb,yes,no) -AC_PATH_PROG(BGROUPS,groups,no,/bin:/usr/bin:/usr/local/bin) -AC_PATH_PROG(ID,id,no,/bin:/usr/bin:/usr/local/bin) +AC_PATH_PROG(BGROUPS,groups,no,$PATH:/bin:/usr/bin:/usr/local/bin) +AC_PATH_PROG(ID,id,no,$PATH:/bin:/usr/bin:/usr/local/bin) AC_SUBST(ID) AC_SUBST(BGROUPS) dnl ================================================================= -dnl debug, gcc and gdb support +dnl debug, gcc and gdb support dnl ================================================================= AC_ARG_WITH(debug, @@ -736,7 +203,7 @@ else AC_MSG_CHECKING([for group]) AC_ARG_WITH(group, [ --with-group=privoxy Set group for privoxy], - [ + [ if test "x$withval" != "xyes"; then if test $BGROUPS = no ; then AC_MSG_ERROR(There is no 'groups' program on this system) @@ -775,7 +242,7 @@ fi dnl ================================================================= dnl additional gcc flags dnl ================================================================= -dnl +dnl if test "$GCC"; then if test "$host" != "powerpc-unknown-amigaos"; then CFLAGS="-pipe $CFLAGS" @@ -793,7 +260,7 @@ dnl Reason: This sets CFLAGS in order to switch the Cygwin compiler dnl into Cygwin or MinGW32 modes. Depending on the mode selected, dnl the compiler will use completely different sets of library dnl and include files. -dnl +dnl dnl ================================================================= AC_MINGW32 @@ -832,6 +299,7 @@ fi]) if test $target_type = mingw; then WIN_ONLY= + CFLAGS="$CFLAGS -DWINVER=0x501" SPECIAL_CFLAGS="-mwindows -mno-cygwin" PTHREAD_LIB=-lpthreadGC echo "Using mingw32 (Win32 GUI)" @@ -848,7 +316,7 @@ else fi AC_SUBST(WIN_ONLY) -dnl Checking which text html browser we have avaliable +dnl Checking which text html browser we have available if test $dodk != no; then AC_CHECK_PROGS(WDUMP,w3m lynx links,false) if test "$WDUMP" = false; then @@ -856,7 +324,7 @@ if test $dodk != no; then fi if test $DB2HTML = false; then dnl We need to clean the variable, otherwise AC_CHECK_PROGS - dnl will fail + dnl will fail DB2HTML="" AC_CHECK_PROGS(DB2HTML,db2html docbook2html,false) fi @@ -932,6 +400,13 @@ fi AC_SUBST(JADECAT) AC_SUBST(DKPREFIX) +AC_ARG_ENABLE(large-file-support, +[ --enable-large-file-support Define _LARGE_FILES and friends. + Required by some systems to support files larger then 2GB.], +[if test $enableval = yes; then + CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1" +fi]) + dnl Save old CFLAGS so we can restore them later, then add SPECIAL_CFLAGS old_CFLAGS_nospecial=$CFLAGS CFLAGS="$CFLAGS $SPECIAL_CFLAGS" @@ -955,7 +430,7 @@ AC_ARG_ENABLE(pthread, [if test $enableval = no; then # Disable pthreads if test $have_pthread = yes; then - AC_MSG_WARN([pthreads seem to be available but you are using --disable-pthread.]) + AC_MSG_WARN([pthreads seem to be available but you are using --disable-pthread.]) AC_MSG_WARN([This is almost always a mistake and can render Privoxy unacceptable slow.]) fi have_pthread=no @@ -1173,10 +648,10 @@ AC_SUBST(SOCKET_LIB) dnl ================================================================= dnl Mac OSX specific dnl ================================================================= - + case "$host" in *-apple-darwin*) SPECIAL_CFLAGS="-Dunix" -;; +;; esac dnl ================================================================= @@ -1226,19 +701,63 @@ dnl AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/time.h unistd.h) AC_CHECK_HEADERS([OS.h arpa/inet.h errno.h fcntl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h sys/timeb.h sys/wait.h unistd.h]) dnl Checks for library functions. -dnl AC_TYPE_SIGNAL -dnl AC_CHECK_FUNC(strstr) -dnl bcopy and memmove are for PCRE -AC_CHECK_FUNCS([strerror bcopy memmove]) +dnl bcopy is for PCRE +AC_CHECK_FUNCS([bcopy]) AC_PROG_GCC_TRADITIONAL -dnl uncommenting does not work for swa. suse linux -dnl AC_FUNC_MALLOC -AC_FUNC_SETPGRP AC_TYPE_SIGNAL -dnl uncommenting does not work for swa. suse linux -dnl AC_FUNC_STAT AC_CHECK_FUNCS([access atexit getcwd gethostbyaddr gethostbyaddr_r gethostbyname gethostbyname_r gettimeofday inet_ntoa localtime_r memchr memmove memset poll putenv random regcomp select setlocale snprintf socket strchr strdup strerror strftime strlcat strlcpy strptime strstr strtoul timegm tzset]) +dnl Checks for RFC 2553 resolver and socket functions +AC_ARG_ENABLE(ipv6-support, +[ --disable-ipv6-support Disable IPv6 support and other RFC-2554-related improvements], +[if test $enableval = yes; then + enable_ipv6_support=yes +fi], enable_ipv6_support=yes) + +if test $enable_ipv6_support != yes; then + AC_MSG_WARN([Skipping checks for IPv6 support and other RFC-2554-related improvements. + Due to lock contention, this may result in slower DNS resolution for IPv4 setups, too.]) +elif test $target_type = mingw; then + AC_CHECK_LIB(ws2_32, main) + + AC_MSG_CHECKING(getaddrinfo in ws2_32) + AC_TRY_LINK( + [ + #include + #include + ], + [getaddrinfo(0,0,0,0)], + have_ws2_32_getaddrinfo=yes + ) + AC_MSG_RESULT($have_ws2_32_getaddrinfo) + + AC_MSG_CHECKING(getnameinfo in ws2_32) + AC_TRY_LINK( + [ + #include + #include + ], + [getnameinfo(0,0,0,0,0,0,0)], + have_ws2_32_getnameinfo=yes + ) + AC_MSG_RESULT($have_ws2_32_getnameinfo) + + if test $have_ws2_32_getaddrinfo ; then + if test $have_ws2_32_getnameinfo ; then + AC_DEFINE([HAVE_RFC2553], [1], + [Define if RFC 2553 resolver functions like getaddrinfo(3) and + getnameinfo(3) present]) + fi + fi +else + AC_CHECK_FUNC([getaddrinfo], + [AC_CHECK_FUNC([getnameinfo], + [AC_DEFINE([HAVE_RFC2553], [1], + [Define if RFC 2553 resolver functions like getaddrinfo(3) and + getnameinfo(3) present]) + ]) + ]) +fi dnl ================================================================= dnl Checks for libraries. @@ -1255,7 +774,7 @@ AC_CHECK_LIB(pcre, pcre_compile, [ ], [have_pcre=no]) ]) ], [have_pcre=no]) - + AC_CHECK_LIB(pcreposix, regcomp, [ AC_CHECK_HEADER(pcreposix.h, [ AC_EGREP_HEADER(pcreposix_regerror, pcreposix.h, [AC_MSG_WARN([[pcreposix old version installed]]); have_pcreposix=no], [have_pcreposix=yes]) @@ -1264,7 +783,7 @@ AC_CHECK_LIB(pcreposix, regcomp, [ AC_EGREP_HEADER(pcreposix_regerror, pcre/pcreposix.h, [AC_MSG_WARN([[pcreposix old version installed]]); have_pcreposix=no], [have_pcreposix=yes]; [AC_DEFINE(PCREPOSIX_H_IN_SUBDIR)]) ], [have_pcreposix=no]) ]) -], [have_pcreposix=no], -lpcre) +], [have_pcreposix=no], -lpcre) dnl ================================================================ dnl libpcrs is temporarily disabled. @@ -1319,15 +838,15 @@ AC_ARG_ENABLE(ie-images, fi],) AC_ARG_ENABLE(image-blocking, -[ --disable-image-blocking Don't try to figure out whether a request is +[ --disable-image-blocking Don't try to figure out whether a request is for an image or HTML - assume HTML.], [if test $enableval = yes; then AC_DEFINE(FEATURE_IMAGE_BLOCKING) fi], AC_DEFINE(FEATURE_IMAGE_BLOCKING)) -AC_ARG_ENABLE(acl-files, -[ --disable-acl-files Prevents the use of ACL files to control access to +AC_ARG_ENABLE(acl-support, +[ --disable-acl-support Prevents the use of ACLs to control access to Privoxy by IP address.], [if test $enableval = yes; then AC_DEFINE(FEATURE_ACL) @@ -1363,11 +882,23 @@ AC_ARG_ENABLE(graceful-termination, fi]) AC_ARG_ENABLE(extended-host-patterns, -[ --enable-extended-host-patterns Allow extended regular expressions in host patterns.], +[ --enable-extended-host-patterns Enable and require PCRE syntax in host patterns. This feature hasn't + been announced yet and it's not clear if it's a good idea. It's expected + to work, but undocumented. You should only enable it if you know what + PCRE is and are sure that you need it for your host patterns. You can + use tools/url-pattern-translator.pl to convert existing action files to + use PCRE host patterns. Please don't enable this option when creating + packages for others that may not be expecting it.], [if test $enableval = yes; then AC_DEFINE(FEATURE_EXTENDED_HOST_PATTERNS) fi]) +AC_ARG_ENABLE(accept-filter, +[ --enable-accept-filter Try to use accf_http(9) if supported.], +[if test $enableval = yes; then + AC_DEFINE(FEATURE_ACCEPT_FILTER) +fi]) + dnl pcre/pcrs is needed for CGI anyway, so dnl the choice is only between static and dnl dynamic: @@ -1397,12 +928,25 @@ if test $enableval2 = yes; then AC_CHECK_LIB(z, zlibVersion, [have_zlib="yes"], [have_zlib="no"]) if test $have_zlib = "yes"; then LIBS="$LIBS -lz" - AC_DEFINE(FEATURE_ZLIB,1,[Define to 1 to use compression through the zlib library.]) + AC_DEFINE(FEATURE_ZLIB,1,[Define to 1 to use zlib to decompress data before filtering.]) else AC_MSG_WARN([No zlib found. Privoxy will not be able to filter compressed content. This may become a fatal error in the future.]) - fi + fi +fi + +AC_ARG_ENABLE(compression, +[ --enable-compression Allow Privoxy to compress buffered content if the client supports it. Requires zlib support.], +[enableval2=$enableval], +[enableval2=no]) +if test $enableval2 = yes; then + if test $have_zlib = "yes"; then + echo Enabling compression support. + AC_DEFINE(FEATURE_COMPRESSION,1,[Define to 1 to use compression through the zlib library.]) + else + AC_MSG_WARN([No zlib found. Privoxy will not be able to (re-)compressed buffered content.]) + fi fi @@ -1416,16 +960,18 @@ if test $have_pcre = "yes"; then STATIC_PCRE_ONLY=# LIBS="$LIBS -lpcre -lpcreposix" else - AC_MSG_WARN([You are using the static PCRE code which is scheduled for removal, for details see: - https://sourceforge.net/mailarchive/message.php?msg_id=20080511195555.2dc6cfdc%40fabiankeil.de]) + AC_MSG_WARN([You are using the static PCRE code which is out of date and scheduled for removal, for details see: + http://sourceforge.net/mailarchive/forum.php?thread_name=20080511195555.2dc6cfdc%40fabiankeil.de&forum_name=ijbswa-developers]) pcre_dyn=no AC_DEFINE(STATIC_PCRE) STATIC_PCRE_ONLY= fi +AC_DEFINE(FEATURE_CONNECTION_KEEP_ALIVE) + if test $have_pthread = "yes" -o $target_type = "mingw"; then - echo Enabling keep-alive support for outgoing connections. - AC_DEFINE(FEATURE_CONNECTION_KEEP_ALIVE) + echo Enabling connection-sharing support. + AC_DEFINE(FEATURE_CONNECTION_SHARING) fi dnl ================================================= @@ -1453,7 +999,7 @@ dnl ================================================================= dnl Final cleanup and output dnl ================================================================= -dnl Remove the SPECIAL_CFLAGS stuff from CFLAGS, and add it seperately +dnl Remove the SPECIAL_CFLAGS stuff from CFLAGS, and add it separately dnl in the Makefile CFLAGS=$old_CFLAGS_nospecial AC_SUBST(SPECIAL_CFLAGS) diff --git a/external/privoxy/cygwin.h b/external/privoxy/cygwin.h index 526f8d07..421516af 100644 --- a/external/privoxy/cygwin.h +++ b/external/privoxy/cygwin.h @@ -1,6 +1,6 @@ #ifndef CYGWIN_H_INCLUDED #define CYGWIN_H_INCLUDED -#define CYGWIN_H_VERSION "$Id: cygwin.h,v 1.6 2006/07/18 14:48:45 david__schmidt Exp $" +#define CYGWIN_H_VERSION "$Id: cygwin.h,v 1.8 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cygwin.h,v $ @@ -13,10 +13,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -34,26 +34,6 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: cygwin.h,v $ - * Revision 1.6 2006/07/18 14:48:45 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.4 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.3 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.2 2001/07/29 18:43:08 jongfoster - * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to - * ANSI C rules. - * - * Revision 1.1.1.1 2001/05/15 13:58:51 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ /* Conditionally include this whole file. */ diff --git a/external/privoxy/deanimate.c b/external/privoxy/deanimate.c index 01fc97c9..cbf0ca8f 100644 --- a/external/privoxy/deanimate.c +++ b/external/privoxy/deanimate.c @@ -1,4 +1,4 @@ -const char deanimate_rcs[] = "$Id: deanimate.c,v 1.19 2008/05/21 15:29:35 fabiankeil Exp $"; +const char deanimate_rcs[] = "$Id: deanimate.c,v 1.21 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/deanimate.c,v $ @@ -6,7 +6,7 @@ const char deanimate_rcs[] = "$Id: deanimate.c,v 1.19 2008/05/21 15:29:35 fabian * Purpose : Declares functions to manipulate binary images on the * fly. High-level functions include: * - Deanimation of GIF images - * + * * Functions declared include: gif_deanimate, buf_free, * buf_copy, buf_getbyte, gif_skip_data_block * and gif_extract_image @@ -19,7 +19,7 @@ const char deanimate_rcs[] = "$Id: deanimate.c,v 1.19 2008/05/21 15:29:35 fabian * and ideas from the Image::DeAnim Perl module by * Ken MacFarlane, * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -37,77 +37,8 @@ const char deanimate_rcs[] = "$Id: deanimate.c,v 1.19 2008/05/21 15:29:35 fabian * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: deanimate.c,v $ - * Revision 1.19 2008/05/21 15:29:35 fabiankeil - * Fix gcc43 warnings. - * - * Revision 1.18 2008/03/28 15:13:38 fabiankeil - * Remove inspect-jpegs action. - * - * Revision 1.17 2007/08/05 13:42:22 fabiankeil - * #1763173 from Stefan Huehner: declare some more functions static. - * - * Revision 1.16 2007/07/14 08:01:58 fabiankeil - * s@failiure@failure@ - * - * Revision 1.15 2007/01/03 14:39:19 fabiankeil - * Fix a gcc43 warning and mark the binbuffer - * as immutable for buf_getbyte(). - * - * Revision 1.14 2006/07/18 14:48:45 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.12.2.1 2004/10/03 12:53:32 david__schmidt - * Add the ability to check jpeg images for invalid - * lengths of comment blocks. Defensive strategy - * against the exploit: - * Microsoft Security Bulletin MS04-028 - * Buffer Overrun in JPEG Processing (GDI+) Could - * Allow Code Execution (833987) - * Enabled with +inspect-jpegs in actions files. - * - * Revision 1.12 2002/05/12 21:36:29 jongfoster - * Correcting function comments - * - * Revision 1.11 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.10 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.9 2002/03/13 00:27:04 jongfoster - * Killing warnings - * - * Revision 1.8 2002/03/09 19:42:47 jongfoster - * Fixing more warnings - * - * Revision 1.7 2002/03/08 17:46:04 jongfoster - * Fixing int/size_t warnings - * - * Revision 1.6 2002/03/07 03:46:17 oes - * Fixed compiler warnings - * - * Revision 1.5 2001/09/10 10:16:06 oes - * Silenced compiler warnings - * - * Revision 1.4 2001/07/18 12:28:49 oes - * - Added feature for extracting the first frame - * to gif_deanimate - * - Separated image buffer extension into buf_extend - * - Extended gif deanimation to GIF87a (untested!) - * - Cosmetics - * - * Revision 1.3 2001/07/15 13:57:50 jongfoster - * Adding #includes string.h and miscutil.h - * - * Revision 1.2 2001/07/13 13:46:20 oes - * Introduced GIF deanimation feature - * - * **********************************************************************/ - + #include "config.h" @@ -122,7 +53,7 @@ const char deanimate_rcs[] = "$Id: deanimate.c,v 1.19 2008/05/21 15:29:35 fabian const char deanimate_h_rcs[] = DEANIMATE_H_VERSION; /********************************************************************* - * + * * Function : buf_free * * Description : Safely frees a struct binbuffer @@ -148,7 +79,7 @@ void buf_free(struct binbuffer *buf) /********************************************************************* - * + * * Function : buf_extend * * Description : Ensure that a given binbuffer can hold a given amount @@ -159,7 +90,7 @@ void buf_free(struct binbuffer *buf) * Parameters : * 1 : buf = Pointer to the binbuffer * 2 : length = Desired minimum size - * + * * * Returns : 0 on success, 1 on failure. * @@ -190,7 +121,7 @@ static int buf_extend(struct binbuffer *buf, size_t length) /********************************************************************* - * + * * Function : buf_copy * * Description : Safely copies a given amount of bytes from one @@ -211,7 +142,7 @@ static int buf_copy(struct binbuffer *src, struct binbuffer *dst, size_t length) /* * Sanity check: Can't copy more data than we have */ - if (src->offset + length > src->size) + if (src->offset + length > src->size) { return 1; } @@ -219,7 +150,7 @@ static int buf_copy(struct binbuffer *src, struct binbuffer *dst, size_t length) /* * Ensure that dst can hold the new data */ - if (buf_extend(dst, length)) + if (buf_extend(dst, length)) { return 1; } @@ -238,7 +169,7 @@ static int buf_copy(struct binbuffer *src, struct binbuffer *dst, size_t length) /********************************************************************* - * + * * Function : buf_getbyte * * Description : Safely gets a byte from a given binbuffer at a @@ -266,7 +197,7 @@ static unsigned char buf_getbyte(const struct binbuffer *src, size_t offset) /********************************************************************* - * + * * Function : gif_skip_data_block * * Description : Safely advances the offset of a given struct binbuffer @@ -284,7 +215,7 @@ static int gif_skip_data_block(struct binbuffer *buf) { unsigned char c; - /* + /* * Data blocks are sequences of chunks, which are headed * by a one-byte length field, with the last chunk having * zero length. @@ -305,12 +236,12 @@ static int gif_skip_data_block(struct binbuffer *buf) /********************************************************************* - * + * * Function : gif_extract_image * * Description : Safely extracts an image data block from a given * struct binbuffer that contains a GIF image and whose - * offset is positioned at the start of a data block + * offset is positioned at the start of a data block * into a given destination binbuffer. * * Parameters : @@ -348,7 +279,7 @@ static int gif_extract_image(struct binbuffer *src, struct binbuffer *dst) if (buf_copy(src, dst, (size_t)map_length)) { return 1; - } + } } if (buf_copy(src, dst, 1)) return 1; @@ -373,7 +304,7 @@ static int gif_extract_image(struct binbuffer *src, struct binbuffer *dst) } /********************************************************************* - * + * * Function : gif_deanimate * * Description : Deanimate a given GIF image, i.e. given a GIF with @@ -405,9 +336,9 @@ int gif_deanimate(struct binbuffer *src, struct binbuffer *dst, int get_first_im c = buf_getbyte(src, 10); /* - * Check & copy GIF header + * Check & copy GIF header */ - if (strncmp(src->buffer, "GIF89a", 6) && strncmp(src->buffer, "GIF87a", 6)) + if (strncmp(src->buffer, "GIF89a", 6) && strncmp(src->buffer, "GIF87a", 6)) { return 1; } @@ -459,7 +390,7 @@ int gif_deanimate(struct binbuffer *src, struct binbuffer *dst, int get_first_im case 0x3b: goto write; - /* + /* * Image block: Extract to current image buffer. */ case 0x2c: @@ -519,13 +450,13 @@ int gif_deanimate(struct binbuffer *src, struct binbuffer *dst, int get_first_im */ default: goto failed; - + } } /* -END- while src */ /* * Either we got here by goto, or because the GIF is - * bogus and EOF was reached before an end-of-gif marker + * bogus and EOF was reached before an end-of-gif marker * was found. */ diff --git a/external/privoxy/deanimate.h b/external/privoxy/deanimate.h index 53af6f12..cc10facf 100644 --- a/external/privoxy/deanimate.h +++ b/external/privoxy/deanimate.h @@ -1,6 +1,6 @@ #ifndef DEANIMATE_H_INCLUDED #define DEANIMATE_H_INCLUDED -#define DEANIMATE_H_VERSION "$Id: deanimate.h,v 1.12 2008/03/28 15:13:39 fabiankeil Exp $" +#define DEANIMATE_H_VERSION "$Id: deanimate.h,v 1.14 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/deanimate.h,v $ @@ -8,9 +8,9 @@ * Purpose : Declares functions to manipulate binary images on the * fly. High-level functions include: * - Deanimation of GIF images - * + * * Functions declared include: gif_deanimate and buf_free. - * + * * * Copyright : Written by and Copyright (C) 2001 - 2004 by the the * SourceForge Privoxy team. http://www.privoxy.org/ @@ -19,10 +19,10 @@ * Ken MacFarlane, * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -40,51 +40,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: deanimate.h,v $ - * Revision 1.12 2008/03/28 15:13:39 fabiankeil - * Remove inspect-jpegs action. - * - * Revision 1.11 2007/01/12 15:41:00 fabiankeil - * Remove some white space at EOL. - * - * Revision 1.10 2006/07/18 14:48:45 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.8.2.1 2004/10/03 12:53:32 david__schmidt - * Add the ability to check jpeg images for invalid - * lengths of comment blocks. Defensive strategy - * against the exploit: - * Microsoft Security Bulletin MS04-028 - * Buffer Overrun in JPEG Processing (GDI+) Could - * Allow Code Execution (833987) - * Enabled with +inspect-jpegs in actions files. - * - * Revision 1.8 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.7 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.6 2002/03/08 17:46:04 jongfoster - * Fixing int/size_t warnings - * - * Revision 1.5 2002/03/07 03:46:17 oes - * Fixed compiler warnings - * - * Revision 1.4 2001/07/29 18:50:04 jongfoster - * Fixing "extern C" block, and renaming #define _DEANIMATE_H - * - * Revision 1.3 2001/07/18 12:29:05 oes - * Updated prototype for gif_deanimate - * - * Revision 1.2 2001/07/13 13:46:20 oes - * Introduced GIF deanimation feature - * - * *********************************************************************/ - + #ifdef __cplusplus extern "C" { @@ -107,7 +64,7 @@ struct binbuffer extern int gif_deanimate(struct binbuffer *src, struct binbuffer *dst, int get_first_image); extern void buf_free(struct binbuffer *buf); -/* +/* * Revision control strings from this header and associated .c file */ extern const char deanimate_rcs[]; diff --git a/external/privoxy/default.action.master b/external/privoxy/default.action.master index 81c41381..a26a0ec8 100644 --- a/external/privoxy/default.action.master +++ b/external/privoxy/default.action.master @@ -11,7 +11,7 @@ # # File : $Source: /cvsroot/ijbswa/current/default.action.master,v $ # -# $Id: default.action.master,v 1.170 2009/03/04 15:05:00 ler762 Exp $ +# $Id: default.action.master,v 1.242 2011/10/16 13:13:50 fabiankeil Exp $ # # Requires : This version requires Privoxy v3.0.11 or later due to # syntax changes. @@ -23,7 +23,7 @@ # and enhancements are better placed in user.action, # the match-all section has been moved to match-all.action. # -# Copyright : Written by and Copyright (C) 2001-2009 the +# Copyright : Written by and Copyright (C) 2001-2010 the # Privoxy team. http://www.privoxy.org/ # # Note: Updated versions of this file will be made available from time @@ -545,7 +545,7 @@ for-privoxy-version=3.0.11 # These aliases define combinations of actions # that are useful for certain types of sites: # -fragile = -block -crunch-all-cookies -filter -fast-redirects -hide-referer -prevent-compression +fragile = -block -crunch-all-cookies -filter -fast-redirects -hide-referer shop = -crunch-all-cookies allow-popups # Your favourite blend of filters: @@ -563,6 +563,8 @@ allow-ads = -block -filter{banners-by-size} -filter{banners-by-link} # { \ +change-x-forwarded-for{block} \ ++client-header-tagger{css-requests} \ ++client-header-tagger{image-requests} \ +hide-from-header{block} \ +set-image-blocker{pattern} \ } @@ -574,6 +576,8 @@ standard.Cautious # { \ +change-x-forwarded-for{block} \ ++client-header-tagger{css-requests} \ ++client-header-tagger{image-requests} \ +deanimate-gifs{last} \ +filter{refresh-tags} \ +filter{img-reorder} \ @@ -640,6 +644,16 @@ standard.Advanced {-handle-as-image} /.*\.(js|php|css|.?html?) +############################################################################# +# These belong to multimedia files of which Firefox occasionally only +# requests parts. #2816708 +############################################################################# +{-filter -deanimate-gifs} +# Sticky Actions = -filter -deanimate-gifs +# URL = http://www.example.org/foo/bar.ogg +# URL = http://www.example.net/bar.ogv +/.*\.og[gv]$ + ############################################################################# # Generic block patterns by host: ############################################################################# @@ -667,6 +681,7 @@ metrics. # Generic unblockers by host: ############################################################################# {-block} +# Sticky Actions = -block adsl. ad[udmw]*. adbl*. @@ -683,6 +698,11 @@ adventure*. .*[epu]ad*. county*. countr*. +#MASTER# REMARKS: We still like tor +# URL = http://metrics.torproject.org/consensus-graphs.html +metrics.torproject.org/ +# URL = http://linuxcounter.net/ +linuxcounter.net/ ############################################################################# # Generic block patterns by path: @@ -708,6 +728,8 @@ countr*. /.*(lo|thre|he|d|gr|l|ro|re|squ|class(ified)?)ads /.*account support./(.*/)?track +# URL = http://repo.or.cz/r/vlc.git/objects/ad/1d316efd83157217fdf9b5d417dddca54bbf41 +/.*\.git/objects/ ############################################################################# # Exceptions for academia and non-profits @@ -737,6 +759,152 @@ support./(.*/)?track #MASTER# REMARKS: Added "text" 20070730 as per http://www.pcworld.com/textad?Keywords=System Resources Tune-Up.&type=pcworld_downloads_search&count=3&ord=906010128&serveUrl=http%3A%2F%2Fwww.pcworld.com%2Fdownloads%2Ffile%2Ffid%2C7661-order%2C1-page%2C1-c%2Csystemresourcestuneup%2Fdescription.html Adam Piggott /.*(top|bottom|left|right|text)_?ad +############################################################################# +# Catch-all exceptions +############################################################################# +{-block} +# Sticky Actions = -block + +#MASTER# REMARKS: Actionsfile feedback item #2933856 2010-01-17 16:59 +#MASTER# REMARKS: Allow URLs containing DektopAdmin (matches .*top_?ad) +# URL = http://support.apple.com/downloads/DL985/en_US/RemoteDesktopAdmin332.dmg +/.*desktopadmin + + +#---------------------------------------------------------------------------- +# Misc Web-bugs, JS and just plain Junk. Images here aren't normal images. +#---------------------------------------------------------------------------- +{+block{Might be a web-bug.} +handle-as-empty-document -handle-as-image} +#MASTER# REMARKS: signature for user tracking nytimes, cnn.com,latimes.com and many others. 10/06/06 +/b/ss/.+ +#MASTER# BLOCK-REFERRER: http://www.thesun.co.uk/article/0,,11071-10784,00.html +#MASTER# REMARKS: widespread hitbox signature 10/06/06 +/HG\?hc= +#MASTER# BLOCK-REFERRER: http://macaddict.com 10/06/06 +.visistat.com +#MASTER# REMARKS: See for user tracking. +#MASTER# REMARKS: There is a ssl.google-analytics as well. +.google-analytics./ +#MASTER# REMARKS: Below Moved here from -handle-as-image 10/16/06 ########## +#MASTER# BLOCK-REFERRER: http://forums2.gardenweb.com/forums/orchids/ 09/25/06 +#MASTER# REMARKS: Mostly JS and plain text stuff +.overture. +#MASTER# PROBLEM-URL: http://www.linuxtoday.com/ +#MASTER# REMARKS: /adi has HTML snipplets for use in IFRAMEs 10/15/06 +.doubleclick.net/adi +.doubleclick.net/(.*/)?adj/ +#MASTER# PROBLEM-URL: http://maps.yahoo.com/ +#MASTER# REMARKS: /AVE/iview has HTML snipplets for use in IFRAMEs 10/15/06 +view.atdmt.com/(.*/)?iview/ +#MASTER# REMARKS: Above Moved here from -handle-as-image 10/16/06 ########## +#MASTER# REMARKS: Generic, re: tracking.foxnews.com/HG? 10/01/06 +tracking. +#MASTER# BLOCK-REFERRER: http://netcraft.com and many others 10/22/06 +/(.*/)?adjs\.php\? +#MASTER# BLOCK-REFERRER: http://groups.yahoo.com/group/epdf/ 10/08/06 +.bc.yahoo.com/b\?P= +#MASTER# BLOCK-REFERRER: http://www.motherboard.cz 10/30/06 +x*.alexa.com +#MASTER# BLOCK-REFERRER: http://mplayernetwork.com 11/07/06 +#MASTER# BLOCK-REFERRER: http://eetimes.com 09/26/06 +/event.ng/ +#MASTER# BLOCK-REFERRER: http://www.homedepot.com/ 11/08/06 +#MASTER# BLOCK-REFERRER: http://www.williams-sonoma.com/ 11/08/06 +/cm\?[tc] +#MASTER# BLOCK-REFERRER: http://www.snapfiles.com/feedback/ 12/13/06 SF tracker +.snapfiles.net/rotation/.*\.asp +#MASTER# BLOCK-REFERRER: not provided. SF tracker #1616034 12/16/06 +#MASTER# COMMENT: JS pop-ups +spa.snap.com/ +#MASTER# BLOCK-REFERRER: http://www.gamefaqs.com/computer/doswin/game/914819.html 12/18/06 +#MASTER# COMMENT: user tracking, and run-away assorted 'junk' +#MASTER# BLOCK-REFERRER: http://formwood.com 2007-11-12 +.insitemetrics.com/ +#MASTER# COMMENT: user tracking, and assorted 'junk' +#MASTER# BLOCK-REFERRER: http://blogblog.com 2007-11-12 +.extreme-dm.com/ +#MASTER# COMMENT: user tracking, and assorted 'junk' +#MASTER# BLOCK-REFERRER: http://www.schillmania.com 2007-11-12 +stats.reinvigorate.net/ +#MASTER# COMMENT: user tracking, and assorted 'junk' +#MASTER# BLOCK-REFERRER: http://wordpress.com 2007-11-12 +.getclicky.com/ +#MASTER# COMMENT: user tracking, and assorted 'junk' +#MASTER# BLOCK-REFERRER: http://infoworld.com 2007-11-12 +.quantserve.com +# Blocked URL = http://media.adrevolver.com/adrevolver/trace?sip=123&cpy=123 +media.adrevolver.com/ +#MASTER# REMARKS: Actionsfile feedback item #2975895 2010-03-24 +# Blocked URL = http://static.chartbeat.com/js/chartbeat.js +.chartbeat.com/(.*/)?chartbeat\.js$ +# Blocked URL = http://js.adlink.net/js?lang=de&s=duesseldorf-international.de&z=home&d=1274103403564 +#MASTER# BLOCK-REFERRER: http://www.duesseldorf-international.de/ +js.adlink.net/ +# Blocked URL = nl.sitestat.com/rdw/rdw/s?www.nl.voertuigeigenaar.voertuigeigenaar&ns__t=1274099350343 +#MASTER# BLOCK-REFERRER: http://www.rdw.nl/nl/voertuigeigenaar/ +.sitestat.com/ +#MASTER# BLOCK-REFERRER: http://www.chip.de/artikel/c_artikelunterseite_10423683.html +# Blocked URL = http://pagead.googlesyndication.example.com/foo/bar/baz.js +pagead*.googlesyndication./.*\.js +#MASTER# BLOCK-REFERRER: http://www.pcmag.com/ 11/22/06 per SF Tracker # 1601148 +/js/slider\.js +#MASTER# BLOCK-REFERRER: http://floodle.net 2007-01-21 SF tracker +scripts.chitika.net/.*\.js +#MASTER# BLOCK-REFERRER: via Yahoo groups +#MASTER# REMARKS: Actionsfile tracker 1645513 2007-01-26 +.adinterax.com/.*\.js +#MASTER# BLOCK-REFERRER: http://dictionary.reference.com/search?q=privacy&db=* +#MASTER# REMARKS: Actionsfile tracker 1650798 2007-02-02 +# Blocked URL = http://partner.googleadservices.com/gampad/google_service.js +# Blocked URL = http://partner.googleadservices.com/gampad/google_ads.js +# Blocked URL = http://partner.googleadservices.com/gampad/slotdata.js?callback=_GA_googleAdData.setAdSlotAttributes&client=ca-gam-lexico +.googleadservices.com/gampad/.*\.js +# Blocked URL = http://richmedia.yimg.com/js/123/personnals_banners/PER_happy_sara1_4_425x600/ad.js?q=123 +/.*/ad\.js\? +# Blocked URL = http://i.cmpnet.com/shared/omniture/s_code_remote.js +#MASTER# BLOCK-REFERRER: http://www.informationweek.de/ +/.*omniture.*\.js +# Blocked URL = http://gadk.hit.gemius.pl/*/_1274097577014/rexdot.gif?l=30&id=..DlR.vCLZGB56RmfkYNSWZVLSqB3ueYOP.Oec5WWiv.h7&fr=1&fv=WIN%2010%2C0%2C45%2C2&tz=-120&href=http%3A//www.baadgalleri.dk/&ref=&screen=1440x900&col=32 +#MASTER# BLOCK-REFERRER: http://www.baadgalleri.dk/ +.gemius.pl/ + + +{+block{Might be a web-bug.} -handle-as-empty-document +handle-as-image} +#MASTER# BLOCK-REFERRER: http://versiontracker.com and many others. 10/20/06 +/(.*/)?__utm.gif\? +#MASTER# BLOCK-REFERRER: http://washingpost.com and others 10/25/06 +/.*\.gif\?D=DM +#MASTER# BLOCK-REFERRER: http://www.washingtonpost.com/ +#stats.surfaid.ihost.com/(crc/)?images/(bounce/)?uc.GIF +#MASTER# BLOCK-REFERRER: http://www.ibm.com 10/09/06 +#MASTER# REMARKS: Similar hostname and paths appear in multiple locations. +# Blocked URL = http://stats.surfaid.ihost.com/crc/images/bounce/uc.GIF +# Blocked URL = http://stats.surfaid.ihost.com/rc/images/bounce/uc.GIF +stats./c?rc/.*/uc.gif +#MASTER# BLOCK-REFERRER: http://priceline.com 10/20/06 +#MASTER# REMARKS: User tracking, webbug stuff +/(.*/)?dcs.gif\?&?dcs +#MASTER# BLOCK-REFERRER: http://www.msnbc.com 10/07/06 +#MASTER# REMARKS: And MANY others. Webbug stuff. +/(.*/)?c(lear)?\.gif\?. +#MASTER# BLOCK-REFERRER: http://www.investorguide.com 10/08/06 +#MASTER# BLOCK-REFERRER: http://foodnetwork.com, http://gardenweb.com 10/20/06 +#MASTER# REMARK: webbug type gif used in MANY places. +#MASTER# REMARK: Too many false positives +#/(.*/)?(clear|(trans_?1x|blank)?1).gif +#MASTER# REMARK: Let's try this way. +/(.*/)?(clear|blank|(trans_?|1x)?1).gif\?. +#MASTER# BLOCK-REFERRER: http://actorstheatre.org 11/02/06 +stats./.*\.gif\? +# Blocked URL = http://ad.yieldmanager.com/pixel?id=123456&t=2 +.yieldmanager.com/pixel\? +# Blocked URL = http://a.analytics.yahoo.com/p.pl?a=1000226660965&js=no +# Blocked URL = http://s.analytics.yahoo.com/fpc.pl?a=1000461640983&v=4.43&enc=utf-8&f=http%3A//www.zoover.nl/nederland/limburg/maasbracht/weer%23tabs&b=Het%20Weer%20in%20Maasbracht.%20Bekijk%20Weersverwachting%20van%20Maasbracht%20%7C%20Zoover%23tabs&flv=WIN%2010%2C0%2C45%2C2&d=Mon%2C%2017%20May%202010%2014%3A09%3A26%20UTC&n=-2&g=nl&h=Y&j=1440x900&k=32&l=true&ittidx=0&fpc=uP04C7j4%7ClaDQjglKaa%7Cfses1000461640983%3D%7CkbSSgv6Jaa%7CuP04C7j4%7Cfvis1000461640983%3DZj1odHRwJTNBLy93d3cuem9vdmVyLm5sLyZiPVpvb3ZlciUyMCU3QyUyMFZha2FudGllYmVvb3JkZWxpbmdlbiUyMHZvb3IlMjBlbiUyMGRvb3IlMjByZWl6aWdlcnM%3D%7C8sHTYo10oM%7C8sHTYo10oM%7C8sHTYo10oM%7CT%7C8sHTYo10oM%7C8sHTYo10oM +.analytics.yahoo.com +#MASTER# BLOCK-REFERRER: http://www.aktivist.pl/ +# Blocked URL = http://go.idmnet.bbelements.com/please/showit/46/1/1/1/?typkodu=img&keywords= +go.idmnet.bbelements.com/please/showit/ + ############################################################################# # Site-specific block patterns; ############################################################################# @@ -748,6 +916,10 @@ support./(.*/)?track landing.trafficz.com/ # Blocked URL = http://www.searchnut.com/?domain=www.inetcat.org .searchnut.com/\?domain +#MASTER# REMARKS: Verizon should know better +#MASTER# BLOCK-REFERRER: http://www.qwetyhjkl.com +# Blocked URL = http://wwwz.websearch.verizon.net/search?qo=www.qwetyhjkl.com +wwwz.websearch.verizon.net/search\?qo= {+block{Site-specific block pattern matches.}} #MASTER# BLOCK-REFERRER: http://www.brooksbrothers.com/ 10/18/06 @@ -887,128 +1059,52 @@ static.lycos-europe.net #MASTER# BLOCK-REFERRER: http://hitta.se # Blocked URL = http://82.99.18.195/media.1/112/9460/146016/150x175_Hitta_FV_Feb08.gif 82.99.18.195 -#MASTER# REMARKS: Actionsfile feedback item #1888197 2008-02-06 -#MASTER# REMARKS: Have a "go there anyway" link for clk.atdmt.com +#MASTER# REMARKS: Actionsfile feedback item #1888197 and #2975927. +#MASTER# REMARKS: Have a "go there anyway" link for clk.atdmt.com and view.atdmt.com. #MASTER# BLOCK-REFERRER: http://www.networkworld.com/resourcelibrary/?tid=4&type=special%20report # Blocked URL = http://clk.atdmt.com/ +# Blocked URL = http://view.atdmt.com/action/mrtiwy_FY10Office2010BetaHomeandBiz1_1 .atdmt.com/ +#MASTER# REMARKS: Actionsfile feedback item #2723873 2009-04-01 +#MASTER# BLOCK-REFERRER: http://www.news.software.coop/paralysed-perl-package-problem/602/ +# Blocked URL = http://www.awin1.com/cread.php?s=123049&v=1983&q=80970&r=79561 +.awin1.com +#MASTER# BLOCK-REFERRER: http://crooksandliars.com/ +# Blocked URL = http://rotator.adjuggler.com/servlet/ajrotator/616245/0/vh?z=csm&dim=616028 +.adjuggler.com/servlet/ajrotator/ +#MASTER# Remark: nothing but "sponsored listings" +# Blocked URL = http://bcc.co.uk/ +bcc.co.uk/ +# Blocked URL = http://fusion.adtoma.com:80/125AFFE801/1DC59C7801.swf +# Blocked URL = http://fusion.adtoma.com/1254D5CC01/1E43C76801.jpg +fusion.adtoma.com/ +#MASTER# Remark: Actionsfile feedback item #2975895 2010-03-24 +# Blocked URL = http://ping.chartbeat.net/ping?h=uservoice.com&p=%2Fsuggestions%2Fping-chartbeat-net-sucks&u=3 +.chartbeat.net/(.*/)?ping\? +# Blocked URL = http://s.atemda.com/Admeta.js +# Blocked URL = http://atemda.com/ClickThrough.ashx?pId=9616&mId=14484&tId=634102151426089505&opS=1&admetac=mR3sJ3%2b9yleq%2bHowITh0hw%3d%3d +#MASTER# BLOCK-REFERRER: http://www.startpagina.nl +.atemda.com/ +#MASTER# Remark: 2o7.net, omtrdc.net and www91.intel.com are domains used by Omniture +# Blocked URL = http://ciscosystemsinc.tt.omtrdc.net/m2/ciscosystemsinc/mbox/standard?mboxHost=www.cisco.com&mboxSession=12 +.omtrdc.net/ +# Blocked URL = http://www91.intel.com/b/ss/intelcorp,intelcorpdc/...ONDataProvider.aspx%3FDownloadType%3DDrivers&ot=A&AQE=1 +www91.intel.com/ -#---------------------------------------------------------------------------- -# Misc Web-bugs, JS and just plain Junk. Images here aren't normal images. -#---------------------------------------------------------------------------- -{+block{Might be a web-bug.} +handle-as-empty-document -handle-as-image} -#MASTER# REMARKS: signature for user tracking nytimes, cnn.com,latimes.com and many others. 10/06/06 -/b/ss/.+ -#MASTER# BLOCK-REFERRER: http://www.thesun.co.uk/article/0,,11071-10784,00.html -#MASTER# REMARKS: widespread hitbox signature 10/06/06 -/HG\?hc= -#MASTER# BLOCK-REFERRER: http://macaddict.com 10/06/06 -.visistat.com -#MASTER# REMARKS: See for user tracking. -#MASTER# REMARKS: There is a ssl.google-analytics as well. -.google-analytics./ -#MASTER# BLOCK-REFERRER: http://versiontracker.com and many others. 10/20/06 -/(.*/)?__utm.gif\? -#MASTER# REMARKS: Below Moved here from -handle-as-image 10/16/06 ########## -#MASTER# BLOCK-REFERRER: http://forums2.gardenweb.com/forums/orchids/ 09/25/06 -#MASTER# REMARKS: Mostly JS and plain text stuff -.overture. -#MASTER# PROBLEM-URL: http://www.linuxtoday.com/ -#MASTER# REMARKS: /adi has HTML snipplets for use in IFRAMEs 10/15/06 -.doubleclick.net/adi -.doubleclick.net/(.*/)?adj/ -#MASTER# PROBLEM-URL: http://maps.yahoo.com/ -#MASTER# REMARKS: /AVE/iview has HTML snipplets for use in IFRAMEs 10/15/06 -view.atdmt.com/(.*/)?iview/ -#MASTER# REMARKS: Above Moved here from -handle-as-image 10/16/06 ########## -#MASTER# REMARKS: Generic, re: tracking.foxnews.com/HG? 10/01/06 -tracking. -#MASTER# BLOCK-REFERRER: http://netcraft.com and many others 10/22/06 -/(.*/)?adjs\.php\? -#MASTER# BLOCK-REFERRER: http://washingpost.com and others 10/25/06 -/.*\.gif\?D=DM -#MASTER# BLOCK-REFERRER: http://www.washingtonpost.com/ -#stats.surfaid.ihost.com/(crc/)?images/(bounce/)?uc.GIF -#MASTER# BLOCK-REFERRER: http://www.ibm.com 10/09/06 -#MASTER# REMARKS: Similar hostname and paths appear in multiple locations. -# Blocked URL = http://stats.surfaid.ihost.com/crc/images/bounce/uc.GIF -# Blocked URL = http://stats.surfaid.ihost.com/rc/images/bounce/uc.GIF -stats./c?rc/.*/uc.gif -#MASTER# BLOCK-REFERRER: http://priceline.com 10/20/06 -#MASTER# REMARKS: User tracking, webbug stuff -/(.*/)?dcs.gif\?&?dcs -#MASTER# BLOCK-REFERRER: http://www.msnbc.com 10/07/06 -#MASTER# REMARKS: And MANY others. Webbug stuff. -/(.*/)?c(lear)?\.gif\?. -#MASTER# BLOCK-REFERRER: http://www.investorguide.com 10/08/06 -#MASTER# BLOCK-REFERRER: http://foodnetwork.com, http://gardenweb.com 10/20/06 -#MASTER# REMARK: webbug type gif used in MANY places. -#MASTER# REMARK: Too many false positives -#/(.*/)?(clear|(trans_?1x|blank)?1).gif -#MASTER# REMARK: Let's try this way. -/(.*/)?(clear|blank|(trans_?|1x)?1).gif\?. -#MASTER# BLOCK-REFERRER: http://groups.yahoo.com/group/epdf/ 10/08/06 -.bc.yahoo.com/b\?P= -#MASTER# BLOCK-REFERRER: http://www.motherboard.cz 10/30/06 -x*.alexa.com -#MASTER# BLOCK-REFERRER: http://actorstheatre.org 11/02/06 -stats./.*\.gif\? -#MASTER# BLOCK-REFERRER: http://mplayernetwork.com 11/07/06 -#MASTER# BLOCK-REFERRER: http://eetimes.com 09/26/06 -/event.ng/ -#MASTER# BLOCK-REFERRER: http://www.homedepot.com/ 11/08/06 -#MASTER# BLOCK-REFERRER: http://www.williams-sonoma.com/ 11/08/06 -/cm\?[tc] -#MASTER# BLOCK-REFERRER: http://www.snapfiles.com/feedback/ 12/13/06 SF tracker -.snapfiles.net/rotation/.*\.asp -#MASTER# BLOCK-REFERRER: not provided. SF tracker #1616034 12/16/06 -#MASTER# COMMENT: JS pop-ups -spa.snap.com/ -#MASTER# BLOCK-REFERRER: http://www.gamefaqs.com/computer/doswin/game/914819.html 12/18/06 -#MASTER# COMMENT: user tracking, and run-away assorted 'junk' -#MASTER# BLOCK-REFERRER: http://formwood.com 2007-11-12 -.insitemetrics.com/ -#MASTER# COMMENT: user tracking, and assorted 'junk' -#MASTER# BLOCK-REFERRER: http://blogblog.com 2007-11-12 -.extreme-dm.com/ -#MASTER# COMMENT: user tracking, and assorted 'junk' -#MASTER# BLOCK-REFERRER: http://www.schillmania.com 2007-11-12 -stats.reinvigorate.net/ -#MASTER# COMMENT: user tracking, and assorted 'junk' -#MASTER# BLOCK-REFERRER: http://wordpress.com 2007-11-12 -.getclicky.com/ -#MASTER# COMMENT: user tracking, and assorted 'junk' -#MASTER# BLOCK-REFERRER: http://infoworld.com 2007-11-12 -.quantserve.com -# Blocked URL = http://media.adrevolver.com/adrevolver/trace?sip=123&cpy=123 -media.adrevolver.com/ #---------------------------------------------------------------------------- # JavaScripts and Texts for ad and popup generation #---------------------------------------------------------------------------- -#MASTER# BLOCK-REFERRER: http://www.chip.de/artikel/c_artikelunterseite_10423683.html -# Blocked URL = http://pagead.googlesyndication.example.com/foo/bar/baz.js -pagead*.googlesyndication./.*\.js #MASTER# REMARKS: broadening scope from a.tfag.de/js.ng/ 10/23/06 # Blocked URL = http://a.tfag.de/js.ng/ /js\.ng/ #MASTER# BLOCK-REFERRER: http://www.britannica.com/ 10/23/06 /popunder -#MASTER# BLOCK-REFERRER: http://www.pcmag.com/ 11/22/06 per SF Tracker # 1601148 -/js/slider\.js #MASTER# BLOCK-REFERRER: http://www.earthcore.com/ feedback item #1605385 12/14/06 /t\.php\?cat=.*&kw=.*&sc= -#MASTER# BLOCK-REFERRER: http://floodle.net 2007-01-21 SF tracker -scripts.chitika.net/.*\.js #MASTER# REMARKS: Actionsfile tracker #1674363 2007-03-05, text ads #MASTER# BLOCK-REFERRER: http://www.securityfocus.com/archive/1/461489/30/0/threaded jlinks.industrybrains.com/ -#MASTER# BLOCK-REFERRER: via Yahoo groups -#MASTER# REMARKS: Actionsfile tracker 1645513 2007-01-26 -.adinterax.com/.*\.js -#MASTER# BLOCK-REFERRER: http://dictionary.reference.com/search?q=privacy&db=* -#MASTER# REMARKS: Actionsfile tracker 1650798 2007-02-02 -.googleadservices.com/gampad/.*\.js #MASTER# BLOCK-REFERRER: http://www.linuxworld.com/news/2007/061307-brian-aker-interview.html #MASTER# REMARKS: Actionsfile feedback item #1736794 2007-06-13 js.adsonar. @@ -1018,10 +1114,7 @@ js.adsonar. bwp. # Blocked URL = http://us.mc123.mail.yahoo.com/mc/stampNonJs .yahoo.com/mc/stampNonJs -# Blocked URL = http://richmedia.yimg.com/js/123/personnals_banners/PER_happy_sara1_4_425x600/ad.js?q=123 -/.*/ad\.js\? -# Blocked URL = http://ad.yieldmanager.com/st?ad_type=iframe&ad_size=728x90&site=123§ion_code=123 -/.*\?ad_(type|size)= + ############################################################################# # Generic block-as-image patterns: @@ -1052,6 +1145,8 @@ bwp. # Blocked URL = http://icons-aa.wunderground.com/ads/images/TripAdvisor-Blinky.gif # URL = http://icons-aa.wunderground.com/ads/images/TripAdvisor-Blinky.gif /(.*/)?ads/images/ +# Blocked URL = http://ad.yieldmanager.com/st?ad_type=iframe&ad_size=728x90&site=123§ion_code=123 +/.*\?ad_(type|size)= ############################################################################# # Site-specific block-as-image patterns: @@ -1080,15 +1175,20 @@ bwp. #.yimg.com/a/.*/flash/ #MASTER# REMARKS: The above replaced with below. Actions file tracker #1645616 2007-01-27 .yimg.com/.*\.yimg\.com/a/ +#MASTER# REMARKS: Yahoo doesn't always have ".yimg.com/a/" in the URL for ads now 2010-02-28 +#MASTER# BLOCK-REFERRER: various yahoo pages +# Blocked URL = http://l.yimg.com/a/a/1-/flash/promotions/l3/intl/100214/300x250mfeyap.jpg +# Blocked URL = http://l.yimg.com/a/a/1-/flash/promotions/l3/intl/100219/300x250mfeya.gif +.yimg.com/.*/flash/promotions/.*\.(gif|jpg)$ bs*.gsanet.com bs*.einets.com .qkimg.net #MASTER# BLOCK-REFERRER: http://salon.com/ 10/19/06 #MASTER# BLOCK-REFERRER: http://maps.yahoo.com/ #MASTER# REMARKS: Banner farms; just exclude their corp. info -#MASTER# REMARKS: and have a "go there anyway" link for clk.atdmt.com -#MASTER# REMARKS: (Actionsfile feedback item #1888197) -[abd-vx-z]*.atdmt.com/ +#MASTER# REMARKS: and have a "go there anyway" link for clk.atdmt.com and view.atdmt.com +#MASTER# REMARKS: (Actionsfile feedback item #1888197 and #2975927) +[abd-ux-z]*.atdmt.com/ #MASTER# BLOCK-REFERRER: http://www.exactaudiocopy.de/ 09/11/06 #MASTER# BLOCK-REFERRER: http://stanford.facebook.com/home.php # URL = http://www.fastclick.net/ @@ -1115,7 +1215,7 @@ a.tribalfusion.com/ #MASTER# REMARKS: Pointdexter .ru4.com/ #MASTER# BLOCK-REFERRER: http://www.boursorama.com/infos/actualites/detail_actu_marches.phtml?news=1510287 -www.smartadserver.com/ +.smartadserver.com/ #MASTER# BLOCK-REFERRER: http://www.chez.tiscali.fr/ 10/07/06 admedia. #MASTER# REMARKS: Bannerfarm used by Morpheus file sharing software @@ -1205,6 +1305,15 @@ img.directtrack.com .pclick.yahoo.com/images/ # Blocked URL = http://rover.ebay.com/ar/1/2/3?mpt=123&adtype=1&size=728x90 /.*\&adtype= +# Blocked URL = http://resources.parfym.se/tradedoubler/250x360.swf +/tradedoubler/.*\.swf +# Blocked URL = http://hstse.tradedoubler.com/file/142609/440x220.swf +hstse.tradedoubler.com/.*\.swf +# Blocked URL = http://www.zdnetasia.com/2007/techguide/network/sponsor/i/logmein_mpu_whitepaper.gif +# Blocked URL = http://www.zdnetasia.com/2007/techguide/network/sponsor/sidebar.gif +www.zdnetasia.com/.*/sponsor/.*\.gif$ +# Blocked URL = http://pagead2.googlesyndication.com/pagead/imgad?id=CPjtipDs9taquQEQoAEYwgQyCIvo2PNnQywb +.googlesyndication.com/.*/imgad\? #---------------------------------------------------------------------------- # Cross-site user tracking @@ -1297,6 +1406,19 @@ feeds.feedburner.com/~a/DilbertDailyStrip\? #MASTER# BLOCK-REFERER: http://www.buch.de/ # URL = http://track.webtrekk.de/471497967328727/wt.pl?p=177,de.buch.show.home,1,1024x768,24,1,1218816426275,0,884x653,0&enc1=%FC&enc2=iso-8859-1&st=view&la=en-US&np=Default%20Plugi track.webtrekk.de/ +#MASTER# BLOCK-REFERER: https://sourceforge.net/ +# URL = http://b.scorecardresearch.com/p2?c1=2&c2=6035546&c3=&c4=&c5=&c6=&c15=&cj=1 +b.scorecardresearch.com/ +# URL = https://sb.scorecardresearch.com/ +sb.scorecardresearch.com/ +#MASTER# BLOCK-REFERRER: http://sourceforge.net/projects/ijbswa/ +# Blocked URL = http://b.collective-media.net/seg/cm/cm_aa_gn1 +b.collective-media.net/ +#MASTER# BLOCK-REFERRER: http://www.spiegel.de/ +# Blocked URL = http://spiegel.ivwbox.de/cgi-bin/ivw/CP/1001;/home/c-18/be-PB64-aG9tZXBhZ2UvY2VudGVy/szwprofil-1001 +#MASTER# BLOCK-REFERRER: http://www.heise.de/ +# Blocked URL = http://heise.ivwbox.de/2004/01/survey.js + .ivwbox.de/ #---------------------------------------------------------------------------- # Specific counters (see above for generic patterns) @@ -1581,6 +1703,14 @@ tags.gawker.com/.*css$ #MASTER# UNBLOCK-REFERRER: http://idonthateyouall.imeem.com/video/8zH0_f9i/kiley_rilo_pull_me_in_tighter_art_video/ # URL = http://ad.doubleclick.net/crossdomain.xml ad.doubleclick.net/crossdomain\.xml +#MASTER# REMARKS: Support request 2838390: 2009-08-16: nfl.com videos not working +#MASTER# REMARKS: bbc.co.uk videos references ad.uk.doubleclick.net +# URL = http://ad.doubleclick.net/879366/DartShell9_8.swf?adServerHost=http://ad.doubleclick.net +# URL = http://ad.doubleclick.net/pfadx/DARTSHELLCONFIGXML;dcmt=text/xml; +# URL = http://ad.doubleclick.net/879366/DartShellPlayer9_8_01_00.swf +# URL = http://ad.uk.doubleclick.net/879366/DartShell7_7.swf?adServerHost=http://ad.uk.doubleclick.net +.doubleclick.net/.*/DartShell.*\.swf +.doubleclick.net/.*/DARTSHELLCONFIGXML #MASTER# REMARKS: Actionsfile feedback item #2021509 2008-07-18 #MASTER# REMARKS: Allow realplayer site help popup windows #MASTER# UNBLOCK-REFERRER: http://real.custhelp.com/cgi-bin/real.cfg/php/enduser/std_adp.php?p_faqid=4512 @@ -1594,7 +1724,8 @@ fritz.box/ # URL = http://kb.adobe.com/selfservice/viewContent.do?externalId=kb402747&sliceId=1 .adobe.com # URL = http://qa.debian.org/popcon.php -qa.debian.org/popcon\.php +# URL = http://qa.debian.org/popcon-png.php?packages=privoxy&show_installed=on&want_legend=on&want_ticks=on&date_fmt=%25Y-%25m&beenhere=1 +qa.debian.org/popcon #MASTER# REMARKS: Support Requests item #2432535 2008-12-16 # URL = http://www.mta.info/bandt/traffic/advmain.htm .mta.info/.*advmain.htm$ @@ -1620,6 +1751,65 @@ qa.debian.org/popcon\.php # URL = http://graphics8.nytimes.com/css/0.1/screen/common/ads.css # URL = http://graphics8.nytimes.com/css/0.1/screen/homepage/ads.css .nytimes.com/.*/ads\.css$ +#MASTER# REMARKS: All hosted videos seemingly require this file. +#MASTER# UNBLOCK-REFERRER: http://www.cnn.com/video/#/video/showbiz/2009/04/14/dcl.boyle.british.talent.show.cnn +# URL = http://i.cdn.turner.com/cnn/.element/js/2.0/video/xmp/AdServiceAdapter.swf +.turner.com/cnn/.*/AdServiceAdapter.swf +#MASTER# REMARKS: Tracker 2786745 : MySpace music player doesn't work +#MASTER# UNBLOCK-REFERRER: www.myspace.com/bandofskulls +# URL = http://lads.myspacecdn.com/videos/musicPlayerAssets.swf +lads.myspacecdn.com/ +#MASTER# REMARKS: AF#2789653 iTunes download blocked +# URL = http://a957.phobos.apple.com/us/r1000/000/Music/ad/47/56/mzi.gnjsyarh.aac.a.m4p +.phobos.apple.com/ +# URL = http://eas8.emediate.eu/eas?camp=114;ty=ct;EASLink=http://www.jp.dk +.emediate.eu/.*EASLink= +#MASTER# REMARKS: Actionfile tracker ID: 2838501: 2009-08-16 +# URL = http://new.meteo.pl/advajax.js +.meteo.pl/advajax\.js +# URL = http://www.adressa.no/ +# URL = http://adressa.no/ +adressa.no/ +# URL = http://www.adresseavisen.no/ +# URL = http://adresseavisen.no/ +adresseavisen.no/ +# URL = http://apps.facebook.com/onthefarm/track.php?creative=&cat=friendvisit&subcat=weeds&key=a789a971dc687bee4c20c044834fabdd&next=index.php%3Fref%3Dnotif%26visitId%3D898835505 +.facebook.com/.*/track.php +# URL = http://www.ifdb.tads.org/ +# URL = http://www.tads.org/ +.tads.org/ +# URL = http://adtoma.com/ +adtoma.com/ +#MASTER# REMARKS: Actionsfile feedback 2859872 2009-09-16 09:58 +# URL = http://adactio.com/ +adactio.com/ +# URL = http://www.peereboom.us/adsuck/ +www.peereboom.us/adsuck/ +# URL = http://www.svd.se/template/ver1-0/css/ads.css?v=194 +.svd.se/.*\.css($|\?) +#MASTER# REMARKS: [privoxy-users] Privoxy blocking Ebay item pictures Jan 31, 2010 +#MASTER# REMARKS: Ebay enlarge picture function doesn't work. +# URL = http://include.ebaystatic.com/v4js/en_GB/e637i/SYS-LIGER_Omniture_e637i10177164_5_en_GB.js +include.ebaystatic.com/.*omniture.*\.js +#MASTER# REMARKS: Allow Yahoo news and mail javascipt pages +# URL = http://l.yimg.com/d/combo?news/p/common/generic/news/p/common/generic/popular-searches-min-12622.js&news/p/common/generic/ads-min-11050.js&news/p/common/generic/foundation/popup-min-12622.js +.yimg.com/d/combo\? +#MASTER# REMARKS: Page formatting problems when .css files are blocked +# URL = http://www.networkworld.com/includes/styles/adstyles.css +# URL = http://www.sj.se/common/css/pop.css +# URL = http://l.yimg.com/d/combo?news/p/common/generic/ads-min-24248.css&news/p/common/generic/widgets-min-10270.css +# URL = http://news.zdnet.com/css/z/ads/hs.css +/.*\.css$ +#MASTER# REMARKS:Actionsfile feedback item #2974204 2010-03-21 +# URL = http://adesklets.sourceforge.net/ +adesklets.sourceforge.net/ +#MASTER# REMARKS: Mostly-french political blog +# URL = http://adassier.wordpress.com/ +adassier.wordpress.com/ +# URL = http://adassier.files.wordpress.com/2010/05/road-to-economic-recovery2.jpg?w=630&h=451 +adassier.files.wordpress.com +# URL = http://adainitiative.org/about-us/ +adainitiative.org/ ############################################################################# @@ -1641,17 +1831,7 @@ images.apple.com #MASTER# REMARKS: Actions Tracker 1293057 09/02/06 .update.microsoft.com #MASTER# REMARKS: Various reports 09/16/06. This site also requires pop-ups. -mail.google. - -#---------------------------------------------------------------------------- -# Semi-fragile, allow for blocks. -#---------------------------------------------------------------------------- -{ -crunch-all-cookies -filter -fast-redirects -hide-referer -prevent-compression } -#MASTER# REMARKS: Problem URL: adserver.yahoo.com 10/01/06 -#MASTER# REMARKS: This is much too broad for my taste. It forces me to add -#MASTER# REMARKS: a special yahoo section in my user.action file, just to -#MASTER# REMARKS: confirm my defaults in default.action. fk 2007-01-19 -.yahoo.com +mail.google.* #---------------------------------------------------------------------------- # Shopping and banking sites - allow cookies and pop-ups @@ -1664,7 +1844,7 @@ mail.google. .dabs.com .overclockers.co.uk .db24.de -.ebay. +.ebay.* .mobile.de www.fondationlejeu.com www.techtv.com @@ -1713,21 +1893,21 @@ i.cnn.net/cnn/.*/clickability/button # Sticky Actions = -fast-redirects www.ukc.ac.uk/cgi-bin/wac\.cgi\? #MASTER# PROBLEM-URL: http://www.google.com/search?q=foo -.google. +# URL = http://www.google.com/search?q=foo +.google.* #MASTER# PROBLEM-URL: http://de.altavista.com/q?pg=q&q=foo&kl=XX&search.x=28&search.y=8&what=web .altavista.com/(.*(like|url|link):|trans.*urltext=)http #MASTER# PROBLEM-URL: http://www.speedfind.de/cgi-bin/search?q=foo&t=STANDARD .speedfind.de #MASTER# PROBLEM-URL: http://www.nytimes.com/ .nytimes.com -#MASTER# REMARKS: Yahoo logout URL after first redirect. fk 2007-01-19 -#MASTER# REMARKS: Logout fails if we fast-redirect to the URL after "done=". -#MASTER# REMARKS: Reported in support request #1635354. +#MASTER# REMARKS: Disable fast-redirects for all of yahoo.com/. +#MASTER# REMARKS: Apparently we can't keep up with maintaining more precise exceptions. # URL = http://login.yahoo.com/config/login?logout=1&.done=http://mail.yahoo.com&.src=ym&.intl=us -.yahoo.com/.*done=http +#MASTER# REMARKS: Reported in support request #1635354. +# URL = http://us.rd.yahoo.com/reg/login1/lisu/login/uk/ym/*http://edit.europe.yahoo.com/c onfig/login?.tries=1&.src=ym&.md5=&.hash=&.js=1&.last=&...kP=Y&.done=http://mail .yahoo.com&.pd=ym_ver=0&c=&login=XXX&passwd=XXX&.persistent =&.hash=1&.md5=1.yahoo.com/ #MASTER# REMARKS: Reported in support request #1802365. -# URL = http://us.rd.yahoo.com/reg/login1/lisu/login/uk/ym/*http://edit.europe.yahoo.com/c onfig/login?.tries=1&.src=ym&.md5=&.hash=&.js=1&.last=&...kP=Y&.done=http://mail .yahoo.com&.pd=ym_ver=0&c=&login=XXX&passwd=XXX&.persistent =&.hash=1&.md5=1 -.rd.yahoo.com/reg/login1/ +.yahoo.com/ # URL = http://validator.w3.org/check .w3.org #MASTER# PROBLEM-URL: http://www.ask.com/ @@ -1794,6 +1974,23 @@ view.samurajdata.se/ps\.php\?url= .landsend.de/ # URL = http://www.youtube.com/swf/l.swf?swf=http%3A//s.ytimg.com/yt/swf/cps-vfl68942.swf&video_id=2cpd6rHIfyA&rel=1&showsearch=1&eurl=&iurl=http%3A//i3.ytimg.com/vi/2cpd6rHIfyA/hqdefault.jpg&sk=5E3I2RCcOLknk1qyI_JgVVnb8FKwgpHzC&use_get_video_info=1&load_modules=1&fs=1&hl=en .youtube.com/swf/.*swf= +# URL = http://redbot.org/?uri=http%3A//apache.org/ +.redbot.org/ +# URL = http://webcache.googleusercontent.com/custom?hl=en&domains=library.gnome.org&sitesearch=library.gnome.org&q=cache:8yGDJ1YpefcJ:http://library.gnome.org/devel//gtk/2.20/GtkLabel.html+gtk_label_set_text+escape&ct=clnk +webcache.googleusercontent.com/ +# URL = http://webcache.googleusercontent.com/search?q=cache:kZYcDFibjHcJ:https://grepular.com/Abusing_HTTP_Status_Codes_to_Expose_Private_Information+inurl:https://grepular.com/Abusing_HTTP_Status_Codes_to_Expose_Private_Information&hl=en&strip=1 +.googleusercontent.com/.*=cache: + +{+redirect{s@.*url=@http://@} -block} +# Sticky Actions = +redirect -block +# URL = http://go.eniro.dk/lg/ni/http:/eas8.emediate.eu/eas?camp=79;ty=ct;EASLink=http://www.bt.dk?http://redirect.metropol.dk/cgi-bin/redir.pl?url=www.bt.dk +# URL = http://eas8.emediate.eu/eas?camp=79;ty=ct;EASLink=http://www.bt.dk?http://redirect.metropol.dk/cgi-bin/redir.pl?url=www.bt.dk +# Redirected URL = http://go.eniro.dk/lg/ni/http:/eas8.emediate.eu/eas?camp=79;ty=ct;EASLink=http://www.bt.dk?http://redirect.metropol.dk/cgi-bin/redir.pl?url=www.bt.dk +# Redirect Destination = http://www.bt.dk +# Redirected URL = http://eas8.emediate.eu/eas?camp=79;ty=ct;EASLink=http://www.bt.dk?http://redirect.metropol.dk/cgi-bin/redir.pl?url=www.bt.dk +# Redirect Destination = http://www.bt.dk +go.eniro.dk/.*EASLink=http://.*url=(?!<=http:) +.emediate.eu/.*EASLink=http://.*url=(?!<=http:) #---------------------------------------------------------------------------- # No filtering for sourcecode or other automatically parsed content @@ -1938,6 +2135,10 @@ javabog.dk/ijk/ .fsfe.org/ # URL = http://www.couchsurfing.com/mapsurf.html .couchsurfing.com/ +# URL = http://www.couchsurfing.org/mapsurf.html +.couchsurfing.org/ +# URL = http://www.thinkgeek.com/tshirts-apparel/unisex/generic/ +.thinkgeek.com/ {-filter{banners-by-link}} # Sticky Actions = -filter{banners-by-link} @@ -1952,9 +2153,6 @@ javabog.dk/ijk/ #MASTER# REMARKS: This section NOT checked 10/18/06 HB #MASTER# REMARKS: These are movie clips, linked from http://us.imdb.com .totaleclips.com -#MASTER# REMARKS: Link to download page breaks -# URL = http://www.mandrakelinux.com/en/ftp.php3 -.mandrakelinux.com/en/ftp.php3 #MASTER# REMARKS: Actions Tracker 1313157 # URL = http://validator.w3.org/check?uri=referer validator.w3.org/check\?uri=referer @@ -2073,22 +2271,37 @@ blogs.msdn.com # URL = http://blogs.msdn.com/wga/archive/2006/07/16/667063.aspx blogs.msdn.com +{-filter{jumping-windows}} +# Sticky Actions = -filter{jumping-windows} +# URL = http://www.openstreetmap.org +.openstreetmap.org + {+fast-redirects{check-decoded-url} -block} # Sticky Actions = +fast-redirects{check-decoded-url} -block #MASTER# REMARKS: Yahoo search results. Added 2007-01-19 fk #MASTER# REDIRECT-REFERRER: http://search.yahoo.com/search?p=privoxy # URL = http://rds.yahoo.com/_ylt=A0geuryczbBF._YAEmxXNyoA;_ylu=X3oDMTB2b2gzdDdtBGNvbG8DZQRsA1dTMQRwb3MDMQRzZWMDc3IEdnRpZAM-/SIG=11b3qg40n/EXP=1169301276/**http%3a//www.privoxy.org/ rds.yahoo.com/ -#MASTER# COMMENTS: Verified 2007-01-19 fk +# Redirected URL = http://rds.yahoo.com/_ylt=A0geuryczbBF._YAEmxXNyoA;_ylu=X3oDMTB2b2gzdDdtBGNvbG8DZQRsA1dTMQRwb3MDMQRzZWMDc3IEdnRpZAM-/SIG=11b3qg40n/EXP=1169301276/**http%3a//www.privoxy.org/ +# Redirect Destination = http://www.privoxy.org/ #MASTER# REDIRECT-REFERRER: http://www.gamefaqs.com/computer/doswin/game/914819.html # URL = http://dw.com.com/redir?asid=0&astid=8&siteid=19&edid=107&destCat=33862&destURL=http%3A%2F%2Fdb.gamefaqs.com%2Fcomputer%2Fdoswin%2Ffile%2Fvampire_tmb_b.txt -dw.com.com/ +dw.com.com/redir\? +# Redirected URL = http://dw.com.com/redir?asid=0&astid=8&siteid=19&edid=107&destCat=33862&destURL=http%3A%2F%2Fdb.gamefaqs.com%2Fcomputer%2Fdoswin%2Ffile%2Fvampire_tmb_b.txt +# Redirect Destination = http://db.gamefaqs.com/computer/doswin/file/vampire_tmb_b.txt #MASTER# REMARKS: Action tracker 1593393. Added 2007-01-20. # URL = http://wzus.bloglines.com/r?t=a&d=us&s=bl&c=blen&ti=1&ai=51060&l=dir&o=0&sv=z6f537f5b&ip=971AC44B&u=http%3A%2F%2Fwww.skweezer.net%2Fbloglines%2Fskweeze.aspx%3F%26i%3Dd%26l%3Den%26r%3Dhttp%253A%252F%252Fwww.bloglines.com%252Fmyblogs_display%253Fsub%253D29302699%2526site%253D5382440%26url%3Dhttp%253A%252F%252Fpermalink.gmane.org%252Fgmane.linux.debian.devel.changes.unstable%252F97340 +# Redirected URL = http://wzus.bloglines.com/r?t=a&d=us&s=bl&c=blen&ti=1&ai=51060&l=dir&o=0&sv=z6f537f5b&ip=971AC44B&u=http%3A%2F%2Fwww.skweezer.net%2Fbloglines%2Fskweeze.aspx%3F%26i%3Dd%26l%3Den%26r%3Dhttp%253A%252F%252Fwww.bloglines.com%252Fmyblogs_display%253Fsub%253D29302699%2526site%253D5382440%26url%3Dhttp%253A%252F%252Fpermalink.gmane.org%252Fgmane.linux.debian.devel.changes.unstable%252F97340 +# Redirect Destination = http://www.skweezer.net/bloglines/skweeze.aspx?&i=d&l=en&r=http%3A%2F%2Fwww.bloglines.com%2Fmyblogs_display%3Fsub%3D29302699%26site%3D5382440&url=http%3A%2F%2Fpermalink.gmane.org%2Fgmane.linux.debian.devel.changes.unstable%2F97340 .bloglines.com/r\? www.skweezer.net/bloglines # URL = http://media.fastclick.net/w/get.media?sid=4681&m=5&tp=6&url=http%3A//www.sciam.com/article.cfm%3FchanID%3Dsa003%26articleID%3DC7C87ECC-E7F2-99DF-39AEFF3D7D1A8CFB%26ref%3Drss +# Redirected URL = http://media.fastclick.net/w/get.media?sid=4681&m=5&tp=6&url=http%3A//www.sciam.com/article.cfm%3FchanID%3Dsa003%26articleID%3DC7C87ECC-E7F2-99DF-39AEFF3D7D1A8CFB%26ref%3Drss +# Redirect Destination = http://www.sciam.com/article.cfm?chanID=sa003&articleID=C7C87ECC-E7F2-99DF-39AEFF3D7D1A8CFB&ref=rss .fastclick.net/w/get\.media\? +# Redirected URL = http://www.awin1.com/cread.php?awinmid=2891&awinaffid=43305&clickref=&p=http://www.groupon.co.uk/ +# Redirect Destination = http://www.groupon.co.uk/ +.awin1.com/.*=http:// {+block{Looks like an anti-leech trigger URL.}} #MASTER# COMMENTS: This section not checked 10/17/06 HB. Still out there? @@ -2096,9 +2309,6 @@ www.skweezer.net/bloglines #MASTER# REMARKS: Lame attempt at banning ad-blockers. Used by other websites as well. /antitheft\.php -{ +prevent-compression } -.compusa.com/ - {+filter{tiny-textforms}} .sourceforge.net/tracker @@ -2116,6 +2326,8 @@ www.skweezer.net/bloglines {+redirect{http://config.privoxy.org/}} # Sticky Actions = +redirect{http://config.privoxy.org/} # URL = http://www.privoxy.org/config +# Redirected URL = http://www.privoxy.org/config +# Redirect Destination = http://config.privoxy.org/ .privoxy.org/config #MASTER# REMARKS: Privoxy's "unsafe" CGI pages check the referrer @@ -2137,8 +2349,28 @@ config.privoxy.org/ # XXX: Privoxy-Regression-Test currently doesn't allow backslashes. # Sticky Actions = -fast-redirects +redirect # URL = http://us.ard.yahoo.com/SIG=AAAAAAAAA/M=NNNNNN.NNNNNNN.NNNNNNN.NNNNNNN/D=mail/S=NNNNNNNNN:HEADR/Y=YAHOO/EXP=NNNNNNNNNN/A=NNNNNNN/R=N/SIG=AAAAAAAAA/*http://login.yahoo.com/config/login?logout=1&.done=http://mail.yahoo.com&.src=ym&.intl=us +# Redirected URL = http://us.ard.yahoo.com/SIG=AAAAAAAAA/M=NNNNNN.NNNNNNN.NNNNNNN.NNNNNNN/D=mail/S=NNNNNNNNN:HEADR/Y=YAHOO/EXP=NNNNNNNNNN/A=NNNNNNN/R=N/SIG=AAAAAAAAA/*http://login.yahoo.com/config/login?logout=1&.done=http://mail.yahoo.com&.src=ym&.intl=us +# Redirect Destination = http://login.yahoo.com/config/login?logout=1&.done=http://mail.yahoo.com&.src=ym&.intl=us .yahoo./.*http://login.yahoo.com/config/login.*http:// +#MASTER# REMARKS: The next two sections are to get flickr's Ajax interface working +#MASTER# REMARKS: with default pre-settings. For more aggressive defaults they additionally +#MASTER# REMARKS: need -crunch-incoming-cookies and -crunch-outgoing-cookies. +#MASTER# REMARKS: They work with +session-cookies-only, though. +{-block -filter} +#MASTER# PROBLEM-URL: http://www.flickr.com/ +# Sticky Actions = -block -filter +# URL = http://l.yimg.com/g/combo/1?event-custom/event-custom-min.js&event/event-min.js&j/.H-.K.A.vNKEa&j/.CP-.U-.DE.A.vKEJz&j/.J_.BR_.CA.A.vKYkg&j/.J_.DB.A.vPpBT&j/popup-login.A.vR53Z&dump/dump-min.js&datatype/datatype-xml-min.js&substitute/substitute-min.js&json/json-min.js&queue-promote/queue-promote-min.js&io/io-min.js&j/.J_.DS.A.vQa28&j/.FW-.FX-.GH.A.vP3XB&j/grease.A.vRktP&j/.CC.A.vNiA6&j/.C-.BL.A.vPPj2&j/.CE-.K.A.vNy32&attribute/attribute-base-min.js&base/base-min.js&anim/anim-min.js&cookie/cookie-min.js&j/.B-.C-.F.A.vQ7SZ&j/urls.A.vQtXp&j/.B-.BY.A.vQCXP&j/.H-.BY.A.vQXXx&j/.DS-value-conversions.A.vQpRt&j/.G-.BD.A.vNHSH&event/event-synthetic-min.js&j/.G-.BO.A.vNwR4&j/.CV-.CH.A.vPFSZ&j/.X-.W-.C-.F.A.vKPQa&j/.X-.W-.D.A.vQXXx&j/.Q-.BX-.K.A.vR1kt&j/.DL.A.vLPjD&j/.CF.A.vNC24&j/.CX-.CY.A.vP8ND&event-simulate/event-simulate-min.js&node/node-event-simulate-min.js&j/.B-.T-.CI-.C-.F.A.vPJPF&j/.CM/.BA_2.5.1-.D.A.vPzui&j/bo-.S-.C-.F.A.vNwWe&j/bo-.S-.D.A.vR6Hx&j/.BZ-.D.A.vNstB&j/.B-.L-.C-.F.A.vNxPX&j/.B-.L-.BH.A.vMdVB&j/.CN-.DD.A.vLjJ2&j/.B-.O-.C-.F.A.vPpcK&j/.BM.A.vKPmz&j/.B-.O.A.vQyHg&j/.B-.H-.BB-.C-.F.A.vQvrB&j/.CW-.CU.A.vQ7Rg&j/.Y-.C-.F.A.vNqGa&j/.Y.A.vLKiT&j/.B-.M-.C-.F.A.vQxDc&j/.U-.CG.A.vQ5Tt&j/.B-.M.A.vQXXx&j/.B-.Q-.BQ.A.vQvTt&j/.B-.N-.C-.F.A.vQaRp&j/.CL.A.vN4N6&j/.B-.CL-.BW.A.vPwkx&j/.DR-.DG.A.vMLJr&j/.B-.BE-.C-.F.A.vPHP4&j/.B-.BE-.D.A.vQLQH&j/.BV.A.vm3Uz&j/.Z-.DK-.D.A.vLQEe&j/.Z-.DJ-.BJ.A.vLQEe&j/.B-.I-.C-.F.A.vPKTK&stylesheet/stylesheet-min.js&j/.B-.I.A.vQvDF&j/.CM-.DO.A.vPboD&j/.B-.D.A.vRbv8&j/.B-.H-.BB.A.vQuhn&j/.B-.N.A.vR6Cn&j/.B-.L-.CZ.A.vQmzP&j/.B-.T-.CI.A.vQXXx&j/.B-.I-.CQ-.BK-.C-.F.A.vNwZF&j/.B-.I-.CQ-.BK.A.vLWQR&j/.B-.R-.C-.F.A.vPfwi&j/.B-.R.A.vRhND&j/.DN-.BB-.D-.C-.F.A.vQXZg&j/.DN-.BB-.D.A.vRcXB&j/.BF_.D-.C-.F.A.vPGYM&j/.BF_.D.A.vQxJn&plugin/plugin-min.js&cache/cache-min.js&j/.CB-.C-.F.A.vNwWe&j/.CB-.D.A.vQS6T +.yimg.com/g/combo/1\?event-custom/ + +{-block -filter{content-cookies}} +#MASTER# PROBLEM-URL: http://www.flickr.com/ +{-filter{content-cookies}} +# Sticky Actions = -block +# URL = http://www.flickr.com/ +.flickr.com/ + + #---------------------------------------------------------------------------- # Sections that modify the action settings based on tags. #---------------------------------------------------------------------------- diff --git a/external/privoxy/default.filter b/external/privoxy/default.filter index 3537c7b2..17c9fa60 100644 --- a/external/privoxy/default.filter +++ b/external/privoxy/default.filter @@ -2,11 +2,11 @@ # # File : $Source: /cvsroot/ijbswa/current/default.filter,v $ # -# $Id: default.filter,v 1.71 2009/03/01 18:33:17 ler762 Exp $ +# $Id: default.filter,v 1.83 2011/10/16 14:01:05 fabiankeil Exp $ # # Purpose : Rules to process the content of web pages # -# Copyright : Written by and Copyright (C) 2001-2009 the +# Copyright : Written by and Copyright (C) 2001-2010 the # Privoxy team. http://www.privoxy.org/ # # We value your feedback. However, to provide you with the best support, @@ -128,15 +128,15 @@ s/(open\s*\([^\)]+always(?:raised|lowered)=)(["']?)(?:yes|1)\2/$1$2no$2/sigU ################################################################################# # -# js-events: Kill all JS event bindings and timers (Radically destructive! Only for extra nasty sites). +# js-events: Kill JavaScript event bindings and timers (Radically destructive! Only for extra nasty sites). # ################################################################################# -FILTER: js-events Kill all JS event bindings and timers (Radically destructive! Only for extra nasty sites). +FILTER: js-events Kill JavaScript event bindings and timers (Radically destructive! Only for extra nasty sites). s/(on|event\.)((mouse(over|out|down|up|move))|(un)?load|contextmenu|selectstart)/never/ig # Not events, but abused on the same type of sites: s/(alert|confirm)\s*\(/concat(/ig -s/settimeout\(/concat(/ig +s/set(timeout|interval)\(/concat(/ig ################################################################################# # @@ -177,15 +177,15 @@ s|||igU ################################################################################# # -# refresh-tags: Kill automatic refresh tags (for dial-on-demand setups). +# refresh-tags: Kill automatic refresh tags if refresh time is larger than 9 seconds. # ################################################################################# -FILTER: refresh-tags Kill automatic refresh tags (for dial-on-demand setups). +FILTER: refresh-tags Kill automatic refresh tags if refresh time is larger than 9 seconds. # Note: Only deactivates refreshes with more than 9 seconds delay to # preserve monster-stupid but common redirections via meta tags. # -s/\2]*))?\2/\2]*))?\2@@\n$0@ + .main_body, .j, \#res, .med, .hd, .g, .s\n\ + {width: 99%; max-width: 100%; margin-left: 0; margin-right: 0;}\n\ + \n$0@ s@
@
@ s@(
@\n\n$0\n@ @@ -621,12 +626,15 @@ s@@\n$0@ # Are these ids still in use? @@ -759,6 +767,34 @@ CLIENT-HEADER-TAGGER: css-requests Tags detected CSS requests as "CSS-REQUEST". s@^Accept:\s*text/css.*@CSS-REQUEST@i +################################################################################# +# +# range-requests: Tags range requests as "RANGE-REQUEST". +# +# By default Privoxy removes Range headers for requests to +# ressources that will be filtered to make sure the filters +# get the whole picture. Otherwise Range requests could be +# intentionally used to circumvent filters or, less likely, +# filtering a partial response may damage it because it matched +# a pattern that the ressource as a whole wouldn't. +# +# Range requests can be useful and save bandwidth so instead +# of removing Range headers for requests to ressources that +# will be filtered, you may prefer to simply disable filtering +# for those requests. +# +# That's what this tagger is all about. After enabling it, +# you can disable filtering for range requests using the following +# action section: +# +# {-filter -deanimate-gifs} +# TAG:^RANGE-REQUEST +# +################################################################################# +CLIENT-HEADER-TAGGER: range-requests Tags range requests as "RANGE-REQUEST". + +s@^Range:.*@RANGE-REQUEST@i + ################################################################################# # # client-ip-address: Tags the request with the client's IP address. @@ -834,456 +870,3 @@ s@^X-Privoxy-Control:\s*@@i SERVER-HEADER-FILTER: privoxy-control Removes X-Privoxy-Control headers. s@^X-Privoxy-Control:.*@@i - - -############################################################################## -# -# Revisions : -# $Log: default.filter,v $ -# Revision 1.71 2009/03/01 18:33:17 ler762 -# couple of changes to the yahoo filter -# -get a bigger email message reply textarea -# -block a few more ads -# -remove the now useless northbanner css change -# -# Revision 1.70 2009/02/21 13:01:51 fabiankeil -# Make blogspot's feed magic slightly more reliable. -# -# Revision 1.69 2009/02/12 15:40:11 ler762 -# more yahoo email ad blocking -# -# Revision 1.68 2008/09/19 13:26:04 fabiankeil -# s@tounge@tongue@. Anonymously reported in #1648657. -# -# Revision 1.67 2008/08/06 17:38:06 fabiankeil -# In banners-by-size, make sure white-space around the height -# attribute is removed as well and replace two spaces with -# "\s" so we don't get fooled by tabs. Fixes #2036125. -# -# Revision 1.66 2008/08/03 17:27:47 fabiankeil -# Teach msn filter to catch a few new ad classes. -# -# Revision 1.65 2008/07/21 13:43:44 fabiankeil -# Fix img-reorder regression introduced with my last commit. -# Some tags were terminated too soon, letting the browser render -# some of their arguments as text. Oops. -# -# Revision 1.64 2008/07/12 15:49:09 fabiankeil -# - Don't let img-reorder touch width attributes -# that aren't followed by either whitespace or '>', -# as those usually indicate onclick nonsense. -# Problem and solution reported by Glenn Washburn in #2014552. -# - While at it, don't use more groups than necessary. -# -# Revision 1.63 2008/06/27 12:53:41 fabiankeil -# Make sure the taggers css-requests and image-requests -# only match at the beginning of the header. -# -# Revision 1.62 2008/06/21 17:02:03 fabiankeil -# Fix typo. -# -# Revision 1.61 2008/05/21 18:44:43 fabiankeil -# - Let the content-type tagger ignore headers without value. -# - Remove a few unused lines at the end of the file. -# -# Revision 1.60 2008/04/26 10:36:41 fabiankeil -# Let the msn filter hide another class. -# -# Revision 1.59 2008/04/23 16:18:18 fabiankeil -# s@declarded@declared@ -# -# Revision 1.58 2008/02/02 15:27:19 fabiankeil -# Yet another yahoo update to get the width limitation removal working again. -# -# Revision 1.57 2008/01/26 15:45:39 fabiankeil -# Don't let the less-download-windows filter mess up -# "Content-Type: application/x-shockwave-flash" headers. -# -# Revision 1.56 2008/01/25 19:12:40 fabiankeil -# - Add yet another new yahoo ad id. -# - Don't let the first banners-by-link job punish URLs for merely -# containing the pattern "/jump/" when it should really look for -# "doubleclick\.net/jump/". -# -# Revision 1.55 2007/12/31 19:53:59 fabiankeil -# Let the msn filter remove the width limitation again. -# -# Revision 1.54 2007/12/31 19:11:31 fabiankeil -# - Let the yahoo filter remove the width limitation again. -# - Teach the blogspot filter to remove useless feed comment -# titles that only contain the beginning of the actual comment. -# -# Revision 1.53 2007/12/23 15:48:12 fabiankeil -# - Lo and behold, the CSS fix for the MSN buttons is no longer necessary. -# - Add some new selectors the msn filter should hide. -# - Add the two yahoo selectors Lee reported in #1856574. -# - Add comments that the width limitation fixes stopped -# working for the msn and yahoo filter. -# -# Revision 1.52 2007/11/27 18:35:48 fabiankeil -# Update CSS for the yahoo filter. -# -# Revision 1.51 2007/11/04 16:15:11 fabiankeil -# - Add client-header taggers: client-ip-address, -# http-method, allow-post, complete-url and user-agent. -# - Add server-header tagger: content-type. -# -# Revision 1.50 2007/11/03 15:05:30 fabiankeil -# Consistently use an empty line between the description and the PCRS code -# and end descriptions with dots. Patch submitted by Simon Ruderich. -# -# Revision 1.49 2007/11/03 14:29:41 fabiankeil -# Spelling fixes mostly submitted by Simon Ruderich. -# -# Revision 1.48 2007/10/17 18:11:32 fabiankeil -# Add privoxy-control header filters and taggers. -# -# Revision 1.47 2007/10/06 15:45:25 fabiankeil -# Let msn hide sponsored links in #at divs. -# -# Revision 1.46 2007/10/06 09:54:13 fabiankeil -# - Let msn hide sponsored links in #ar divs. -# - Teach banners-by-link not to block the graphs for sf's tracker statistics. -# -# Revision 1.45 2007/08/11 16:54:12 fabiankeil -# - Complete the changes from r1.42. -# - Make crude-parental less sensitive to the amount of white-space, -# add the note that it doesn't work too well again and replace the -# DMOZ link with a less confusing explanation. -# -# Revision 1.44 2007/07/18 11:06:56 hal9 -# Replace notarget with '' in all popups filter to keep from breaking xhmtl per -# report from Siegfried Gipp. -# -# Revision 1.43 2007/06/01 14:17:04 fabiankeil -# Mention possible delimiter conflicts with variables in dynamic pcrs commands. -# -# Revision 1.42 2007/05/17 15:55:36 fabiankeil -# Undo an improperly tested last-minute change -# and turn "text-requests" back into "css-requests". -# -# Revision 1.41 2007/05/17 15:45:41 fabiankeil -# - Mention new filter types and the 'D' option. -# - Header filters are now case-insensitive and accept a -# varying amount of whitespace after the colon. -# - Add another selector for yahoo ads. -# - New server-header filter: less-download-windows -# - New client-header taggers: text-requests and image-requests. -# -# Revision 1.40 2007/03/20 15:40:00 fabiankeil -# Adjust to new world order with dedicated header-filter actions. -# -# Revision 1.39 2007/02/21 14:10:23 fabiankeil -# - Fix a js-annoyances pcrs command that broke -# evaluated code. (BR #1124071, thanks to Bor Gergely) -# - Have unsolicited-popups and all-popups catch the -# wheather.com popup reported in in AF #1640173. -# -# Revision 1.38 2007/02/19 11:22:48 hal9 -# Adding back the orginal filter content to offset problems found by Fabian. -# -# Revision 1.37 2007/02/17 13:29:44 hal9 -# Updates to the crude parental filter per Feature Requests item #1648657. -# -# Revision 1.36 2007/02/05 16:47:31 fabiankeil -# - Let banners-by-link look for "advert". -# - Fix XML systax problems with banners-by-link -# and banners-by-size (AF#1651570). -# -# Revision 1.35 2006/12/21 12:28:12 fabiankeil -# Escaping special characters in filter descriptions is no -# longer necessary, it's done by Privoxy now. -# -# Revision 1.34 2006/12/12 17:32:23 fabiankeil -# Added id mbEnd to google filter, it's now and then -# used for the sponsored links. -# -# Have js-annoyances try to prevent status bar -# modifications where the status bar text is -# inside another variable. Fixes 1605710. -# -# Revision 1.33 2006/11/16 17:10:43 fabiankeil -# Removed webbugs debugging comment again. -# The apostrophe could break JavaScript and -# the comment itself could mess up existing -# comments. -# -# Revision 1.32 2006/11/10 18:04:04 fabiankeil -# Have no-ping print the ping warning in red. -# -# Modified yahoo to keep in sync with recent -# CSS changes and to suppress a useless horizontal -# scrollbar. -# -# msn now makes sure that the continue-link boxes -# act as links (the original CSS just changes the cursor). -# -# Changed fun filter regex to leave microsoft links alone. -# Fixes BR 1019996. -# -# Revision 1.31 2006/10/21 13:12:28 fabiankeil -# Added no-ping and hide-tor-exit-notation. -# -# Adjusted jumping-windows to break less. -# Fixes BR 1146134. -# -# Revision 1.30 2006/10/18 12:36:50 fabiankeil -# google filter now cleans Google groups as well. -# -# Revision 1.29 2006/10/11 14:03:17 fabiankeil -# Changed img-reorder regex to only move width -# attributes if they are following at least one -# whitespace. Fixes BR 1328455. -# -# Revision 1.28 2006/10/11 13:31:13 fabiankeil -# Added Anduin Withers' js-annoyances fix -# for not messing up escaped quotes. Fixes BR 999765. -# -# Improved blogspot filter to make it less likely that -# the blogspot banner at the top of the page is missed. -# -# Revision 1.27 2006/10/08 17:00:51 fabiankeil -# Modified webbugs filter to create a comment around the offending -# image instead of removing it entirely. -# -# Adjusted regex to only match if there's at least one whitespace -# before the width and height attributes. Makes it more likely that -# they are indeed attributes, and not part of the value of another attribute. -# Solves BR 1035587. -# -# Thanks to Martin Thomas for diagnosing the cause of the problem. -# -# Revision 1.26 2006/10/06 18:06:16 fabiankeil -# Added header filter x-httpd-php-to-html -# and reverted another img-reorder whitespace -# problem. -# -# Revision 1.25 2006/10/06 15:26:09 fabiankeil -# Bumped copyright year. -# -# Reverted parts of the last img-reorder change -# which were intended to remove superfluous whitespace -# but had the side effect to mess up some tags. -# -# Modified banners-by-size and banners-by-link to -# use border value "0" instead of "\0". Fixes BR 1100065. -# -# Revision 1.24 2006/10/06 11:25:31 fabiankeil -# Taught img-reorder not to break img tags -# with empty src attributes. Fixes BR 1089474. -# Thanks to Raphael Moll for reporting. -# -# Revision 1.23 2006/10/05 14:46:28 fabiankeil -# Replaced "<" in img-reorder's description with "<". -# -# Modified msn filter to tag ads with classes instead -# of ids. There may be more than one ad per page, -# but ids are required to be unique. -# -# Revision 1.22 2006/10/04 19:17:14 fabiankeil -# Incorportated Frédéric Crozat's ie-exploits -# modification to make it less trigger-happy. -# -# Modified blogspot filter to make .post-body -# scrollable if necessary. -# -# Revision 1.21 2006/10/02 16:21:14 fabiankeil -# Adjusted yahoo filter to hide .yschspns as well. -# Added header filters: html-to-xml and xml-to-html. -# -# Revision 1.20 2006/10/01 21:00:22 fabiankeil -# New site-specific filters: google, yahoo, msn and blogspot. -# -# Revision 1.19 2006/07/18 14:48:45 david__schmidt -# Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) -# with what was really the latest development (the v_3_0_branch branch) -# -# Revision 1.11.2.23 2004/02/17 13:34:01 oes -# - Beefed up the protection of the unsolicited-popups -# filter against matching in JavaScript string constants. -# - Extended the fun filter with a German joke -# - Extended the site-specifics filter with a convenience -# reeplacement for managing mailing lists at SourceForge -# -# Revision 1.11.2.22 2004/01/30 15:29:29 oes -# Updated the copyright note -# -# Revision 1.11.2.21 2004/01/20 15:15:01 oes -# Detail enhancement in all-popups -# -# Revision 1.11.2.20 2004/01/06 16:46:14 oes -# Fixed a JS syntax problem in jumping-windows -# -# Revision 1.11.2.19 2003/12/17 17:09:25 oes -# Added remedy against IE address bar spoofing -# -# Revision 1.11.2.18 2003/12/02 11:25:27 oes -# Fixed a line trashed in previous commit -# -# Revision 1.11.2.17 2003/12/01 21:58:46 oes -# Assorted tuning: -# -# - unsolicited-popups no longer matches at start or end of quoted -# strings, and is now activated earlier and deactivated later in -# the page. -# - replacement images in banners-by-* now without border -# - more effective shockwave flash flattening -# - Custom annoyance filtering for Yahoo Groups, Monster.com, NY Times. -# -# Revision 1.11.2.16 2003/05/08 09:44:56 oes -# Allow extra parameters in blink,marquee tags. Fixes bug #734012 -# -# Revision 1.11.2.15 2003/03/30 13:57:08 oes -# Making unsolicited-popups safe for use on tags enclosed in JS strings -# -# Revision 1.11.2.14 2003/03/19 13:17:50 oes -# - Added filter "site-specifics" to address site specific problems -# - Fixed a small problem in the img-reorder filter -# -# Revision 1.11.2.13 2003/03/18 19:28:59 oes -# Fixed a minor problem in the img-reorder filter -# -# Revision 1.11.2.12 2003/03/15 14:06:58 oes -# - Assorted refinements, optimizations and fixes in the js-annoyances, -# img-reorder, banners-by-size, banners-by-link, webbugs, refresh-tags, -# html-annoyances, content-cookies and fun filters -# - Replaced filter "popups" by choice between two modes: -# - "unsolicited-popups" tries to catch only the unsolicited ones -# - "all-popups" tries to kill them all (as before) -# - New filter "tiny-textforms" Help those tiny or hard-wrap textareas. -# - New filter "jumping-windows" that prevents windows from resizing -# and moving themselves -# - Replaced "nimda" with more general "ie-exploits" filter in which -# all filters for exploits shall be collected -# -# Revision 1.11.2.11 2002/11/12 16:14:43 oes -# Exchanged js-annoyance filter against status bar rewrites with improved version by Don Libes -# -# Revision 1.11.2.10 2002/11/11 13:39:47 oes -# Make refresh-tags filter work even on incorrect refresh tags like found on usatoday.com -# -# Revision 1.11.2.9 2002/11/08 16:39:17 oes -# Made img-reorder more cautious. Fixes bug #632715 -# -# Revision 1.11.2.8 2002/10/13 21:56:52 hal9 -# Adding demoronizer filter. This should include all the common abuses. I have -# left a few of the rare cases commented out (never found these in the wild). -# -# Revision 1.11.2.7 2002/09/25 15:09:39 oes -# Preserve original quoting style in tags wherever possible. Fixes Bug #605956 -# -# Revision 1.11.2.6 2002/08/23 14:12:26 oes -# Proofed frameset-borders against "fremaborder=0 border=0" -# -# Revision 1.11.2.5 2002/08/22 15:05:20 oes -# Added Filter to make Quicktime movies saveable (thanks to aaron@linville.org for the idea) -# -# Revision 1.11.2.4 2002/08/10 11:32:29 oes -# Attribute values in replacement tags of banners-by-size filter now undelimited. (Fixes bug #592493) -# -# Revision 1.11.2.3 2002/08/05 11:43:56 oes -# Fixed a bug in the popups filter that was introduced with the last fix :-( -# -# Revision 1.11.2.2 2002/08/01 11:20:13 oes -# Fixed bugs 587802, 577802 and an unreported one -# -# Revision 1.11.2.1 2002/07/26 15:18:26 oes -# - All filters reviewed and many shorcomings fixed -# - New filters: img-reorder, banners-by-link and js-events -# - Jobs reorderd because they are now executed in order of -# appearance -# -# Revision 1.11 2002/05/24 00:57:18 oes -# Made WeBugs job ungreedy; Fixes bug 559190 -# -# Revision 1.10 2002/04/18 10:14:19 oes -# renamed some filters -# -# Revision 1.9 2002/04/11 07:36:35 oes -# Generalized js-popup filter -# -# Revision 1.8 2002/04/10 17:07:21 oes -# Fixed potentially desctructive jobs, added noflash filter -# -# Revision 1.7 2002/04/09 18:34:51 oes -# Fixed HTML syntax in replacements -# -# Revision 1.6 2002/04/03 19:49:52 swa -# name change -# -# Revision 1.5 2002/03/27 15:30:26 swa -# have a consistent appearance -# -# Revision 1.4 2002/03/26 22:29:54 swa -# we have a new homepage! -# -# Revision 1.3 2002/03/24 16:08:03 jongfoster -# Fixing banners-by-size for new config URLs -# -# Revision 1.2 2002/03/24 13:02:18 swa -# name change related issues. -# -# Revision 1.1 2002/03/24 11:37:39 jongfoster -# Name change -# -# Revision 1.24 2002/03/16 20:39:54 oes -# - Added descriptions to the filters so users will know what they select in the cgi editor -# - Added content-cookies filter -# - Bugfixed many jobs (Thanks to Al for some hints) -# -# Revision 1.22 2002/03/12 13:42:50 oes -# Fixing & Optimizing REs -# -# Revision 1.21 2002/03/12 11:59:20 oes -# Beefed up Buzzword Bingo -# -# Revision 1.20 2002/03/12 01:42:50 oes -# Introduced modular filters -# -# Revision 1.19 2002/03/10 19:49:24 oes -# Added expression to kill referer tracking in JavaScripts -# -# Revision 1.18 2002/03/08 17:14:12 oes -# PNG -> image in comments -# -# Revision 1.17 2002/03/07 03:50:54 oes -# Adapted comments to new built-in images -# -# Revision 1.16 2002/02/21 00:12:19 jongfoster -# Modifying the banner regexps to use long URLS and to autodetect -# whether to show a logo or a transparent GIF, based on actionsfile -# setting. -# -# Revision 1.15 2001/12/28 23:54:20 steudten -# Fix for feature Req #495374: http-equiv problem -# -# Revision 1.14 2001/12/09 18:55:11 david__schmidt -# Updated CODE_STATUS to beta, commented out microsuck line in re_filterfile -# for 2.9.10 beta -# -# Revision 1.13 2001/10/13 13:11:20 joergs -# Fixed WebBug filter. -# -# Revision 1.12 2001/10/07 15:46:42 oes -# Followed Guy's proposal to change the document.cookie job -# -# Revision 1.11 2001/09/21 12:34:00 joergs -# Added filter to replace "Nimda" code by a warning. -# -# Revision 1.10 2001/07/20 11:04:26 oes -# Added Rodneys javascript cookie filter -# -# Revision 1.9 2001/07/13 14:03:48 oes -# Elimiated yet another bug in the banner-by-size jobs. Shame on me! -# -# Revision 1.8 2001/06/29 13:34:00 oes -# - Added explanation for U and T options -# - Added hint on image replacement by CGI call -# - Fixed bug in banner-by-size jobs -# -# Revision 1.7 2001/06/19 14:21:56 oes -# Fixed microsuck line -# -# Revision 1.6 2001/06/09 14:01:57 swa -# header. cosmetics. default: no messing ala microsuck. -# diff --git a/external/privoxy/doc/pcrs.3 b/external/privoxy/doc/pcrs.3 index 59e0f227..6b96b375 100644 --- a/external/privoxy/doc/pcrs.3 +++ b/external/privoxy/doc/pcrs.3 @@ -28,7 +28,7 @@ pcrs - Perl-compatible regular substitution. .B "#include " .PP .br -.BI "pcrs_job *pcrs_compile(const char *" pattern "," +.BI "pcrs_job *pcrs_compile(const char *" pattern "," .ti +5n .BI "const char *" substitute ", const char *" options , .ti +5n @@ -68,7 +68,7 @@ pcrs - Perl-compatible regular substitution. The .SM PCRS -library is a supplement to the +library is a supplement to the .SB PCRE(3) library that implements .RB "regular expression based substitution, like provided by " Perl(1) "'s 's'" @@ -77,10 +77,10 @@ differences (see below). In a first step, the information on a substitution, i.e. the pattern, the substitute and the options are compiled from Perl syntax to an internal form -.RB "called " pcrs_job " by using either the " pcrs_compile() " or " +.RB "called " pcrs_job " by using either the " pcrs_compile() " or " .BR pcrs_compile_command() " functions." -Once the job is compiled, it can be used on subjects, which are arbitrary +Once the job is compiled, it can be used on subjects, which are arbitrary memory areas containing string or binary data, by calling .BR pcrs_execute() ". Jobs can be chained to joblists and whole" .RB "joblists can be applied to a subject using " pcrs_execute_list() . @@ -104,7 +104,7 @@ There are also convenience functions for freeing the jobs and for errno-to-strin .RB "follows the '" "s" "' will be used as the delimiter. Patterns or substitutes" that contain the delimiter need to quote it: \fBs/th\\/is/th\\/at/\fR -.RB "will replace " "th/is" " by " "th/at" " and can be written more simply as" +.RB "will replace " "th/is" " by " "th/at" " and can be written more simply as" .BR "s|th/is|th/at|" "." .IR "pattern" ", " "substitute" ", " "options" " and " "command" " must be" @@ -123,7 +123,7 @@ On success, both functions return a pointer to the compiled job. .SS Substitutes .RI "The " "substitute" " uses" .RB "Perl syntax as documented in the " "perlre(1)" " manual page, with" -some exceptions: +some exceptions: Most notably and evidently, since .SM PCRS @@ -147,9 +147,9 @@ refers to what the last capturing subpattern matched. if a global substitution previously matched. .PP -Perl4-style references to subpattern matches of the form +Perl4-style references to subpattern matches of the form \fB\\1, \\2, ...\fR -.RB "which only exist in Perl5 for backwards compatibility, are " "not" +.RB "which only exist in Perl5 for backwards compatibility, are " "not" supported. Also, since the substitute is a double-quoted string in Perl, you @@ -269,7 +269,7 @@ is set. .SS String subjects -If your +If your .SS Return value and diagnostics @@ -298,7 +298,7 @@ contains pointers to other dynamically allocated structures. Chaining the jobs is up to you, but once you have built a linked list of jobs, .RI "you can execute a whole " joblist " on a given subject by" .RB "a single call to " pcrs_execute_list() ", which will sequentially traverse" -.RB "the linked list until it reaches a " NULL " pointer, and call " pcrs_execute() +.RB "the linked list until it reaches a " NULL " pointer, and call " pcrs_execute() .RI "for each job it encounters, feeding the " result " and " result_length " of each" .RI "call into the next as the " subject " and " subject_length ". As in the single" .RI "job case, the original " subject " remains untouched, but all interim " result "s" @@ -335,22 +335,22 @@ Under normal circumstances, it can take the following values: While compiling the pattern, .SM PCRE ran out of memory. -.TP +.TP .B PCRS_ERR_NOMEM While compiling the job, .SM PCRS ran out of memory. -.TP +.TP .B PCRS_ERR_CMDSYNTAX .BR pcrs_compile_command() " didn't find four tokens while parsing the" .IR command . -.TP +.TP .B PCRS_ERR_STUDY A .SM PCRE .RB "error occured while studying the compiled pattern. Since " pcre_study() only provides textual diagnostic information, the details are lost. -.TP +.TP .B PCRS_WARN_BADREF .RI "The " substitute " contains a reference to a capturing subpattern that" .RI "has a higher index than the number of capturing subpatterns in the " pattern @@ -368,12 +368,12 @@ While matching the pattern, ran out of memory. This can only happen if there are more than 33 backrefrences .RI "in the " pattern "(!)" .BR and " memory is too tight to extend storage for more." -.TP +.TP .B PCRS_ERR_NOMEM While executing the job, .SM PCRS ran out of memory. -.TP +.TP .B PCRS_ERR_BADJOB .RB "The " pcrs_job "* passed to " pcrs_execute " was NULL, or the" .RB "job is bogus (it contains " NULL " pointers to the compiled diff --git a/external/privoxy/doc/source/authors.sgml b/external/privoxy/doc/source/authors.sgml index a810736c..120e1b2a 100644 --- a/external/privoxy/doc/source/authors.sgml +++ b/external/privoxy/doc/source/authors.sgml @@ -2,31 +2,31 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/authors.sgml,v $ Purpose : AUTHORS file for Privoxy - - $Id: authors.sgml,v 2.11 2009/02/12 16:08:26 fabiankeil Exp $ - + $Id: authors.sgml,v 2.21 2011/12/26 17:05:40 fabiankeil Exp $ + + Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ See LICENSE. ======================================================================== - NOTE: Please read developer-manual/documentation.html before touching + NOTE: Please read developer-manual/documentation.html before touching anything in this, or other Privoxy documentation. You have been warned! - Failure to abide by this rule will result in the revocation of your license + Failure to abide by this rule will result in the revocation of your license to live a peaceful existence! ======================================================================== =================================================================== - READ: Document Note: This file generates the AUTHORS file in the + READ: Document Note: This file generates the AUTHORS file in the top level source directory. See p-authors.sgml for list of developers and contributors, etc. They were split from here for use in man page. =================================================================== --> + - + diff --git a/external/privoxy/doc/source/buildsource.sgml b/external/privoxy/doc/source/buildsource.sgml index f8f59551..bf109e47 100644 --- a/external/privoxy/doc/source/buildsource.sgml +++ b/external/privoxy/doc/source/buildsource.sgml @@ -2,8 +2,8 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/buildsource.sgml,v $ Purpose : Entity included in other project documents. - - $Id: buildsource.sgml,v 2.18 2009/02/23 09:03:12 fabiankeil Exp $ + + $Id: buildsource.sgml,v 2.19 2011/09/04 11:10:12 fabiankeil Exp $ Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ See LICENSE. @@ -12,7 +12,7 @@ This file used for inclusion with other documents only. ====================================================================== - If you make changes to this file, please verify the finished + If you make changes to this file, please verify the finished docs all display as intended. This file is included into: @@ -22,7 +22,7 @@ --> - To build Privoxy from source, + To build Privoxy from source, autoconf, GNU make @@ -32,12 +32,12 @@ When building from a source tarball, - first unpack the source: + tarball), +--> first unpack the source: @@ -63,7 +63,7 @@ - This will create a directory named current/, which will + This will create a directory named current/, which will contain the source tree. @@ -81,7 +81,7 @@ and group just for this purpose. See your local documentation for the correct command line to do add new users and groups (something like adduser, but the command syntax may vary from platform - to platform). + to platform). @@ -113,7 +113,7 @@ autoheader autoconf ./configure # (--help to see options) - make # (the make from GNU, sometimes called gmake) + make # (the make from GNU, sometimes called gmake) su # Possibly required make -n install # (to see where all the files will go) make -s install # (to really install, -s to silence output) @@ -135,14 +135,14 @@ - To build an executable with security enhanced features so that + To build an executable with security enhanced features so that users cannot easily bypass the proxy (e.g. Go There Anyway), or alter their own configurations, configure like this: ./configure --disable-toggle --disable-editor --disable-force - + Then build as above. In Privoxy 3.0.7 and later, all of these options can also be disabled through the configuration file. @@ -177,9 +177,9 @@ can also be disabled through the configuration file. - The default installation path for make install is - /usr/local. This may of course be customized with - the various ./configure path options. If you are doing + The default installation path for make install is + /usr/local. This may of course be customized with + the various ./configure path options. If you are doing an install to anywhere besides /usr/local, be sure to set the appropriate paths with the correct configure options (./configure --help). Non-privileged users must of course @@ -209,15 +209,15 @@ can also be disabled through the configuration file. localstatedir (ie: var/) will default to /var instead of $prefix/var so the logs will go to /var/log/privoxy/, and the pid file - will be created in /var/run/privoxy.pid. + will be created in /var/run/privoxy.pid. - make install will attempt to set the correct values - in config (main configuration file). You should + make install will attempt to set the correct values + in config (main configuration file). You should check this to make sure all values are correct. If appropriate, - an init script will be installed, but it is up to the user to determine - how and where to start Privoxy. The init + an init script will be installed, but it is up to the user to determine + how and where to start Privoxy. The init script should be checked for correct paths and values, if anything other than a default install is done. @@ -248,9 +248,9 @@ can also be disabled through the configuration file. - The simplest command line to start Privoxy is - $path/privoxy --user=privoxy $path/etc/privoxy/config. - See privoxy --usage, or the man page, for other options, + The simplest command line to start Privoxy is + $path/privoxy --user=privoxy $path/etc/privoxy/config. + See privoxy --usage, or the man page, for other options, and configuration. ]]> diff --git a/external/privoxy/doc/source/config.sgml b/external/privoxy/doc/source/config.sgml index 472884c6..eb55a994 100644 --- a/external/privoxy/doc/source/config.sgml +++ b/external/privoxy/doc/source/config.sgml @@ -1,7 +1,7 @@ + - + @@ -12,19 +12,19 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/config.sgml,v $ Purpose : config file generation - - $Id: config.sgml,v 2.12 2009/02/12 16:08:26 fabiankeil Exp $ + + $Id: config.sgml,v 2.22 2011/12/26 17:05:40 fabiankeil Exp $ Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ See LICENSE. ======================================================================== - NOTE: Please read developer-manual/documentation.html before touching - anything in this, or other Privoxy documentation. + NOTE: Please read developer-manual/documentation.html before touching + anything in this, or other Privoxy documentation. ======================================================================== - This file is used to generate the main Privoxy config file. It is mostly - content included from p-config.sgml (where all the data is). See that + This file is used to generate the main Privoxy config file. It is mostly + content included from p-config.sgml (where all the data is). See that file for more comments. --> diff --git a/external/privoxy/doc/source/contacting.sgml b/external/privoxy/doc/source/contacting.sgml index 96293f76..93e1bc5c 100644 --- a/external/privoxy/doc/source/contacting.sgml +++ b/external/privoxy/doc/source/contacting.sgml @@ -2,10 +2,10 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/contacting.sgml,v $ Purpose : Entity included in other project documents. - - $Id: contacting.sgml,v 2.14 2008/04/26 11:38:51 fabiankeil Exp $ - Copyright (C) 2001-2008 Privoxy Developers http://www.privoxy.org/ + $Id: contacting.sgml,v 2.30 2011/11/19 14:44:01 fabiankeil Exp $ + + Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/ See LICENSE. ====================================================================== @@ -29,13 +29,13 @@ We value your feedback. In fact, we rely on it to improve Privoxy and its configuration. - However, please note the following hints, so we can + However, please note the following hints, so we can provide you with the best support: Get Support - For casual users, our + For casual users, our support forum at SourceForge is probably best suited: http://sourceforge.net/tracker/?group_id=11118&atid=211118 @@ -52,6 +52,15 @@ developers, either use the mailing lists or the support trackers. + + If you have to contact a Privoxy developer directly for other reasons, + please send a real mail and do not bother with SourceForge's messaging + system. Answers to SourceForge messages are usually bounced by SourceForge's + mail server in which case the developer wasted time writing a response you + don't get. From your point of view it will look like your message has + been completely ignored, so this is frustrating for all parties involved. + + Note that the Privoxy mailing lists are moderated. Posts from unsubscribed addresses have to be accepted manually by a moderator. This may cause a @@ -77,30 +86,30 @@ - Configuration issues, such as ads that slip through, or sites that - don't function properly due to one Privoxy + Configuration issues, such as ads that slip through, or sites that + don't function properly due to one Privoxy action or another being turned on. - + - Bugs in the programming code that makes up + Bugs in the programming code that makes up Privoxy, such as that might cause a crash. - + Reporting Ads or Other Configuration Problems Please send feedback on ads that slipped through, innocent images that were - blocked, sites that don't work properly, and other configuration related problem of - default.action file, to + blocked, sites that don't work properly, and other configuration related problem of + default.action file, to http://sourceforge.net/tracker/?group_id=11118&atid=460288, the Actions File Tracker. - + New, improved default.action files may occasionally be made @@ -115,15 +124,15 @@ Reporting Bugs - Please report all bugs through our bug tracker: - http://sourceforge.net/tracker/?group_id=11118&atid=111118. + Please report all bugs through our bug tracker: + http://sourceforge.net/tracker/?group_id=11118&atid=111118. Before doing so, please make sure that the bug has not already been submitted and observe the additional hints at the top of the submit - form. If already submitted, please feel free to add any info to the + form. If already submitted, please feel free to add any info to the original report that might help to solve the issue. @@ -150,7 +159,7 @@ that your bug still exists. -Please be sure to provide the following information: + Please be sure to provide the following information: @@ -161,7 +170,7 @@ Please be sure to provide the following information: (if you got the source from CVS, please also provide the source code revisions as shown in http://config.privoxy.org/show-version). - + @@ -171,11 +180,11 @@ Please be sure to provide the following information: sending the output of uname -a should do, in case of GNU/Linux, please also name the distribution. - + - The name, platform, and version of the browser + The name, platform, and version of the browser you were using (e.g. Internet Explorer v5.5 for Mac). @@ -183,9 +192,9 @@ Please be sure to provide the following information: The URL where the problem occurred, or some way for us to duplicate the - problem (e.g. http://somesite.example.com/?somethingelse=123). + problem (e.g. http://somesite.example.com/?somethingelse=123). - + @@ -193,52 +202,85 @@ Please be sure to provide the following information: by the Privoxy developers via SourceForge, or if you got your copy somewhere else. - + - Whether you are using Privoxy in tandem with + Whether you are using Privoxy in tandem with another proxy such as Tor. If so, please temporary disable the other proxy to see if the symptoms change. - + - Whether you are using a personal firewall product. If so, does + Whether you are using a personal firewall product. If so, does Privoxy work without it? - + Any other pertinent information to help identify the problem such as config or log file excerpts (yes, you should have log file entries for each - action taken). + action taken). To get a meaningful logfile, please make sure that the + logfile directive + is being used and the following debug options are enabled: + debug 1 # Log the destination for each request Privoxy let through. See also debug 1024. +debug 2 # show each connection status +debug 4 # show I/O status +debug 8 # show header parsing +debug 128 # debug redirects +debug 256 # debug GIF de-animation +debug 512 # Common Log Format +debug 1024 # Log the destination for requests Privoxy didn't let through, and the reason why. +debug 4096 # Startup banner and warnings. +debug 8192 # Non-fatal errors + If you are having trouble with a filter, please additionally enable + debug 64 # debug regular expression filters + If you are using Privoxy 3.0.17 or later and suspect that it interprets the + request or the response incorrectly, please enable + debug 32768 # log all data read from the network + Note that Privoxy log files may contain sensitive information so please don't + submit any logfiles you didn't read first. You can mask sensitive information + as long as it's clear that you removed something. - + You don't have to tell us your actual name when filing a problem - report, but please use a nickname so we can differentiate between - your messages and the ones entered by other "anonymous" users that + report, but if you don't, please use a nickname so we can differentiate + between your messages and the ones entered by other "anonymous" users that may respond to your request if they have the same problem or already - found a solution. + found a solution. Note that due to spam the trackers may not always + allow to post without being logged into SourceForge. If that's the + case, you are still free to create a login that isn't directly linked + to your name, though. Please also check the status of your request a few days after submitting it, as we may request additional information. If you use a SF id, you should automatically get a mail when someone responds to your request. + Please don't bother to add an email address when using the tracker. + If you prefer to communicate through email, just use one of the mailing + lists directly. + + + + If you are new to reporting problems, you might be interested in + How to Report Bugs Effectively. The appendix - of the Privoxy User Manual also has helpful information - on understanding actions, and action debugging. + of the Privoxy User Manual also has helpful information + on understanding actions, and action debugging. @@ -251,10 +293,13 @@ Please be sure to provide the following information: -Other +Mailing Lists -For any other issues, feel free to use the mailing lists. Technically interested users -and people who wish to contribute to the project are also welcome on the developers list! +If you prefer to communicate through email, instead of using a web interface, +feel free to use one of the mailing lists. +To discuss issues that haven't been completely diagnosed yet, please use the Privoxy +users list. Technically interested users and people who wish to contribute to +the project are always welcome on the developers list. You can find an overview of all Privoxy-related mailing lists, including list archives, at: http://sourceforge.net/mail/?group_id=11118. diff --git a/external/privoxy/doc/source/copyright.sgml b/external/privoxy/doc/source/copyright.sgml index 01c978d0..74e6848e 100644 --- a/external/privoxy/doc/source/copyright.sgml +++ b/external/privoxy/doc/source/copyright.sgml @@ -2,17 +2,17 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/copyright.sgml,v $ Purpose : Entity included in other project documents. - - $Id: copyright.sgml,v 2.10 2009/02/10 16:13:30 fabiankeil Exp $ - Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ + $Id: copyright.sgml,v 2.14 2011/09/04 11:10:12 fabiankeil Exp $ + + Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/ See LICENSE. ====================================================================== This file used for inclusion with other documents only. ====================================================================== - If you make changes to this file, please verify the finished + If you make changes to this file, please verify the finished docs all display as intended. This file is included into: @@ -23,8 +23,8 @@ faq ************************************************************** - NOTE: the &my-copy entity must be defined in any file that will - include this file. (This is a workaround for docbook2man not + NOTE: the &my-copy entity must be defined in any file that will + include this file. (This is a workaround for docbook2man not handling the standard © entity in the man page processing.) ************************************************************** @@ -36,7 +36,7 @@ --> - Copyright &my-copy; 2001-2009 by Privoxy Developers ijbswa-developers@lists.sourceforge.net + Copyright &my-copy; 2001-2011 by Privoxy Developers ijbswa-developers@lists.sourceforge.net diff --git a/external/privoxy/doc/source/developer-manual.sgml b/external/privoxy/doc/source/developer-manual.sgml index 0e1dc1f6..e916e047 100644 --- a/external/privoxy/doc/source/developer-manual.sgml +++ b/external/privoxy/doc/source/developer-manual.sgml @@ -1,5 +1,5 @@ + @@ -8,7 +8,7 @@ - + @@ -23,16 +23,16 @@ Purpose : developer manual This file belongs into ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/ - - $Id: developer-manual.sgml,v 2.27 2009/02/19 02:20:22 hal9 Exp $ + + $Id: developer-manual.sgml,v 2.38 2011/12/26 17:05:40 fabiankeil Exp $ Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ See LICENSE. ======================================================================== - NOTE: Please read developer-manual/documentation.html before touching + NOTE: Please read developer-manual/documentation.html before touching anything in this, or other Privoxy documentation. You have been warned! - Failure to abide by this rule will result in the revocation of your license + Failure to abide by this rule will result in the revocation of your license to live a peaceful existence! ======================================================================== @@ -45,24 +45,24 @@ - Copyright &my-copy; 2001-2009 by + Copyright &my-copy; 2001-2009 by Privoxy Developers - $Id: developer-manual.sgml,v 2.27 2009/02/19 02:20:22 hal9 Exp $ + $Id: developer-manual.sgml,v 2.38 2011/12/26 17:05:40 fabiankeil Exp $ @@ -118,16 +118,16 @@ Hal. I don't like seeing blank space :) So added *something* here. - --> + --> Privoxy, as an heir to - Junkbuster, is a Free Software project + Junkbuster, is a Free Software project and the code is licensed under the GNU General Public License version 2. As such, Privoxy development is potentially open to anyone who has the time, knowledge, and desire to contribute in any capacity. Our goals are simply to continue the mission, to improve Privoxy, and - to make it available to as wide an audience as possible. + to make it available to as wide an audience as possible. One does not have to be a programmer to contribute. Packaging, testing, @@ -139,19 +139,19 @@ Hal. The first step is to join the developer's mailing list. - You can submit your ideas, or even better patches. Patches are best - submitted to the Sourceforge tracker set up for this purpose, but + You can submit your ideas, or even better patches. Patches are best + submitted to the Sourceforge tracker set up for this purpose, but can be sent to the list for review too. - You will also need to have a cvs package installed, which will + You will also need to have a cvs package installed, which will entail having ssh installed as well (which seems to be a requirement of SourceForge), in order to access the cvs repository. Having the GNU build tools is also going to be important (particularly, autoconf and gmake). - For the time being (read, this section is under construction), you can - also refer to the extensive comments in the source code. In fact, + For the time being (read, this section is under construction), you can + also refer to the extensive comments in the source code. In fact, reading the code is recommended in any case. @@ -161,7 +161,7 @@ Hal. The CVS Repository If you become part of the active development team, you will eventually - need write access to our holy grail, the CVS repository. One of the + need write access to our holy grail, the CVS repository. One of the team members will need to set this up for you. Please read this chapter completely before accessing via CVS. @@ -206,21 +206,21 @@ Hal. At one time there were two distinct branches: stable and unstable. The - more drastic changes were to be in the unstable branch. These branches - have now been merged to minimize time and effort of maintaining two + more drastic changes were to be in the unstable branch. These branches + have now been merged to minimize time and effort of maintaining two branches. - + --> CVS Commit Guidelines @@ -231,16 +231,16 @@ Hal. main development trunk, and we ask anyone with CVS access to strictly adhere to the following guidelines: - + Basic Guidelines, for all branches: - Please don't commit even + Please don't commit even a small change without testing it thoroughly first. When we're - close to a public release, ask a fellow developer to review your + close to a public release, ask a fellow developer to review your changes. @@ -269,18 +269,18 @@ Hal. url="http://sourceforge.net/tracker/?atid=311118&group_id=11118&func=browse">patch tracker instead. - + - + - + Documentation Guidelines All formal documents are maintained in Docbook SGML and located in the doc/source/* directory. You will need - Docbook, the Docbook + Docbook, the Docbook DTD's and the Docbook modular stylesheets (or comparable alternatives), and either jade or openjade (recommended) installed in order to @@ -337,20 +337,20 @@ Hal. privoxy.1 (man page), and config files are also now maintained as Docbook SGML. These files, when built, in the top-level source directory are - generated files! Also, the Privoxy index.html (and a - variation on this file, privoxy-index.html, + generated files! Also, the Privoxy index.html (and a + variation on this file, privoxy-index.html, meant for inclusion with doc packages), are maintained as SGML as well. DO NOT edit these directly. Edit the SGML source, or contact someone involved in the documentation. - + config requires some special handling. The reason it is maintained this way is so that the extensive comments in the file - mirror those in user-manual. But the conversion - process requires going from SGML to HTML to text to special formatting + mirror those in user-manual. But the conversion + process requires going from SGML to HTML to text to special formatting required for the embedded comments. Some of this does not survive so well. Especially some of the examples that are longer than 80 characters. - The build process for this file outputs to config.new, + The build process for this file outputs to config.new, which should be reviewed for errors and mis-formatting. Once satisfied that it is correct, then it should be hand copied to config. @@ -362,8 +362,8 @@ Hal. Packagers are encouraged to include this documentation. For those without the ability to build the docs locally, text versions of each are kept in - CVS. HTML versions are also being kept in CVS under - doc/webserver/*. And PDF version are kept in + CVS. HTML versions are also being kept in CVS under + doc/webserver/*. And PDF version are kept in doc/pdf/*. @@ -381,7 +381,7 @@ Hal. How do you update the webserver (i.e. the pages on privoxy.org)? - + First, build the docs by running make @@ -399,7 +399,7 @@ Hal. Finished docs should be occasionally submitted to CVS - (doc/webserver/*/*.html) so that those without + (doc/webserver/*/*.html) so that those without the ability to build them locally, have access to them if needed. This is especially important just prior to a new release! Please do this after the $VERSION and @@ -411,14 +411,14 @@ Hal. Quickstart to Docbook and SGML - If you are not familiar with SGML, it is a markup language similar to HTML. - Actually, not a mark up language per se, but a language used to define + If you are not familiar with SGML, it is a markup language similar to HTML. + Actually, not a mark up language per se, but a language used to define markup languages. In fact, HTML is an SGML application. Both will use tags to format text and other content. SGML tags can be much more varied, and flexible, but do much of the same kinds of things. The tags, or elements, are definable in SGML. There is no set standards. Since we are using - Docbook, our tags are those that are defined by + Docbook, our tags are those that are defined by Docbook. Much of how the finish document is rendered is determined by the stylesheets. The stylesheets determine how each tag gets translated to HTML, or other @@ -435,26 +435,26 @@ Hal. Our documents use sections for the most part. Sections - will be processed into HTML headers (e.g. h1 for + will be processed into HTML headers (e.g. h1 for sect1). The Docbook stylesheets - will use these to also generate the Table of Contents for each doc. Our - TOC's are set to a depth of three. Meaning sect1, - sect2, and sect3 will have TOC - entries, but sect4 will not. Each section requires - a <title> element, and at least one - <para>. There is a limit of five section - levels in Docbook, but generally three should be sufficient for our + will use these to also generate the Table of Contents for each doc. Our + TOC's are set to a depth of three. Meaning sect1, + sect2, and sect3 will have TOC + entries, but sect4 will not. Each section requires + a <title> element, and at least one + <para>. There is a limit of five section + levels in Docbook, but generally three should be sufficient for our purposes. - Some common elements that you likely will use: + Some common elements that you likely will use: - <para></para>, paragraph delimiter. Most + <para></para>, paragraph delimiter. Most text needs to be within paragraph elements (there are some exceptions). @@ -468,7 +468,7 @@ Hal. <command></command>, command examples. - <literallayout></literallayout>, like + <literallayout></literallayout>, like <pre>, more or less. @@ -478,15 +478,15 @@ Hal. <listitem></listitem>, member of the above. - <screen></screen>, screen output, implies + <screen></screen>, screen output, implies <literallayout>. - <ulink url="example.com"></ulink>, like + <ulink url="example.com"></ulink>, like HTML <a> tag. - <quote></quote>, for, doh, quoting text. + <quote></quote>, for, doh, quoting text. @@ -506,8 +506,8 @@ Hal. <application>Privoxy</application> Documentation Style - It will be easier if everyone follows a similar writing style. This - just makes it easier to read what someone else has written if it + It will be easier if everyone follows a similar writing style. This + just makes it easier to read what someone else has written if it is all done in a similar fashion. @@ -519,7 +519,7 @@ Hal. All tags should be lower case. - + Tags delimiting a block of text (even small @@ -534,11 +534,11 @@ Hal. Just to <emphasis>emphasize</emphasis>, some text goes here. - + Tags should be nested and step indented for block text like: (except - in-line tags) + in-line tags) <para> <itemizedlist> @@ -552,48 +552,48 @@ Hal. This makes it easier to find the text amongst the tags ;-) - + - Use white space to separate logical divisions within a document, - like between sections. Running everything together consistently + Use white space to separate logical divisions within a document, + like between sections. Running everything together consistently makes it harder to read and work on. - + - Do not hesitate to make comments. Comments can either use the - <comment> element, or the <!-- --> style comment - familiar from HTML. (Note in Docbook v4.x <comment> is + Do not hesitate to make comments. Comments can either use the + <comment> element, or the <!-- --> style comment + familiar from HTML. (Note in Docbook v4.x <comment> is replaced by <remark>.) - + - We have an international audience. Refrain from slang, or English - idiosyncrasies (too many to list :). Humor also does not translate + We have an international audience. Refrain from slang, or English + idiosyncrasies (too many to list :). Humor also does not translate well sometimes. - + Try to keep overall line lengths in source files to 80 characters or less for obvious reasons. This is not always possible, with lengthy URLs for instance. - + - Our documents are available in differing formats. Right now, they - are just plain text, HTML, and PDF, but others are always a - future possibility. Be careful with URLs (<ulink>), and avoid + Our documents are available in differing formats. Right now, they + are just plain text, HTML, and PDF, but others are always a + future possibility. Be careful with URLs (<ulink>), and avoid this mistake: My favorite site is <ulink url="http://example.com">here</ulink>. - This will render as My favorite site is here, which is + This will render as My favorite site is here, which is not real helpful in a text doc. Better like this: @@ -607,37 +607,37 @@ Hal. -H option. (ispell I think too.) - + - - + + - + Privoxy Custom Entities - Privoxy documentation is using - a number of customized entities to facilitate - documentation maintenance. + Privoxy documentation is using + a number of customized entities to facilitate + documentation maintenance. We are using a set of boilerplate files with generic text, that is used by multiple docs. This way we can write something once, and use it repeatedly without having to re-write the same content over and over again. If editing such a file, keep in mind that it should be - generic. That is the purpose; so it can be used in varying + generic. That is the purpose; so it can be used in varying contexts without additional modifications. - We are also using what Docbook calls - internal entities. These are like variables in + We are also using what Docbook calls + internal entities. These are like variables in programming. Well, sort of. For instance, we have the - p-version entity that contains the current - Privoxy version string. You are strongly - encouraged to use these where possible. Some of these obviously + p-version entity that contains the current + Privoxy version string. You are strongly + encouraged to use these where possible. Some of these obviously require re-setting with each release (done by the Makefile). A sampling of custom entities are listed below. See any of the main docs for examples. @@ -653,28 +653,28 @@ Hal. In this example, the contents of the file, - supported.sgml is available for inclusion anywhere - in the doc. To make this happen, just reference the now defined - entity: &supported; (starts with an ampersand - and ends with a semi-colon), and the contents will be dumped into + supported.sgml is available for inclusion anywhere + in the doc. To make this happen, just reference the now defined + entity: &supported; (starts with an ampersand + and ends with a semi-colon), and the contents will be dumped into the finished doc at that point. - + Commonly used internal entities: - p-version: the Privoxy + p-version: the Privoxy version string, e.g. &p-version;. - p-status: the project status, either + p-status: the project status, either alpha, beta, or stable. - p-not-stable: use to conditionally include + p-not-stable: use to conditionally include text in not stable releases (e.g. beta). @@ -684,16 +684,16 @@ Hal. p-text: this doc is only generated as text. - + - + - There are others in various places that are defined for a specific + There are others in various places that are defined for a specific purpose. Read the source! - + - + @@ -718,7 +718,7 @@ Hal. Using Comments - + Comment, Comment, Comment @@ -757,7 +757,7 @@ is actually being done. - + Use blocks for comments @@ -798,9 +798,9 @@ if ( this_variable == that_variable ) /* this may not either */ wish to "disrupt" the flow of the code, feel free to use a 1 line comment which is NOT on the same line as the code. - + - + Keep Comments on their own line @@ -853,7 +853,7 @@ short do_something_very_important( } /* -END- do_something_very_important */ - + Comment each logical step @@ -871,9 +871,9 @@ short do_something_very_important( comment. After all, these are usually major logic containers. - + - + Comment All Functions Thoroughly @@ -892,9 +892,9 @@ short do_something_very_important( functions should contain the information presented in the addendum section of this document. - + - + Comment at the end of braces if the content is more than one screen length @@ -930,12 +930,12 @@ if ( 1 == X ) } /* -END- if ( 1 == X ) */ - + Naming Conventions - + Variable Names @@ -960,9 +960,9 @@ int msiis5hack = 0; int msIis5Hack = 0; - - + + Function Names @@ -988,9 +988,9 @@ int loadSomeFile( struct client_state *csp ) - + - + Header file prototypes @@ -1007,15 +1007,15 @@ int loadSomeFile( struct client_state *csp ) Instead of: -(.h) extern int load_aclfile( struct client_state * ); or -(.h) extern int load_aclfile(); +(.h) extern int load_aclfile( struct client_state * ); or +(.h) extern int load_aclfile(); (.c) int load_aclfile( struct client_state *csp ) - + - + Enumerations, and #defines @@ -1043,7 +1043,7 @@ int loadSomeFile( struct client_state *csp ) #endif /* def FEATURE_FORCE */ - + Constants @@ -1065,23 +1065,23 @@ int loadSomeFile( struct client_state *csp ) -#define USE_IMG_LST 1 or +#define USE_IMG_LST 1 or #define _USE_IMAGE_LIST 1 or -#define USE_IMAGE_LIST_ 1 or +#define USE_IMAGE_LIST_ 1 or #define use_image_list 1 or #define UseImageList 1 - + - + Using Space - + Put braces on a line by themselves. @@ -1127,7 +1127,7 @@ while ( more lines are read ) } - + ALL control statements should have a block @@ -1160,9 +1160,9 @@ if ( this == that ) "feature". The "explanation" and "exception" from the point above also applies. - + - + Do not belabor/blow-up boolean expressions @@ -1181,9 +1181,9 @@ structure->flag = ( condition ); to the project has at least a "good" knowledge of C/C++. (Hope I do not offend by that last comment ... 8-) - + - + Use white space freely because it is free @@ -1205,7 +1205,7 @@ if ( this_variable == this_variable ) first_value = old_value + ( ( some_value - another_value ) - whatever ) - + Don't use white space around structure operators @@ -1229,9 +1229,9 @@ function_name(); Instead of: a_struct -> a_member; a_struct . a_member; function_name (); - + - + Make the last brace of a function stand out @@ -1267,9 +1267,9 @@ int function2( ... ) Status: developer-discretion on the number of blank lines. Enforced is the end of function comments. - + - + Use 3 character indentions @@ -1306,11 +1306,11 @@ int function1( ... ) - + Initializing - + Initialize all variables @@ -1337,11 +1337,11 @@ struct *ptr = NULL; - + Functions - + Name functions that return a boolean as a question. @@ -1358,7 +1358,7 @@ contains_an_image(); is_web_page_blank(); - + Always specify a return type for a function. @@ -1370,9 +1370,9 @@ is_web_page_blank(); purpose, and create a void return type if the function does not need to return anything. - + - + Minimize function calls when iterating by using variables @@ -1416,9 +1416,9 @@ for ( size_t cnt = 0; cnt < len; cnt++ ) *may* change or could *potentially* change, then you must code the function call in the for/while loop. - + - + Pass and Return by Const Reference @@ -1437,9 +1437,9 @@ for ( size_t cnt = 0; cnt < len; cnt++ ) Both these pointers are *const*! If the c runtime library maintainers do it, we should too. - + - + Pass and Return by Value @@ -1453,9 +1453,9 @@ for ( size_t cnt = 0; cnt < len; cnt++ ) prototypes with "pass by value": int load_aclfile( struct client_state *csp ) - + - + Names of include files @@ -1478,7 +1478,7 @@ for ( size_t cnt = 0; cnt < len; cnt++ ) -/* This is not a local include, but requires a path element. */ +/* This is not a local include, but requires a path element. */ #include <sys/fileName.h> @@ -1487,9 +1487,9 @@ for ( size_t cnt = 0; cnt < len; cnt++ ) without a _very_ good reason. This duplicates the #include "file.h" behavior. - + - + Provide multiple inclusion protection @@ -1512,7 +1512,7 @@ for ( size_t cnt = 0; cnt < len; cnt++ ) #endif /* ndef PROJECT_H_INCLUDED */ - + Use `extern "C"` when appropriate @@ -1536,7 +1536,7 @@ extern "C" #endif /* def __cplusplus */ - + Where Possible, Use Forward Struct Declaration Instead of Includes @@ -1562,13 +1562,13 @@ extern file_list *xyz; Status: Use with discretion. - + General Coding Practices - + Turn on warnings @@ -1578,9 +1578,9 @@ extern file_list *xyz; should turn on as many as possible. With GCC, the switch is "-Wall". Try and fix as many warnings as possible. - + - + Provide a default case for all switch statements @@ -1623,9 +1623,9 @@ switch( hash_string( cmd ) ) Status: Programmer discretion is advised. - + - + Try to avoid falling through cases in a switch statement. @@ -1648,9 +1648,9 @@ switch( hash_string( cmd ) ) the fact of the fall through and reason why you felt it was necessary. - + - + Use 'long' or 'short' Instead of 'int' @@ -1666,9 +1666,9 @@ switch( hash_string( cmd ) ) now). Should we add these to IJB now that we have a "configure" script? - + - + Don't mix size_t and other types @@ -1680,9 +1680,9 @@ switch( hash_string( cmd ) ) variable of a different type (or even against a constant) without casting one of the values. - + - + Declare each variable and struct on its own line. @@ -1715,9 +1715,9 @@ long c = 0; Status: developer-discretion. - + - + Use malloc/zalloc sparingly @@ -1735,7 +1735,7 @@ If a function creates a struct and stores a pointer to it in a list, then it should definitely be allocated via `malloc'. - + The Programmer Who Uses 'malloc' is Responsible for Ensuring 'free' @@ -1765,9 +1765,9 @@ static void unload_re_filterfile( void *f ) { ... } standard is for allocating and freeing data structures (complex or nested). - + - + Add loaders to the `file_list' structure and in order @@ -1783,9 +1783,9 @@ static void unload_re_filterfile( void *f ) { ... } POPUPs can also be referred to as KILLPOPUPs, it is clear that it should come first. - + - + "Uncertain" new code and/or changes to existing code, use FIXME or XXX @@ -1815,7 +1815,7 @@ static void unload_re_filterfile( void *f ) { ... } include in the project (or conversely exclude from the project). - + @@ -1850,13 +1850,10 @@ const char FILENAME_rcs[] = "$Id$"; * The GNU General Public License should be included with * this file. If not, you can view it at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or write to the Free Software Foundation, Inc., + * or write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 , * USA * - * Revisions : - * $Log$ - * *********************************************************************/ @@ -1907,13 +1904,10 @@ const char FILENAME_h_rcs[] = FILENAME_H_VERSION; * The GNU General Public License should be included with * this file. If not, you can view it at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or write to the Free Software Foundation, Inc., + * or write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 , * USA * - * Revisions : - * $Log$ - * *********************************************************************/ @@ -2017,7 +2011,7 @@ Install the rpm. Any error messages? Please submit test reports only with the test form at sourceforge. Three simple steps: - + Select category: the distribution you test on. Select group: the version of Privoxy that we are about to release. Fill the Summary and Detailed Description with something @@ -2027,7 +2021,7 @@ at sourceforge. Three simple steps: Do not mail to the mailing list (we cannot keep track on issues there). - + @@ -2055,7 +2049,7 @@ at sourceforge. Three simple steps: Version numbers - First you need to determine which version number the release will have. + First you need to determine which version number the release will have. Privoxy version numbers consist of three numbers, separated by dots, like in X.Y.Z (e.g. 3.0.0), where: @@ -2063,7 +2057,7 @@ at sourceforge. Three simple steps: X, the version major, is rarely ever changed. It is increased by one if turning a development branch into stable substantially changes the functionality, - user interface or configuration syntax. Majors 1 and 2 were + user interface or configuration syntax. Majors 1 and 2 were Junkbuster, and 3 will be the first stable Privoxy release. @@ -2087,7 +2081,7 @@ at sourceforge. Three simple steps: Z, the point or sub version, represents a release of the software within a branch. - It is therefore incremented immediately before each code freeze. + It is therefore incremented immediately before each code freeze. In development branches, only the even point versions correspond to actual releases, while the odd ones denote the evolving state of the sources on CVS in between. It follows that Z is odd on CVS in development branches most of the time. There, it gets @@ -2100,11 +2094,11 @@ at sourceforge. Three simple steps: Stable branches work a little differently, since there should be little to no development happening in such branches. Remember, only bugfixes, which presumably should have had some testing - before being committed. Stable branches will then have their - version reported as 0.0.0, during that period - between releases when changes are being added. This is to denote - that this code is not for release. Then - as the release nears, the version is bumped according: e.g. + before being committed. Stable branches will then have their + version reported as 0.0.0, during that period + between releases when changes are being added. This is to denote + that this code is not for release. Then + as the release nears, the version is bumped according: e.g. 3.0.1 -> 0.0.0 -> 3.0.2. @@ -2126,16 +2120,16 @@ at sourceforge. Three simple steps: before committing to a stable branch! - Developers should remember too that if they commit a bugfix to the stable - branch, this will more than likely require a separate submission to the - main trunk, since these are separate development trees within CVS. If you + Developers should remember too that if they commit a bugfix to the stable + branch, this will more than likely require a separate submission to the + main trunk, since these are separate development trees within CVS. If you are working on both, then this would require at least two separate check outs (i.e main trunk, and the stable release branch, which is v_3_0_branch at the moment). - + Before the Release: Freeze @@ -2151,26 +2145,26 @@ at sourceforge. Three simple steps: they have pending changes/fixes in their pipelines. Announce the freeze so that nobody will interfere with last minute changes. - + Increment the version number (point from odd to even in development - branches!) in configure.in. (RPM spec files + branches!) in configure.in. (RPM spec files will need to be incremented as well.) - + If default.action has changed since last release (i.e. software release or standalone actions file release), bump up its version info to A.B in this line: - + {+add-header{X-Actions-File-Version: A.B} -filter -no-popups} - + Then change the version info in doc/webserver/actions/index.php, line: '$required_actions_file_version = "A.B";' @@ -2178,36 +2172,36 @@ at sourceforge. Three simple steps: All documentation should be rebuild after the version bump. - Finished docs should be then be committed to CVS (for those - without the ability to build these). Some docs may require + Finished docs should be then be committed to CVS (for those + without the ability to build these). Some docs may require rather obscure processing tools. config, the man page (and the html version of the man page), and the PDF docs fall in this category. REAMDE, the man page, AUTHORS, and config - should all also be committed to CVS for other packagers. The + should all also be committed to CVS for other packagers. The formal docs should be uploaded to the webserver. See the Section "Updating the webserver" in this manual for details. - + - The User Manual is also used for context + The User Manual is also used for context sensitive help for the CGI editor. This is version sensitive, so that - the user will get appropriate help for his/her release. So with + the user will get appropriate help for his/her release. So with each release a fresh version should be uploaded to the webserver (this is in addition to the main User Manual - link from the main page since we need to keep manuals for various - versions available). The CGI pages will link to something like + link from the main page since we need to keep manuals for various + versions available). The CGI pages will link to something like http://privoxy.org/$(VERSION)/user-manual/. This will need to be updated for each new release. There is no Makefile target for this at this time!!! It needs to be done manually. - + All developers should look at the ChangeLog and make sure noteworthy changes are referenced. - + Commit all files that were changed in the above steps! @@ -2219,14 +2213,14 @@ at sourceforge. Three simple steps: cvs tag v_X_Y_Z. Don't use vX_Y_Z, ver_X_Y_Z, v_X.Y.Z (won't work) etc. - + If the release was in a development branch, increase the point version from even to odd (X.Y.(Z+1)) again in configure.in and commit your change. - + On the webserver, copy the user manual to a new top-level directory @@ -2234,27 +2228,27 @@ at sourceforge. Three simple steps: pages, which have the version as a prefix, will go into the right version of the manual. If this is a development branch release, also symlink X.Y.(Z-1) to X.Y.Z and X.Y.(Z+1) to - . (i.e. dot). + . (i.e. dot). - + - + - + Building and Releasing the Packages Now the individual packages can be built and released. Note that for GPL reasons the first package to be released is always the source tarball. - + For all types of packages, including the source tarball, you must make sure that you build from clean sources by exporting the right version from CVS into an empty directory (just press return when asked for a password): - + mkdir dist # delete or choose different name if it already exists @@ -2263,20 +2257,20 @@ at sourceforge. Three simple steps: cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa export -r v_X_Y_Z current - + Do NOT change a single bit, including, but not limited to version information after export from CVS. This is to make sure that all release packages, and with them, all future bug reports, are based on exactly the same code. - + - Every significant release of Privoxy has included at least one - package that either had incorrect versions of files, missing files, - or incidental leftovers from a previous build process that gave - unknown numbers of users headaches to try to figure out what was + Every significant release of Privoxy has included at least one + package that either had incorrect versions of files, missing files, + or incidental leftovers from a previous build process that gave + unknown numbers of users headaches to try to figure out what was wrong. PLEASE, make sure you are using pristene sources, and are following the prescribed process! @@ -2284,14 +2278,14 @@ at sourceforge. Three simple steps: Please find additional instructions for the source tarball and the - individual platform dependent binary packages below. And details + individual platform dependent binary packages below. And details on the Sourceforge release process below that. Note on Privoxy Packaging - Please keep these general guidelines in mind when putting together + Please keep these general guidelines in mind when putting together your package. These apply to all platforms! @@ -2299,11 +2293,11 @@ at sourceforge. Three simple steps: Privoxy requires - write access to: all *.action files, all - logfiles, and the trust file. You will + write access to: all *.action files, all + logfiles, and the trust file. You will need to determine the best way to do this for your platform. - + Please include up to date documentation. At a bare minimum: @@ -2349,11 +2343,11 @@ at sourceforge. Three simple steps: The documentation has been designed such that the manuals are linked - to each other from parallel directories, and should be packaged + to each other from parallel directories, and should be packaged that way. privoxy-index.html can also be included and can serve as a focal point for docs and other links of interest (and possibly renamed to index.html). - This should be one level up from the manuals. There is a link also + This should be one level up from the manuals. There is a link also on this page to an HTMLized version of the man page. To avoid 404 for this, it is in CVS as doc/webserver/man-page/privoxy-man-page.html, @@ -2363,16 +2357,16 @@ at sourceforge. Three simple steps: with privoxy-index.html, (i.e. one level up from the manual directories). - + user.action and user.filter are designed for local preferences. Make sure these do not get overwritten! - config should not be overwritten either. This + config should not be overwritten either. This has especially important configuration data in it. trust should be left in tact as well. - + Other configuration files (default.action and @@ -2382,29 +2376,29 @@ at sourceforge. Three simple steps: likely to change between releases and contain important new features and bug fixes. - + - Please check platform specific notes in this doc, if you haven't - done Privoxy packaging before for other platform - specific issues. Conversely, please add any notes that you know - are important for your platform (or contact one of the doc + Please check platform specific notes in this doc, if you haven't + done Privoxy packaging before for other platform + specific issues. Conversely, please add any notes that you know + are important for your platform (or contact one of the doc maintainers to do this if you can't). - + - Packagers should do a clean install of their - package after building it. So any previous installs should be - removed first to ensure the integrity of the newly built package. - Then run the package for a while to make sure there are no + Packagers should do a clean install of their + package after building it. So any previous installs should be + removed first to ensure the integrity of the newly built package. + Then run the package for a while to make sure there are no obvious problems, before uploading. - + - - + + Source Tarball @@ -2450,7 +2444,7 @@ at sourceforge. Three simple steps: First, make sure that you have freshly exported the right version into an empty directory. (See "Building and releasing - packages" above). + packages" above). As the only exception to not changing anything after export from CVS, @@ -2521,7 +2515,7 @@ at sourceforge. Three simple steps: Change directory to the os2setup directory. Edit the os2build.cmd file to set the final executable filename. - For example, + For example, @@ -2641,7 +2635,7 @@ at sourceforge. Three simple steps: - Then, run: + Then, run: @@ -2699,7 +2693,7 @@ at sourceforge. Three simple steps: - You can then upload privoxyosx_setup_x.y.z.zip anonymously to + You can then upload privoxyosx_setup_x.y.z.zip anonymously to uploads.sourceforge.net/incoming, create a release for it, and you're done. Use the release notes and Change Log from the source tarball package. @@ -2820,7 +2814,7 @@ at sourceforge. Three simple steps: Uploading and Releasing Your Package - After the package is ready, it is time to upload it + After the package is ready, it is time to upload it to SourceForge, and go through the release steps. The upload is done via FTP: @@ -2830,47 +2824,47 @@ at sourceforge. Three simple steps: Upload to: ftp://upload.sourceforge.net/incoming - + user: anonymous - + password: ijbswa-developers@lists.sourceforge.net - + - + Or use the make targets as described above. Once this done go to https://sourceforge.net/project/admin/editpackages.php?group_id=11118, - making sure you are logged in. Find your target platform in the - second column, and click Add Release. You will - then need to create a new release for your package, using the format + >https://sourceforge.net/project/admin/editpackages.php?group_id=11118, + making sure you are logged in. Find your target platform in the + second column, and click Add Release. You will + then need to create a new release for your package, using the format of $VERSION ($CODE_STATUS), e.g. &p-version; (beta). Now just follow the prompts. Be sure to add any appropriate Release - notes. You should see your freshly uploaded packages in - Step 2. Add Files To This Release. Check the - appropriate box(es). Remember at each step to hit the - Refresh/Submit buttons! You should now see your - file(s) listed in Step 3. Fill out the forms with the appropriate + notes. You should see your freshly uploaded packages in + Step 2. Add Files To This Release. Check the + appropriate box(es). Remember at each step to hit the + Refresh/Submit buttons! You should now see your + file(s) listed in Step 3. Fill out the forms with the appropriate information for your platform, being sure to hit Update - for each file. If anyone is monitoring your platform, check the - email box at the very bottom to notify them of + for each file. If anyone is monitoring your platform, check the + email box at the very bottom to notify them of the new package. This should do it! - If you have made errors, or need to make changes, you can go through - essentially the same steps, but select Edit Release, + If you have made errors, or need to make changes, you can go through + essentially the same steps, but select Edit Release, instead of Add Release. @@ -2884,20 +2878,20 @@ at sourceforge. Three simple steps: include the download location, the release notes and the Changelog. Also, post an - updated News item on the project page Sourceforge, and update the Home + updated News item on the project page Sourceforge, and update the Home page and docs linked from the Home page (see below). Other news sites and release oriented sites, such as Freshmeat, should also be notified. - + Update the Webserver The webserver should be updated at least with each stable release. When updating, please follow these steps to make sure that no broken links, - inconsistent contents or permission problems will occur (as it has many + inconsistent contents or permission problems will occur (as it has many times in the past!): @@ -2912,7 +2906,7 @@ at sourceforge. Three simple steps: That will generate doc/webserver/user-manual, doc/webserver/developer-manual, - doc/webserver/faq, + doc/webserver/faq, doc/pdf/*.pdf and doc/webserver/index.html automatically. @@ -2929,7 +2923,7 @@ at sourceforge. Three simple steps: create new directories under doc/webserver). - Next, commit any changes from the above steps to CVS. All set? + Next, commit any changes from the above steps to CVS. All set? If these are docs in the stable branch, then do: @@ -2956,7 +2950,7 @@ at sourceforge. Three simple steps: &contacting; - + Privoxy Copyright, License and History @@ -2981,7 +2975,7 @@ at sourceforge. Three simple steps: - + See also @@ -2992,7 +2986,7 @@ at sourceforge. Three simple steps: - Copyright &my-copy; 2001-2009 by + Copyright &my-copy; 2001-2011 by Privoxy Developers -$Id: faq.sgml,v 2.58 2009/03/21 12:27:44 fabiankeil Exp $ +$Id: faq.sgml,v 2.85 2011/12/26 17:05:40 fabiankeil Exp $ +--> @@ -137,7 +137,7 @@ Hal. You can find the latest version of the document at http://www.privoxy.org/faq/. Please see the Contact section if you want to - contact the developers. + contact the developers. @@ -152,7 +152,7 @@ Hal. General Information Who should give &my-app; a try? - Anyone who is interested in security, privacy, or in + Anyone who is interested in security, privacy, or in finer-grained control over their web and Internet experience. @@ -160,7 +160,7 @@ Hal. Is Privoxy the best choice for me? - &my-app; is certainly a good choice, especially for those who want more + &my-app; is certainly a good choice, especially for those who want more control and security. Those with the willingness to read the documentation and the ability to fine-tune their installation will benefit the most. @@ -170,19 +170,19 @@ me? completely personalize your installation. Being familiar with, or at least having an interest in learning about HTTP and other networking - protocols, HTML, and + protocols, HTML, and Regular Expressions - will be a big plus and will help you get the most out of &my-app;. - A new installation just includes a very basic configuration. The user - should take this as a starting point only, and enhance it as he or she - sees fit. In fact, the user is encouraged, and expected to, fine-tune the + will be a big plus and will help you get the most out of &my-app;. + A new installation just includes a very basic configuration. The user + should take this as a starting point only, and enhance it as he or she + sees fit. In fact, the user is encouraged, and expected to, fine-tune the configuration. - Much of Privoxy's configuration can be done + Much of Privoxy's configuration can be done with a Web browser. - But there are areas where configuration is done using a + But there are areas where configuration is done using a text editor to edit configuration files. Also note that the web-based action editor doesn't use authentication and should only be enabled in environments @@ -220,13 +220,13 @@ Privoxy work? Does Privoxy do anything more than ad blocking? - - Yes, ad blocking is but one possible use. There are many, many ways &my-app; - can be used to sanitize and customize web browsing. + + Yes, ad blocking is but one possible use. There are many, many ways &my-app; + can be used to sanitize and customize web browsing. -What is this new version of +<sect2 renderas="sect3" id="newjb"><title>What is this new version of <quote><citetitle>Junkbuster</citetitle></quote>? @@ -247,20 +247,20 @@ Junkbuster at all? led to confusion. - There are also potential legal complications from our use of the - Junkbuster name, which is a registered trademark of + There are also potential legal complications from our use of the + Junkbuster name, which is a registered trademark of Junkbusters Corporation. - There are, however, no objections from Junkbusters Corporation to the + There are, however, no objections from Junkbusters Corporation to the Privoxy project itself, and they, in fact, still share our ideals and goals. - The developers also believed that there are so many improvements over the original - code, that it was time to make a clean break from the past and make + The developers also believed that there are so many improvements over the original + code, that it was time to make a clean break from the past and make a name in their own right. - Privoxy is the + Privoxy is the Privacy Enhancing Proxy. Also, its content modification and junk suppression gives you, the user, more control, more freedom, and allows you to browse your personal and @@ -269,7 +269,7 @@ Junkbuster at all? How does Privoxy differ -from the old Junkbuster? +from the old Junkbuster? Privoxy picks up where Junkbuster left off. @@ -283,7 +283,7 @@ from the old Junkbuster? Privoxy's new features include: - + &newfeatures; @@ -302,7 +302,7 @@ an ad, and what is not? and the host (blocking the big banner hosting services like doublecklick.net already helps a lot). Privoxy takes advantage of this fact by using URL - patterns to sort out and block the requests for things that sound + patterns to sort out and block the requests for things that sound like they would be ads or banners. @@ -320,7 +320,7 @@ an ad, and what is not? -Can Privoxy make mistakes? +<title id="mistakes">Can Privoxy make mistakes? This does not sound very scientific. Actually, it's a black art ;-) And yes, it is always possible to have a broad @@ -347,12 +347,12 @@ This does not sound very scientific. The default installation should give you a good starting point, and block most ads and unwanted content, but many of the more advanced features are off by default, and require - you to activate them. + you to activate them. You do have to set up your browser to use Privoxy (see the Installation section below). + linkend="firststep">Installation section below). And you will certainly run into situations where there are false positives, @@ -367,7 +367,7 @@ This does not sound very scientific. Can Privoxy run as a server on a network? - + Yes, &my-app; runs as a server already, and can easily be configured to serve more than one client. See How can I set up Privoxy to act as a proxy for my LAN below. @@ -384,8 +384,8 @@ Privoxy. Why should I use Privoxy at all? your browser just can't. - In addition, a proxy is good choice if you use multiple browsers, or - have a LAN with multiple computers since &my-app; can run as a server + In addition, a proxy is good choice if you use multiple browsers, or + have a LAN with multiple computers since &my-app; can run as a server application. This way all the configuration is in one place, and you don't have to maintain a similar configuration for possibly many browsers or users. @@ -404,8 +404,8 @@ Privoxy. Why should I use Privoxy at all? The most important reason is because you have access to everything, and you can control everything. You can check every line of every configuration file yourself. You can check every - last bit of source code should you desire. And even if you can't read code, - there should be some comfort in knowing that other people can, + last bit of source code should you desire. And even if you can't read code, + there should be some comfort in knowing that other people can, and do read it. You can build the software from scratch, if you want, so that you know the executable is clean, and that it is yours. In fact, we encourage this level of scrutiny. It @@ -413,14 +413,14 @@ Privoxy. Why should I use Privoxy at all? -Is there is a license or fee? What about a +<sect2 renderas="sect3" id="license"><title>Is there is a license or fee? What about a warranty? Registration? Privoxy is free software and licensed under the GNU General Public License (GPL) version 2. It is free to use, copy, modify or distribute as you wish under the terms of this license. Please see the Copyright section for more - information on the license and copyright. Or the LICENSE file + information on the license and copyright. Or the LICENSE file that should be included. @@ -464,9 +464,9 @@ warranty? Registration? -I would like to help you, what can I do? +I would like to help you, what can I do? -Would you like to participate? +Would you like to participate? Well, we always need help. There is something for everybody who wants to help us. We welcome new developers, packagers, @@ -475,59 +475,92 @@ warranty? Registration? programmer. There are many other tasks available. In fact, the programmers often can't spend as much time programming because of some of the other, more mundane things that need to be done, like checking the - Tracker feedback sections. + Tracker feedback sections or responding to user questions on the mailing + lists. - So first thing, Privoxy Users + or the Privoxy + Developers mailing list, join the discussion, help out other users, provide general + feedback or report problems you noticed. + + + If you intend to help out with the trackers, you also might want to get an account on SourceForge.net - and mail your id to the developers - mailing list. Then, please read the Developer's Manual, at least - the pertinent sections. - - - You can also start helping out without SourceForge.net account, - simply by showing up on the mailing list, helping out other users, - providing general feedback or reporting problems you noticed. + so we don't confuse you with the other name-less users. + + We also have a Developer's Manual. + While it is partly out of date, it's still worth reading. + + + Our TODO list + may be of interest to you as well. + Please let us know if you want to work on one of the items listed. + @@ -542,10 +575,10 @@ warranty? Registration? Which browsers are supported by Privoxy? - Any browser that can be configured to use a proxy, which + Any browser that can be configured to use a proxy, which should be virtually all browsers, including Firefox, Internet - Explorer, Opera, and + Explorer, Opera, and Safari among others. Direct browser support is not an absolute requirement since Privoxy runs as a separate application and talks @@ -571,7 +604,7 @@ Include supported.sgml here: dealing with some of the common abuses of HTML in email. See How can I configure Privoxy with Outlook? below for more on - this. + this. Be aware that HTML email presents a number of unique security and privacy @@ -582,11 +615,11 @@ Include supported.sgml here: -I just installed Privoxy. Is there anything +<title>I just installed Privoxy. Is there anything special I have to do now? - All browsers should be told to use Privoxy - as a proxy by specifying the correct proxy address and port number + All browsers should be told to use Privoxy + as a proxy by specifying the correct proxy address and port number in the appropriate configuration area for the browser. It's possible to combine &my-app; with a packet filter to intercept HTTP requests even if the client isn't explicitly configured to use &my-app;, - but where possible, configuring the client is recommended. See + but where possible, configuring the client is recommended. See the User Manual for more details. You should also flush your browser's memory and disk - cache to get rid of any cached junk items, and remove any stored + cache to get rid of any cached junk items, and remove any stored cookies. @@ -626,7 +659,7 @@ special I have to do now? If you set up the Privoxy to run on the computer you browse from (rather than your ISP's server or some - networked computer on a LAN), the proxy will be on 127.0.0.1 + networked computer on a LAN), the proxy will be on 127.0.0.1 (sometimes referred to as localhost, which is the special name used by every computer on the Internet to refer to itself) and the port will be 8118 (unless you used the When configuring your browser's proxy settings you typically enter the word localhost or the IP address 127.0.0.1 in the boxes next to HTTP and Secure (HTTPS) and - then the number 8118 for port. + then the number 8118 for port. This tells your browser to send all web requests to Privoxy instead of directly to the Internet. - Privoxy can also be used to proxy for - a Local Area Network. In this case, your would enter either the IP - address of the LAN host where Privoxy + Privoxy can also be used to proxy for + a Local Area Network. In this case, your would enter either the IP + address of the LAN host where Privoxy is running, or the equivalent hostname, e.g. 192.168.1.1. Port assignment would be same as above. Note that Privoxy doesn't listen on any LAN interfaces by @@ -662,17 +695,17 @@ special I have to do now? All the ads are there. What's wrong? - Did you configure your browser to use Privoxy + Did you configure your browser to use Privoxy as a proxy? It does not sound like it. See above. You might also try flushing - the browser's caches to force a full re-reading of pages. You can verify - that Privoxy is running, and your browser - is correctly configured by entering the special URL: - http://p.p/. + the browser's caches to force a full re-reading of pages. You can verify + that Privoxy is running, and your browser + is correctly configured by entering the special URL: + http://p.p/. This should take you to a page titled This is Privoxy.. with access to Privoxy's internal configuration. - If you see this, then you are good to go. If you receive a page saying + If you see this, then you are good to go. If you receive a page saying Privoxy is not running, then the browser is not set up to use your Privoxy installation. If you receive anything else (probably nothing at all), it could either @@ -711,7 +744,7 @@ Privoxy is running and being used. The procedure for clearing the cache varies from browser to browser. For - example, Mozilla/Netscape users would click + example, Mozilla/Netscape users would click Edit --> Preferences --> Advanced --> Cache and then click both Clear Memory Cache @@ -735,7 +768,7 @@ Privoxy is running and being used. &my-app; utilizes the concept of - actions + actions that are used to manipulate and control web page data. Actions files are where these actions @@ -745,7 +778,7 @@ Privoxy is running and being used. There is a wide array of actions available that give the user a high degree of control and flexibility on how to process each and every web page. - + Actions can be defined on a URL pattern basis, i.e. @@ -761,7 +794,7 @@ Privoxy is running and being used. -The <quote>actions</quote> concept confuses me. Please list +<title>The <quote>actions</quote> concept confuses me. Please list some of these <quote>actions</quote>. For a comprehensive discussion of the actions concept, please refer @@ -777,7 +810,7 @@ some of these actions. How are actions files configured? What is the easiest -way to do this? +way to do this? Actions files are just text files in a special syntax and can be edited @@ -786,8 +819,8 @@ way to do this? at http://config.privoxy.org/ (Shortcut: http://p.p/) and then select View & - change the current configuration from the menu. Note - that this feature must be explicitly enabled in the main config file + change the current configuration from the menu. Note + that this feature must be explicitly enabled in the main config file (see enable-edit-actions). @@ -798,30 +831,15 @@ way to do this? There are several different <quote>actions</quote> files. What are the differences? - Three actions files - are being included by the developers, to be used for - different purposes: These are - default.action, the main actions file - which is actively maintained by the Privoxy - developers and typically sets the default policies, user.action, - where users are encouraged to make their private customizations. - Please see the actions chapter - in the User Manual for a more - detailed explanation. - - - - Earlier versions included three different versions of the - default.action file. The new scheme allows for - greater flexibility of local configuration, and for browser based - selection of pre-defined aggressiveness levels. + Please have a look at the the actions chapter + in the User Manual for a detailed explanation. Where can I get updated Actions Files? - Based on your feedback and the continuing development, updates of + Based on your feedback and the continuing development, updates of default.action will be made available from time to time on the files section of @@ -850,21 +868,21 @@ the differences? Why is the configuration so complicated? - Complicated is in the eye of the beholder. Those that are + Complicated is in the eye of the beholder. Those that are familiar with some of the underlying concepts, such as regular expression syntax, take to it like a fish takes to water. Also, software that tries hard to be user friendly, often lacks sophistication and flexibility. There is always that trade-off there between power vs. easy-of-use. Furthermore, anyone is welcome to contribute ideas and - implementations to enhance &my-app;. + implementations to enhance &my-app;. How can I make my Yahoo/Hotmail/Gmail account work? The default configuration shouldn't impact the usability of any of these services. - It may, however, make all cookies + It may, however, make all cookies temporary, so that your browser will forget your login credentials in between browser sessions. If you would like not to have to log in manually each time you access those websites, simply turn off all cookie handling @@ -878,9 +896,9 @@ the differences? .login.yahoo.com - These kinds of sites are often quite complex and heavy with - Javascript and - thus fragile. So if still a problem, + These kinds of sites are often quite complex and heavy with + Javascript and + thus fragile. So if still a problem, we have an alias just for such sticky situations: @@ -898,8 +916,8 @@ the differences? Make sure the domain, host and path are appropriate as well. Your browser can - tell you where you are specifically and you should use that information for - your configuration settings. Note that above it is not referenced as + tell you where you are specifically and you should use that information for + your configuration settings. Note that above it is not referenced as gmail.com, which is a valid domain name. @@ -913,7 +931,7 @@ the differences? profiles in the web based actions file editor at http://config.privoxy.org/show-status. See the User - Manual for a list of actions, and how the default + Manual for a list of actions, and how the default profiles are set. @@ -921,23 +939,23 @@ the differences? Where the defaults are likely to break some sites, exceptions for known popular problem sites are included, but in general, the more aggressive your default settings are, the more exceptions - you will have to make later. New users are best to start off in - Cautious setting. This is safest and will have the fewest + you will have to make later. New users are best to start off in + Cautious setting. This is safest and will have the fewest problems. See the User Manual for a more detailed discussion. - It should be noted that the Advanced profile (formerly known + It should be noted that the Advanced profile (formerly known as the Adventuresome profile) is more - aggressive, and will make use of some of + aggressive, and will make use of some of Privoxy's advanced features. Use at your own risk! - Why can I change the configuration +<sect2 renderas="sect3" id="browseconfig"> <title>Why can I change the configuration with a browser? Does that not raise security issues? It may seem strange that regular users can edit the config files with their @@ -953,7 +971,7 @@ with a browser? Does that not raise security issues? If you run Privoxy for multiple untrusted users (e.g. in a LAN) or aren't entirely in control of your own browser, you will probably want - to make sure that the the web-based editor and remote toggle features are + to make sure that the web-based editor and remote toggle features are off by setting enable-edit-actions 0 and filter action in one of the actions files. Content filtering is automatically - disabled for inappropriate MIME types, but if you now better than Privoxy + disabled for inappropriate MIME types, but if you know better than Privoxy what should or should not be filtered you can filter any content you like. @@ -995,21 +1013,21 @@ with a browser? Does that not raise security issues? - If you are familiar with regular expressions, and HTML, you can look at + If you are familiar with regular expressions, and HTML, you can look at the provided default.filter with a text editor and define your own filters. This is potentially a very powerful feature, but - requires some expertise in both regular expressions and HTML/HTTP. - user.filter, so they won't - be overwritten during upgrades. - The ability to define multiple filter files + requires some expertise in both regular expressions and HTML/HTTP. + user.filter, so they won't + be overwritten during upgrades. + The ability to define multiple filter files in config is a new feature as of v. 3.0.5.]]> - There is no GUI editor option for this part of the configuration, - but you can disable/enable the various pre-defined filters of the included + There is no GUI editor option for this part of the configuration, + but you can disable/enable the various pre-defined filters of the included default.filter file with the web-based actions file editor. Note that the custom actions editor must be explicitly enabled in @@ -1026,10 +1044,10 @@ with a browser? Does that not raise security issues? -How can I set up Privoxy to act as a proxy for my +<title>How can I set up Privoxy to act as a proxy for my LAN? - By default, Privoxy only responds to requests + By default, Privoxy only responds to requests from 127.0.0.1 (localhost). To have it act as a server for a network, this needs to be changed in the main configuration file. Look for @@ -1048,12 +1066,12 @@ with a browser? Does that not raise security issues? - Save the file, and restart Privoxy. Configure + Save the file, and restart Privoxy. Configure all browsers on the network then to use this address and port number. - Alternately, you can have Privoxy listen on + Alternately, you can have Privoxy listen on all available interfaces: @@ -1063,10 +1081,10 @@ with a browser? Does that not raise security issues? - And then use Privoxy's + And then use Privoxy's permit-access - feature to limit connections. A firewall in this situation is recommended + url="../user-manual/config.html#PERMIT-ACCESS">permit-access + feature to limit connections. A firewall in this situation is recommended as well. @@ -1101,7 +1119,7 @@ with a browser? Does that not raise security issues? If you want to see nothing, then change the set-image-blocker - action to blank. This can be done by editing the + action to blank. This can be done by editing the user.action file, or through the web-based actions file editor. @@ -1116,7 +1134,7 @@ with a browser? Does that not raise security issues? is rather smart, it will make occasional mistakes. The checkerboard image is visually decent, and it shows you where images have been blocked, which can be very helpful in case some navigation aid or otherwise innocent image was - erroneously blocked. It is recommended for new users so they can + erroneously blocked. It is recommended for new users so they can see what is happening. Some people might also enjoy seeing how many banners they don't have to see. @@ -1132,7 +1150,7 @@ instead of the checkerboard image. Why and how do I get rid of this? or (i)layers, and these external HTML documents are blocked. Being non-images they get replaced by a substitute HTML page rather than a substitute image, which wouldn't work out technically, since the browser expects and accepts - only HTML when it has requested an HTML document. + only HTML when it has requested an HTML document. The substitute page adapts to the available space and shows itself as a @@ -1151,15 +1169,15 @@ instead of the checkerboard image. Why and how do I get rid of this? -Can Privoxy run as a service +<title>Can Privoxy run as a service on Win2K/NT/XP? Windows service functionality. See - the User Manual for details on how to install and configure + the User Manual for details on how to install and configure Privoxy as a service. - + Earlier ]]>3.x versions could run as a system service using srvany.exe. See the discussion at -How can I make Privoxy work with other -proxies like Squid or Tor? +How can I make Privoxy work with other proxies? This can be done and is often useful to combine the benefits of - Privoxy with those of a another proxy. + Privoxy with those of a another proxy, + for example to cache content. See the forwarding chapter in the User Manual which - describes how to do this, and the - How do I use Privoxy together with - Tor section below. + describes how to do this. If you intend to use Privoxy with Tor, + please also have a look at + How do I use Privoxy together with Tor. @@ -1189,8 +1207,9 @@ proxies like Squid or Tor? and thus avoid individual browser configuration? - No, its more complicated than that. This only works with special kinds - of proxies known as intercepting proxies (see below). + No, its more complicated than that. This only works with special kinds + of proxies known as intercepting proxies + (see below). @@ -1207,7 +1226,7 @@ and thus avoid individual browser configuration? However, some people say transparent proxy when they mean intercepting proxy. If you are one of them, - please read the next entry. + please read the next entry. @@ -1219,7 +1238,7 @@ and thus avoid individual browser configuration? but it can handle requests that where intercepted and redirected with a packet filter (like PF or iptables), as long as the Host - header is present. + header is present. As the Host header is required by HTTP/1.1 and as most @@ -1260,14 +1279,14 @@ and thus avoid individual browser configuration? of knowing which particular application makes a request, so there is no way to distinguish between web pages and HTML mail. Privoxy just blindly proxies all requests. In the - case of Outlook Express (see above), OE uses - IE anyway, and there is no way for Privoxy to ever + case of Outlook Express (see above), OE uses + IE anyway, and there is no way for Privoxy to ever be able to distinguish between them (nor could any other proxy type application for that matter). - For a good discussion of some of the issues involved (including privacy and - security issues), see + For a good discussion of some of the issues involved (including privacy and + security issues), see http://sourceforge.net/tracker/?func=detail&atid=211118&aid=629518&group_id=11118. @@ -1276,12 +1295,12 @@ and thus avoid individual browser configuration? I sometimes notice cookies sneaking through. How? Cookies can be - set in several ways. The classic method is via the + url="http://en.wikipedia.org/wiki/Browser_cookie">Cookies can be + set in several ways. The classic method is via the Set-Cookie HTTP header. This is straightforward, and an - easy one to manipulate, such as the &my-app; concept of + easy one to manipulate, such as the &my-app; concept of session-cookies-only. - There is also the possibility of using + There is also the possibility of using Javascript to set cookies (&my-app; calls these content-cookies). This is trickier because the syntax can vary widely, and thus requires a certain @@ -1300,20 +1319,20 @@ and thus avoid individual browser configuration? Are all cookies bad? Why? - No, in fact there are many beneficial uses of + No, in fact there are many beneficial uses of cookies. Cookies are just a method that browsers can use to store data between pages, or between browser sessions. Sometimes there is a good reason for this, and the user's life is a bit easier as a result. But there is a long history of some websites taking - advantage of this layer of trust, and using the data they glean from you and + advantage of this layer of trust, and using the data they glean from you and your browsing habits for their own purposes, and maybe to your potential detriment. Such sites are using you and storing their data on your system. That is why the privacy conscious watch from whom those cookies come, and why they really need to be there. - See the + See the Wikipedia cookie definition for more. @@ -1323,14 +1342,14 @@ and thus avoid individual browser configuration? How can I allow permanent cookies for my trusted sites? - There are several actions that relate to cookies. The default behavior is to + There are several actions that relate to cookies. The default behavior is to allow only session cookies, which means the cookies only last - for the current browser session. This eliminates most kinds of abuse related + for the current browser session. This eliminates most kinds of abuse related to cookies. But there may be cases where you want cookies to last. To disable all cookie actions, so that cookies are allowed unrestricted, - both in and out, for example.com: + both in and out, for example.com: @@ -1351,14 +1370,14 @@ and thus avoid individual browser configuration? Each instance of Privoxy has its own configuration, including such attributes as the TCP port that it listens on. - What you can do is run multiple instances of Privoxy, each with - a unique + What you can do is run multiple instances of Privoxy, each with + a unique listen-address configuration setting, and configuration path, and then each of these can have their own configurations. Think of it as per-port configuration. - + Simple enough for a few users, but for large installations, consider having groups of users that might share like configurations. @@ -1377,7 +1396,7 @@ and thus avoid individual browser configuration? ############################################################ { +block } / # Block *all* URLs - + ############################################################ # Whitelist ############################################################ @@ -1386,12 +1405,12 @@ and thus avoid individual browser configuration? toys.example.com games.example.com - This allows access to only those three sites by first blocking all URLs, and + This allows access to only those three sites by first blocking all URLs, and then subsequently allowing three specific exceptions. - Another approach is Privoxy's - trustfile concept, which incorporates the notion of + Another approach is Privoxy's + trustfile concept, which incorporates the notion of trusted referrers. See the Trust documentation for details. @@ -1408,14 +1427,14 @@ and thus avoid individual browser configuration? How can I turn off ad-blocking? - Ad blocking is achieved through a complex application of various &my-app; - actions. These - actions are deployed against simple images, banners, flash animations, + Ad blocking is achieved through a complex application of various &my-app; + actions. These + actions are deployed against simple images, banners, flash animations, text pages, JavaScript, pop-ups and pop-unders, etc., so its not as simple as just turning one or two actions off. The various actions that make up &my-app; ad blocking are hard-coded into the default configuration files. It has been assumed that everyone using &my-app; is interested in this - particular feature. + particular feature. If you want to do without this, there are several approaches you can take: @@ -1425,7 +1444,7 @@ and thus avoid individual browser configuration? blocking rules, and corresponding exceptions. Or lastly, if you are not concerned about the additional blocks that are done for privacy reasons, you can very easily over-ride all blocking with the - following very simple rule in your user.action: + following very simple rule in your user.action: @@ -1433,7 +1452,7 @@ and thus avoid individual browser configuration? { -block } / # UN-Block *all* URLs - + Or even a more comprehensive reversing of various ad related actions: @@ -1455,7 +1474,7 @@ and thus avoid individual browser configuration? -How can I have custom template pages, like the +<title>How can I have custom template pages, like the <emphasis>BLOCKED</emphasis> page? &my-app; templates are specialized text files utilized by @@ -1469,12 +1488,12 @@ and thus avoid individual browser configuration? during upgrades. You can, however, create completely new templates, place them in another directory and specify the alternate path in the main config. For details, have a look at the templdir option. + url="../user-manual/config.html#templdir">templdir option. -How can I remove the <quote>Go There Anyway</quote> link from +<title>How can I remove the <quote>Go There Anyway</quote> link from the <emphasis>BLOCKED</emphasis> page? There is more than one way to do it (although Perl is not involved). @@ -1483,7 +1502,7 @@ the BLOCKED page? Editing the BLOCKED template page (see above) may dissuade some users, but this method is easily circumvented. Where you need this level of control, you might want to build &my-app; from source, and disable various features that are - available as compile-time options. You should + available as compile-time options. You should configure the sources as follows: @@ -1513,15 +1532,15 @@ the BLOCKED page? Miscellaneous -How much does Privoxy slow my browsing down? This +<title id="slowsme">How much does Privoxy slow my browsing down? This has to add extra time to browsing. How much of an impact depends on many things, including the CPU of the host - system, how aggressive the configuration is, which specific actions are being triggered, + system, how aggressive the configuration is, which specific actions are being triggered, the size of the page, the bandwidth of the connection, etc. - Overall, it should not slow you down any in real terms, and may actually help + Overall, it should not slow you down any in real terms, and may actually help speed things up since ads, banners and other junk are not typically being retrieved and displayed. The actual processing time required by Privoxy itself for each page, is relatively small @@ -1559,7 +1578,7 @@ delays in page requests. What's wrong? url="../user-manual/actions-file.html#FILTER">filter action, such as filtering banners by size, web-bugs etc, or the deanimate-gifs - action, the entire document must be loaded into memory in order for the filtering + action, the entire document must be loaded into memory in order for the filtering mechanism to work, and nothing is sent to the browser during this time. @@ -1573,7 +1592,7 @@ delays in page requests. What's wrong? anti-virus software). - Filtering is automatically disabled for inappropriate MIME types. But note + Filtering is automatically disabled for inappropriate MIME types. But note that if the web server mis-reports the MIME type, then content that should not be filtered, could be. Privoxy only knows how to differentiate filterable content because of the MIME type as reported by @@ -1586,11 +1605,11 @@ delays in page requests. What's wrong? "http://p.p/"? http://config.privoxy.org/ is the - address of Privoxy's built-in user interface, and + address of Privoxy's built-in user interface, and http://p.p/ is a shortcut for it. - Since Privoxy sits between your web browser and the Internet, + Since Privoxy sits between your web browser and the Internet, it can simply intercept requests for these addresses and answer them with its built-in web server. @@ -1611,7 +1630,7 @@ delays in page requests. What's wrong? Do you still maintain the blocklists? No. The patterns for blocking now reside (among other things) in the actions files, which are + url="../user-manual/actions-file.html">actions files, which are actively maintained instead. See next question ... @@ -1625,25 +1644,25 @@ various ways to interact with the developers. -If I do submit missed ads, will +<sect2 renderas="sect3" id="newads2"><title>If I do submit missed ads, will they be included in future updates? Whether such submissions are eventually included in the - default.action configuration file depends on how - significant the issue is. We of course want to address any potential - problem with major, high-profile sites such as Google, - Yahoo, etc. Any site with global or regional reach, + default.action configuration file depends on how + significant the issue is. We of course want to address any potential + problem with major, high-profile sites such as Google, + Yahoo, etc. Any site with global or regional reach, has a good chance of being a candidate. But at the other end of the spectrum are any number of smaller, low-profile sites such as for local clubs or schools. Since their reach and impact are much less, they are best handled by inclusion in the user's user.action, and thus would be - unlikely to be included. + unlikely to be included. -Why doesn't anyone answer my support +<sect2 renderas="sect3" id="noonecares"><title>Why doesn't anyone answer my support request? Rest assured that it has been read and considered. Why it is not answered, @@ -1661,7 +1680,7 @@ us help you. Your efforts are not wasted, and we do appreciate them. If you run both the browser and &my-app; locally, you cannot hide your IP address with Privoxy or ultimately any other software alone. The server needs to know your IP address so that it knows - where to send the responses back. + where to send the responses back. There are many publicly usable "anonymous" proxies out there, which @@ -1697,8 +1716,8 @@ us help you. Your efforts are not wasted, and we do appreciate them. Privoxy can remove various information about you, - and allows you more freedom to decide which sites - you can trust, and what details you want to reveal. But it neither + and allows you more freedom to decide which sites + you can trust, and what details you want to reveal. But it neither hides your IP address, nor can it guarantee that the rest of the system behaves correctly. There are several possibilities how a web sites can find out who you are, even if you are using a strict Privoxy @@ -1748,7 +1767,7 @@ us help you. Your efforts are not wasted, and we do appreciate them. 5. Startup to make sure Privoxy itself is setup correctly. - + If it is, refer to Tor's extensive documentation to learn how to install Tor, and make sure Tor's logfile says that @@ -1767,9 +1786,11 @@ us help you. Your efforts are not wasted, and we do appreciate them. If you verified that Privoxy and Tor are working, it is time to connect them. As far as Privoxy is concerned, Tor is just another proxy that can be reached - by socks4 or socks4a. Most likely you are interested in Tor - to increase your anonymity level, therefore you should use socks4a, to make sure DNS requests are - done through Tor and thus invisible to your local network. + by socks4, socks4a and socks5. Most likely you are interested in Tor + to increase your anonymity level, therefore you should use socks5, to make sure DNS + requests are done through Tor and thus invisible to your + local network. Using socks4a would work too, but with socks5 you get more precise error + messages. -# forward-socks4a / 127.0.0.1:9050 . +# forward-socks5 / 127.0.0.1:9050 . @@ -1840,7 +1861,7 @@ us help you. Your efforts are not wasted, and we do appreciate them. content is being altered? - Definitely. It is common for sites to use browser type, browser version, + Definitely. It is common for sites to use browser type, browser version, HTTP header content, and various other techniques in order to dynamically decide what to display and how to display it. What you see, and what I see, might be very different. There are many, many ways that this can be handled, @@ -1866,8 +1887,8 @@ content is being altered? many other ways things can go wrong when trying to fool a web server. The results of which could inadvertently cause pages to load incorrectly, partially, or even not at all. And there may be no obvious clues as to just - what went wrong, or why. Nowhere will there be a message that says - Turn off fast-redirects or else! + what went wrong, or why. Nowhere will there be a message that says + Turn off fast-redirects or else! @@ -1877,8 +1898,8 @@ content is being altered? - If you have problems with a site, you will have to adjust your configuration - accordingly. Cookies are probably the most likely adjustment that may + If you have problems with a site, you will have to adjust your configuration + accordingly. Cookies are probably the most likely adjustment that may be required, but by no means the only one. @@ -1886,13 +1907,13 @@ content is being altered? -Can Privoxy act as a <quote>caching</quote> proxy to +<title id="caching">Can Privoxy act as a <quote>caching</quote> proxy to speed up web browsing? - No, it does not have this ability at all. You want something like + No, it does not have this ability at all. You want something like Squid or Polipo for this. - And, yes, before you ask, Privoxy can co-exist + And, yes, before you ask, Privoxy can co-exist with other kinds of proxies like Squid. See the forwarding chapter in the user @@ -1903,7 +1924,7 @@ speed up web browsing? What about as a firewall? Can Privoxy protect me? - Not in the way you mean, or in the way some firewall vendors claim they can. + Not in the way you mean, or in the way some firewall vendors claim they can. Privoxy can help protect your privacy, but can't protect your system from intrusion attempts. It is, of course, perfectly possible to use both. @@ -1915,10 +1936,10 @@ speed up web browsing? ads used to be. Why? It is technically possible to eliminate banners and ads in a way that frees - their allocated page space. This could easily be done by blocking with + their allocated page space. This could easily be done by blocking with Privoxy's filters, and eliminating the entire image references from the - HTML page source. + HTML page source. But, this would consume considerably more CPU resources (IOW, slow things @@ -1957,35 +1978,35 @@ ads used to be. Why? As far as ad blocking is concerned, this is less of a restriction than it may seem, since ad sources are often identifiable by the host name, and often the banners to be placed in an encrypted page come unencrypted nonetheless - for efficiency reasons, which exposes them to the full power of + for efficiency reasons, which exposes them to the full power of Privoxy's ad blocking. Content cookies (those that are embedded in the actual HTML or JS page content, see filter{content-cookies}), - in an SSL transaction will be impossible to block under these conditions. - Fortunately, this does not seem to be a very common scenario since most + url="../user-manual/actions-file.html#FILTER-CONTENT-COOKIES">filter{content-cookies}), + in an SSL transaction will be impossible to block under these conditions. + Fortunately, this does not seem to be a very common scenario since most cookies come by traditional means. -Privoxy runs as a <quote>server</quote>. How +<title id="secure">Privoxy runs as a <quote>server</quote>. How secure is it? Do I need to take any special precautions? - On Unix-like systems, Privoxy can run as a non-privileged + On Unix-like systems, Privoxy can run as a non-privileged user, which is how we recommend it be run. Also, by default Privoxy listens to requests from localhost only. - The server aspect of Privoxy is not itself directly + The server aspect of Privoxy is not itself directly exposed to the Internet in this configuration. If you want to have Privoxy serve as a LAN proxy, this will have to be opened up to allow for LAN requests. In this case, we'd recommend - you specify only the LAN gateway address, e.g. 192.168.1.1, in the main + you specify only the LAN gateway address, e.g. 192.168.1.1, in the main Privoxy configuration file and check all access control and security options. All LAN hosts can then use this as their proxy address @@ -2008,23 +2029,23 @@ secure is it? Do I need to take any special precautions? url="http://config.privoxy.org/toggle">http://config.privoxy.org/toggle. - See the Bookmarklets section - of the User Manual for an easy way to access this - feature. Note that this is a feature that may need to be enabled in the main + See the Bookmarklets section + of the User Manual for an easy way to access this + feature. Note that this is a feature that may need to be enabled in the main config file. -When <quote>disabled</quote> is Privoxy totally +<title>When <quote>disabled</quote> is Privoxy totally out of the picture? No, this just means all optional filtering and actions are disabled. - Privoxy is still acting as a proxy, but just + Privoxy is still acting as a proxy, but just doing less of the things that Privoxy would - normally be expected to do. It is still a middle-man in - the interaction between your browser and web sites. See below to bypass + normally be expected to do. It is still a middle-man in + the interaction between your browser and web sites. See below to bypass the proxy. @@ -2040,10 +2061,10 @@ out of the picture? -My logs show Privoxy <quote>crunches</quote> +<title>My logs show Privoxy <quote>crunches</quote> ads, but also its own internal CGI pages. What is a <quote>crunch</quote>? - A crunch simply means Privoxy intercepted + A crunch simply means Privoxy intercepted something, nothing more. Often this is indeed ads or banners, but Privoxy uses the same mechanism for trapping requests for its own internal pages. For instance, a request for @@ -2067,7 +2088,7 @@ from a webserver? FTP server? viewing a document (i.e. a page), and downloading a file. The same is true of Privoxy. If there is a match for a block pattern, - it will still be blocked, and of course this is obvious. + it will still be blocked, and of course this is obvious. Filtering is potentially more of a concern since the results are not always @@ -2094,7 +2115,7 @@ from a webserver? FTP server? altered by filtering, will be saved too, for these (probably rare) cases. - Note that versions later than 3.0.2 do NOT filter document types reported as + Note that versions later than 3.0.2 do NOT filter document types reported as text/plain. Prior to this, Privoxy did filter this document type. @@ -2116,7 +2137,7 @@ from a webserver? FTP server? all to the content is to be avoided. - Privoxy does not do FTP at all, only HTTP + Privoxy does not do FTP at all, only HTTP and HTTPS (SSL) protocols. @@ -2133,18 +2154,18 @@ altered it! Yikes, what is wrong! Should I continue to use a <quote>HOSTS</quote> file for ad-blocking? One time-tested technique to defeat common ads is to trick the local DNS - system by giving a phony IP address for the ad generator in the local - HOSTS file, typically using 127.0.0.1, aka + system by giving a phony IP address for the ad generator in the local + HOSTS file, typically using 127.0.0.1, aka localhost. This effectively blocks the ad. - There is no reason to use this technique in conjunction with + There is no reason to use this technique in conjunction with Privoxy. Privoxy - does essentially the same thing, much more elegantly and with much more + does essentially the same thing, much more elegantly and with much more flexibility. A large HOSTS file, in fact, not only duplicates effort, but may get in the way and seriously slow down your system. - It is recommended to remove such entries from your HOSTS file. If you think - your hosts list is neglected by Privoxy's + It is recommended to remove such entries from your HOSTS file. If you think + your hosts list is neglected by Privoxy's configuration, consider adding your list to your user.action file: @@ -2166,15 +2187,15 @@ and related issues? -I've noticed that Privoxy changes <quote>Microsoft</quote> to +<title>I've noticed that Privoxy changes <quote>Microsoft</quote> to <quote>MicroSuck</quote>! Why are you manipulating my browsing? @@ -2195,7 +2216,43 @@ and related issues? Privoxy generates HTML in both its own templates, and possibly whenever there are text substitutions via a &my-app; filter. While this should always conform to the HTML 4.01 specifications, it has not been - validated against this or any other standard. + validated against this or any other standard. + + + + +How did you manage to get Privoxy on my computer without my consent? + + + We didn't. We make Privoxy available for download, but we don't go + around installing it on other people's systems behind their back. + If you discover Privoxy running on your system and are sure you didn't + install it yourself, somebody else did. You may not even be running + the real Privoxy, but maybe something else that only pretends to be + Privoxy, or maybe something that is based on the real Privoxy, + but has been modified. + + + Lately there have been reports of problems with some kind of + Privoxy versions that come preinstalled on some Netbooks. + Some of the problems described are inconsistent with the behaviour + of official Privoxy versions, which suggests that the preinstalled + software may contain vendor modifications that we don't know about + and thus can't debug. + + + Privoxy's license allows vendor + modifications, but the vendor has to comply with the license, + which involves informing the user about the changes and to make + the changes available under the same license as Privoxy itself. + + + If you are having trouble with a modified Privoxy version, + please try to talk to whoever made the modifications before + reporting the problem to us. Please also try to convince + whoever made the modifications to talk to us. If you think + somebody gave you a modified Privoxy version without complying + to the license, please let us know. @@ -2217,7 +2274,7 @@ and related issues? -Privoxy is not running. Solution: verify +Privoxy is not running. Solution: verify that &my-app; is installed correctly, has not crashed, and is indeed running. Turn on Privoxy's logging, and look at the logs to see what they say. @@ -2230,7 +2287,7 @@ and related issues? configuration and take the forwarders out of the equation. - Or you have a firewall that is interfering and blocking you. Solution: + Or you have a firewall that is interfering and blocking you. Solution: try disabling or removing the firewall as a simple test. @@ -2251,7 +2308,7 @@ and related issues? -I just added a new rule, but the steenkin ad is +<title id="flushit">I just added a new rule, but the steenkin ad is still getting through. How? If the ad had been displayed before you added its URL, it will probably be @@ -2265,16 +2322,16 @@ still getting through. How? applied. Try pasting the full URL of the offending ad into http://config.privoxy.org/show-url-info and see if it really matches your new rule. Blocking ads is like blocking - spam: a lot of tinkering is required to stay ahead of the game. And - remember you need to block the URL of the ad in question, which may be + spam: a lot of tinkering is required to stay ahead of the game. And + remember you need to block the URL of the ad in question, which may be entirely different from the site URL itself. Most ads are hosted on different servers than the main site itself. If you right-click on the ad, you should - be able to get all the relevant information you need. Alternately, you can + be able to get all the relevant information you need. Alternately, you can find the correct URL by looking at Privoxy's logs (you may need to enable logging in the main config file if its disabled). - Below is a slightly modified real-life log snippet that originates with one + Below is a slightly modified real-life log snippet that originates with one requested URL: www.example.com (name of site was changed for this example, the number of requests is real). You can see in this the complexity of what goes into making up this one page. There @@ -2284,8 +2341,8 @@ still getting through. How? content is obviously good or bad, but not all. Many of the more questionable looking requests, are going to outside domains that seem to be identifying themselves with suspicious looking names, making - our job a little easier. &my-app; has crunched (meaning caught - and BLOCKED) quite a few items in this example, but perhaps missed a few as well. + our job a little easier. &my-app; has crunched (meaning caught + and BLOCKED) quite a few items in this example, but perhaps missed a few as well. @@ -2338,7 +2395,7 @@ Request: 66.70.21.80/scripts/click.php?hid=a71b9f6504b0c5681fa5&si=Ua What can I do? - First verify that it is indeed a Privoxy problem, + First verify that it is indeed a Privoxy problem, by toggling off Privoxy through http://config.privoxy.org/toggle (the toggle feature may need to be enabled in the main @@ -2374,13 +2431,13 @@ What can I do? on again. Remember to flush your browser's caches in between any such changes! - Alternately, if you are comfortable with a text editor, you can accomplish - the same thing by editing the appropriate actions file. Probably the easiest + Alternately, if you are comfortable with a text editor, you can accomplish + the same thing by editing the appropriate actions file. Probably the easiest way to deal with such problems when editing by hand is to add your site to a { fragile } section in user.action, which is an alias that turns off most dangerous actions, but is also likely to turn off more actions then needed, and thus lower - your privacy and protection more than necessary, + your privacy and protection more than necessary, Troubleshooting actions is discussed in more detail in the with general configuration information and examples. - As a last resort, you can always see if your browser has a setting that will + As a last resort, you can always see if your browser has a setting that will bypass the proxy setting for selective sites. Modern browsers can do this. @@ -2438,7 +2495,7 @@ every time I start IE. What gives? set-up DUN connection and each LAN connection in IE store the settings for each user individually. As such this enforces individual configurations rather than common ones. Hence the first time you use a DUN connection after - re-booting your system it may not perform as you expect, and prompt you for + re-booting your system it may not perform as you expect, and prompt you for the password. Just set and save the password again and all should be OK. @@ -2453,16 +2510,16 @@ every time I start IE. What gives? I cannot connect to any FTP sites. Privoxy is blocking me. - Privoxy cannot act as a proxy for FTP traffic, + Privoxy cannot act as a proxy for FTP traffic, so do not configure your browser to use Privoxy as an FTP proxy. The same is true for any protocol other than HTTP - or HTTPS (SSL). + or HTTPS (SSL). Most browsers understand FTP as well as HTTP. If you connect to a site, with a URL like ftp://ftp.example.com, your browser is making - an FTP connection, and not a HTTP connection. So while your browser may - speak FTP, Privoxy does not, and cannot proxy + an FTP connection, and not a HTTP connection. So while your browser may + speak FTP, Privoxy does not, and cannot proxy such traffic. @@ -2472,7 +2529,7 @@ every time I start IE. What gives? accidentally enable FTP proxying in these cases. And of course, if this happens, Privoxy will indeed cause problems since it does not know FTP. Just disable the FTP setting + message if a FTP connection is attempted.]]> Just disable the FTP setting and all will be well again. @@ -2484,14 +2541,14 @@ every time I start IE. What gives? -In Mac OS X, I can't configure Microsoft Internet Explorer to use +<title>In Mac OS X, I can't configure Microsoft Internet Explorer to use Privoxy as the HTTP proxy. Microsoft Internet Explorer (in versions like 5.1) respects system-wide network settings. In order to change the HTTP proxy, open System Preferences, and click on the Network icon. In the settings pane that - comes up, click on the Proxies tab. Ensure the "Web Proxy (HTTP)" checkbox - is checked and enter 127.0.0.1 in the entry field. + comes up, click on the Proxies tab. Ensure the "Web Proxy (HTTP)" checkbox + is checked and enter 127.0.0.1 in the entry field. Enter 8118 in the Port field. The next time you start IE, it should reflect these values. @@ -2499,12 +2556,12 @@ every time I start IE. What gives? -In Mac OS X, I dragged the Privoxy folder to the trash in order to +<title>In Mac OS X, I dragged the Privoxy folder to the trash in order to uninstall it. Now the finder tells me I don't have sufficient privileges to empty the trash. Note: This ONLY applies to privoxy 3.0.6 and earlier. - + Just dragging the Privoxy folder to the trash is not enough to delete it. Privoxy supplies an @@ -2512,9 +2569,9 @@ every time I start IE. What gives? these details. Open the trash, drag the uninstall.command file out of the trash and double-click on it. You will be prompted for confirmation and the administration password. - + - The trash may still appear full after this command; emptying the trash + The trash may still appear full after this command; emptying the trash from the desktop should make it appear empty again. @@ -2527,7 +2584,7 @@ every time I start IE. What gives? localhost as my browser's proxy setting. We believe this is due to an IPv6-related bug in Mac OS X, but don't fully - understand the issue yet. In any case, changing the proxy setting to + understand the issue yet. In any case, changing the proxy setting to 127.0.0.1 instead of localhost works around the problem. @@ -2552,9 +2609,9 @@ every time I start IE. What gives? user.action: - # Make exceptions for ill-behaved sites: - # - {-prevent-compression} + # Make exceptions for ill-behaved sites: + # + {-prevent-compression} .example.com If that works, you may also want to report the problem to the @@ -2572,7 +2629,7 @@ Why? its running on from the IP address of the system interface it is bound to (from the config file listen-address setting). If the system cannot supply - this information, Privoxy logs this condition. + this information, Privoxy logs this condition. Typically, this would be considered a minor system configuration error. It is @@ -2593,11 +2650,11 @@ Why? -When I try to launch Privoxy, I get an +<title>When I try to launch Privoxy, I get an error message <quote>port 8118 is already in use</quote> (or similar wording). Why? - Port 8118 is Privoxy's default TCP + Port 8118 is Privoxy's default TCP listening port. Typically this message would mean that there is already one instance of Privoxy running, and your system is actually trying to start a second @@ -2627,8 +2684,8 @@ Why? is used? - This may also be caused by the demoronizer filter, - in conjunction with a web server that is misreporting the content type. Binary + This may also be caused by the demoronizer filter, + in conjunction with a web server that is misreporting the content type. Binary files are exempted from Privoxy's filtering (unless the web server by mistake says the file is something else). Either upgrade Privoxy, or go to the most recent @@ -2642,26 +2699,26 @@ Why? What is the demoronizer and why is it there? - The original demoronizer was a Perl script that cleaned up HTML pages which - were created with certain Microsoft products. MS has used proprietary extensions + The original demoronizer was a Perl script that cleaned up HTML pages which + were created with certain Microsoft products. MS has used proprietary extensions to standardized font encodings (ISO 8859-1), which has caused problems for pages that are viewed with non-Microsoft products (and are expecting to see a standard set of fonts). The demoronizer corrected these errors so the pages displayed correctly. Privoxy borrowed from this script, introducing a filter based on the original demoronizer, which in turn could - correct these errors on the fly. + correct these errors on the fly. - But this is only needed in some situations, and will cause serious problems in some + But this is only needed in some situations, and will cause serious problems in some other situations. - If you are using Microsoft products, you do not need it. If you need to view - pages with UTF-8 characters (such as Cyrillic or Chinese), then it will + If you are using Microsoft products, you do not need it. If you need to view + pages with UTF-8 characters (such as Cyrillic or Chinese), then it will cause corruption of the fonts, and thus should not be on. - On the other hand, if you use non-Microsoft products, and you occasionally + On the other hand, if you use non-Microsoft products, and you occasionally notice weird characters on pages, you might want to try it. @@ -2671,16 +2728,16 @@ Why? Why do I keep seeing PrivoxyWindowOpen() in raw source code? - Privoxy is attempting to disable malicious - Javascript + Privoxy is attempting to disable malicious + Javascript in this case, with the unsolicited-popups - filter. Privoxy cannot tell very well + filter. Privoxy cannot tell very well good code snippets from bad code snippets. - If you see this in HTML source, and the page displays without problems, then - this is good, and likely some pop-up window was disabled. If you see this - where it is causing a problem, such as a downloaded program source code file, + If you see this in HTML source, and the page displays without problems, then + this is good, and likely some pop-up window was disabled. If you see this + where it is causing a problem, such as a downloaded program source code file, then you should set an exception for this site or page such that the integrity of the page stays in tact by disabling all filtering. @@ -2718,13 +2775,13 @@ Why? - At one site Privoxy just hangs, and starts taking + At one site Privoxy just hangs, and starts taking all CPU. Why is this? This is probably a manifestation of the 100% cpu problem that - occurs on pages containing many (thousands upon thousands) of blank lines. The blank lines - are in the raw HTML source of the page, and the browser just ignores them. But the + occurs on pages containing many (thousands upon thousands) of blank lines. The blank lines + are in the raw HTML source of the page, and the browser just ignores them. But the pattern matching in Privoxy's page filtering mechanism is trying to match against absurdly long strings and this becomes very CPU-intensive, taking a long, long time to complete. @@ -2852,7 +2909,7 @@ browsing has slowed to a crawl. What gives? If you compiled &my-app; with threading support (on POSIX-based systems), the Conditional #defines section on http://config.privoxy.org/show-status - will list FEATURE_PTHREAD as enabled. + will list FEATURE_PTHREAD as enabled. @@ -2865,18 +2922,18 @@ browsing has slowed to a crawl. What gives? &contacting; - + Privoxy Copyright, License and History ©right; - + Portions of this document are borrowed from the original - Junkbuster (tm) FAQ, and modified as + Junkbuster (tm) FAQ, and modified as appropriate for Privoxy. @@ -2897,8 +2954,8 @@ browsing has slowed to a crawl. What gives? - - + + diff --git a/external/privoxy/doc/source/install.sgml b/external/privoxy/doc/source/install.sgml index bba9ccc7..5ce50964 100644 --- a/external/privoxy/doc/source/install.sgml +++ b/external/privoxy/doc/source/install.sgml @@ -1,7 +1,7 @@ + - + @@ -15,16 +15,16 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/install.sgml,v $ Purpose : INSTALL file for Privoxy - - $Id: install.sgml,v 2.11 2009/02/12 16:08:26 fabiankeil Exp $ + + $Id: install.sgml,v 2.21 2011/12/26 17:05:40 fabiankeil Exp $ Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ See LICENSE. ======================================================================== - NOTE: Please read developer-manual/documentation.html before touching + NOTE: Please read developer-manual/documentation.html before touching anything in this, or other Privoxy documentation. You have been warned! - Failure to abide by this rule will result in the revocation of your license + Failure to abide by this rule will result in the revocation of your license to live a peaceful existence! ======================================================================== @@ -62,10 +62,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -80,8 +80,8 @@ * The GNU General Public License should be included with * this file. If not, you can view it at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * or write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA * *********************************************************************/ diff --git a/external/privoxy/doc/source/ldp.dsl b/external/privoxy/doc/source/ldp.dsl deleted file mode 100644 index 896e8ab6..00000000 --- a/external/privoxy/doc/source/ldp.dsl +++ /dev/null @@ -1,420 +0,0 @@ - - - -]]> - - -]]> -]> - - - - - - - - -;; ============================== -;; customize the print stylesheet -;; ============================== -;; -;; see http://docbook.sourceforge.net/projects/dsssl/doc/print.html -;; - -(define %indent-screen-lines% - ;; Indent lines in a 'Screen'? - #t) - -(define %callout-fancy-bug% - ;; Use fancy callout bugs? - #t) - -(define %chap-app-running-heads% - ;; Generate running headers and footers on chapter-level elements? - #t) - -(define %chap-app-running-head-autolabel% - ;; Put chapter labels in running heads? - #t) - -;; this is necessary because right now jadetex does not understand -;; symbolic entities, whereas things work well with numeric entities. -(declare-characteristic preserve-sdata? - "UNREGISTERED::James Clark//Characteristic::preserve-sdata?" - #f) - -;; put the legal notice in a separate file -(define %generate-legalnotice-link% - #t) - -;; use graphics in admonitions, and have their path be "stylesheet-images" -;; NO: they do not yet look very good -(define %admon-graphics-path% - "./stylesheet-images/") - -(define %admon-graphics% - #f) - -(define %funcsynopsis-decoration% - ;; make funcsynopsis look pretty - #t) - -;;(define %shade-verbatim% -;; #t) - -(define %section-autolabel% #t) - ;; For enumerated sections (1.1, 1.1.1, 1.2, etc.) - -;; HB changed TOC depth to 3 levels. -(define (toc-depth nd) - 3) - -;; HB added 03/20/02, see dbparam.dsl ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(define %body-attr% - ;; REFENTRY body-attr - ;; PURP What attributes should be hung off of BODY? - ;; DESC - ;; A list of the the BODY attributes that should be generated. - ;; The format is a list of lists, each interior list contains the - ;; name and value of a BODY attribute. - ;; /DESC - ;; AUTHOR N/A - ;; /REFENTRY - (list - (list "BGCOLOR" "#EEEEEE") - (list "TEXT" "#000000") - (list "LINK" "#0000FF") - (list "VLINK" "#840084") - (list "ALINK" "#0000FF"))) - -(define %stylesheet% - ;; REFENTRY stylesheet - ;; PURP Name of the stylesheet to use - ;; DESC - ;; The name of the stylesheet to place in the HTML LINK TAG, or '#f' to - ;; suppress the stylesheet LINK. - ;; /DESC - ;; AUTHOR N/A - ;; /REFENTRY - "../p_doc.css") - -(define %stylesheet-type% - ;; REFENTRY stylesheet-type - ;; PURP The type of the stylesheet to use - ;; DESC - ;; The type of the stylesheet to place in the HTML LINK TAG. - ;; /DESC - ;; AUTHOR N/A - ;; /REFENTRY - "text/css") - -(define %css-liststyle-alist% - ;; REFENTRY css-liststyle-alist - ;; PURP Map DocBook OVERRIDE and MARK attributes to CSS - ;; DESC - ;; If '%css-decoration%' is turned on then the list-style-type property of - ;; list items will be set to reflect the list item style selected in the - ;; DocBook instance. This associative list maps the style type names used - ;; in your instance to the appropriate CSS names. If no mapping exists, - ;; the name from the instance will be used. - ;; /DESC - ;; AUTHOR N/A - ;; /REFENTRY - '(("bullet" "disc") - ("box" "square"))) - -(define %css-decoration% - ;; REFENTRY css-decoration - ;; PURP Enable CSS decoration of elements - ;; DESC - ;; If '%css-decoration%' is turned on then HTML elements produced by the - ;; stylesheet may be decorated with STYLE attributes. For example, the - ;; LI tags produced for list items may include a fragment of CSS in the - ;; STYLE attribute which sets the CSS property "list-style-type". - ;; /DESC - ;; AUTHOR N/A - ;; /REFENTRY - #t) - -;; swa1 - -(define %generate-part-toc% - #f) - -(define %generate-article-toc% - ;; Should a Table of Contents be produced for Articles? - ;; If true, a Table of Contents will be generated for each 'Article'. - #t) - -(define %generate-part-toc-on-titlepage% - ;; Should the Part TOC appear on the Part title page? - #f) - -;;Do you want a separate page for the title? -(define %generate-article-titlepage-on-separate-page% - #t) - -;;Do you want the article toc on the titlepage or separate? -(define %generate-article-toc-on-titlepage% - #f) - -;;Titlepage Separate? -;; This is the one that makes TOC only on first page!! hal. -(define (chunk-skip-first-element-list) - '()) - -(define %body-start-indent% - ;; Default indent of body text - 2pi) - -(define %para-indent-firstpara% - ;; First line start-indent for the first paragraph - 0pt) - -;; swa2 - -(define %para-indent% - ;; First line start-indent for paragraphs (other than the first) - 0pt) - -(define %block-start-indent% - ;; Extra start-indent for block-elements - 2pt) - -;;Define distance between paragraphs -(define %para-sep% - (/ %bf-size% 2.0)) - -;; with swa2 no effects - -;; swa3 - -;;Define distance between block elements (figures, tables, etc.). -(define %block-sep% - (* %para-sep% 1.0)) -;; (* %para-sep% 2.0)) - -(define %hyphenation% - ;; Allow automatic hyphenation? - #t) - -(define %left-margin% 5pi) -(define %right-margin% 5pi) -(define %top-margin% 5pi) -(define %bottom-margin% 5pi) -(define %footer-margin% 2pi) -(define %header-margin% 2pi) - -(define %line-spacing-factor% 1.3) - ;; Factor used to calculate leading - ;; The leading is calculated by multiplying the current font size by the - ;; '%line-spacing-factor%'. For example, if the font size is 10pt and - ;; the '%line-spacing-factor%' is 1.1, then the text will be - ;; printed "10-on-11". - -(define %head-before-factor% - ;; Factor used to calculate space above a title - ;; The space before a title is calculated by multiplying the font size - ;; used in the title by the '%head-before-factor%'. -;; 0.75) - 0.5) - -(define %head-after-factor% - ;; Factor used to calculate space below a title - ;; The space after a title is calculated by multiplying the font size used - ;; in the title by the '%head-after-factor%'. - 0.5) - -(define %input-whitespace-treatment% 'collapse) - -(define ($generate-article-lot-list$) - ;; Which Lists of Titles should be produced for Articles? - (list )) - - - - - - - - - - - -;; this is necessary because right now jadetex does not understand -;; symbolic entities, whereas things work well with numeric entities. -(declare-characteristic preserve-sdata? - "UNREGISTERED::James Clark//Characteristic::preserve-sdata?" - #f) - -;; put the legal notice in a separate file -(define %generate-legalnotice-link% - #t) - -;; use graphics in admonitions, and have their path be "stylesheet-images" -;; NO: they do not yet look very good -(define %admon-graphics-path% - "./stylesheet-images/") - -(define %admon-graphics% - #f) - -(define %funcsynopsis-decoration% - ;; make funcsynopsis look pretty - #t) - -(define %html-ext% - ".html") - -(define %generate-article-toc% - ;; Should a Table of Contents be produced for Articles? - ;; If true, a Table of Contents will be generated for each 'Article'. - #t) - -;; HB added next three statements 05/03/02. -;;Do you want a separate page for the title? -(define %generate-article-titlepage-on-separate-page% - #t) - -;;Do you want the article toc on the titlepage or separate? -(define %generate-article-toc-on-titlepage% - #t) - -;;Titlepage Separate? -;; This is the one that makes TOC only on first page!! hal. -(define (chunk-skip-first-element-list) - '()) - -(define %root-filename% - ;; The filename of the root HTML document (e.g, "index"). - "index") - -(define %generate-part-toc% - #t) - -(define %shade-verbatim% - #t) - -(define %use-id-as-filename% - ;; Use ID attributes as name for component HTML files? - #t) - -(define %graphic-default-extension% - "gif") - -(define %section-autolabel% #t) - ;; For enumerated sections (1.1, 1.1.1, 1.2, etc.) - -;; HB changed TOC depth to 3 levels. -(define (toc-depth nd) - 3) - -;; HB added 03/20/02, see dbparam.dsl ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(define %body-attr% - ;; REFENTRY body-attr - ;; PURP What attributes should be hung off of BODY? - ;; DESC - ;; A list of the the BODY attributes that should be generated. - ;; The format is a list of lists, each interior list contains the - ;; name and value of a BODY attribute. - ;; /DESC - ;; AUTHOR N/A - ;; /REFENTRY - (list - (list "BGCOLOR" "#EEEEEE") - (list "TEXT" "#000000") - (list "LINK" "#0000FF") - (list "VLINK" "#840084") - (list "ALINK" "#0000FF"))) - -(define %stylesheet% - ;; REFENTRY stylesheet - ;; PURP Name of the stylesheet to use - ;; DESC - ;; The name of the stylesheet to place in the HTML LINK TAG, or '#f' to - ;; suppress the stylesheet LINK. - ;; /DESC - ;; AUTHOR N/A - ;; /REFENTRY - "../p_doc.css") - -(define %stylesheet-type% - ;; REFENTRY stylesheet-type - ;; PURP The type of the stylesheet to use - ;; DESC - ;; The type of the stylesheet to place in the HTML LINK TAG. - ;; /DESC - ;; AUTHOR N/A - ;; /REFENTRY - "text/css") - -(define %css-liststyle-alist% - ;; REFENTRY css-liststyle-alist - ;; PURP Map DocBook OVERRIDE and MARK attributes to CSS - ;; DESC - ;; If '%css-decoration%' is turned on then the list-style-type property of - ;; list items will be set to reflect the list item style selected in the - ;; DocBook instance. This associative list maps the style type names used - ;; in your instance to the appropriate CSS names. If no mapping exists, - ;; the name from the instance will be used. - ;; /DESC - ;; AUTHOR N/A - ;; /REFENTRY - '(("bullet" "disc") - ("box" "square"))) - -(define %css-decoration% - ;; REFENTRY css-decoration - ;; PURP Enable CSS decoration of elements - ;; DESC - ;; If '%css-decoration%' is turned on then HTML elements produced by the - ;; stylesheet may be decorated with STYLE attributes. For example, the - ;; LI tags produced for list items may include a fragment of CSS in the - ;; STYLE attribute which sets the CSS property "list-style-type". - ;; /DESC - ;; AUTHOR N/A - ;; /REFENTRY - #t) - -;; HB added 2008-01-19 -(define %html-header-tags% - '(("META" ("HTTP-EQUIV" "Content-Type") ("CONTENT" "text/html; -charset=ISO-8859-1")))) - - - - - - - - -;; =================================================== -;; Vairant without TOC for the Homepage --oes 24/05/02 -;; =================================================== - -(define %generate-article-toc% - ;; Should a Table of Contents be produced for Articles? - ;; If true, a Table of Contents will be generated for each 'Article'. - #f) - - - - - - - diff --git a/external/privoxy/doc/source/ldp.dsl.in b/external/privoxy/doc/source/ldp.dsl.in index a86de0d8..ccbea7d1 100644 --- a/external/privoxy/doc/source/ldp.dsl.in +++ b/external/privoxy/doc/source/ldp.dsl.in @@ -83,7 +83,7 @@ ;; REFENTRY body-attr ;; PURP What attributes should be hung off of BODY? ;; DESC - ;; A list of the the BODY attributes that should be generated. + ;; A list of the BODY attributes that should be generated. ;; The format is a list of lists, each interior list contains the ;; name and value of a BODY attribute. ;; /DESC diff --git a/external/privoxy/doc/source/license.sgml b/external/privoxy/doc/source/license.sgml index b674770e..9a504259 100644 --- a/external/privoxy/doc/source/license.sgml +++ b/external/privoxy/doc/source/license.sgml @@ -2,17 +2,17 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/license.sgml,v $ Purpose : Entity included in other project documents. - - $Id: license.sgml,v 2.6 2008/05/23 15:09:48 fabiankeil Exp $ + + $Id: license.sgml,v 2.7 2011/09/04 11:10:12 fabiankeil Exp $ Copyright (C) 2001-2008 Privoxy Developers http://www.privoxy.org/ See LICENSE. - + ====================================================================== This file used for inclusion with other documents only. ====================================================================== - If you make changes to this file, please verify the finished + If you make changes to this file, please verify the finished docs all display as intended. This file is included into: @@ -27,7 +27,7 @@ Privoxy is free software; you can - redistribute it and/or modify it under the terms of the + redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation. diff --git a/external/privoxy/doc/source/newfeatures.sgml b/external/privoxy/doc/source/newfeatures.sgml index b1db531f..4ddd0c1c 100644 --- a/external/privoxy/doc/source/newfeatures.sgml +++ b/external/privoxy/doc/source/newfeatures.sgml @@ -2,8 +2,8 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/newfeatures.sgml,v $ Purpose : Entity included in other project documents. - - $Id: newfeatures.sgml,v 2.10 2009/02/14 17:37:13 fabiankeil Exp $ + + $Id: newfeatures.sgml,v 2.14 2009/10/10 05:51:13 fabiankeil Exp $ Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ See LICENSE. @@ -12,7 +12,7 @@ This file used for inclusion with other documents only. ====================================================================== - If you make changes to this file, please verify the finished + If you make changes to this file, please verify the finished docs all display as intended. This file is included into: @@ -30,57 +30,64 @@ FIXME: complete the list of features. change the order: most important features to the top of the list. prefix new features with "NEW". - + --> - Can keep outgoing connections alive and reuse them later on. + Supports "Connection: keep-alive". Outgoing connections can + be kept alive independently from the client. - + + + + + Supports IPv6, provided the operating system does so too, + and the configure script detects it. + + Supports tagging which allows to change the behaviour based on client and server headers. - + Can be run as an "intercepting" proxy, which obviates the need to configure browsers individually. - + Sophisticated actions and filters for manipulating both server and client - headers. + headers. - + Can be chained with other proxies. - + - Integrated browser based configuration and control utility at http://config.privoxy.org/ (shortcut: http://p.p/). Browser-based tracing of rule and filter effects. Remote toggling. - + Web page filtering (text replacements, removes banners based on size, - invisible web-bugs, JavaScript and HTML annoyances, - pop-up windows, etc.) + invisible web-bugs and HTML annoyances, etc.) - + @@ -88,69 +95,50 @@ user settings to reside in separate files, so that installing updated actions files won't overwrite individual user settings. - + - Support for Perl Compatible Regular Expressions in the configuration files, and + Support for Perl Compatible Regular Expressions in the configuration files, and a more sophisticated and flexible configuration syntax. - + - Improved cookie management features (e.g. session based cookies). + GIF de-animation. - + - - - GIF de-animation. - - - Bypass many click-tracking scripts (avoids script redirection). - - - - - Multi-threaded (POSIX and native threads). - - + User-customizable HTML templates for most proxy-generated pages (e.g. "blocked" page). - + Auto-detection and re-reading of config file changes. - + - Improved signal handling, and a true daemon mode (Unix). + Most features are controllable on a per-site or per-location basis. - - - - - Every feature now controllable on a per-site or per-location basis, configuration - more powerful and versatile over-all. - - + Many smaller new features added, limitations and bugs removed. - + diff --git a/external/privoxy/doc/source/p-authors.sgml b/external/privoxy/doc/source/p-authors.sgml index b8eb1ca4..6ef6077b 100644 --- a/external/privoxy/doc/source/p-authors.sgml +++ b/external/privoxy/doc/source/p-authors.sgml @@ -2,8 +2,8 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/p-authors.sgml,v $ Purpose : Entity included in other project documents. - - $Id: p-authors.sgml,v 2.34 2009/02/08 18:13:26 fabiankeil Exp $ + + $Id: p-authors.sgml,v 2.44 2011/12/26 18:41:54 fabiankeil Exp $ Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ See LICENSE. @@ -12,7 +12,7 @@ This file used for inclusion with other documents only. ====================================================================== - If you make changes to this file, please verify the finished + If you make changes to this file, please verify the finished docs all display as intended. This file is included into: @@ -35,11 +35,8 @@ Current Privoxy Team: ]]> Hal Burgiss - Mark Miller - Gerry Murphy Lee Rian Roland Rosenfeld - Jörg Strohmayer @@ -61,10 +58,13 @@ Current Privoxy Team: Adam Lock Guy Laroche Justin McMurtry + Mark Miller + Gerry Murphy Andreas Oesterhelt Haroon Rafique Georg Sauthoff Thomas Steudten + Jörg Strohmayer Rodney Stromlund Sviatoslav Sviridov Sarantis Paskalis @@ -80,10 +80,14 @@ Current Privoxy Team: Ken Arromdee Devin Bayer + Havard Berland Gergely Bor + Francois Botha Reiner Buehl Andrew J. Caines Clifford Caoile + Wan-Teh Chang + Billy Crook Frédéric Crozat Michael T. Davis Mattes Dolak @@ -95,6 +99,7 @@ Current Privoxy Team: Stephen Gildea Daniel Griscom Felix Gröbert + Jeff H. Aaron Hamid Darel Henman Magnus Holmgren @@ -108,13 +113,17 @@ Current Privoxy Team: Bert van Leeuwen Don Libes Paul Lieverse + Han Liu Toby Lyward Wil Mahan Jindrich Makovicka + Raphael Marichez + Francois Marier David Mediavilla Raphael Moll Amuro Namie Adam Piggott + Petr Písar Dan Price Roberto Ragusa Félix Rauch @@ -122,6 +131,7 @@ Current Privoxy Team: Chung-chieh Shan Spinor S. Bart Schelstraete + Dan Stahlke Oliver Stoeneberg Peter Thoenen Martin Thomas diff --git a/external/privoxy/doc/source/p-config.sgml b/external/privoxy/doc/source/p-config.sgml index 3b59fbf1..eb2c9510 100644 --- a/external/privoxy/doc/source/p-config.sgml +++ b/external/privoxy/doc/source/p-config.sgml @@ -3,39 +3,39 @@ Purpose : Used with other docs and files only. - $Id: p-config.sgml,v 2.41 2009/02/19 16:59:41 fabiankeil Exp $ + $Id: p-config.sgml,v 2.79 2011/09/04 11:10:12 fabiankeil Exp $ - Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ + Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/ See LICENSE. ======================================================================== - NOTE: Please read developer-manual/documentation.html before touching + NOTE: Please read developer-manual/documentation.html before touching anything in this, or other Privoxy documentation. ======================================================================== - - This file contains all the config file comments and options. It used to + + This file contains all the config file comments and options. It used to build both the user-manual config sections, and all of config (yes, the main config file) itself. - Rationale: This is broken up into two files since a file with a prolog + Rationale: This is broken up into two files since a file with a prolog (DTD, etc) cannot be sourced as a secondary file. config.sgml is basically a wrapper for this file. IMPORTANT: - OPTIONS: The actual options are included in this file and prefixed with - '@@', and processed by the Makefile to strip the '@@'. Default options - that should appear commented out should be listed as: '@@#OPTION'. + OPTIONS: The actual options are included in this file and prefixed with + '@@', and processed by the Makefile to strip the '@@'. Default options + that should appear commented out should be listed as: '@@#OPTION'. Otherwise, as '@@OPTION'. Example: @@listen-address 127.0.0.1:8118 - The Makefile does significant other processing too. The final results - should be checked to make sure that the perl processing does not + The Makefile does significant other processing too. The final results + should be checked to make sure that the perl processing does not fubar something!!! Makefile processing requires w3m, fmt (shell line formatter), and perl. - + This file is included into: @@ -50,8 +50,8 @@ The Main Configuration File - Again, the main configuration file is named config on - Linux/Unix/BSD and OS/2, and config.txt on Windows. + By default, the main configuration file is named config, + with the exception of Windows, where it is named config.txt. Configuration lines consist of an initial keyword followed by a list of values, all separated by whitespace (any number of spaces or tabs). For example: @@ -59,11 +59,11 @@ - + confdir /etc/privoxy - + @@ -81,7 +81,9 @@ The main config file controls all aspects of Privoxy's operation that are not location dependent (i.e. they apply universally, no matter - where you may be surfing). + where you may be surfing). Like the filter and action files, the config file is + a plain text file and can be modified with a text editor like emacs, vim or + notepad.exe. ]]> @@ -95,10 +97,10 @@ Sample Configuration File for Privoxy v&p-version; - $Id: p-config.sgml,v 2.41 2009/02/19 16:59:41 fabiankeil Exp $ + $Id: p-config.sgml,v 2.79 2011/09/04 11:10:12 fabiankeil Exp $ -Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ +Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/ @@ -165,7 +167,7 @@ II. FORMAT OF THE CONFIGURATION FILE Thus, by placing a # at the start of an existing configuration line, - you can make it a comment and it will be treated as if it weren't there. + you can make it a comment and it will be treated as if it weren't there. This is called "commenting out" an option and can be useful. Removing the # again is called "uncommenting". @@ -235,11 +237,11 @@ II. FORMAT OF THE CONFIGURATION FILE Notes: - The User Manual URI is the single best source of information on + The User Manual URI is the single best source of information on Privoxy, and is used for help links from some of the internal CGI pages. The manual itself is normally packaged with the binary distributions, so you probably want to set this to a locally - installed copy. + installed copy. Examples: @@ -263,7 +265,7 @@ II. FORMAT OF THE CONFIGURATION FILE   user-manual  file://///some-server/some-path/privoxy-&p-version;/user-manual/ - --> + --> The best all purpose solution is simply to put the full local PATH to where the User Manual is @@ -279,7 +281,7 @@ II. FORMAT OF THE CONFIGURATION FILE (or the shortcut: http://p.p/user-manual/). - If the documentation is not on the local system, it can be accessed + If the documentation is not on the local system, it can be accessed from a remote server, as: @@ -293,7 +295,7 @@ II. FORMAT OF THE CONFIGURATION FILE file, because it is used while the config file is being read on start-up. - + ]]>
- + If set, this option should be the first option in the config file, because it is used while the config file is being read. @@ -325,7 +327,7 @@ II. FORMAT OF THE CONFIGURATION FILE Specifies: - A URL to be displayed in the error page that users will see if access to an untrusted page is denied. + A URL to be displayed in the error page that users will see if access to an untrusted page is denied. @@ -413,7 +415,7 @@ II. FORMAT OF THE CONFIGURATION FILE If both admin-address and proxy-info-url are unset, the whole "Local Privoxy Support" box on all generated pages will not be shown. - + @@ -462,10 +464,10 @@ II. FORMAT OF THE CONFIGURATION FILE If both admin-address and proxy-info-url are unset, the whole "Local Privoxy Support" box on all generated pages will not be shown. - + This URL shouldn't be blocked ;-) - + @@ -487,7 +489,7 @@ II. FORMAT OF THE CONFIGURATION FILE Privoxy can (and normally does) use a number of other files for additional configuration, help and logging. This section of the configuration file tells Privoxy - where to find those other files. + where to find those other files. @@ -531,16 +533,16 @@ II. FORMAT OF THE CONFIGURATION FILE No trailing /, please. - + --> @@ -683,7 +685,7 @@ actionsfile Effect if unset: - No actions are taken at all. More or less neutral proxying. + No actions are taken at all. More or less neutral proxying. @@ -693,15 +695,15 @@ actionsfile Multiple actionsfile lines are permitted, and are in fact recommended! - + The default values are default.action, which is the main actions file maintained by the developers, and user.action, where you can make your personal additions. - - Actions files contain all the per site and per URL configuration for + + Actions files contain all the per site and per URL configuration for ad blocking, cookie management, privacy considerations, etc. - There is no point in using Privoxy without at + There is no point in using Privoxy without at least one actions file. @@ -770,7 +772,7 @@ actionsfile rules that use regular expressions. These rules permit powerful changes on the content of Web pages, and optionally the headers as well, e.g., you could try to disable your favorite JavaScript annoyances, - re-write the actual displayed text, or just have some fun + re-write the actual displayed text, or just have some fun playing buzzword bingo with web pages. @@ -794,7 +796,7 @@ actionsfile @@filterfile default.filter]]> -@@#filterfile user.filter # User customizations]]> +@@filterfile user.filter # User customizations]]> @@ -856,7 +858,7 @@ actionsfile periodically remove it. On Unix systems, you can do this with a cron job (see man cron). For Red Hat based Linux distributions, a logrotate script has been included. - + Any log files must be writable by whatever user Privoxy is being run as (on Unix, default user id is privoxy). @@ -909,14 +911,14 @@ actionsfile If you specify a trust file, Privoxy will only allow - access to sites that are specified in the trustfile. Sites can be listed + access to sites that are specified in the trustfile. Sites can be listed in one of two ways: - Prepending a ~ character limits access to this site - only (and any sub-paths within this site), e.g. + Prepending a ~ character limits access to this site + only (and any sub-paths within this site), e.g. ~www.example.com allows access to - ~www.example.com/features/news.html, etc. + ~www.example.com/features/news.html, etc. Or, you can designate sites as trusted referrers, by @@ -930,7 +932,7 @@ actionsfile made. - If you use the + operator in the trust file, it may grow + If you use the + operator in the trust file, it may grow considerably over time. @@ -942,7 +944,7 @@ actionsfile Possible applications include limiting Internet access for children. - + @@ -1007,7 +1009,7 @@ actionsfile debug 2 # show each connection status debug 4 # show I/O status debug 8 # show header parsing - debug 16 # log all data written to the network into the logfile + debug 16 # log all data written to the network debug 32 # debug force feature debug 64 # debug regular expression filters debug 128 # debug redirects @@ -1017,6 +1019,7 @@ actionsfile debug 2048 # CGI user interface debug 4096 # Startup banner and warnings. debug 8192 # Non-fatal errors + debug 32768 # log all data read from the network @@ -1025,7 +1028,7 @@ actionsfile A debug level of 1 is informative because it will show you each request - as it happens. 1, 4096 and 8192 are recommended + as it happens. 1, 1024, 4096 and 8192 are recommended so that you will notice when things go wrong. The other levels are probably only of interest if you are hunting down a specific problem. They can produce a hell of an output (especially 16). @@ -1191,7 +1194,7 @@ actionsfile Specifies: - The IP address and TCP port on which Privoxy will + The address and TCP port on which Privoxy will listen for client requests. @@ -1200,6 +1203,7 @@ actionsfile Type of value: [IP-Address]:Port + [Hostname]:Port @@ -1213,9 +1217,9 @@ actionsfile Effect if unset: - Bind to 127.0.0.1 (localhost), port 8118. This is suitable and recommended for - home users who run Privoxy on the same machine as - their browser. + Bind to 127.0.0.1 (IPv4 localhost), port 8118. This is suitable and + recommended for home users who run Privoxy on + the same machine as their browser. @@ -1231,11 +1235,55 @@ actionsfile will need to override the default. - If you leave out the IP address, Privoxy will - bind to all interfaces (addresses) on your machine and may become reachable - from the Internet. In that case, consider using access control lists (ACL's, see below), and/or - a firewall. + You can use this statement multiple times to make + Privoxy listen on more ports or more + IP addresses. Suitable if your operating system does not + support sharing IPv6 and IPv4 protocols + on the same socket. + + + If a hostname is used instead of an IP address, Privoxy + will try to resolve it to an IP address and if there are multiple, use the first + one returned. + + + If the address for the hostname isn't already known on the system + (for example because it's in /etc/hostname), this may result in DNS + traffic. + + + If the specified address isn't available on the system, or if the + hostname can't be resolved, Privoxy + will fail to start. + + + IPv6 addresses containing colons have to be quoted by brackets. + They can only be used if Privoxy has + been compiled with IPv6 support. If you aren't sure if your version + supports it, have a look at + http://config.privoxy.org/show-status. + + + Some operating systems will prefer IPv6 to IPv4 addresses even if the + system has no IPv6 connectivity which is usually not expected by the user. + Some even rely on DNS to resolve localhost which mean the "localhost" address + used may not actually be local. + + + It is therefore recommended to explicitly configure the intended IP address + instead of relying on the operating system, unless there's a strong reason not to. + + + If you leave out the address, Privoxy will bind to all + IPv4 interfaces (addresses) on your machine and may become reachable from the + Internet and/or the local network. Be aware that some GNU/Linux distributions + modify that behaviour without updating the documentation. Check for non-standard + patches if your Privoxyversion behaves differently. + + + If you configure Privoxyto be reachable from the + network, consider using access control lists + (ACL's, see below), and/or a firewall. If you open Privoxy to untrusted users, you will @@ -1243,6 +1291,12 @@ actionsfile linkend="enable-edit-actions">enable-edit-actions and enable-remote-toggle + + With the exception noted above, listening on multiple addresses is currently + not supported by Privoxy directly. + It can be done on most operating systems by letting a packet filter + redirect request for certain addresses to Privoxy, though. + @@ -1257,6 +1311,16 @@ actionsfile listen-address 192.168.0.1:8118 + + + + Suppose you are running Privoxy on an + IPv6-capable machine and you want it to listen on the IPv6 address + of the loopback device: + + + + listen-address [::1]:8118 @@ -1385,7 +1449,7 @@ actionsfile Note that you must have compiled Privoxy with - support for this feature, otherwise this option has no effect. + support for this feature, otherwise this option has no effect. @@ -1508,7 +1572,7 @@ actionsfile Note that you must have compiled Privoxy with - support for this feature, otherwise this option has no effect. + support for this feature, otherwise this option has no effect. @@ -1611,23 +1675,41 @@ ACLs: permit-access and deny-access Type of value: - src_addr[/src_masklen] - [dst_addr[/dst_masklen]] + src_addr[:port][/src_masklen] + [dst_addr[:port][/dst_masklen]] - Where src_addr and - dst_addr are IP addresses in dotted decimal notation or valid - DNS names, and src_masklen and + Where src_addr and + dst_addr are IPv4 addresses in dotted decimal notation or valid + DNS names, port is a port + number, and src_masklen and dst_masklen are subnet masks in CIDR notation, i.e. integer values from 2 to 30 representing the length (in bits) of the network address. The masks and the whole destination part are optional. + + If your system implements + RFC 3493, then + src_addr and dst_addr can be IPv6 addresses delimeted by + brackets, port can be a number + or a service name, and + src_masklen and + dst_masklen can be a number + from 0 to 128. + Default value: Unset + + If no port is specified, + any port will match. If no src_masklen or + src_masklen is given, the complete IP + address has to match (i.e. 32 bits for IPv4 and 128 bits for IPv6). + @@ -1644,11 +1726,11 @@ ACLs: permit-access and deny-access Access controls are included at the request of ISPs and systems administrators, and are not usually needed by individual users. - For a typical home user, it will normally suffice to ensure that + For a typical home user, it will normally suffice to ensure that Privoxy only listens on the localhost (127.0.0.1) or internal (home) network address by means of the listen-address - option. + option. Please see the warnings in the FAQ that Privoxy @@ -1676,6 +1758,13 @@ ACLs: permit-access and deny-access like *.org or partial domain names. If a DNS name resolves to multiple IP addresses, only the first one is used. + + Some systems allow IPv4 clients to connect to IPv6 server sockets. + Then the client's IPv4 address will be translated by the system into + IPv6 address space with special prefix ::ffff:0:0/96 (so called IPv4 + mapped IPv6 address). Privoxy can handle it + and maps such ACL addresses automatically. + Denying access to particular sites by ACL may have undesired side effects if the site in question is hosted on a machine which also hosts other sites @@ -1717,6 +1806,24 @@ ACLs: permit-access and deny-access deny-access 192.168.45.73 www.dirty-stuff.example.com + + Allow access from the IPv4 network 192.0.2.0/24 even if listening on + an IPv6 wild card address (not supported on all platforms): + + + + permit-access 192.0.2.0/24 + + + + This is equivalent to the following line even if listening on an + IPv4 address (not supported on all platforms): + + + + permit-access [::ffff:192.0.2.0]/120 + + @@ -1760,7 +1867,7 @@ ACLs: permit-access and deny-access For content filtering, i.e. the +filter and - +deanimate-gif actions, it is necessary that + +deanimate-gif actions, it is necessary that Privoxy buffers the entire document body. This can be potentially dangerous, since a server could just keep sending data indefinitely and wait for your RAM to exhaust -- with nasty consequences. @@ -1833,12 +1940,12 @@ ACLs: permit-access and deny-access http_parent[:port] - where target_pattern is a URL pattern + where target_pattern is a URL pattern that specifies to which requests (i.e. URLs) this forward rule shall apply. Use / to denote all URLs. http_parent[:port] is the DNS name or IP address of the parent HTTP proxy through which the requests should be forwarded, - optionally followed by its listening port (default: 8080). + optionally followed by its listening port (default: 8000). Use a single dot (.) to denote no forwarding. @@ -1864,6 +1971,16 @@ ACLs: permit-access and deny-access If http_parent is ., then requests are not forwarded to another HTTP proxy but are made directly to the web servers. + + http_parent can be a + numerical IPv6 address (if + RFC 3493 is + implemented). To prevent clashes with the port delimiter, the whole IP + address has to be put into brackets. On the other hand a target_pattern containing an IPv6 address + has to be put into angle brackets (normal brackets are reserved for + regular expressions already). + Multiple lines are OK, they are checked in sequence, and the last match wins. @@ -1891,6 +2008,24 @@ ACLs: permit-access and deny-access forward .isp.example.net . + + Parent proxy specified by an IPv6 address: + + + + forward / [2001:DB8::1]:8000 + + + + Suppose your parent proxy doesn't support IPv6: + + + + forward / parent-proxy.example.org:8000 + forward ipv6-server.example.org . + forward <[2-3][0-9a-f][0-9a-f][0-9a-f]:*> . + + @@ -1928,7 +2063,7 @@ forward-socks4, forward-socks4a and forward-socks5 and socks_proxy are IP addresses in dotted decimal notation or valid DNS names (http_parent - may be . to denote no HTTP forwarding), and the optional + may be . to denote no HTTP forwarding), and the optional port parameters are TCP ports, i.e. integer values from 1 to 65535 @@ -1962,6 +2097,17 @@ forward-socks4, forward-socks4a and forward-socks5 With forward-socks5 the DNS resolution will happen on the remote server as well. + + socks_proxy and + http_parent can be a + numerical IPv6 address (if + RFC 3493 is + implemented). To prevent clashes with the port delimiter, the whole IP + address has to be put into brackets. On the other hand a target_pattern containing an IPv6 address + has to be put into angle brackets (normal brackets are reserved for + regular expressions already). + If http_parent is ., then requests are not forwarded to another HTTP proxy but are made (HTTP-wise) directly to the web servers, albeit through @@ -1992,14 +2138,14 @@ forward-socks4, forward-socks4a and forward-socks5 forward-socks4 / socks-gw.example.com:1080 . - + - To chain Privoxy and Tor, both running on the same system, you would use + To chain Privoxy and Tor, both running on the same system, you would use something like: - forward-socks4a / 127.0.0.1:9050 . + forward-socks5 / 127.0.0.1:9050 . @@ -2043,7 +2189,7 @@ forward-socks4, forward-socks4a and forward-socks5 Advanced Forwarding Examples - If you have links to multiple ISPs that provide various special content + If you have links to multiple ISPs that provide various special content only to their subscribers, you can configure multiple Privoxies which have connections to the respective ISPs to act as forwarders to each other, so that your users can see the internal content of all ISPs. @@ -2084,9 +2230,9 @@ forward-socks4, forward-socks4a and forward-socks5 - If you intend to chain Privoxy and - squid locally, then chaining as - browser -> squid -> privoxy is the recommended way. + If you intend to chain Privoxy and + squid locally, then chaining as + browser -> squid -> privoxy is the recommended way. @@ -2096,14 +2242,14 @@ forward-socks4, forward-socks4a and forward-socks5 - # Define Privoxy as parent proxy (without ICP) - cache_peer 127.0.0.1 parent 8118 7 no-query + # Define Privoxy as parent proxy (without ICP) + cache_peer 127.0.0.1 parent 8118 7 no-query - # Define ACL for protocol FTP - acl ftp proto FTP + # Define ACL for protocol FTP + acl ftp proto FTP # Do not forward FTP requests to Privoxy - always_direct allow ftp + always_direct allow ftp # Forward all the rest to Privoxy never_direct allow all @@ -2123,7 +2269,7 @@ forward-socks4, forward-socks4a and forward-socks5 forward / . - forward /.*\.(exe|com|dll|zip)$ antivir.example.com:8010 + forward /.*\.(exe|com|dll|zip)$ antivir.example.com:8010 @@ -2135,7 +2281,7 @@ forward-socks4, forward-socks4a and forward-socks5 Specifies: - How often Privoxy retries if a forwarded connection request fails. + How often Privoxy retries if a forwarded connection request fails. @@ -2194,6 +2340,11 @@ forward-socks4, forward-socks4a and forward-socks5 @@forwarded-connect-retries 0]]> + + + +Miscellaneous + accept-intercepted-requests @@ -2233,7 +2384,7 @@ forward-socks4, forward-socks4a and forward-socks5 If you don't trust your clients and want to force them to use Privoxy, enable this option and configure your packet filter to redirect outgoing - HTTP connections into Privoxy. + HTTP connections into Privoxy. Make sure that Privoxy's own requests @@ -2410,34 +2561,46 @@ forward-socks4, forward-socks4a and forward-socks5 Effect if unset: - Connections are not reused. + Connections are not kept alive. Notes: + + This option allows clients to keep the connection to &my-app; + alive. If the server supports it, &my-app; will keep + the connection to the server alive as well. Under certain + circumstances this may result in speed-ups. + + + By default, &my-app; will close the connection to the server if + the client connection gets closed, or if the specified timeout + has been reached without a new request coming in. This behaviour + can be changed with the connection-sharing option. + This option has no effect if Privoxy has been compiled without keep-alive support. - - - - Notes: - - Note that reusing connections doesn't necessary cause speedups. - There are also a few privacy implications you should be aware of. + Note that a timeout of five seconds as used in the default + configuration file significantly decreases the number of + connections that will be reused. The value is used because + some browsers limit the number of connections they open to + a single host and apply the same limit to proxies. This can + result in a single website grabbing all the + connections the browser allows, which means connections to + other websites can't be opened until the connections currently + in use time out. - Outgoing connections are shared between clients (if there are more - than one) and closing the client that initiated the outgoing connection - does not affect the connection between &my-app; and the server unless - the client's request hasn't been completed yet. If the outgoing connection - is idle, it will not be closed until either Privoxy's - or the server's timeout is reached. While it's open, the server knows - that the system running &my-app; is still there. + Several users have reported this as a Privoxy bug, so the + default value has been reduced. Consider increasing it to + 300 seconds or even more if you think your browser can handle + it. If your browser appears to be hanging it can't. @@ -2450,7 +2613,187 @@ forward-socks4, forward-socks4a and forward-socks5 -@@keep-alive-timeout 300]]> +@@keep-alive-timeout 5]]> + + + +default-server-timeout + + + Specifies: + + + Assumed server-side keep-alive timeout if not specified by the server. + + + + + Type of value: + + + Time in seconds. + + + + + Default value: + + None + + + + Effect if unset: + + + Connections for which the server didn't specify the keep-alive + timeout are not reused. + + + + + Notes: + + + Enabling this option significantly increases the number of connections + that are reused, provided the keep-alive-timeout option + is also enabled. + + + While it also increases the number of connections problems + when &my-app; tries to reuse a connection that already has + been closed on the server side, or is closed while &my-app; + is trying to reuse it, this should only be a problem if it + happens for the first request sent by the client. If it happens + for requests on reused client connections, &my-app; will simply + close the connection and the client is supposed to retry the + request without bothering the user. + + + Enabling this option is therefore only recommended if the + connection-sharing option + is disabled. + + + It is an error to specify a value larger than the keep-alive-timeout value. + + + This option has no effect if Privoxy + has been compiled without keep-alive support. + + + + + Examples: + + + default-server-timeout 60 + + + + +@@#default-server-timeout 60]]> + + + +connection-sharing + + + Specifies: + + + Whether or not outgoing connections that have been kept alive + should be shared between different incoming connections. + + + + + Type of value: + + + 0 or 1 + + + + + Default value: + + None + + + + Effect if unset: + + + Connections are not shared. + + + + + Notes: + + + This option has no effect if Privoxy + has been compiled without keep-alive support, or if it's disabled. + + + + + Notes: + + + Note that reusing connections doesn't necessary cause speedups. + There are also a few privacy implications you should be aware of. + + + If this option is effective, outgoing connections are shared between + clients (if there are more than one) and closing the browser that initiated + the outgoing connection does no longer affect the connection between &my-app; + and the server unless the client's request hasn't been completed yet. + + + If the outgoing connection is idle, it will not be closed until either + Privoxy's or the server's timeout is reached. + While it's open, the server knows that the system running &my-app; is still + there. + + + If there are more than one client (maybe even belonging to multiple users), + they will be able to reuse each others connections. This is potentially + dangerous in case of authentication schemes like NTLM where only the + connection is authenticated, instead of requiring authentication for + each request. + + + If there is only a single client, and if said client can keep connections + alive on its own, enabling this option has next to no effect. If the client + doesn't support connection keep-alive, enabling this option may make sense + as it allows &my-app; to keep outgoing connections alive even if the client + itself doesn't support it. + + + You should also be aware that enabling this option increases the likelihood + of getting the "No server or forwarder data" error message, especially if you + are using a slow connection to the Internet. + + + This option should only be used by experienced users who + understand the risks and can weight them against the benefits. + + + + + Examples: + + + connection-sharing 1 + + + + +@@#connection-sharing 1]]> @@ -2491,9 +2834,9 @@ forward-socks4, forward-socks4a and forward-socks5 Notes: - For SOCKS requests the timeout currently doesn't start until - the SOCKS server accepted the request. This will be fixed in - the next release. + The default is quite high and you probably want to reduce it. + If you aren't using an occasionally slow proxy like Tor, reducing + it to a few seconds should be fine. @@ -2510,6 +2853,279 @@ forward-socks4, forward-socks4a and forward-socks5 +max-client-connections + + + Specifies: + + + Maximum number of client connections that will be served. + + + + + Type of value: + + + Positive number. + + + + + Default value: + + None + + + + Effect if unset: + + + Connections are served until a resource limit is reached. + + + + + Notes: + + + &my-app; creates one thread (or process) for every incoming client + connection that isn't rejected based on the access control settings. + + + If the system is powerful enough, &my-app; can theoretically deal with + several hundred (or thousand) connections at the same time, but some + operating systems enforce resource limits by shutting down offending + processes and their default limits may be below the ones &my-app; would + require under heavy load. + + + Configuring &my-app; to enforce a connection limit below the thread + or process limit used by the operating system makes sure this doesn't + happen. Simply increasing the operating system's limit would work too, + but if &my-app; isn't the only application running on the system, + you may actually want to limit the resources used by &my-app;. + + + If &my-app; is only used by a single trusted user, limiting the + number of client connections is probably unnecessary. If there + are multiple possibly untrusted users you probably still want to + additionally use a packet filter to limit the maximal number of + incoming connections per client. Otherwise a malicious user could + intentionally create a high number of connections to prevent other + users from using &my-app;. + + + Obviously using this option only makes sense if you choose a limit + below the one enforced by the operating system. + + + + + Examples: + + + max-client-connections 256 + + + + +@@#max-client-connections 256]]> + + + +handle-as-empty-doc-returns-ok + + + Specifies: + + + The status code Privoxy returns for pages blocked with + + +handle-as-empty-document. + + + + + Type of value: + + + 0 or 1 + + + + + Default value: + + 0 + + + + Effect if unset: + + + Privoxy returns a status 403(forbidden) for all blocked pages. + + + + + Effect if set: + + + Privoxy returns a status 200(OK) for pages blocked with +handle-as-empty-document + and a status 403(Forbidden) for all other blocked pages. + + + + + Notes: + + + This is a work-around for Firefox bug 492459: + + Websites are no longer rendered if SSL requests for JavaScripts are blocked by a proxy. + + (https://bugzilla.mozilla.org/show_bug.cgi?id=492459) + As the bug has been fixed for quite some time this option should no longer + be needed and will be removed in a future release. Please speak up if you + have a reason why the option should be kept around. + + + + +@@#handle-as-empty-doc-returns-ok 1]]> + + + +enable-compression + + + Specifies: + + + Whether or not buffered content is compressed before delivery. + + + + + Type of value: + + + 0 or 1 + + + + + Default value: + + 0 + + + + Effect if unset: + + + Privoxy does not compress buffered content. + + + + + Effect if set: + + + Privoxy compresses buffered content before delivering it to the client, + provided the client supports it. + + + + + Notes: + + + This directive is only supported if Privoxy has been compiled with + FEATURE_COMPRESSION, which should not to be confused with FEATURE_ZLIB. + + + Compressing buffered content is mainly useful if Privoxy and the + client are running on different systems. If they are running on the + same system, enabling compression is likely to slow things down. + If you didn't measure otherwise, you should assume that it does + and keep this option disabled. + + + Privoxy will not compress buffered content below a certain length. + + + + +@@#enable-compression 1]]> + + + +compression-level + + + Specifies: + + + The compression level that is passed to the zlib library when compressing buffered content. + + + + + Type of value: + + + Positive number ranging from 0 to 9. + + + + + Default value: + + 1 + + + + Notes: + + + Compressing the data more takes usually longer than compressing + it less or not compressing it at all. Which level is best depends + on the connection between Privoxy and the client. If you can't + be bothered to benchmark it for yourself, you should stick with + the default and keep compression disabled. + + + If compression is disabled, the compression level is irrelevant. + + + + + Examples: + + + + # Best speed (compared to the other levels) + compression-level 1 + # Best compression + compression-level 9 + # No compression. Only useful for testing as the added header + # slightly increases the amount of data that has to be sent. + # If your benchmark shows that using this compression level + # is superior to using no compression at all, the benchmark + # is likely to be flawed. + compression-level 0 + + + + + +@@#compression-level 1]]> + + + @@ -2536,11 +3152,11 @@ forward-socks4, forward-socks4a and forward-socks5 - + activity-animation 1 - + ]]> @@ -2557,18 +3173,18 @@ forward-socks4, forward-socks4a and forward-socks5 - + log-messages 1 - + ]]> @@]]> - + If log-buffer-size is set to 1, the size of the log buffer, i.e. the amount of memory used for the log messages displayed in the console window, will be limited to log-max-lines (see below). @@ -2583,11 +3199,11 @@ forward-socks4, forward-socks4a and forward-socks5 - + log-buffer-size 1 - + ]]> @@ -2603,11 +3219,11 @@ forward-socks4, forward-socks4a and forward-socks5 - + log-max-lines 200 - + ]]> @@ -2624,11 +3240,11 @@ forward-socks4, forward-socks4a and forward-socks5 - + log-highlight-messages 1 - + ]]> @@ -2643,11 +3259,11 @@ forward-socks4, forward-socks4a and forward-socks5 - + log-font-name Comic Sans MS - + ]]> @@ -2662,18 +3278,18 @@ forward-socks4, forward-socks4a and forward-socks5 - + log-font-size 8 - + ]]> @@]]> - + show-on-task-bar controls whether or not Privoxy will appear as a button on the Task bar when minimized: @@ -2683,11 +3299,11 @@ forward-socks4, forward-socks4a and forward-socks5 - + show-on-task-bar 0 - + ]]> @@ -2704,11 +3320,11 @@ forward-socks4, forward-socks4a and forward-socks5 - + close-button-minimizes 1 - + ]]> @@ -2726,11 +3342,11 @@ forward-socks4, forward-socks4a and forward-socks5 - + #hide-console - + ]]> diff --git a/external/privoxy/doc/source/privoxy-man-page.sgml b/external/privoxy/doc/source/privoxy-man-page.sgml index ea336e37..035ee53e 100644 --- a/external/privoxy/doc/source/privoxy-man-page.sgml +++ b/external/privoxy/doc/source/privoxy-man-page.sgml @@ -4,22 +4,22 @@ Purpose : Manual Page This file belongs into ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/ - - $Id: privoxy-man-page.sgml,v 2.29 2009/02/19 02:20:22 hal9 Exp $ + + $Id: privoxy-man-page.sgml,v 2.40 2011/12/26 17:05:40 fabiankeil Exp $ Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ See LICENSE. ======================================================================== - NOTE: Please read developer-manual/documentation.html before touching - anything in this, or other Privoxy documentation. + NOTE: Please read developer-manual/documentation.html before touching + anything in this, or other Privoxy documentation. ======================================================================== Doc NOTES: This is some tricky markup! There are some quirks to how this markup is handled. It is not always so co-operative. - Please don't change the markup unless you can verify the changes - will improve finished output! - + Please don't change the markup unless you can verify the changes + will improve finished output! + literallayout tags are particularly sensitive to where they are placed. The 'replaceable' and 'command' tags are used here somewhat unconventionally, since it seems to generate the proper formatting (at least for me :). @@ -28,21 +28,21 @@ Requires docbook2man (short perl script), see CVS http://sources.redhat.com/docbook-tools/. Also requires openjade and SGMLSpm - perl module. - + perl module. + For man page references, see: http://www.linuxdoc.org/HOWTO/mini/DocBook-Install/using.html http://docbook.org/tdg/en/html/ch02.html#making-refentry --> + - + @@ -57,7 +57,7 @@ 2009-02-15 - privoxy + privoxy 1 Privoxy &p-version; @@ -70,16 +70,16 @@ - + privoxy - pidfile - user[.group] + pidfile + user[.group] - hostname - configfile + hostname + configfile @@ -92,7 +92,7 @@ options: - + --help @@ -157,7 +157,7 @@ Privoxy process that the directory tree starts there. If set up carefully, this can limit the impact of possible vulnerabilities in Privoxy to the files contained in - that hierarchy. + that hierarchy. @@ -177,7 +177,7 @@ If the configfile is not specified on the command line, Privoxy will look for a file named config in the current directory. If no - configfile is found, Privoxy will + configfile is found, Privoxy will fail to start. @@ -201,21 +201,21 @@ filter to build an intercepting proxy (see config). The default setting is for localhost, on port 8118 (configurable in the main config file). To set the - HTTP proxy in Firefox, go through: Tools; + HTTP proxy in Firefox, go through: Tools; Options; General; Connection Settings; - Manual Proxy Configuration. + Manual Proxy Configuration. - For Internet Explorer, go through: Tools; + For Internet Explorer, go through: Tools; Internet Properties; Connections; - LAN Settings. + LAN Settings. The Secure (SSL) Proxy should also be set to the same values, otherwise https: URLs will not be proxied. Note: Privoxy can only proxy HTTP and HTTPS traffic. Do not try it with FTP or other protocols. - HTTPS presents some limitations, and not all features will work with HTTPS + HTTPS presents some limitations, and not all features will work with HTTPS connections. @@ -231,25 +231,25 @@ Privoxy can be configured with the various configuration files. The default configuration files are: config, default.filter, default.action and - default.action. user.action should + default.action. user.action should be used for locally defined exceptions to the default rules in match-all.action and default.action, and user.filter for locally defined filters. These are well commented. On Unix and Unix-like systems, these are located in - /etc/privoxy/ by default. + /etc/privoxy/ by default. - - Privoxy uses the concept of actions + + Privoxy uses the concept of actions in order to manipulate the data stream between the browser and remote sites. - There are various actions available with specific functions for such things + There are various actions available with specific functions for such things as blocking web sites, managing cookies, etc. These actions can be invoked - individually or combined, and used against individual URLs, or groups of URLs + individually or combined, and used against individual URLs, or groups of URLs that can be defined using wildcards and regular expressions. The result is that the user has greatly enhanced control and freedom. The actions list (ad blocks, etc) can also be configured with your - web browser at http://config.privoxy.org/ + web browser at http://config.privoxy.org/ (assuming the configuration allows it). Privoxy's configuration parameters can also be viewed at the same page. In addition, Privoxy can be toggled on/off. @@ -268,7 +268,7 @@ Files - + /usr/sbin/privoxy /etc/privoxy/config /etc/privoxy/match-all.action @@ -296,11 +296,11 @@ Privoxy terminates on the SIGINT, SIGTERM and SIGABRT signals. Log - rotation scripts may cause a re-opening of the logfile by sending a + rotation scripts may cause a re-opening of the logfile by sending a SIGHUP to Privoxy. Note that unlike other daemons, Privoxy does not need to be made aware of config file changes by SIGHUP -- it will detect them - automatically. + automatically. @@ -309,7 +309,7 @@ Notes - This is a &p-status; version of Privoxy. Not + This is a &p-status; version of Privoxy. Not all features are well tested. ]]> diff --git a/external/privoxy/doc/source/privoxy.sgml b/external/privoxy/doc/source/privoxy.sgml index 1e4791f9..fa700549 100644 --- a/external/privoxy/doc/source/privoxy.sgml +++ b/external/privoxy/doc/source/privoxy.sgml @@ -2,17 +2,17 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/privoxy.sgml,v $ Purpose : Entity included in other project documents. - - $Id: privoxy.sgml,v 2.9 2009/03/21 12:42:49 fabiankeil Exp $ - Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ + $Id: privoxy.sgml,v 2.12 2011/09/04 11:10:12 fabiankeil Exp $ + + Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/ See LICENSE. ====================================================================== This file used for inclusion with other documents only. ====================================================================== - If you make changes to this file, please verify the finished + If you make changes to this file, please verify the finished docs all display as intended. This file is included into: @@ -35,10 +35,27 @@ - Privoxy is Free Software and licensed under the GPL2. + Privoxy is Free Software and licensed under the GNU GPLv2. Privoxy is an associated project of Software in the Public Interest (SPI). - Donations are welcome. + + + + Helping hands and donations are welcome: + + + + http://www.privoxy.org/faq/general.html#PARTICIPATE + + + + + http://www.privoxy.org/faq/general.html#DONATE + + + diff --git a/external/privoxy/doc/source/readme.sgml b/external/privoxy/doc/source/readme.sgml index 3bbacf7e..02002e22 100644 --- a/external/privoxy/doc/source/readme.sgml +++ b/external/privoxy/doc/source/readme.sgml @@ -1,10 +1,10 @@ + - + @@ -16,23 +16,23 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/readme.sgml,v $ Purpose : README for Privoxy - - $Id: readme.sgml,v 2.26 2009/03/21 11:32:38 hal9 Exp $ - Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ + $Id: readme.sgml,v 2.49 2011/12/26 17:05:40 fabiankeil Exp $ + + Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/ See LICENSE. ======================================================================== - NOTE: Please read developer-manual/documentation.html before touching + NOTE: Please read developer-manual/documentation.html before touching anything in this, or other Privoxy documentation. You have been warned! - Failure to abide by this rule will result in the revocation of your license + Failure to abide by this rule will result in the revocation of your license to live a peaceful existence! ======================================================================== =================================================================== - READ: Document Note: This file generates the README in the top level - source directory. It is generated as only a plain text file. The - current markup is not suitable for other formats. Build from + READ: Document Note: This file generates the README in the top level + source directory. It is generated as only a plain text file. The + current markup is not suitable for other formats. Build from Makefile with 'make dok-readme'. =================================================================== @@ -40,21 +40,21 @@ ====================================================================== NOTE: The left margin spacing is *important* when using 'literallayout' - WYSISWYG!!! Don't mess this up!!! Careful with linebreaks too, ie + WYSISWYG!!! Don't mess this up!!! Careful with linebreaks too, ie the para tag forces a linebreak. Tags need to be carefully placed as a result - to avoid extra blank lines, etc. + to avoid extra blank lines, etc. ====================================================================== - For stable releases, change - - entity % p-not-stable "INCLUDE" - - to - - entity % p-not-stable "IGNORE" - + For stable releases, change + + entity % p-not-stable "INCLUDE" + + to + + entity % p-not-stable "IGNORE" + in the DTD at the top. This will toggle various text 'off'. BOTH - MUST be toggled in this case or you will get both text referencing + MUST be toggled in this case or you will get both text referencing stable and unstable versions. You only want one or the other! --> @@ -80,14 +80,14 @@ * * Purpose : README file to give a short intro. * - * Copyright : Written by and Copyright (C) 2001-2009 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2011 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -102,8 +102,8 @@ * The GNU General Public License should be included with * this file. If not, you can view it at * http://www.gnu.org/copyleft/gpl.html - * or write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * or write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA * *********************************************************************/ @@ -126,45 +126,21 @@ -IMPORTANT CHANGES +CHANGES - March 2009, Privoxy 3.0.12 is released. - - - This is primarily a bug fix release. See the "ChangeLog", and the "What's - New" section and the "Upgrader's Notes" in the User - Manual for details. + For a list of changes in this release, please have a + look at the "ChangeLog", the "What's New" section or + the "Upgrader's Notes" in the User Manual. - - February 2009, Privoxy 3.0.11 is released. - - - As usual there are changes that effect the configuration. See the "ChangeLog", - and the "What's New" section and the "Upgrader's Notes" in - the User Manual for details and specifics. - - - This is a stable release, and marks a departure for Privoxy development. - - - Previously, odd numbered releases were considered beta versions and - were only released at the end of the development cycle when the code - was already believed to be stable. Usually it was, so the stable release - contained pretty much the same code, but got a higher version number. - In the future we intend to release several snapshots between stable releases. - There will probably still be about two stable releases per year, - but hopefully about six snapshots instead of the two betas we have now. - The intentions is to make testing without CVS access easier. - INSTALL - + See the INSTALL file in this directory, for installing from raw source, and the User Manual, for all other - installation types. + installation types. @@ -176,7 +152,7 @@ HOSTNAME ][config_file] - See the man page or User Manual for an explanation of each option, and + See the man page or User Manual for an explanation of each option, and other configuration and usage issues. @@ -184,12 +160,6 @@ file named 'config' in the current directory (except Win32 which will look for 'config.txt'). If no config_file is found, Privoxy will fail to start. - - Or for Red Hat and Fedora based distributions: /etc/rc.d/init.d/privoxy start - - - Or Debian and Ubuntu: /etc/init.d/privoxy start - @@ -208,7 +178,7 @@ Be sure to set your browser(s) for HTTP/HTTPS Proxy at <IP>:<Port>, or whatever you specify in the config file under 'listen-address'. DEFAULT is - localhost:8118. Note that Privoxy ONLY proxies HTTP (and HTTPS) traffic. Do not try it + 127.0.0.1:8118. Note that Privoxy ONLY proxies HTTP (and HTTPS) traffic. Do not try it with FTP or other protocols for the simple reason it does not work. @@ -227,10 +197,10 @@ DOCUMENTATION There should be documentation in the 'doc' subdirectory. In particular, see the + may not be completed at this point]]>. In particular, see the User Manual there, the FAQ, and those interested in Privoxy development, should look at - developer-manual. + developer-manual. The source and configuration files are all well commented. The main configuration files are: 'config', 'default.action', and - 'default.filter'. + 'default.filter'. - Included documentation may vary according to platform and packager. All - documentation is posted on http://www.privoxy.org, in case you don't have it, + Included documentation may vary according to platform and packager. All + documentation is posted on http://www.privoxy.org, in case you don't have it, or can't find it. @@ -262,7 +232,7 @@ - + diff --git a/external/privoxy/doc/source/seealso.sgml b/external/privoxy/doc/source/seealso.sgml index 087ebc5c..fb106866 100644 --- a/external/privoxy/doc/source/seealso.sgml +++ b/external/privoxy/doc/source/seealso.sgml @@ -2,8 +2,8 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/seealso.sgml,v $ Purpose : Entity included in other project documents. - - $Id: seealso.sgml,v 2.12 2009/02/23 10:42:58 fabiankeil Exp $ + + $Id: seealso.sgml,v 2.13 2011/09/04 11:10:12 fabiankeil Exp $ Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ See LICENSE. @@ -12,7 +12,7 @@ This file used for inclusion with other documents only. ====================================================================== - If you make changes to this file, please verify the finished + If you make changes to this file, please verify the finished docs all display as intended. This file is included into: @@ -22,7 +22,7 @@ faq developer-manual - NOTE: 04/05/02, HB Removed   tags. They were causing docbook2man + NOTE: 04/05/02, HB Removed   tags. They were causing docbook2man to barf. --> @@ -36,28 +36,28 @@ http://www.privoxy.org/, - the Privoxy Home page. + url="http://www.privoxy.org/">http://www.privoxy.org/, + the Privoxy Home page. http://www.privoxy.org/faq/, - the Privoxy FAQ. + url="http://www.privoxy.org/faq/">http://www.privoxy.org/faq/, + the Privoxy FAQ. http://www.privoxy.org/developer-manual/, - the Privoxy developer manual. + url="http://www.privoxy.org/developer-manual/">http://www.privoxy.org/developer-manual/, + the Privoxy developer manual. - https://sourceforge.net/projects/ijbswa/, - the Project Page for Privoxy on + https://sourceforge.net/projects/ijbswa/, + the Project Page for Privoxy on SourceForge. @@ -71,7 +71,7 @@ https://sourceforge.net/tracker/?group_id=11118&atid=460288, to submit misses and other - configuration related suggestions to the developers. + configuration related suggestions to the developers. - https://www.torproject.org/, - Tor can help anonymize web browsing, + https://www.torproject.org/, + Tor can help anonymize web browsing, web publishing, instant messaging, IRC, SSH, and other applications. diff --git a/external/privoxy/doc/source/supported.sgml b/external/privoxy/doc/source/supported.sgml index 62bfde1f..d1b5b32c 100644 --- a/external/privoxy/doc/source/supported.sgml +++ b/external/privoxy/doc/source/supported.sgml @@ -2,8 +2,8 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/supported.sgml,v $ Purpose : Entity included in other project documents. - - $Id: supported.sgml,v 2.9 2008/01/17 01:49:51 hal9 Exp $ + + $Id: supported.sgml,v 2.10 2011/09/04 11:10:12 fabiankeil Exp $ Copyright (C) 2001-2008 Privoxy Developers http://www.privoxy.org/ See LICENSE. @@ -12,7 +12,7 @@ This file used for inclusion with other documents only. ====================================================================== - If you make changes to this file, please verify the finished + If you make changes to this file, please verify the finished docs all display as intended. This file is included into: @@ -34,13 +34,13 @@ But any operating system that runs TCP/IP, can conceivably take advantage of Privoxy in a networked situation where - Privoxy would run as a server on a LAN gateway. + Privoxy would run as a server on a LAN gateway. Then only the gateway needs to be running one of the above operating systems. - Source code is freely available, so porting to other operating systems + Source code is freely available, so porting to other operating systems is always a possibility. ]]> diff --git a/external/privoxy/doc/source/user-manual.sgml b/external/privoxy/doc/source/user-manual.sgml index 2999e3e1..ddbc2d55 100644 --- a/external/privoxy/doc/source/user-manual.sgml +++ b/external/privoxy/doc/source/user-manual.sgml @@ -1,5 +1,5 @@ + @@ -11,7 +11,7 @@ - + @@ -34,13 +34,13 @@ This file belongs into ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/ - $Id: user-manual.sgml,v 2.103 2009/03/21 10:49:05 fabiankeil Exp $ + $Id: user-manual.sgml,v 2.146 2011/12/26 17:05:40 fabiankeil Exp $ - Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ + Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/ See LICENSE. ======================================================================== - NOTE: Please read developer-manual/documentation.html before touching + NOTE: Please read developer-manual/documentation.html before touching anything in this, or other Privoxy documentation. ======================================================================== @@ -55,12 +55,12 @@ - Copyright &my-copy; 2001-2009 by + Copyright &my-copy; 2001-2011 by Privoxy Developers -$Id: user-manual.sgml,v 2.103 2009/03/21 10:49:05 fabiankeil Exp $ +$Id: user-manual.sgml,v 2.146 2011/12/26 17:05:40 fabiankeil Exp $ Since this is a &p-status; version, not all new features are well tested. This - documentation may be slightly out of sync as a result (especially with + documentation may be slightly out of sync as a result (especially with CVS sources). And there may be bugs, though hopefully - not many! + not many! ]]> Features - In addition to the core - features of ad blocking and + In addition to the core + features of ad blocking and cookie management, Privoxy provides many supplemental - features, + features, that give the end-user more control, more privacy and more freedom: @@ -165,14 +165,14 @@ Hal. - Note: - On some platforms, the installer may remove previously installed versions, if + Note: + On some platforms, the installer may remove previously installed versions, if found. (See below for your platform). In any case be sure to backup your old configuration if it is valuable to you. See the note to upgraders section below. - + Binary Packages How to install the binary packages depends on your operating system: @@ -185,7 +185,7 @@ How to install the binary packages depends on your operating system: RPMs can be installed with rpm -Uvh privoxy-&p-version;-1.rpm, - and will use /etc/privoxy for the location + and will use /etc/privoxy for the location of configuration files. @@ -193,13 +193,13 @@ How to install the binary packages depends on your operating system: Note that on Red Hat, Privoxy will not be automatically started on system boot. You will need to enable that using chkconfig, - ntsysv, or similar methods. + ntsysv, or similar methods. - If you have problems with failed dependencies, try rebuilding the SRC RPM: - rpm --rebuild privoxy-&p-version;-1.src.rpm. This - will use your locally installed libraries and RPM version. + If you have problems with failed dependencies, try rebuilding the SRC RPM: + rpm --rebuild privoxy-&p-version;-1.src.rpm. This + will use your locally installed libraries and RPM version. @@ -214,7 +214,7 @@ How to install the binary packages depends on your operating system: Debian and Ubuntu DEBs can be installed with apt-get install privoxy, - and will use /etc/privoxy for the location of + and will use /etc/privoxy for the location of configuration files. @@ -225,7 +225,7 @@ How to install the binary packages depends on your operating system: Just double-click the installer, which will guide you through the installation process. You will find the configuration files - in the same directory as you installed Privoxy in. + in the same directory as you installed Privoxy in. Version 3.0.5 beta introduced full Windows service @@ -256,7 +256,7 @@ How to install the binary packages depends on your operating system: command: services.msc. If you do not take the manual step of modifying Privoxy's service settings, it will not start. Note too that you will need to give Privoxy a user account that - actually exists, or it will not be permitted to + actually exists, or it will not be permitted to write to its log and configuration files. @@ -277,7 +277,7 @@ How to install the binary packages depends on your operating system: First, make sure that no previous installations of - Junkbuster and / or + Junkbuster and / or Privoxy are left on your system. Check that no Junkbuster or Privoxy objects are in @@ -311,7 +311,7 @@ How to install the binary packages depends on your operating system: installation (in addition to every time your computer starts up). To prevent the privoxy service from automatically starting when your computer starts up, remove or rename the folder named - /Library/StartupItems/Privoxy. + /Library/StartupItems/Privoxy. To manually start or stop the privoxy service, use the Privoxy Utility @@ -323,9 +323,9 @@ How to install the binary packages depends on your operating system: AmigaOS - Copy and then unpack the lha archive to a suitable location. + Copy and then unpack the lha archive to a suitable location. All necessary files will be installed into Privoxy - directory, including all configuration and log files. To uninstall, just + directory, including all configuration and log files. To uninstall, just remove this directory. @@ -352,19 +352,19 @@ How to install the binary packages depends on your operating system: Gentoo - Gentoo source packages (Ebuilds) for Privoxy are - contained in the Gentoo Portage Tree (they are not on the download page, - but there is a Gentoo section, where you can see when a new + Gentoo source packages (Ebuilds) for Privoxy are + contained in the Gentoo Portage Tree (they are not on the download page, + but there is a Gentoo section, where you can see when a new Privoxy Version is added to the Portage Tree). - Before installing Privoxy under Gentoo just do - first emerge --sync to get the latest changes from the - Portage tree. With emerge privoxy you install the latest + Before installing Privoxy under Gentoo just do + first emerge --sync to get the latest changes from the + Portage tree. With emerge privoxy you install the latest version. - Configuration files are in /etc/privoxy, the + Configuration files are in /etc/privoxy, the documentation is in /usr/share/doc/privoxy-&p-version; and the Log directory is in /var/log/privoxy. @@ -377,7 +377,7 @@ How to install the binary packages depends on your operating system: The most convenient way to obtain the Privoxy sources - is to download the source tarball from our + is to download the source tarball from our project download page. @@ -386,8 +386,8 @@ How to install the binary packages depends on your operating system: If you like to live on the bleeding edge and are not afraid of using possibly unstable development versions, you can check out the up-to-the-minute version directly from the - CVS repository. - - + Keeping your Installation Up-to-Date As user feedback comes in and development continues, we will make updated versions @@ -420,7 +420,7 @@ How to install the binary packages depends on your operating system: In order not to lose your personal changes and adjustments when updating to the latest default.action file we strongly - recommend that you use user.action and + recommend that you use user.action and user.filter for your local customizations of Privoxy. See the Chapter on actions files for details. @@ -437,88 +437,1032 @@ How to install the binary packages depends on your operating system: What's New in this Release - Privoxy 3.0.12 is mainly a bugfix release: + Privoxy 3.0.19 is a stable release. + The changes since 3.0.18 stable are: + + + + + + + Bug fixes: + + + + Prevent a segmentation fault when de-chunking buffered content. + It could be triggered by malicious web servers if Privoxy was + configured to filter the content and running on a platform + where SIZE_T_MAX isn't larger than UINT_MAX, which probably + includes most 32-bit systems. On those platforms, all Privoxy + versions before 3.0.19 appear to be affected. + To be on the safe side, this bug should be presumed to allow + code execution as proving that it doesn't seems unrealistic. + + + + + Do not expect a response from the SOCKS4/4A server until it + got something to respond to. This regression was introduced + in 3.0.18 and prevented the SOCKS4/4A negotiation from working. + Reported by qqqqqw in #3459781. + + + + + + + + General improvements: + + + + Fix an off-by-one in an error message about connect failures. + + + + + Use a GNUMakefile variable for the webserver root directory and + update the path. Sourceforge changed it which broke various + web-related targets. + + + + + Update the CODE_STATUS description. + + + + + + + + + + The following changes were made between 3.0.17 and 3.0.18: - The socket-timeout option now also works on platforms whose - select() implementation modifies the timeout structure. - Previously the timeout was triggered even if the connection - didn't stall. Reported by cyberpatrol. + Bug fixes: + + + + If a generated redirect URL contains characters RFC 3986 doesn't + permit, they are (re)encoded. Not doing this makes Privoxy versions + from 3.0.5 to 3.0.17 susceptible to HTTP response splitting (CWE-113) + attacks if the +fast-redirects{check-decoded-url} action is used. + + + + + Fix a logic bug that could cause Privoxy to reuse a server + socket after it got tainted by a server-header-tagger-induced + block that was triggered before the whole server response had + been read. If keep-alive was enabled and the request following + the blocked one was to the same host and using the same forwarding + settings, Privoxy would send it on the tainted server socket. + While the server would simply treat it as a pipelined request, + Privoxy would later on fail to properly parse the server's + response as it would try to parse the unread data from the + first response as server headers for the second one. + Regression introduced in 3.0.17. + + + + + When implying keep-alive in client_connection(), remember that + the client didn't. Fixes a regression introduced in 3.0.13 that + would cause Privoxy to wait for additional client requests after + receiving a HTTP/1.1 request with "Connection: close" set + and connection sharing enabled. + With clients which terminates the client connection after detecting + that the whole body has been received it doesn't really matter, + but with clients that don't the connection would be kept open until + it timed out. + + + + + Fix a subtle race condition between prepare_csp_for_next_request() + and sweep(). A thread preparing itself for the next client request + could briefly appear to be inactive. + If all other threads were already using more recent files, + the thread could get its files swept away under its feet. + So far this has only been reproduced while stress testing in + valgrind while touching action files in a loop. It's unlikely + to have caused any actual problems in the real world. + + + + + Disable filters if SDCH compression is used unless filtering is forced. + If SDCH was combined with a supported compression algorithm, Privoxy + previously could try to decompress it and ditch the Content-Encoding + header even though the SDCH compression wasn't dealt with. + Reported by zebul666 in #3225863. + + + + + Make a copy of the --user value and only mess with that when splitting + user and group. On some operating systems modifying the value directly + is reflected in the output of ps and friends and can be misleading. + Reported by zepard in #3292710. + + + + + If forwarded-connect-retries is set, only retry if Privoxy is actually + forwarding the request. Previously direct connections would be retried + as well. + + + + + Fixed a small memory leak when retrying connections with IPv6 + support enabled. + + + + + Remove an incorrect assertion in compile_dynamic_pcrs_job_list() + It could be triggered by a pcrs job with an invalid pcre + pattern (for example one that contains a lone quantifier). + + + + + If the --user argument user[.group] contains a dot, always bail out + if no group has been specified. Previously the intended, but undocumented + (and apparently untested), behaviour was to try interpreting the whole + argument as user name, but the detection was flawed and checked for '0' + instead of '\0', thus merely preventing group names beginning with a zero. + + + + + In html_code_map[], use a numeric character reference instead of ' + which wasn't standardized before XHTML 1.0. + + + + + Fix an invalid free when compiled with FEATURE_GRACEFUL_TERMINATION + and shut down through http://config.privoxy.org/die + + + + + In get_actions(), fix the "temporary" backwards compatibility hack + to accept block actions without reason. + It also covered other actions that should be rejected as invalid. + Reported by Billy Crook. + + + - The Connection: keep-alive code properly deals with files - larger than 2GB. Previously the connection was closed too - early. + General improvements: + + + + Privoxy can (re)compress buffered content before delivering + it to the client. Disabled by default as most users wouldn't + benefit from it. + + + + + The +fast-redirects{check-decoded-url} action checks URL + segments separately. If there are other parameters behind + the redirect URL, this makes it unnecessary to cut them off + by additionally using a +redirect{} pcrs command. + Initial patch submitted by Jamie Zawinski in #3429848. + + + + + When loading action sections, verify that the referenced filters + exist. Currently missing filters only result in an error message, + but eventually the severity will be upgraded to fatal. + + + + + Allow to bind to multiple separate addresses. + Patch set submitted by Petr Pisar in #3354485. + + + + + Set socket_error to errno if connecting fails in rfc2553_connect_to(). + Previously rejected direct connections could be incorrectly reported + as DNS issues if Privoxy was compiled with IPv6 support. + + + + + Adjust url_code_map[] so spaces are replaced with %20 instead of '+' + While '+' can be used by client's submitting form data, this is not + actually what Privoxy is using the lookups for. This is more of a + cosmetic issue and doesn't fix any known problems. + + + + + When compiled without FEATURE_FAST_REDIRECTS, do not silently + ignore +fast-redirect{} directives + + + + + Added a workaround for GNU libc's strptime() reporting negative + year values when the parsed year is only specified with two digits. + On affected systems cookies with such a date would not be turned + into session cookies by the +session-cookies-only action. + Reported by Vaeinoe in #3403560 + + + + + Fixed bind failures with certain GNU libc versions if no non-loopback + IP address has been configured on the system. This is mainly an issue + if the system is using DHCP and Privoxy is started before the network + is completely configured. + Reported by Raphael Marichez in #3349356. + Additional insight from Petr Pisar. + + + + + Privoxy log messages now use the ISO 8601 date format %Y-%m-%d. + It's only slightly longer than the old format, but contains + the full date including the year and allows sorting by date + (when grepping in multiple log files) without hassle. + + + + + In get_last_url(), do not bother trying to decode URLs that do + not contain at least one '%' sign. It reduces the log noise and + a number of unnecessary memory allocations. + + + + + In case of SOCKS5 failures, dump the socks response in the log message. + + + + + Simplify the signal setup in main(). + + + + + Streamline socks5_connect() slightly. + + + + + In socks5_connect(), require a complete socks response from the server. + Previously Privoxy didn't care how much data the server response + contained as long as the first two bytes contained the expected + values. While at it, shrink the buffer size so Privoxy can't read + more than a whole socks response. + + + + + In chat(), do not bother to generate a client request in case of + direct CONNECT requests. It will not be used anyway. + + + + + Reduce server_last_modified()'s stack size. + + + + + Shorten get_http_time() by using strftime(). + + + + + Constify the known_http_methods pointers in unknown_method(). + + + + + Constify the time_formats pointers in parse_header_time(). + + + + + Constify the formerly_valid_actions pointers in action_used_to_be_valid(). + + + + + Introduce a GNUMakefile MAN_PAGE variable that defaults to privoxy.1. + The Debian package uses section 8 for the man page and this + should simplify the patch. + + + + + Deduplicate the INADDR_NONE definition for Solaris by moving it to jbsockets.h + + + + + In block_url(), ditch the obsolete workaround for ancient Netscape versions + that supposedly couldn't properly deal with status code 403. + + + + + Remove a useless NULL pointer check in load_trustfile(). + + + + + Remove two useless NULL pointer checks in load_one_re_filterfile(). + + + + + Change url_code_map[] from an array of pointers to an array of arrays + It removes an unnecessary layer of indirection and on 64bit system reduces + the size of the binary a bit. + + + + + Fix various typos. Fixes taken from Debian's 29_typos.dpatch by Roland Rosenfeld. + + + + + Add a dok-tidy GNUMakefile target to clean up the messy HTML + generated by the other dok targets. + + + + + GNUisms in the GNUMakefile have been removed. + + + + + Change the HTTP version in static responses to 1.1 + + + + + Synced config.sub and config.guess with upstream + 2011-11-11/386c7218162c145f5f9e1ff7f558a3fbb66c37c5. + + + + + Add a dedicated function to parse the values of toggles. Reduces duplicated + code in load_config() and provides better error handling. Invalid or missing + toggle values are now a fatal error instead of being silently ignored. + + + + + Terminate HTML lines in static error messages with \n instead of \r\n. + + + + + Simplify cgi_error_unknown() a bit. + + + + + In LogPutString(), don't bother looking at pszText when not + actually logging anything. + + + + + Change ssplit()'s fourth parameter from int to size_t. + Fixes a clang complaint. + + + + + Add a warning that the statistics currently can't be trusted. + Mention Privoxy-Log-Parser's --statistics option as + an alternative for the time being. + + + + + In rfc2553_connect_to(), start setting cgi->error_message on error. + + + + + Change the expected status code returned for http://p.p/die depending + on whether or not FEATURE_GRACEFUL_TERMINATION is available. + + + + + In cgi_die(), mark the client connection for closing. + If the client will fetch the style sheet through another connection + it gets the main thread out of the accept() state and should thus + trigger the actual shutdown. + + + + + Add a proper CGI message for cgi_die(). + + + + + Don't enforce a logical line length limit in read_config_line(). + + + + + Slightly refactor server_last_modified() to remove useless gmtime*() calls. + + + + + In get_content_type(), also recognize '.jpeg' as JPEG extension. + + + + + Add '.png' to the list of recognized file extensions in get_content_type(). + + + + + In block_url(), consistently use the block reason "Request blocked by Privoxy" + In two places the reason was "Request for blocked URL" which hides the + fact that the request got blocked by Privoxy and isn't necessarily + correct as the block may be due to tags. + + + + + In listen_loop(), reload the configuration files after accepting + a new connection instead of before. + Previously the first connection that arrived after a configuration + change would still be handled with the old configuration. + + + + + In chat()'s receive-data loop, skip a client socket check if + the socket will be written to right away anyway. This can + increase the transfer speed for unfiltered content on fast + network connections. + + + + + The socket timeout is used for SOCKS negotiations as well which + previously couldn't timeout. + + + + + Don't keep the client connection alive if any configuration file + changed since the time the connection came in. This is closer to + Privoxy's behaviour before keep-alive support for client connection + has been added and also less confusing in general. + + + + + Treat all Content-Type header values containing the pattern + 'script' as a sign of text. Reported by pribog in #3134970. + + + - The content length for files above 2GB is logged correctly. + Action file improvements: + + + + Moved the site-specific block pattern section below the one for the + generic patterns so for requests that are matched in both, the block + reason for the domain is shown which is usually more useful than showing + the one for the generic pattern. + + + + + Remove -prevent-compression from the fragile alias. It's no longer + used anywhere by default and isn't known to break stuff anyway. + + + + + Add a (disabled) section to block various Facebook tracking URLs. + Reported by Dan Stahlke in #3421764. + + + + + Add a (disabled) section to rewrite and redirect click-tracking + URLs used on news.google.com. + Reported by Dan Stahlke in #3421755. + + + + + Unblock linuxcounter.net/. + Reported by Dan Stahlke in #3422612. + + + + + Block 'www91.intel.com/' which is used by Omniture. + Reported by Adam Piggott in #3167370. + + + + + Disable the handle-as-empty-doc-returns-ok option and mark it as deprecated. + Reminded by tceverling in #2790091. + + + + + Add ".ivwbox.de/" to the "Cross-site user tracking" section. + Reported by Nettozahler in #3172525. + + + + + Unblock and fast-redirect ".awin1.com/.*=http://". + Reported by Adam Piggott in #3170921. + + + + + Block "b.collective-media.net/". + + + + + Widen the Debian popcon exception to "qa.debian.org/popcon". + Seen in Debian's 05_default_action.dpatch by Roland Rosenfeld. + + + + + Block ".gemius.pl/" which only seems to be used for user tracking. + Reported by johnd16 in #3002731. Additional input from Lee and movax. + + + + + Disable banners-by-size filters for '.thinkgeek.com/'. + The filter only seems to catch pictures of the inventory. + + + + + Block requests for 'go.idmnet.bbelements.com/please/showit/'. + Reported by kacperdominik in #3372959. + + + + + Unblock adainitiative.org/. + + + + + Add a fast-redirects exception for '.googleusercontent.com/.*=cache'. + + + + + Add a fast-redirects exception for webcache.googleusercontent.com/. + + + + + Unblock http://adassier.wordpress.com/ and http://adassier.files.wordpress.com/. + + + - The user-manual directive on the show-status page links to - the documentation location specified with the directive, - not to the Privoxy website. + Filter file improvements: + + + + Let the yahoo filter hide '.ads'. + + + + + Let the msn filter hide overlay ads for Facebook 'likes' in search + results and elements with the id 's_notf_div'. They only seem to be + used to advertise site 'enhancements'. + + + + + Let the js-events filter additionally disarm setInterval(). + Suggested by dg1727 in #3423775. + + + - When running in daemon mode, Privoxy doesn't log anything - to the console unless there are errors before the logfile - has been opened. + Documentation improvements: + + + + Clarify the effect of compiling Privoxy with zlib support. + Suggested by dg1727 in #3423782. + + + + + Point out that the SourceForge messaging system works like a black + hole and should thus not be used to contact individual developers. + + + + + Mention some of the problems one can experience when not explicitly + configuring an IP addresses as listen address. + + + + + Explicitly mention that hostnames can be used instead of IP addresses + for the listen-address, that only the first address returned will be + used and what happens if the address is invalid. + Requested by Calestyo in #3302213. + + + - The show-status page prints warnings about invalid directives - on the same line as the directives themselves. + Log message improvements: + + + + If only the server connection is kept alive, do not pretend to + wait for a new client request. + + + + + Remove a superfluous log message in forget_connection(). + + + + + In chat(), properly report missing server responses as such + instead of calling them empty. + + + + + In forwarded_connect(), fix a log message nobody should ever see. + + + + + Fix a log message in socks5_connect(), a failed write operation + was logged as failed read operation. + + + + + Let load_one_actions_file() properly complain about a missing + '{' at the beginning of the file. + Simply stating that a line is invalid isn't particularly helpful. + + + + + Do not claim to listen on a socket until Privoxy actually does. + Patch submitted by Petr Pisar #3354485 + + + + + Prevent a duplicated LOG_LEVEL_CLF message when sending out + the "no-server-data" response. + + + + + Also log the client socket when dropping a connection. + + + + + Include the destination host in the 'Request ... marked for + blocking. limit-connect{...} doesn't allow CONNECT ...' message + Patch submitted by Saperski in #3296250. + + + + + Prevent a duplicated log message if none of the resolved IP + addresses were reachable. + + + + + In connect_to(), do not pretend to retry if forwarded-connect-retries + is zero or unset. + + + + + When a specified user or group can't be found, put the name in + single-quotes when logging it. + + + + + In rfc2553_connect_to(), explain getnameinfo() errors better. + + + + + Remove a useless log message in chat(). + + + + + When retrying to connect, also log the maximum number of connection + attempts. + + + + + Rephrase a log message in compile_dynamic_pcrs_job_list(). + Divide the error code and its meaning with a colon. Call the pcrs + job dynamic and not the filter. Filters may contain dynamic and + non-dynamic pcrs jobs at the same time. Only mention the name of + the filter or tagger, but don't claim it's a filter when it could + be a tagger. + + + + + In a fatal error message in load_one_actions_file(), cover both + URL and TAG patterns. + + + + + In pcrs_strerror(), properly report unknown positive error code + values as such. Previously they were handled like 0 (no error). + + + + + In compile_dynamic_pcrs_job_list(), also log the actual error code as + pcrs_strerror() doesn't handle all errors reported by pcre. + + + + + Don't bother trying to continue chatting if the client didn't ask for it. + Reduces log noise a bit. + + + + + Make two fatal error message in load_one_actions_file() more descriptive. + + + + + In cgi_send_user_manual(), log when rejecting a file name due to '/' or '..'. + + + + + In load_file(), log a message if opening a file failed. + The CGI error message alone isn't too helpful. + + + + + In connection_destination_matches(), improve two log messages + to help understand why the destinations don't match. + + + + + Rephrase a log message in serve(). Client request arrival + should be differentiated from closed client connections now. + + + + + In serve(), log if a client connection isn't reused due to a + configuration file change. + + + + + Let mark_server_socket_tainted() always mark the server socket tainted, + just don't talk about it in cases where it has no effect. It doesn't change + Privoxy's behaviour, but makes understanding the log file easier. + + + - Fixed several justified (but harmless) compiler warnings, - mostly on 64 bit platforms. + configure: + + + + Added a --disable-ipv6-support switch for platforms where support + is detected but doesn't actually work. + + + + + Do not check for the existence of strerror() and memmove() twice + + + + + Remove a useless test for setpgrp(2). Privoxy doesn't need it and + it can cause problems when cross-compiling. + + + + + Rename the --disable-acl-files switch to --disable-acl-support. + Since about 2001, ACL directives are specified in the standard + config file. + + + + + Update the URL of the 'Removing outdated PCRE version after the + next stable release' posting. The old URL stopped working after + one of SF's recent site "optimizations". Reported by Han Liu. + + + - The mingw32 version explicitly requests the default charset - to prevent display problems with some fonts available on more - recent Windows versions. Patch by Burberry. + Privoxy-Regression-Test: + + + + Added --shuffle-tests option to increase the chances of detection race conditions. + + + + + Added a --local-test-file option that allows to use Privoxy-Regression-Test without Privoxy. + + + + + Added tests for missing socks4 and socks4a forwarders. + + + + + The --privoxy-address option now works with IPv6 addresses containing brackets, too. + + + + + Perform limited sanity checks for parameters that are supposed to have numerical values. + + + + + Added a --sleep-time option to specify a number of seconds to + sleep between tests, defaults to 0. + + + + + Disable the range-requests tagger for tests that break if it's enabled. + + + + + Log messages use the ISO 8601 date format %Y-%m-%d. + + + + + Fix spelling in two error messages. + + + + + In the --help output, include a list of supported tests and their default levels. + + + + + Adjust the tests to properly deal with FEATURE_TOGGLE being disabled. + + + - The mingw32 version uses the Privoxy icon in the alt-tab - windows. Patch by Burberry. + Privoxy-Log-Parser: + + + + Perform limited sanity checks for command line parameters that + are supposed to have numerical values. + + + + + Implement a --unbreak-lines-only option to try to revert MUA breakage. + + + + + Accept and highlight: Added header: Content-Encoding: deflate + + + + + Accept and highlight: Compressed content from 29258 to 8630 bytes. + + + + + Accept and highlight: Client request arrived in time on socket 21. + + + + + Highlight: Didn't receive data in time: a.fsdn.com:443 + + + + + Accept log messages with ISO 8601 time stamps, too. + + + - The timestamp and the thread id is omitted in the "Fatal error" - message box on mingw32. - - - - - Fixed two related mingw32-only buffer overflows. Triggering - them required control over the configuration file, therefore - this isn't seen as a security issue. - - - - - In verbose mode, or if the new option --show-skipped-tests - is used, Privoxy-Regression-Test logs skipped tests and the - skip reason. + uagen: + + + + Bump generated Firefox version to 8.0. + + + + + Only randomize the release date if the new --randomize-release-date + option is enabled. Firefox versions after 4 use a fixed date string + without meaning. + + + @@ -531,7 +1475,7 @@ How to install the binary packages depends on your operating system: Note to Upgraders - A quick list of things to be aware of before upgrading from earlier + A quick list of things to be aware of before upgrading from earlier versions of Privoxy: @@ -540,7 +1484,7 @@ How to install the binary packages depends on your operating system: - The recommended way to upgrade &my-app; is to backup your old + The recommended way to upgrade &my-app; is to backup your old configuration files, install the new ones, verify that &my-app; is working correctly and finally merge back your changes using diff and maybe patch. @@ -554,20 +1498,20 @@ How to install the binary packages depends on your operating system: - + Note that some installers remove earlier versions completely, including configuration files, therefore you should really save any important configuration files! - - On the other hand, other installers don't overwrite existing configuration + + On the other hand, other installers don't overwrite existing configuration files, thinking you will want to do that yourself. - + standard.action has been merged into the default.action file. @@ -584,21 +1528,21 @@ How to install the binary packages depends on your operating system: - Three other config file settings are now off by default: + Three other config file settings are now off by default: enable-remote-toggle, enable-remote-http-toggle, - and enable-edit-actions. + and enable-edit-actions. If you use or want these, you will need to explicitly enable them, and - be aware of the security issues involved. + be aware of the security issues involved. @@ -672,19 +1616,19 @@ How to install the binary packages depends on your operating system: Install Privoxy. See the Installation Section below for platform specific - information. + information. - + Advanced users and those who want to offer Privoxy service to more than just their local machine should check the main config file, especially the security-relevant options. These are + linkend="access-control">security-relevant options. These are off by default. - + @@ -700,26 +1644,26 @@ How to install the binary packages depends on your operating system: HTTPS (SSL) proxy by setting the proxy configuration for address of 127.0.0.1 and port 8118. - DO NOT activate proxying for FTP or + DO NOT activate proxying for FTP or any protocols besides HTTP and HTTPS (SSL) unless you intend to prevent your browser from using these protocols. - + Flush your browser's disk and memory caches, to remove any cached ad images. - If using Privoxy to manage + If using Privoxy to manage cookies, you should remove any currently stored cookies too. - + - A default installation should provide a reasonable starting point for + A default installation should provide a reasonable starting point for most. There will undoubtedly be occasions where you will want to adjust the - configuration, but that can be dealt with as the need arises. Little + configuration, but that can be dealt with as the need arises. Little to no initial configuration is required in most cases, you may want to enable the web-based action editor though. @@ -733,7 +1677,7 @@ How to install the binary packages depends on your operating system: introduction to how Privoxy blocks ads and banners. - + @@ -748,7 +1692,7 @@ How to install the binary packages depends on your operating system: Action has hints on how to understand and debug actions that misbehave. - + Please see the section Contacting the Developers on how to report bugs, problems with websites or to get - help. + help. - + Now enjoy surfing with enhanced control, comfort and privacy! - + @@ -785,35 +1729,35 @@ How to install the binary packages depends on your operating system: Quickstart to Ad Blocking Ad blocking is but one of Privoxy's - array of features. Many of these features are for the technically minded advanced + array of features. Many of these features are for the technically minded advanced user. But, ad and banner blocking is surely common ground for everybody. - - This section will provide a quick summary of ad blocking so + + This section will provide a quick summary of ad blocking so you can get up to speed quickly without having to read the more extensive information provided below, though this is highly recommended. First a bit of a warning ... blocking ads is much like blocking SPAM: the - more aggressive you are about it, the more likely you are to block - things that were not intended. And the more likely that some things + more aggressive you are about it, the more likely you are to block + things that were not intended. And the more likely that some things may not work as intended. So there is a trade off here. If you want extreme ad free browsing, be prepared to deal with more problem sites, and to spend more time adjusting the - configuration to solve these unintended consequences. In short, there is - not an easy way to eliminate all ads. Either take + configuration to solve these unintended consequences. In short, there is + not an easy way to eliminate all ads. Either take the easy way and settle for most ads blocked with the default configuration, or jump in and tweak it for your personal surfing habits and preferences. Secondly, a brief explanation of Privoxy's - actions. Actions in this context, are + actions. Actions in this context, are the directives we use to tell Privoxy to perform some task relating to HTTP transactions (i.e. web browsing). We tell Privoxy to take some action. Each @@ -825,7 +1769,7 @@ How to install the binary packages depends on your operating system: Actions are specified in Privoxy's configuration, - followed by one or more URLs to which the action should apply. URLs + followed by one or more URLs to which the action should apply. URLs can actually be URL type patterns that use wildcards so they can apply potentially to a range of similar URLs. The actions, together with the URL patterns are called a section. @@ -848,7 +1792,7 @@ How to install the binary packages depends on your operating system: The most important actions for basic ad blocking are: block, handle-as-image, + linkend="handle-as-image">handle-as-image, handle-as-empty-document,and set-image-blocker: @@ -856,10 +1800,10 @@ How to install the binary packages depends on your operating system: - + - block - this is perhaps + block - this is perhaps the single most used action, and is particularly important for ad blocking. This action stops any contact between your browser and any URL patterns that match this action's configuration. It can be used for blocking ads, @@ -868,32 +1812,32 @@ How to install the binary packages depends on your operating system: Privoxy's own built-in BLOCKED page instead to let you now what has happened (with some exceptions, see below). - + - handle-as-image - + handle-as-image - tells Privoxy to treat this URL as an image. Privoxy's default configuration already does this for all common image types (e.g. GIF), but there are many situations where this is not so easy to determine. So we'll force it in these cases. This is particularly important for ad blocking, since only if we know that it's an image of - some kind, can we replace it with an image of our choosing, instead of the + some kind, can we replace it with an image of our choosing, instead of the Privoxy BLOCKED page (which would only result in a broken image icon). There are some limitations to this though. For instance, you can't just brute-force an image substitution for an entire HTML page in most situations. - + - handle-as-empty-document - - sends an empty document instead of Privoxy's - normal BLOCKED HTML page. This is useful for file types that are neither + handle-as-empty-document - + sends an empty document instead of Privoxy's + normal BLOCKED HTML page. This is useful for file types that are neither HTML nor images, such as blocking JavaScript files. - + @@ -910,7 +1854,7 @@ How to install the binary packages depends on your operating system: -    pattern - a checkerboard pattern, so that an ad +    pattern - a checkerboard pattern, so that an ad replacement is obvious. This is the default. @@ -926,14 +1870,14 @@ How to install the binary packages depends on your operating system: of the user's choosing (advanced usage). - + Advanced users will eventually want to explore &my-app; - filters as well. Filters + filters as well. Filters are very different from blocks. A block blocks a site, page, or unwanted contented. Filters @@ -948,7 +1892,7 @@ How to install the binary packages depends on your operating system: The quickest way to adjust any of these settings is with your browser through the special Privoxy editor at http://config.privoxy.org/show-status - (shortcut: http://p.p/show-status). This + (shortcut: http://p.p/show-status). This is an internal page, and does not require Internet access. @@ -980,21 +1924,21 @@ How to install the binary packages depends on your operating system: - Right click on the ad image to be blocked, then select + Right click on the ad image to be blocked, then select Copy Link Location from the - pop-up menu. + pop-up menu. - + - Set your browser to + Set your browser to http://config.privoxy.org/show-status - + - Find user.action in the top section, and click + Find user.action in the top section, and click on Edit: @@ -1004,29 +1948,29 @@ How to install the binary packages depends on your operating system: - + [ Screenshot of Actions Files in Use ] - - + + You should have a section with only - block listed under + block listed under Actions:. If not, click a Insert new section below - button, and in the new section that just appeared, click the + button, and in the new section that just appeared, click the Edit button right under the word Actions:. This will bring up a list of all actions. Find block near the top, and click in the Enabled column, then Submit just below the list. - + Now, in the block actions section, @@ -1036,21 +1980,21 @@ How to install the binary packages depends on your operating system: Submit (or OK if in a pop-up window). - + Now go back to the original page, and press SHIFT-Reload (or flush all browser caches). The image should be gone now. - - + + - This is a very crude and simple example. There might be good reasons to use a + This is a very crude and simple example. There might be good reasons to use a wildcard pattern match to include potentially similar images from the same - site. For a more extensive explanation of patterns, and + site. For a more extensive explanation of patterns, and the entire actions concept, see the Actions section. @@ -1061,11 +2005,11 @@ How to install the binary packages depends on your operating system: The ideas explained therein also apply to the web-based editor. - There are also various - filters that can be used for ad blocking - (filters are a special subset of actions). These + There are also various + filters that can be used for ad blocking + (filters are a special subset of actions). These fall into the advanced usage category, and are explained in - depth in later sections. + depth in later sections. @@ -1081,14 +2025,14 @@ How to install the binary packages depends on your operating system: Before launching Privoxy for the first time, you will want to configure your browser(s) to use - Privoxy as a HTTP and HTTPS (SSL) + Privoxy as a HTTP and HTTPS (SSL) proxy. The default is 127.0.0.1 (or localhost) for the proxy address, and port 8118 (earlier versions used port 8000). This is the one configuration step that must be done ! - Please note that Privoxy can only proxy HTTP and + Please note that Privoxy can only proxy HTTP and HTTPS traffic. It will not work with FTP or other protocols. @@ -1099,35 +2043,35 @@ How to install the binary packages depends on your operating system: - + [ Screenshot of Mozilla Proxy Configuration ] - - + + With Firefox, this is typically set under: - + Tools -> Options -> Advanced -> Network ->Connection -> Settings - + Or optionally on some platforms: - + Edit -> Preferences -> General -> Connection Settings -> Manual Proxy Configuration - + With Netscape (and Mozilla), this can be set under: @@ -1141,7 +2085,7 @@ How to install the binary packages depends on your operating system: - For Internet Explorer v.5-7: + For Internet Explorer v.5-7: @@ -1163,7 +2107,7 @@ How to install the binary packages depends on your operating system: - + [ Screenshot of IE Proxy Configuration ] @@ -1174,7 +2118,7 @@ How to install the binary packages depends on your operating system: After doing this, flush your browser's disk and memory caches to force a - re-reading of all pages and to get rid of any ads that may be cached. Remove + re-reading of all pages and to get rid of any ads that may be cached. Remove any cookies, if you want Privoxy to manage that. You are now ready to start enjoying the benefits of using @@ -1238,7 +2182,7 @@ Click on the &my-app; Icon to start Privoxy. If no co Privoxy can run with full Windows service functionality. On Windows only, the &my-app; program has two new command line arguments - to install and uninstall &my-app; as a service. See the + to install and uninstall &my-app; as a service. See the Windows Installation instructions for details. @@ -1305,7 +2249,7 @@ Example Unix startup command: Start Privoxy (with RUN <>NIL:) in your startnet script (AmiTCP), in s:user-startup (RoadShow), as startup program in your - startup script (Genesis), or as startup action (Miami and MiamiDx). + startup script (Genesis), or as startup action (Miami and MiamiDx). Privoxy will automatically quit when you quit your TCP/IP stack (just ignore the harmless warning your TCP/IP stack may display that Privoxy is still running). @@ -1315,7 +2259,7 @@ Example Unix startup command: Gentoo - A script is again used. It will use the file /etc/privoxy/config + A script is again used. It will use the file /etc/privoxy/config as its main configuration file. @@ -1324,11 +2268,11 @@ Example Unix startup command: - Note that Privoxy is not automatically started at - boot time by default. You can change this with the rc-update + Note that Privoxy is not automatically started at + boot time by default. You can change this with the rc-update command. - + rc-update add privoxy default @@ -1350,7 +2294,7 @@ must find a better place for this paragraph actions files. These are where various cookie actions are defined, ad and banner blocking, and other aspects of Privoxy configuration. There are several - such files included, with varying levels of aggressiveness. + such files included, with varying levels of aggressiveness. @@ -1370,7 +2314,7 @@ must find a better place for this paragraph sites is the popup-killing (through +filter{popups}), because your favorite shopping, banking, or leisure site may need - popups (explained below). + popups (explained below). @@ -1386,24 +2330,24 @@ must find a better place for this paragraph - After running Privoxy for a while, you can - start to fine tune the configuration to suit your personal, or site, - preferences and requirements. There are many, many aspects that can - be customized. Actions - can be adjusted by pointing your browser to + After running Privoxy for a while, you can + start to fine tune the configuration to suit your personal, or site, + preferences and requirements. There are many, many aspects that can + be customized. Actions + can be adjusted by pointing your browser to http://config.privoxy.org/ - (shortcut: http://p.p/), - and then follow the link to View & Change the Current Configuration. + (shortcut: http://p.p/), + and then follow the link to View & Change the Current Configuration. (This is an internal page and does not require Internet access.) In fact, various aspects of Privoxy - configuration can be viewed from this page, including - current configuration parameters, source code version numbers, - the browser's request headers, and actions that apply - to a given URL. In addition to the actions file - editor mentioned above, Privoxy can also + configuration can be viewed from this page, including + current configuration parameters, source code version numbers, + the browser's request headers, and actions that apply + to a given URL. In addition to the actions file + editor mentioned above, Privoxy can also be turned on and off (toggled) from this page. @@ -1426,9 +2370,9 @@ must find a better place for this paragraph If you can't get rid of the problem at all, think you've found a bug in - Privoxy, want to propose a new feature or smarter rules, please see the + Privoxy, want to propose a new feature or smarter rules, please see the section Contacting the - Developers below. + Developers below. --> @@ -1451,7 +2395,7 @@ must find a better place for this paragraph Print version info and exit. Unix only. - + --help @@ -1459,7 +2403,7 @@ must find a better place for this paragraph Print short usage info and exit. Unix only. - + --no-daemon @@ -1468,7 +2412,7 @@ must find a better place for this paragraph Don't become a daemon, i.e. don't fork and become process group leader, and don't detach from controlling tty. Unix only. - + --pidfile FILE @@ -1479,7 +2423,7 @@ must find a better place for this paragraph FILE is non-fatal. If no FILE option is given, no PID file will be used. Unix only. - + --user USER[.GROUP] @@ -1495,9 +2439,9 @@ must find a better place for this paragraph --chroot - Before changing to the user ID given in the --user option, + Before changing to the user ID given in the --user option, chroot to that user's home directory, i.e. make the kernel pretend to the &my-app; - process that the directory tree starts there. If set up carefully, this can limit + process that the directory tree starts there. If set up carefully, this can limit the impact of possible vulnerabilities in &my-app; to the files contained in that hierarchy. Unix only. @@ -1525,23 +2469,23 @@ must find a better place for this paragraph configfile - If no configfile is included on the command line, - Privoxy will look for a file named - config in the current directory (except on Win32 - where it will look for config.txt instead). Specify - full path to avoid confusion. If no config file is found, + If no configfile is included on the command line, + Privoxy will look for a file named + config in the current directory (except on Win32 + where it will look for config.txt instead). Specify + full path to avoid confusion. If no config file is found, Privoxy will fail to start. - + - On MS Windows only there are two additional - command-line options to allow Privoxy to install and - run as a service. See the -Window Installation section + On MS Windows only there are two additional + command-line options to allow Privoxy to install and + run as a service. See the +Window Installation section for details. @@ -1555,9 +2499,9 @@ for details. Privoxy Configuration - All Privoxy configuration is stored + All Privoxy configuration is stored in text files. These files can be edited with a text editor. - Many important aspects of Privoxy can + Many important aspects of Privoxy can also be controlled easily with a web browser. @@ -1567,9 +2511,9 @@ for details. Controlling Privoxy with Your Web Browser - Privoxy's user interface can be reached through the special + Privoxy's user interface can be reached through the special URL http://config.privoxy.org/ - (shortcut: http://p.p/), + (shortcut: http://p.p/), which is a built-in page and works without Internet access. You will see the following section: @@ -1611,14 +2555,14 @@ for details. cookie, and URL blocking magic is configured as well as other advanced features of Privoxy. This is an easy way to adjust various aspects of Privoxy configuration. The actions - file, and other configuration files, are explained in detail below. + file, and other configuration files, are explained in detail below. - Toggle Privoxy On or Off is handy for sites that might + Toggle Privoxy On or Off is handy for sites that might have problems with your current actions and filters. You can in fact use - it as a test to see whether it is Privoxy - causing the problem or not. Privoxy continues + it as a test to see whether it is Privoxy + causing the problem or not. Privoxy continues to run as a proxy in this case, but all manipulation is disabled, i.e. Privoxy acts like a normal forwarding proxy. There is even a toggle Bookmarklet offered, so @@ -1648,14 +2592,14 @@ for details. For Unix, *BSD and Linux, all configuration files are located in /etc/privoxy/ by default. For MS Windows, OS/2, and - AmigaOS these are all in the same directory as the + AmigaOS these are all in the same directory as the Privoxy executable. - The installed defaults provide a reasonable starting point, though + The installed defaults provide a reasonable starting point, though some settings may be aggressive by some standards. For the time being, the principle configuration files are: @@ -1669,7 +2613,7 @@ for details. on Linux, Unix, BSD, OS/2, and AmigaOS and config.txt on Windows. This is a required file. - + @@ -1683,23 +2627,23 @@ for details. It should be the second actions file loaded and shouldn't be edited by the user. - Multiple actions files may be defined in config. These - are processed in the order they are defined. Local customizations and locally + Multiple actions files may be defined in config. These + are processed in the order they are defined. Local customizations and locally preferred exceptions to the default policies as defined in match-all.action (which you will most probably want to define sooner or later) are best applied in user.action, where you can preserve them across upgrades. The file isn't installed by all installers, but you can easily create it yourself with a text editor. - + There is also a web based editor that can be accessed from http://config.privoxy.org/show-status (Shortcut: http://p.p/show-status) for the - various actions files. + various actions files. - + @@ -1707,15 +2651,15 @@ for details. file) can be used to re-write the raw page content, including viewable text as well as embedded HTML and JavaScript, and whatever else lurks on any given web page. The filtering jobs are only pre-defined here; - whether to apply them or not is up to the actions files. - default.filter includes various filters made - available for use by the developers. Some are much more intrusive than - others, and all should be used with caution. You may define additional - filter files in config as you can with - actions files. We suggest user.filter for any + whether to apply them or not is up to the actions files. + default.filter includes various filters made + available for use by the developers. Some are much more intrusive than + others, and all should be used with caution. You may define additional + filter files in config as you can with + actions files. We suggest user.filter for any locally defined filters or customizations. - + @@ -1737,15 +2681,15 @@ for details. - The actions files and filter files + The actions files and filter files can use Perl style regular expressions for - maximum flexibility. + maximum flexibility. After making any changes, there is no need to restart Privoxy in order for the changes to take - effect. Privoxy detects such changes + effect. Privoxy detects such changes automatically. Note, however, that it may take one or two additional requests for the change to take effect. When changing the listening address of Privoxy, these wake up requests @@ -1754,9 +2698,9 @@ for details. - While under development, the configuration content is subject to change. - The below documentation may not be accurate by the time you read this. - Also, what constitutes a default setting, may change, so + While under development, the configuration content is subject to change. + The below documentation may not be accurate by the time you read this. + Also, what constitutes a default setting, may change, so please check all your configuration files on important issues. ]]> @@ -1792,15 +2736,15 @@ for details. The actions files are used to define what actions Privoxy takes for which URLs, and thus determines how ad images, cookies and various other aspects of HTTP content and - transactions are handled, and on which sites (or even parts thereof). + transactions are handled, and on which sites (or even parts thereof). There are a number of such actions, with a wide range of functionality. Each action does something a little different. - These actions give us a veritable arsenal of tools with which to exert - our control, preferences and independence. Actions can be combined so that + These actions give us a veritable arsenal of tools with which to exert + our control, preferences and independence. Actions can be combined so that their effects are aggregated when applied against a given set of URLs. - + - There + There are three action files included with Privoxy with differing purposes: @@ -1813,7 +2757,7 @@ for details. content modification, cookie handling etc should be applied by default. It should be the first actions file loaded - + default.action - defines many exceptions (both @@ -1822,15 +2766,15 @@ for details. work reasonably well as-is for most users. This file is only supposed to be edited by the developers. It should be the second actions file loaded. - + - user.action - is intended to be for local site + user.action - is intended to be for local site preferences and exceptions. As an example, if your ISP or your bank - has specific requirements, and need special handling, this kind of + has specific requirements, and need special handling, this kind of thing should go here. This file will not be upgraded. - + Edit Set to Cautious Set to Medium Set to Advanced @@ -1838,16 +2782,16 @@ for details. These have increasing levels of aggressiveness and have no influence on your browsing unless you select them explicitly in the - editor. A default installation should be pre-set to + editor. A default installation should be pre-set to Cautious. New users should try this for a while before - adjusting the settings to more aggressive levels. The more aggressive - the settings, then the more likelihood there is of problems such as sites + adjusting the settings to more aggressive levels. The more aggressive + the settings, then the more likelihood there is of problems such as sites not working as they should. - The Edit button allows you to turn each + The Edit button allows you to turn each action on/off individually for fine-tuning. The Cautious - button changes the actions list to low/safe settings which will activate + button changes the actions list to low/safe settings which will activate ad blocking and a minimal set of &my-app;'s features, and subsequently there will be less of a chance for accidental problems. The Medium button sets the list to a medium level of @@ -1918,7 +2862,7 @@ for details. blocks only blocks only - + Privacy Features low @@ -1987,12 +2931,12 @@ for details.
- + - + - The list of actions files to be used are defined in the main configuration + The list of actions files to be used are defined in the main configuration file, and are processed in the order they are defined (e.g. default.action is typically processed before user.action). The content of these can all be viewed and @@ -2003,7 +2947,7 @@ for details. (defined in default.action), followed by any exceptions (typically also in default.action), which are then followed lastly by any - local preferences (typically in user.action). + local preferences (typically in user.action). Generally, user.action has the last word. @@ -2013,7 +2957,7 @@ for details. alias section at the top of that file. Then comes the default set of rules which will apply universally to all sites and pages (be very careful with using such a - universal set in user.action or any other actions file after + universal set in user.action or any other actions file after default.action, because it will override the result from consulting any previous file). And then below that, exceptions to the defined universal policies. You can regard @@ -2022,7 +2966,7 @@ for details. personal settings across Privoxy upgrades easier. - + Actions can be used to block anything you want, including ads, banners, or just some obnoxious URL whose content you would rather not see. Cookies can be accepted or rejected, or accepted only during the current browser session (i.e. not @@ -2038,7 +2982,7 @@ for details. Note that some actions, like cookie suppression or script disabling, may render some sites unusable that rely on these techniques to work properly. Finding the right mix of actions is not always easy and - certainly a matter of personal taste. And, things can always change, requiring + certainly a matter of personal taste. And, things can always change, requiring refinements in the configuration. In general, it can be said that the more aggressive your default settings (in the top section of the actions file) are, the more exceptions for trusted sites you @@ -2070,13 +3014,13 @@ for details. like Cautious, Medium or Advanced. Warning: the Advanced setting is more aggressive, and will be more likely to cause problems for some sites. - Experienced users only! + Experienced users only! If you prefer plain text editing to GUIs, you can of course also directly edit the the actions files with your favorite text editor. Look at - default.action which is richly commented with many + default.action which is richly commented with many good examples. @@ -2104,12 +3048,12 @@ for details. If multiple applying sections set the same action differently, the last match wins. If not, the effects are aggregated. - E.g. a URL might match a regular section with a heading line of { + E.g. a URL might match a regular section with a heading line of { +handle-as-image }, then later another one with just { +block }, resulting - in both actions to apply. And there may well be - cases where you will want to combine actions together. Such a section then + in both actions to apply. And there may well be + cases where you will want to combine actions together. Such a section then might look like: @@ -2136,7 +3080,7 @@ for details. Patterns - + As mentioned, Privoxy uses patterns to determine what actions might apply to which sites and pages your browser attempts to access. These patterns use wild @@ -2144,23 +3088,29 @@ for details. flexibility. This allows one expression to be expanded and potentially match against many similar patterns. - + Generally, an URL pattern has the form - <domain>/<path>, where both the - <domain> and <path> are - optional. (This is why the special / pattern matches all - URLs). Note that the protocol portion of the URL pattern (e.g. - http://) should not be included in - the pattern. This is assumed already! + <domain><port>/<path>, where the + <domain>, the <port> + and the <path> are optional. (This is why the special + / pattern matches all URLs). Note that the protocol + portion of the URL pattern (e.g. http://) should + not be included in the pattern. This is assumed already! The pattern matching syntax is different for the domain and path parts of - the URL. The domain part uses a simple globbing type matching technique, - while the path part uses more flexible + the URL. The domain part uses a simple globbing type matching technique, + while the path part uses more flexible Regular Expressions (POSIX 1003.2). + + The port part of a pattern is a decimal port number preceded by a colon + (:). If the domain part contains a numerical IPv6 address, + it has to be put into angle brackets + (<, >). + @@ -2169,7 +3119,7 @@ for details. is a domain-only pattern and will match any request to www.example.com, regardless of which document on that server is requested. So ALL pages in - this domain would be covered by the scope of this action. Note that a + this domain would be covered by the scope of this action. Note that a simple example.com is different and would NOT match. @@ -2210,12 +3160,38 @@ for details. + + / + + + Matches any URL because there's no requirement for either the + domain or the path to match anything. + + + + + :8000/ + + + Matches any URL pointing to TCP port 8000. + + + + + <2001:db8::1>/ + + + Matches any URL with the host address 2001:db8::1. + (Note that the real URL uses plain brackets, not angle brackets.) + + + index.html matches nothing, since it would be interpreted as a domain name and - there is no top-level domain called .html. So its + there is no top-level domain called .html. So its a mistake. @@ -2228,7 +3204,7 @@ for details. The matching of the domain part offers some flexible options: if the - domain starts or ends with a dot, it becomes unanchored at that end. + domain starts or ends with a dot, it becomes unanchored at that end. For example: @@ -2266,7 +3242,7 @@ for details. a domain.) This might be www.example.com, news.example.de, or www.example.net/cgi/testing.pl for instance. All these - cases are matched. + cases are matched. @@ -2276,12 +3252,12 @@ for details. Additionally, there are wild-cards that you can use in the domain names themselves. These work similarly to shell globbing type wild-cards: * represents zero or more arbitrary characters (this is - equivalent to the + equivalent to the Regular Expression based syntax of .*), ? represents any single character (this is equivalent to the regular expression syntax of a simple .), and you can define - character classes in square brackets which is similar to + character classes in square brackets which is similar to the same regular expression technique. All of this can be freely mixed: @@ -2290,7 +3266,7 @@ for details. ad*.example.com - matches adserver.example.com, + matches adserver.example.com, ads.example.com, etc but not sfads.example.com @@ -2308,7 +3284,7 @@ for details. matches www.ipix.com, - pictures.epix.com, a.b.c.d.e.upix.com etc. + pictures.epix.com, a.b.c.d.e.upix.com etc. @@ -2316,9 +3292,9 @@ for details. www[1-9a-ez].example.c* - matches www1.example.com, - www4.example.cc, wwwd.example.cy, - wwwz.example.com etc., but not + matches www1.example.com, + www4.example.cc, wwwd.example.cy, + wwwz.example.com etc., but not wwww.example.com. @@ -2352,13 +3328,13 @@ for details. Note that the path pattern is automatically left-anchored at the /, - i.e. it matches as if it would start with a ^ (regular expression speak + i.e. it matches as if it would start with a ^ (regular expression speak for the beginning of a line). Please also note that matching in the path is CASE INSENSITIVE - by default, but you can switch to case sensitive at any point in the pattern by using the + by default, but you can switch to case sensitive at any point in the pattern by using the (?-i) switch: www.example.com/(?-i)PaTtErN.* will match only documents whose path starts with PaTtErN in exactly this capitalization. @@ -2369,7 +3345,7 @@ for details. .example.com/.* - Is equivalent to just .example.com, since any documents + Is equivalent to just .example.com, since any documents within that domain are matched with or without the .* regular expression. This is redundant @@ -2383,9 +3359,9 @@ for details. named index.html, and that is part of some path. For example, it matches www.example.com/testing/index.html but NOT www.example.com/index.html because the regular - expression called for at least two /'s, thus the path - requirement. It also would match - www.example.com/testing/index_html, because of the + expression called for at least two /'s, thus the path + requirement. It also would match + www.example.com/testing/index_html, because of the special meta-character .. @@ -2394,9 +3370,9 @@ for details. .example.com/(.*/)?index\.html$ - This regular expression is conditional so it will match any page - named index.html regardless of path which in this case can - have one or more /'s. And this one must contain exactly + This regular expression is conditional so it will match any page + named index.html regardless of path which in this case can + have one or more /'s. And this one must contain exactly .html (but does not have to end with that!). @@ -2406,7 +3382,7 @@ for details. This regular expression will match any path of example.com - that contains any of the words ads, banner, + that contains any of the words ads, banner, banners (because of the ?) or junk. The path does not have to end in these words, just contain them. @@ -2416,8 +3392,8 @@ for details. .example.com/(.*/)(ads|banners?|junk)/.*\.(jpe?g|gif|png)$ - This is very much the same as above, except now it must end in either - .jpg, .jpeg, .gif or .png. So this + This is very much the same as above, except now it must end in either + .jpg, .jpeg, .gif or .png. So this one is limited to common image formats. @@ -2425,7 +3401,7 @@ for details. - There are many, many good examples to be found in default.action, + There are many, many good examples to be found in default.action, and more tutorials below in Appendix on regular expressions. @@ -2515,23 +3491,23 @@ for details. - + Again, actions are invoked by placing them on a line, enclosed in curly braces and - separated by whitespace, like in + separated by whitespace, like in {+some-action -some-other-action{some-parameter}}, followed by a list of URL patterns, one per line, to which they apply. Together, the actions line and the following pattern lines make up a section - of the actions file. + of the actions file. - + Actions fall into three categories: - + Boolean, i.e the action can only be enabled or disabled. Syntax: @@ -2540,14 +3516,14 @@ for details. +name # enable action name -name # disable action name - + Example: +handle-as-image - + Parameterized, where some value is required in order to enable this type of action. Syntax: @@ -2561,13 +3537,13 @@ for details. Note that if the URL matches multiple positive forms of a parameterized action, the last match wins, i.e. the params from earlier matches are simply ignored. - + Example: +hide-user-agent{Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.4) Gecko/20070602 Firefox/2.0.0.4} - + - + Multi-value. These look exactly like parameterized actions, but they behave differently: If the action applies multiple times to the same URL, but with different parameters, all the parameters @@ -2582,7 +3558,7 @@ for details. # If it was the last one left, disable the action. -name # disable this action completely and remove all parameters from the list - + Examples: +add-header{X-Fun-Header: Some text} and +filter{html-annoyances} @@ -2601,8 +3577,8 @@ for details. Later defined action sections always over-ride earlier ones of the same type. - So exceptions to any rules you make, should come in the latter part of the file (or - in a file that is processed later when using multiple actions files such + So exceptions to any rules you make, should come in the latter part of the file (or + in a file that is processed later when using multiple actions files such as user.action). For multi-valued actions, the actions are applied in the order they are specified. Actions files are processed in the order they are defined in config (the default @@ -2654,7 +3630,7 @@ for details. Multi-value. - + Parameter: @@ -2665,16 +3641,19 @@ for details. - + Notes: - This action may be specified multiple times, in order to define multiple - headers. This is rarely needed for the typical user. If you don't know what - HTTP headers are, you definitely don't need to worry about this + This action may be specified multiple times, in order to define multiple + headers. This is rarely needed for the typical user. If you don't know what + HTTP headers are, you definitely don't need to worry about this one. + + Headers added by this action are not modified by other actions. + @@ -2712,10 +3691,10 @@ for details. the handle-as-image, set-image-blocker, and + linkend="set-image-blocker">set-image-blocker, and handle-as-empty-document actions. - + @@ -2734,7 +3713,7 @@ for details. A block reason that should be given to the user. - + Notes: @@ -2745,18 +3724,18 @@ for details. to the blocked content (the latter only if the force feature is available and enabled). - - A very important exception occurs if both + + A very important exception occurs if both block and handle-as-image, - apply to the same request: it will then be replaced by an image. If + apply to the same request: it will then be replaced by an image. If set-image-blocker (see below) also applies, the type of image will be determined by its parameter, if not, the standard checkerboard pattern is sent. - It is important to understand this process, in order - to understand how Privoxy deals with - ads and other unwanted content. Blocking is a core feature, and one + It is important to understand this process, in order + to understand how Privoxy deals with + ads and other unwanted content. Blocking is a core feature, and one upon which various other features depend. @@ -2777,12 +3756,12 @@ for details. # Block and replace with "blocked" page .nasty-stuff.example.com -{+block{Doubleclick banners.} +handle-as-image} +{+block{Doubleclick banners.} +handle-as-image} # Block and replace with image .ad.doubleclick.net .ads.r.us/banners/ -{+block{Layered ads.} +handle-as-empty-document} +{+block{Layered ads.} +handle-as-empty-document} # Block and then ignore adserver.example.net/.*\.js$ @@ -2840,7 +3819,7 @@ for details. - + Notes: @@ -2905,7 +3884,7 @@ for details. - + Notes: @@ -2970,7 +3949,7 @@ for details. Client headers to which this action applies are filtered on-the-fly through the specified regular expression based substitutions, the result is used as - tag. + tag. @@ -2992,7 +3971,7 @@ for details. - + Notes: @@ -3077,11 +4056,11 @@ TAG:^User-Agent: MPlayer/ Parameter: - Any string. - + Any string. + - + Notes: @@ -3090,7 +4069,7 @@ TAG:^User-Agent: MPlayer/ browser to decide what to do with the document. The value of this header can cause the browser to open a download menu instead of displaying the document by itself, even if the document's format is - supported by the browser. + supported by the browser. The declared content type can also affect which rendering mode @@ -3104,13 +4083,13 @@ TAG:^User-Agent: MPlayer/ Content-Type: text/html, you can use &my-app; to overwrite it with application/xml and validate the web master's claim inside your XHTML-supporting browser. - If the syntax is incorrect, the browser will complain loudly. + If the syntax is incorrect, the browser will complain loudly. You can also go the opposite direction: if your browser prints error messages instead of rendering a document falsely declared as XHTML, you can overwrite the content type with - text/html and have it rendered as broken HTML document. + text/html and have it rendered as broken HTML document. By default content-type-overwrite only replaces @@ -3128,7 +4107,7 @@ TAG:^User-Agent: MPlayer/ Of course you can apply content-type-overwrite to a whole site and then make URL based exceptions, but it's a lot - more work to get the same precision. + more work to get the same precision. @@ -3190,10 +4169,10 @@ new action Any string. - + - + Notes: @@ -3226,7 +4205,7 @@ new action Example usage (section): - # Block the non-existent "Privacy-Violation:" client header + # Block the non-existent "Privacy-Violation:" client header { +crunch-client-header{Privacy-Violation:} } / @@ -3273,10 +4252,10 @@ new action N/A - + - + Notes: @@ -3360,7 +4339,7 @@ new action - + Notes: @@ -3373,7 +4352,7 @@ new action It makes no sense at all to use this action in conjunction with the session-cookies-only action, - since it would prevent the session cookies from being set. See also + since it would prevent the session cookies from being set. See also filter-content-cookies. @@ -3427,10 +4406,10 @@ new action Any string. - + - + Notes: @@ -3511,7 +4490,7 @@ new action - + Notes: @@ -3579,7 +4558,7 @@ new action - + Notes: @@ -3647,16 +4626,26 @@ new action - + Notes: This is a left-over from the time when Privoxy didn't support important HTTP/1.1 features well. It is left here for the - unlikely case that you experience HTTP/1.1 related problems with some server - out there. Not all HTTP/1.1 features and requirements are supported yet, - so there is a chance you might need this action. + unlikely case that you experience HTTP/1.1-related problems with some server + out there. + + + Note that enabling this action is only a workaround. It should not + be enabled for sites that work without it. While it shouldn't break + any pages, it has an (usually negative) performance impact. + + + If you come across a site where enabling this action helps, please report it, + so the cause of the problem can be analyzed. If the problem turns out to be + caused by a bug in Privoxy it should be + fixed so the following release works without the work around. @@ -3727,7 +4716,7 @@ problem-host.example.com Notes: - + Many sites, like yahoo.com, don't just link to other sites. Instead, they will link to some script on their own servers, giving the destination as a parameter, which will then redirect you to the final target. URLs @@ -3745,7 +4734,7 @@ problem-host.example.com This feature is currently not very smart and is scheduled for improvement. If it is enabled by default, you will have to create some exceptions to - this action. It can lead to failures in several ways: + this action. It can lead to failures in several ways: Not every URLs with other URLs as parameters is evil. @@ -3786,7 +4775,7 @@ problem-host.example.com { +fast-redirects{simple-check} } - one.example.com + one.example.com { +fast-redirects{check-decoded-url} } another.example.com/testing @@ -3806,7 +4795,7 @@ problem-host.example.com Typical use: - Get rid of HTML and JavaScript annoyances, banner advertisements (by size), + Get rid of HTML and JavaScript annoyances, banner advertisements (by size), do fun text replacements, add personalized effects, etc. @@ -3831,17 +4820,17 @@ problem-host.example.com Parameterized. - + Parameter: The name of a content filter, as defined in the filter file. - Filters can be defined in one or more files as defined by the + Filters can be defined in one or more files as defined by the filterfile - option in the config file. - default.filter is the collection of filters - supplied by the developers. Locally defined filters should go + option in the config file. + default.filter is the collection of filters + supplied by the developers. Locally defined filters should go in their own file, such as user.filter. @@ -3850,38 +4839,39 @@ problem-host.example.com - + Notes: - For your convenience, there are a number of pre-defined filters available + For your convenience, there are a number of pre-defined filters available in the distribution filter file that you can use. See the examples below for a list. Filtering requires buffering the page content, which may appear to slow down page rendering since nothing is displayed until all content has - passed the filters. (It does not really take longer, but seems that way - since the page is not incrementally displayed.) This effect will be more - noticeable on slower connections. + passed the filters. (The total time until the page is completely rendered + doesn't change much, but it may be perceived as slower since the page is + not incrementally displayed.) + This effect will be more noticeable on slower connections. Rolling your own - filters requires a knowledge of + filters requires a knowledge of Regular - Expressions and + Expressions and HTML. - This is very powerful feature, and potentially very intrusive. + This is very powerful feature, and potentially very intrusive. Filters should be used with caution, and where an equivalent action is not available. - The amount of data that can be filtered is limited to the + The amount of data that can be filtered is limited to the buffer-limit - option in the main config file. The + option in the main config file. The default is 4096 KB (4 Megs). Once this limit is exceeded, the buffered - data, and all pending data, is passed through unfiltered. + data, and all pending data, is passed through unfiltered. Inappropriate MIME types, such as zipped files, are not filtered at all. @@ -3892,10 +4882,10 @@ problem-host.example.com by defining appropriate -filter exceptions. - Compressed content can't be filtered either, unless &my-app; - is compiled with zlib support (requires at least &my-app; 3.0.7), - in which case &my-app; will decompress the content before filtering - it. + Compressed content can't be filtered either, but if &my-app; + is compiled with zlib support and a supported compression algorithm + is used (gzip or deflate), &my-app; can first decompress the content + and then filter it. If you use a &my-app; version without zlib support, but want filtering to work on @@ -3904,11 +4894,11 @@ problem-host.example.com action in conjunction with filter. - Content filtering can achieve some of the same effects as the + Content filtering can achieve some of the same effects as the block - action, i.e. it can be used to block ads and banners. But the mechanism - works quite differently. One effective use, is to block ad banners - based on their size (see below), since many of these seem to be somewhat + action, i.e. it can be used to block ads and banners. But the mechanism + works quite differently. One effective use, is to block ad banners + based on their size (see below), since many of these seem to be somewhat standardized. @@ -3926,7 +4916,7 @@ problem-host.example.com Example usage (with filters from the distribution default.filter file). - See the Predefined Filters section for + See the Predefined Filters section for more explanation on each: @@ -4058,7 +5048,7 @@ new action Declares a document as text, even if the Content-Type: isn't detected as such. - + @@ -4090,7 +5080,7 @@ new action force-text-mode declares a document as text, without looking at the Content-Type: first. - + Think twice before activating this action. Filtering binary data with regular expressions can cause file damage. @@ -4098,7 +5088,7 @@ new action - + Example usage: @@ -4132,7 +5122,7 @@ new action Overrules the forward directives in the configuration file. - + @@ -4186,7 +5176,7 @@ new action file, but without the URL pattern. It can be used as replacement, but normally it's only used in cases where matching based on the request URL isn't sufficient. - + Please read the description for the forward directives before using this action. Forwarding to the wrong people will reduce your privacy and increase the @@ -4204,7 +5194,7 @@ new action - + Example usage: @@ -4298,7 +5288,7 @@ new action # Block all documents on example.org that end with ".js", -# but send an empty document instead of the usual HTML message. +# but send an empty document instead of the usual HTML message. {+block{Blocked JavaScript} +handle-as-empty-document} example.org/.*\.js$ @@ -4351,14 +5341,14 @@ example.org/.*\.js$ - + Notes: The below generic example section is actually part of default.action. It marks all URLs with well-known image file name extensions as images and should - be left intact. + be left intact. Users will probably only want to use the handle-as-image action in conjunction with @@ -4432,10 +5422,10 @@ new action Keyword: block, or any user defined value. - + - + Notes: @@ -4461,7 +5451,7 @@ new action to a rare language, you should consider that it helps to make your requests unique and thus easier to trace. If you don't plan to change this header frequently, - you should stick to a common language. + you should stick to a common language. @@ -4518,10 +5508,10 @@ new action Keyword: block, or any user defined value. - + - + Notes: @@ -4590,7 +5580,7 @@ new action Effect: - Deletes the If-Modified-Since: HTTP client header or modifies its value. + Deletes the If-Modified-Since: HTTP client header or modifies its value. @@ -4608,10 +5598,10 @@ new action Keyword: block, or a user defined value that specifies a range of hours. - + - + Notes: @@ -4699,12 +5689,12 @@ new action - + Notes: - The keyword block will completely remove the header + The keyword block will completely remove the header (not to be confused with the block action). @@ -4785,7 +5775,7 @@ new action - + Notes: @@ -4814,12 +5804,12 @@ new action will work with referrer checks, as long as content and valid referring page are on the same host. Most of the time that's the case. - + hide-referer is an alternate spelling of hide-referrer and the two can be can be freely substituted with each other. (referrer is the correct English spelling, however the HTTP specification has a bug - it - requires it to be spelled as referer.) + requires it to be spelled as referer.) @@ -4875,16 +5865,16 @@ new action - + Notes: - + This can lead to problems on web sites that depend on looking at this header in order to customize their content for different browsers (which, by the way, is NOT the right thing to do: good web sites - work browser-independently). + work browser-independently). @@ -4893,17 +5883,14 @@ new action not recommended. In single-user, single-browser setups, you might use it to delete your OS version information from the headers, because it is an invitation to exploit known bugs for your - OS. It is also occasionally useful to forge this in order to access - sites that won't let you in otherwise (though there may be a good - reason in some cases). Example of this: some MSN sites will not - let Mozilla enter, yet forging to a - Netscape 6.1 user-agent works just fine. - (Must be just a silly MS goof, I'm sure :-). + OS. It is also occasionally useful to forge this in order to access + sites that won't let you in otherwise (though there may be a good + reason in some cases). - More information on known user-agent strings can be found at + More information on known user-agent strings can be found at http://www.user-agents.org/ - and + and http://en.wikipedia.org/wiki/User_agent. @@ -4959,7 +5946,7 @@ new action - + Notes: @@ -5042,7 +6029,7 @@ new action - + Notes: @@ -5062,7 +6049,7 @@ new action Most text-based instances compress very well, the size is seldom decreased by less than 50%, for markup-heavy instances like news feeds saving more than 90% of the original size isn't - unusual. + unusual. Not using compression will therefore slow down the transfer, and you should only @@ -5127,7 +6114,7 @@ new action Effect: - Deletes the Last-Modified: HTTP server header or modifies its value. + Deletes the Last-Modified: HTTP server header or modifies its value. @@ -5146,10 +6133,10 @@ new action One of the keywords: block, reset-to-request-time and randomize - + - + Notes: @@ -5165,7 +6152,7 @@ new action between the original value and the current time. In theory the server could send each document with a different Last-Modified: header to track visits without using cookies. Randomize - makes it impossible and the browser can still revalidate cached documents. + makes it impossible and the browser can still revalidate cached documents. reset-to-request-time overwrites the value of the @@ -5181,7 +6168,7 @@ new action of the request, the random range becomes zero and the value stays the same. Therefore you should later randomize it a second time with hided-if-modified-since, - just to be sure. + just to be sure. It is also recommended to use this action together with @@ -5248,7 +6235,7 @@ new action - + Notes: @@ -5357,7 +6344,7 @@ www.privoxy.org/user-manual/ - + Notes: @@ -5440,7 +6427,7 @@ example.org/instance-that-is-delivered-as-xml-but-is-not - + Notes: @@ -5491,7 +6478,7 @@ example.org/instance-that-is-delivered-as-xml-but-is-not Allow only temporary session cookies (for the current - browser session only). + browser session only). @@ -5523,12 +6510,12 @@ example.org/instance-that-is-delivered-as-xml-but-is-not - + Notes: - This is less strict than crunch-incoming-cookies / + This is less strict than crunch-incoming-cookies / crunch-outgoing-cookies and allows you to browse websites that insist or rely on setting cookies, without compromising your privacy too badly. @@ -5536,7 +6523,7 @@ example.org/instance-that-is-delivered-as-xml-but-is-not Most browsers will not permanently store cookies that have been processed by session-cookies-only and will forget about them between sessions. This makes profiling cookies useless, but won't break sites which require cookies so - that you can log in for transactions. This is generally turned on for all + that you can log in for transactions. This is generally turned on for all sites, and is the recommended setting. @@ -5555,9 +6542,9 @@ example.org/instance-that-is-delivered-as-xml-but-is-not These would have to be removed manually. - Privoxy also uses - the content-cookies filter - to block some types of cookies. Content cookies are not effected by + Privoxy also uses + the content-cookies filter + to block some types of cookies. Content cookies are not effected by session-cookies-only. @@ -5631,7 +6618,7 @@ example.org/instance-that-is-delivered-as-xml-but-is-not target-url to send a redirect to target-url. You can redirect - to any image anywhere, even in your local filesystem via file:/// URL. + to any image anywhere, even in your local filesystem via file:/// URL. (But note that not all browsers support redirecting to a local file system). @@ -5694,8 +6681,8 @@ example.org/instance-that-is-delivered-as-xml-but-is-not Summary Note that many of these actions have the potential to cause a page to - misbehave, possibly even not to display at all. There are many ways - a site designer may choose to design his site, and what HTTP header + misbehave, possibly even not to display at all. There are many ways + a site designer may choose to design his site, and what HTTP header content, and other criteria, he may depend on. There is no way to have hard and fast rules for all sites. See the Appendix for a brief example on troubleshooting @@ -5713,7 +6700,7 @@ example.org/instance-that-is-delivered-as-xml-but-is-not These can in turn be invoked just like the built-in actions. Currently, an alias name can contain any character except space, tab, =, - { and }, but we strongly + { and }, but we strongly recommend that you only use a to z, 0 to 9, +, and -. Alias names are not case sensitive, and are not required to start with a @@ -5780,7 +6767,7 @@ example.org/instance-that-is-delivered-as-xml-but-is-not - ...and put them to use. These sections would appear in the lower part of an + ...and put them to use. These sections would appear in the lower part of an actions file and define exceptions to the default actions (as specified further up for the / pattern): @@ -5798,7 +6785,7 @@ example.org/instance-that-is-delivered-as-xml-but-is-not # Shopping sites: # Allow cookies (for setting and retrieving your customer data) - # + # {shop} .quietpc.com .worldpay.com # for quietpc.com @@ -5812,8 +6799,8 @@ example.org/instance-that-is-delivered-as-xml-but-is-not - Aliases like shop and fragile are typically used for - problem sites that require more than one action to be disabled + Aliases like shop and fragile are typically used for + problem sites that require more than one action to be disabled in order to function properly. @@ -5858,7 +6845,7 @@ hal stop here preceding the action name enables the action, a - disables!). Also note how this long line has been made more readable by splitting it into multiple lines with line continuation. - + @@ -5961,13 +6948,13 @@ mail.google.com require cookies to log in, and pop-up windows for shopping carts or item details. Again, we'll use a pre-defined alias: - + # Shopping sites: # { shop } -.quietpc.com +.quietpc.com .worldpay.com # for quietpc.com .jungle.com .scan.co.uk @@ -6036,7 +7023,7 @@ edit.*.yahoo.com # Known ad generators: # { +block-as-image } -ar.atwola.com +ar.atwola.com .ad.doubleclick.net .ad.*.doubleclick.net .a.yimg.com/(?:(?!/i/).)*$ @@ -6071,7 +7058,7 @@ bs*.gsanet.com { +block{Banner ads.} } # Generic patterns: -# +# ad*. .*ads. banner?. @@ -6092,7 +7079,7 @@ count*. But being very generic, they necessarily also catch URLs that we don't want - to block. The pattern .*ads. e.g. catches + to block. The pattern .*ads. e.g. catches nasty-ads.nasty-corp.com as intended, but also downloads.sourcefroge.net or adsl.some-provider.net. So here come some @@ -6119,7 +7106,7 @@ count*. ########################################################################## # By domain: -# +# { -block } adv[io]*. # (for advogato.org and advice.*) adsl. # (has nothing to do with ads) @@ -6169,13 +7156,13 @@ wiki. So far we are painting with a broad brush by setting general policies, - which would be a reasonable starting point for many people. Now, + which would be a reasonable starting point for many people. Now, you might want to be more specific and have customized rules that are more suitable to your personal habits and preferences. These would be for narrowly defined situations like your ISP or your bank, and should - be placed in user.action, which is parsed after all other + be placed in user.action, which is parsed after all other actions files and hence has the last word, over-riding any previously - defined actions. user.action is also a + defined actions. user.action is also a safe place for your personal settings, since default.action is actively maintained by the Privoxy developers and you'll probably want @@ -6184,7 +7171,7 @@ wiki. So let's look at a few examples of things that one might typically do in - user.action: + user.action: @@ -6207,8 +7194,8 @@ wiki. # (Re-)define aliases for this file: # {{alias}} -# -# These aliases just save typing later, and the alias names should +# +# These aliases just save typing later, and the alias names should # be self explanatory. # +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies @@ -6239,7 +7226,7 @@ handle-as-text = -filter +-block action. Say you've seen an ad on your favourite page on example.com that you want to get rid of. You have right-clicked the image, selected copy image location - and pasted the URL below while removing the leading http://, into a + and pasted the URL below while removing the leading http://, into a { +block{} } section. Note that { +handle-as-image } need not be specified, since all URLs ending in .gif will be tagged as images by the general rules as set @@ -6302,7 +7289,7 @@ stupid-server.example.com/ The URLs of dynamically generated banners, especially from large banner farms, often don't use the well-known image file name extensions, which makes it impossible for Privoxy to guess - the file type just by looking at the URL. + the file type just by looking at the URL. You can use the +block-as-image alias defined above for these cases. Note that objects which match this rule but then turn out NOT to be an @@ -6327,7 +7314,7 @@ stupid-server.example.com/ -- whoa! -- it worked. The fragile aliases disables those actions that are most likely to break a site. Also, good for testing purposes to see if it is Privoxy - that is causing the problem or not. We later find other regular sites + that is causing the problem or not. We later find other regular sites that misbehave, and add those to our personalized list of troublemakers: @@ -6372,19 +7359,19 @@ stupid-server.example.com/ { allow-ads } .sourceforge.net .slashdot.org - .osdn.net + .osdn.net - Note that allow-ads has been aliased to - -block, - -filter{banners-by-size}, and + Note that allow-ads has been aliased to + -block, + -filter{banners-by-size}, and -filter{banners-by-link} above. Invoke another alias here to force an over-ride of the MIME type - application/x-sh which typically would open a download type + application/x-sh which typically would open a download type dialog. In my case, I want to look at the shell script, and then I can save it should I choose to. @@ -6392,7 +7379,7 @@ stupid-server.example.com/ { handle-as-text } - /.*\.sh$ + /.*\.sh$ @@ -6427,7 +7414,7 @@ stupid-server.example.com/ On-the-fly text substitutions need - to be defined in a filter file. Once defined, they + to be defined in a filter file. Once defined, they can then be invoked as an action. @@ -6481,7 +7468,7 @@ stupid-server.example.com/ Substitutions are made at the source level, so if you want to roll - your own filters, you should first be familiar with HTML syntax, + your own filters, you should first be familiar with HTML syntax, and, of course, regular expressions. @@ -6491,7 +7478,7 @@ stupid-server.example.com/ here. Each filter consists of a heading line, that starts with one of the keywords FILTER:, CLIENT-HEADER-FILTER: or SERVER-HEADER-FILTER: - followed by the filter's name, and a short (one line) + followed by the filter's name, and a short (one line) description of what it does. Below that line come the jobs, i.e. lines that define the actual text substitutions. By convention, the name of a filter @@ -6506,7 +7493,7 @@ stupid-server.example.com/ +filter{name} in any actions file. - + Filter definitions start with a header line that contains the filter type, the filter name and the filter description. @@ -6530,13 +7517,13 @@ stupid-server.example.com/ - If you are new to + If you are new to Regular Expressions, you might want to take a look at the Appendix on regular expressions, and see the Perl manual for - the + the s/// operator's syntax and Perl-style regular expressions in general. @@ -6651,7 +7638,7 @@ s|(<script.*)document\.referrer(.*</script>)|$1"Not Your Business!"$2|U Now the pattern is deciphered, but wasn't this about substituting things? So lets look at the substitute: $1"Not Your Business!"$2 is - easy to read: The text remembered as $1, followed by + easy to read: The text remembered as $1, followed by "Not Your Business!" (including the quotation marks!), followed by the text remembered as $2. This produces an exact copy of the original string, with the middle part @@ -6718,7 +7705,7 @@ s/(<body [^>]*)onunload(.*>)/$1never$2/iU Note that the i option makes the pattern matching case-insensitive. Also note that ungreedy matching alone doesn't always guarantee a minimal match: In the first parenthesis, we had to use [^>]* - instead of .* to prevent the match from exceeding the + instead of .* to prevent the match from exceeding the <body> tag if it doesn't contain OnUnload, but the page's content does. @@ -6738,7 +7725,7 @@ s/microsoft(?!\.com)/MicroSuck/ig Note the (?!\.com) part (a so-called negative lookahead) - in the job's pattern, which means: Don't match, if the string + in the job's pattern, which means: Don't match, if the string .com appears directly following microsoft in the page. This prevents links to microsoft.com from being trashed, while still replacing the word everywhere else. @@ -6764,7 +7751,7 @@ s* industry[ -]leading \ The x option in this job turns on extended syntax, and allows for - e.g. the liberal use of (non-interpreted!) whitespace for nicer formatting. + e.g. the liberal use of (non-interpreted!) whitespace for nicer formatting. @@ -6776,11 +7763,11 @@ s* industry[ -]leading \ The Pre-defined Filters - @@ -6820,12 +7807,12 @@ pre-defined filters for your convenience: - Use with caution. This is an aggressive filter, and can break sites that + Use with caution. This is an aggressive filter, and can break sites that rely heavily on JavaScript. - + js-events @@ -6849,7 +7836,7 @@ pre-defined filters for your convenience: This filter will undo many common instances of HTML based abuse. - The BLINK and MARQUEE tags + The BLINK and MARQUEE tags are neutralized (yeah baby!), and browser windows will be created as resizeable (as of course they should be!), and will have location, scroll and menu bars -- even if specified otherwise. @@ -6870,9 +7857,9 @@ pre-defined filters for your convenience: This filter disables most HTML and JavaScript code that reads or sets - cookies. It cannot detect all clever uses of these types of code, so it + cookies. It cannot detect all clever uses of these types of code, so it should not be relied on as an absolute fix. Use it wherever you would also - use the cookie crunch actions. + use the cookie crunch actions. @@ -6881,8 +7868,8 @@ pre-defined filters for your convenience: refresh tags - Disable any refresh tags if the interval is greater than nine seconds (so - that redirections done via refresh tags are not destroyed). This is useful + Disable any refresh tags if the interval is greater than nine seconds (so + that redirections done via refresh tags are not destroyed). This is useful for dial-on-demand setups, or for those who find this HTML feature annoying. @@ -6893,9 +7880,9 @@ pre-defined filters for your convenience: unsolicited-popups - This filter attempts to prevent only unsolicited pop-up - windows from opening, yet still allow pop-up windows that the user - has explicitly chosen to open. It was added in version 3.0.1, + This filter attempts to prevent only unsolicited pop-up + windows from opening, yet still allow pop-up windows that the user + has explicitly chosen to open. It was added in version 3.0.1, as an improvement over earlier such filters. @@ -6906,7 +7893,7 @@ pre-defined filters for your convenience: This is recommended only for browsers that cannot perform this function - reliably themselves. And be aware that some sites require such windows + reliably themselves. And be aware that some sites require such windows in order to function normally. Use with caution. @@ -6939,7 +7926,7 @@ pre-defined filters for your convenience: banners-by-size - This filter removes image tags purely based on what size they are. Fortunately + This filter removes image tags purely based on what size they are. Fortunately for us, many ads and banner images tend to conform to certain standardized sizes, which makes this filter quite effective for ad stripping purposes. @@ -6948,7 +7935,7 @@ pre-defined filters for your convenience: but just happen to be of one of the standard banner sizes. - Recommended only for those who require extreme ad blocking. The default + Recommended only for those who require extreme ad blocking. The default block rules should catch 95+% of all ads without this filter enabled. @@ -6958,7 +7945,7 @@ pre-defined filters for your convenience: banners-by-link - This is an experimental filter that attempts to kill any banners if + This is an experimental filter that attempts to kill any banners if their URLs seem to point to known or suspected click trackers. It is currently not of much value and is not recommended for use by default. @@ -6969,7 +7956,7 @@ pre-defined filters for your convenience: webbugs - Webbugs are small, invisible images (technically 1X1 GIF images), that + Webbugs are small, invisible images (technically 1X1 GIF images), that are used to track users across websites, and collect information on them. As an HTML page is loaded by the browser, an embedded image tag causes the browser to contact a third-party site, disclosing the tracking information @@ -6988,7 +7975,7 @@ pre-defined filters for your convenience: A rather special-purpose filter that can be used to enlarge textareas (those - multi-line text boxes in web forms) and turn off hard word wrap in them. + multi-line text boxes in web forms) and turn off hard word wrap in them. It was written for the sourceforge.net tracker system where such boxes are a nuisance, but it can be handy on other sites, too. @@ -7032,20 +8019,20 @@ pre-defined filters for your convenience: Many Microsoft products that generate HTML use non-standard extensions (read: violations) of the ISO 8859-1 aka Latin-1 character set. This can cause those - HTML documents to display with errors on standard-compliant platforms. + HTML documents to display with errors on standard-compliant platforms. - This filter translates the MS-only characters into Latin-1 equivalents. - It is not necessary when using MS products, and will cause corruption of + This filter translates the MS-only characters into Latin-1 equivalents. + It is not necessary when using MS products, and will cause corruption of all documents that use 8-bit character sets other than Latin-1. It's mostly worthwhile for Europeans on non-MS platforms, if weird garbage characters - sometimes appear on some pages, or user agents that don't correct for this on + sometimes appear on some pages, or user agents that don't correct for this on the fly. +--> @@ -7055,7 +8042,7 @@ pre-defined filters for your convenience: A filter for shockwave haters. As the name suggests, this filter strips code - out of web pages that is used to embed shockwave flash objects. + out of web pages that is used to embed shockwave flash objects. @@ -7131,12 +8118,12 @@ pre-defined filters for your convenience: - + yahoo - Another CSS based block, this time for Yahoo text ads. And removes + Another CSS based block, this time for Yahoo text ads. And removes a width limitation as well. @@ -7146,7 +8133,7 @@ pre-defined filters for your convenience: msn - Another CSS based block, this time for MSN text ads. And removes + Another CSS based block, this time for MSN text ads. And removes tracking URLs, as well as a width limitation. @@ -7175,7 +8162,7 @@ pre-defined filters for your convenience: - + html-to-xml @@ -7254,13 +8241,13 @@ pre-defined filters for your convenience: Privoxy's Template Files - All Privoxy built-in pages, i.e. error pages such as the + All Privoxy built-in pages, i.e. error pages such as the 404 - No Such Domain error page, the BLOCKED page and all pages of its web-based - user interface, are generated from templates. + user interface, are generated from templates. (Privoxy must be running for the above links to work as intended.) @@ -7277,10 +8264,10 @@ pre-defined filters for your convenience: or exports), which Privoxy fills at run time. It is possible to edit the templates with a normal text editor, should you want to customize them. (Not recommended for the casual - user). Should you create your own custom templates, you should use + user). Should you create your own custom templates, you should use the config setting templdir to specify an alternate location, so your templates do not get overwritten - during upgrades. + during upgrades. Note that just like in configuration files, lines starting @@ -7412,7 +8399,7 @@ Requests expressions in its actions files and filter file, through the PCRE and - @@ -7439,7 +8426,7 @@ Requests To make a simple analogy, we do something similar when we use wild-card - characters when listing files with the dir command in DOS. + characters when listing files with the dir command in DOS. *.* matches all filenames. The special character here is the asterisk which matches any and all characters. We can be more specific and use ? to match just individual @@ -7450,7 +8437,7 @@ Requests Regular expressions do essentially the same thing, but are much, much more - powerful. There are many more special characters and ways of + powerful. There are many more special characters and ways of building complex patterns however. Let's look at a few of the common ones, and then some examples: @@ -7486,10 +8473,10 @@ Requests \ - The escape character denotes that - the following character should be taken literally. This is used where one of the + the following character should be taken literally. This is used where one of the special characters (e.g. .) needs to be taken literally and - not as a special meta-character. Example: example\.com, makes - sure the period is recognized only as a period (and not expanded to its + not as a special meta-character. Example: example\.com, makes + sure the period is recognized only as a period (and not expanded to its meta-character meaning of any single character). @@ -7498,7 +8485,7 @@ Requests [ ] - Characters enclosed in brackets will be matched if any of the enclosed characters are encountered. For instance, [0-9] - matches any numeric digit (zero through nine). As an example, we can combine + matches any numeric digit (zero through nine). As an example, we can combine this with + to match any digit one of more times: [0-9]+. @@ -7515,14 +8502,14 @@ Requests | - The bar character works like an or conditional statement. A match is successful if the sub-expression on either side of | matches. As an example: - /(this|that) example/ uses grouping and the bar character + /(this|that) example/ uses grouping and the bar character and would match either this example or that example, and nothing else. - These are just some of the ones you are likely to use when matching URLs with + These are just some of the ones you are likely to use when matching URLs with Privoxy, and is a long way from a definitive list. This is enough to get us started with a few simple examples which may be more illuminating: @@ -7530,12 +8517,12 @@ Requests /.*/banners/.* - A simple example - that uses the common combination of . and * to + that uses the common combination of . and * to denote any character, zero or more times. In other words, any string at all. - So we start with a literal forward slash, then our regular expression pattern + So we start with a literal forward slash, then our regular expression pattern (.*) another literal forward slash, the string banners, another forward slash, and lastly another - .*. We are building + .*. We are building a directory path here. This will match any file with the path that has a directory named banners in it. The .* matches any characters, and this could conceivably be more forward slashes, so it @@ -7551,14 +8538,14 @@ Requests - /.*/adv((er)?ts?|ertis(ing|ements?))?/ - + /.*/adv((er)?ts?|ertis(ing|ements?))?/ - We have several literal forward slashes again (/), so we are - building another expression that is a file path statement. We have another + building another expression that is a file path statement. We have another .*, so we are matching against any conceivable sub-path, just so it matches our expression. The only true literal that must match our pattern is adv, together with the forward slashes. What comes after the adv string is the - interesting part. + interesting part. @@ -7568,29 +8555,29 @@ Requests ((er)?ts?|ertis(ing|ements?)) is optional, as are the individual sub-expressions: (er), (ing|ements?), and the s. The | - means or. We have two of those. For instance, - (ing|ements?), can expand to match either ing + means or. We have two of those. For instance, + (ing|ements?), can expand to match either ing OR ements?. What is being done here, is an - attempt at matching as many variations of advertisement, and + attempt at matching as many variations of advertisement, and similar, as possible. So this would expand to match just adv, or advert, or adverts, or advertising, or advertisement, or - advertisements. You get the idea. But it would not match + advertisements. You get the idea. But it would not match advertizements (with a z). We could fix that by - changing our regular expression to: + changing our regular expression to: /.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/, which would then match either spelling. - /.*/advert[0-9]+\.(gif|jpe?g) - Again - another path statement with forward slashes. Anything in the square brackets + /.*/advert[0-9]+\.(gif|jpe?g) - Again + another path statement with forward slashes. Anything in the square brackets [ ] can be matched. This is using 0-9 as a shorthand expression to mean any digit one through nine. It is the same as saying 0123456789. So any digit matches. The + - means one or more of the preceding expression must be included. The preceding - expression here is what is in the square brackets -- in this case, any digit - one through nine. Then, at the end, we have a grouping: (gif|jpe?g). + means one or more of the preceding expression must be included. The preceding + expression here is what is in the square brackets -- in this case, any digit + one through nine. Then, at the end, we have a grouping: (gif|jpe?g). This includes a |, so this needs to match the expression on either side of that bar character also. A simple gif on one side, and the other side will in turn match either jpeg or jpg, @@ -7620,7 +8607,7 @@ Requests - More reading on Perl Compatible Regular expressions: + More reading on Perl Compatible Regular expressions: http://perldoc.perl.org/perlre.html @@ -7639,22 +8626,22 @@ Requests Privoxy's Internal Pages - Since Privoxy proxies each requested - web page, it is easy for Privoxy to + Since Privoxy proxies each requested + web page, it is easy for Privoxy to trap certain special URLs. In this way, we can talk directly to - Privoxy, and see how it is - configured, see how our rules are being applied, change these + Privoxy, and see how it is + configured, see how our rules are being applied, change these rules and other configuration options, and even turn - Privoxy's filtering off, all with + Privoxy's filtering off, all with a web browser. - The URLs listed below are the special ones that allow direct access + The URLs listed below are the special ones that allow direct access to Privoxy. Of course, - Privoxy must be running to access these. If - not, you will get a friendly error message. Internet access is not + Privoxy must be running to access these. If + not, you will get a friendly error message. Internet access is not necessary either. @@ -7662,11 +8649,11 @@ Requests - - Privoxy main page: + + Privoxy main page:
- + http://config.privoxy.org/
@@ -7678,77 +8665,77 @@ Requests
- - Show information about the current configuration, including viewing and + + Show information about the current configuration, including viewing and editing of actions files:
- + http://config.privoxy.org/show-status
- + - + Show the source code version numbers:
- + http://config.privoxy.org/show-version
- + - + Show the browser's request headers:
- + http://config.privoxy.org/show-request
- + - + Show which actions apply to a URL and why:
- + http://config.privoxy.org/show-url-info
- + - - Toggle Privoxy on or off. This feature can be turned off/on in the main + + Toggle Privoxy on or off. This feature can be turned off/on in the main config file. When toggled off, Privoxy continues to run, but only as a pass-through proxy, with no actions taking place:
- + http://config.privoxy.org/toggle
- Short cuts. Turn off, then on: + Short cuts. Turn off, then on:
- + http://config.privoxy.org/toggle?set=disable
- + http://config.privoxy.org/toggle?set=enable
- +
@@ -7773,7 +8760,7 @@ Requests the bookmark may not be safe - just click OK. Then you can run the Bookmarklet directly from your favorites/bookmarks. For even faster access, you can put them on the Links bar (IE) or the Personal - Toolbar (Netscape), and run them with a single click. + Toolbar (Netscape), and run them with a single click. @@ -7784,47 +8771,47 @@ Requests Privoxy - Enable -
+
Privoxy - Disable - + Privoxy - Toggle Privoxy (Toggles between enabled and disabled) - + Privoxy- View Status - + + + --> Privoxy - Why? - + Credit: The site which gave us the general idea for these bookmarklets is www.bookmarklets.com. They - have more information about bookmarklets. + have more information about bookmarklets. @@ -7837,7 +8824,7 @@ Requests Chain of Events - Let's take a quick look at how some of Privoxy's + Let's take a quick look at how some of Privoxy's core features are triggered, and the ensuing sequence of events when a web page is requested by your browser: @@ -7846,48 +8833,48 @@ Requests - First, your web browser requests a web page. The browser knows to send - the request to Privoxy, which will in turn, - relay the request to the remote web server after passing the following - tests: + First, your web browser requests a web page. The browser knows to send + the request to Privoxy, which will in turn, + relay the request to the remote web server after passing the following + tests: - + - Privoxy traps any request for its own internal CGI + Privoxy traps any request for its own internal CGI pages (e.g http://p.p/) and sends the CGI page back to the browser. - + - Next, Privoxy checks to see if the URL + Next, Privoxy checks to see if the URL matches any +block patterns. If so, the URL is then blocked, and the remote web server will not be contacted. - +handle-as-image - and + +handle-as-image + and +handle-as-empty-document - are then checked, and if there is no match, an + are then checked, and if there is no match, an HTML BLOCKED page is sent back to the browser. Otherwise, if it does match, an image is returned for the former, and an empty text document for the latter. The type of image would depend on the setting of +set-image-blocker (blank, checkerboard pattern, or an HTTP redirect to an image elsewhere). - + Untrusted URLs are blocked. If URLs are being added to the trust file, then that is done. - + If the URL pattern matches the +fast-redirects action, it is then processed. Unwanted parts of the requested URL are stripped. - + Now the rest of the client browser's request headers are processed. If any @@ -7896,24 +8883,24 @@ Requests etc.), headers are suppressed or forged as determined by these actions and their parameters. - + Now the web server starts sending its response back (i.e. typically a web page). - + First, the server headers are read and processed to determine, among other things, the MIME type (document type) and encoding. The headers are then - filtered as determined by the + filtered as determined by the +crunch-incoming-cookies, +session-cookies-only, and +downgrade-http-version actions. - + If any +filter action @@ -7926,35 +8913,35 @@ Requests they are specified in one of the filter files. Animated GIFs, if present, are reduced to either the first or last frame, depending on the action setting.The entire page, which is now filtered, is then sent by - Privoxy back to your browser. + Privoxy back to your browser. If neither a +filter action or +deanimate-gifs - matches, then Privoxy passes the raw data through + matches, then Privoxy passes the raw data through to the client browser as it becomes available. - + - As the browser receives the now (possibly filtered) page content, it + As the browser receives the now (possibly filtered) page content, it reads and then requests any URLs that may be embedded within the page source, e.g. ad images, stylesheets, JavaScript, other HTML documents (e.g. frames), sounds, etc. For each of these objects, the browser issues a separate request (this is easily viewable in Privoxy's logs). And each such request is in turn processed just as above. Note that a - complex web page will have many, many such embedded URLs. If these - secondary requests are to a different server, then quite possibly a very + complex web page will have many, many such embedded URLs. If these + secondary requests are to a different server, then quite possibly a very differing set of actions is triggered. - - + + NOTE: This is somewhat of a simplistic overview of what happens with each URL - request. For the sake of brevity and simplicity, we have focused on + request. For the sake of brevity and simplicity, we have focused on Privoxy's core features only. @@ -7966,7 +8953,7 @@ Requests Troubleshooting: Anatomy of an Action - The way Privoxy applies + The way Privoxy applies actions and filters to any given URL can be complex, and not always so easy to understand what is happening. And sometimes we need to be able to @@ -7975,16 +8962,16 @@ Requests is causing us a problem inadvertently. It can be a little daunting to look at the actions and filters files themselves, since they tend to be filled with regular expressions whose consequences are not - always so obvious. + always so obvious. - One quick test to see if Privoxy is causing a problem - or not, is to disable it temporarily. This should be the first troubleshooting - step. See the Bookmarklets section on a quick - and easy way to do this (be sure to flush caches afterward!). Looking at the - logs is a good idea too. (Note that both the toggle feature and logging are - enabled via config file settings, and may need to be + One quick test to see if Privoxy is causing a problem + or not, is to disable it temporarily. This should be the first troubleshooting + step. See the Bookmarklets section on a quick + and easy way to do this (be sure to flush caches afterward!). Looking at the + logs is a good idea too. (Note that both the toggle feature and logging are + enabled via config file settings, and may need to be turned on.) @@ -7996,7 +8983,7 @@ Requests - Privoxy also provides the + Privoxy also provides the http://config.privoxy.org/show-url-info page that can show us very specifically how actions are being applied to any given URL. This is a big help for troubleshooting. @@ -8004,7 +8991,7 @@ Requests First, enter one URL (or partial URL) at the prompt, and then - Privoxy will tell us + Privoxy will tell us how the current configuration will handle it. This will not help with filtering effects (i.e. the +filter action) from @@ -8020,8 +9007,8 @@ Requests - Let's try an example, google.com, - and look at it one section at a time in a sample configuration (your real + Let's try an example, google.com, + and look at it one section at a time in a sample configuration (your real configuration may vary): @@ -8045,7 +9032,7 @@ Requests +session-cookies-only +set-image-blocker {pattern} / - + { -session-cookies-only } .google.com @@ -8053,17 +9040,17 @@ Requests .google.com In file: user.action [ View ] [ Edit ] -(no matches in this file) +(no matches in this file) - This is telling us how we have defined our + This is telling us how we have defined our actions, and - which ones match for our test case, google.com. + which ones match for our test case, google.com. Displayed is all the actions that are available to us. Remember, the + sign denotes on. - - denotes off. So some are on here, but many + denotes off. So some are on here, but many are off. Each example we try may provide a slightly different end result, depending on our configuration directives. @@ -8091,7 +9078,7 @@ In file: user.action [ View ] [ Edit ].google.com. This will match any hosts and sub-domains, in the google.com domain also, such as - www.google.com or mail.google.com. But it would not + www.google.com or mail.google.com. But it would not match www.google.de! So, apparently, we have these two actions defined as exceptions to the general rules at the top somewhere in the lower part of our default.action file, and @@ -8101,7 +9088,7 @@ In file: user.action [ View ] [ Edit ] Then, for our user.action file, we again have no hits. So there is nothing google-specific that we might have added to our own, local - configuration. If there was, those actions would over-rule any actions from + configuration. If there was, those actions would over-rule any actions from previously processed files, such as default.action. user.action typically has the last word. This is the best place to put hard and fast exceptions, @@ -8109,7 +9096,7 @@ In file: user.action [ View ] [ Edit ] And finally we pull it all together in the bottom section and summarize how - Privoxy is applying all its actions + Privoxy is applying all its actions to google.com: @@ -8118,10 +9105,10 @@ In file: user.action [ View ] [ Edit ] Final results: - + -add-header -block - +change-x-forwarded-for{block} + +change-x-forwarded-for{block} -client-header-filter{hide-tor-exit-notation} -content-type-overwrite -crunch-client-header @@ -8172,15 +9159,15 @@ In file: user.action [ View ] [ Edit ] - Notice the only difference here to the previous listing, is to + Notice the only difference here to the previous listing, is to fast-redirects and session-cookies-only, - which are activated specifically for this site in our configuration, + which are activated specifically for this site in our configuration, and thus show in the Final Results. @@ -8203,25 +9190,25 @@ In file: user.action [ View ] [ Edit ] - We'll just show the interesting part here - the explicit matches. It is - matched three different times. Two +block{} sections, + We'll just show the interesting part here - the explicit matches. It is + matched three different times. Two +block{} sections, and a +block{} +handle-as-image, - which is the expanded form of one of our aliases that had been defined as: + which is the expanded form of one of our aliases that had been defined as: +block-as-image. (Aliases are defined in - the first section of the actions file and typically used to combine more + the first section of the actions file and typically used to combine more than one action.) - Any one of these would have done the trick and blocked this as an unwanted - image. This is unnecessarily redundant since the last case effectively - would also cover the first. No point in taking chances with these guys - though ;-) Note that if you want an ad or obnoxious + Any one of these would have done the trick and blocked this as an unwanted + image. This is unnecessarily redundant since the last case effectively + would also cover the first. No point in taking chances with these guys + though ;-) Note that if you want an ad or obnoxious URL to be invisible, it should be defined as ad.doubleclick.net is done here -- as both a +block{} - and an + and an +handle-as-image. The custom alias +block-as-image just simplifies the process and make it more readable. @@ -8239,9 +9226,9 @@ In file: user.action [ View ] [ Edit ][ View ] [ Edit ] - {-add-header + {-add-header -block - +change-x-forwarded-for{block} + +change-x-forwarded-for{block} -client-header-filter{hide-tor-exit-notation} -content-type-overwrite -crunch-client-header @@ -8249,8 +9236,8 @@ In file: user.action [ View ] [ Edit ][ View ] [ Edit ][ View ] [ Edit ] - Ooops, the /adsl/ is matching /ads in our + Ooops, the /adsl/ is matching /ads in our configuration! But we did not want this at all! Now we see why we get the - blank page. It is actually triggering two different actions here, and - the effects are aggregated so that the URL is blocked, and &my-app; is told + blank page. It is actually triggering two different actions here, and + the effects are aggregated so that the URL is blocked, and &my-app; is told to treat the block as if it were an image. But this is, of course, all wrong. We could now add a new action below this (or better in our own user.action file) that explicitly @@ -8323,14 +9310,14 @@ In file: user.action [ View ] [ Edit ] - Now the page displays ;-) + Now the page displays ;-) Remember to flush your browser's caches when making these kinds of changes to your configuration to insure that you get a freshly delivered page! Or, try using Shift+Reload. - But now what about a situation where we get no explicit matches like + But now what about a situation where we get no explicit matches like we did with: @@ -8344,7 +9331,7 @@ In file: user.action [ View ] [ Edit ] That actually was very helpful and pointed us quickly to where the problem - was. If you don't get this kind of match, then it means one of the default + was. If you don't get this kind of match, then it means one of the default rules in the first section of default.action is causing the problem. This would require some guesswork, and maybe a little trial and error to isolate the offending rule. One likely cause would be one of the @@ -8367,7 +9354,7 @@ In file: user.action [ View ] [ Edit ] - { shop } is an alias that expands to + { shop } is an alias that expands to { -filter -session-cookies-only }. Or you could do your own exception to negate filtering: @@ -8388,23 +9375,23 @@ In file: user.action [ View ] [ Edit ]user.action, for local site exceptions. Note that when a simple domain pattern is used by itself (without - the subsequent path portion), all sub-pages within that domain are included + the subsequent path portion), all sub-pages within that domain are included automatically in the scope of the action. - Images that are inexplicably being blocked, may well be hitting the + Images that are inexplicably being blocked, may well be hitting the +filter{banners-by-size} - rule, which assumes - that images of certain sizes are ad banners (works well + rule, which assumes + that images of certain sizes are ad banners (works well most of the time since these tend to be standardized). { fragile } is an alias that disables most actions that are the most likely to cause trouble. This can be used as a - last resort for problem sites. - + last resort for problem sites. + @@ -8413,16 +9400,16 @@ In file: user.action [ View ] [ Edit ] - + - Remember to flush caches! Note that the - mail.google reference lacks the TLD portion (e.g. - .com). This will effectively match any TLD with - google in it, such as mail.google.de., + Remember to flush caches! Note that the + mail.google reference lacks the TLD portion (e.g. + .com). This will effectively match any TLD with + google in it, such as mail.google.de., just as an example. - + If this still does not work, you will have to go through the remaining actions one by one to find which one(s) is causing the problem. @@ -8433,7 +9420,7 @@ In file: user.action [ View ] [ Edit ][ View ] [ Edit ][ View ] [ Edit ] - + @@ -20,7 +20,7 @@ This file belongs into ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/ - $Id: index.sgml,v 2.9 2009/02/19 14:12:02 fabiankeil Exp $ + $Id: index.sgml,v 2.20 2011/12/26 17:05:40 fabiankeil Exp $ Copyright (C) 2001-2009 Privoxy Developers See LICENSE. @@ -90,7 +90,7 @@ - Download recent releases + Download recent releases - Pictures of the Privoxy Team + Pictures of the Privoxy Team @@ -222,7 +222,7 @@ - Copyright __copy 2001-2009 by Privoxy Developers + Copyright __copy 2001-2010 by Privoxy Developers @@ -249,6 +249,42 @@ Temple Place - Suite 330, Boston, MA 02111-1307, USA. $Log: index.sgml,v $ + Revision 2.20 2011/12/26 17:05:40 fabiankeil + Bump entities for 3.0.19 + + Revision 2.19 2011/11/13 17:03:54 fabiankeil + Bump entities for 3.0.18 stable + + Revision 2.18 2011/08/17 10:40:07 fabiankeil + Update the entities. + + This commit is chronological out of order. + + Revision 2.17 2010/11/10 21:49:38 fabiankeil + Set p-version to 3.0.17 + + Revision 2.16 2010/02/13 17:38:39 fabiankeil + Update entities for 3.0.16 stable. + + Revision 2.15 2010/02/13 16:38:18 fabiankeil + Update copyright. + + Revision 2.14 2010/01/11 13:47:25 fabiankeil + Finally bump entities for 3.0.16 UNRELEASED here, too. + + Revision 2.13 2009/10/10 06:07:40 fabiankeil + Prepare for 3.0.15 beta. + + Revision 2.12 2009/08/01 11:48:22 fabiankeil + Update the "Download recent releases" URL and fix the "Pictures of the Privoxy Team" URL. + privoxy.org redirects to www.privoxy.org anyway. + + Revision 2.11 2009/07/18 16:24:39 fabiankeil + Bump entities for 3.0.14 beta. + + Revision 2.10 2009/06/12 14:30:59 fabiankeil + Update entities for 3.0.13 beta. + Revision 2.9 2009/02/19 14:12:02 fabiankeil Change link to the project page to https://. diff --git a/external/privoxy/doc/webserver/announce.txt b/external/privoxy/doc/webserver/announce.txt index be37205d..fa042c33 100644 --- a/external/privoxy/doc/webserver/announce.txt +++ b/external/privoxy/doc/webserver/announce.txt @@ -1,47 +1,376 @@ - Announcing Privoxy v.3.0.12 ------------------------------------------------------------------ + Announcing Privoxy v.3.0.19 stable +-------------------------------------------------------------------- -Privoxy 3.0.12-stable is primarily a bugfix release. - -See http://www.privoxy.org/3.0.12/user-manual/whatsnew.html for details. +This is a bug-fix release for the previously released +Privoxy 3.0.18. One of the fixes addresses a security issue. -------------------------------------------------------------------- ChangeLog for Privoxy -------------------------------------------------------------------- -*** Version 3.0.12 *** +*** Version 3.0.19 Stable *** -- The socket-timeout option now also works on platforms whose - select() implementation modifies the timeout structure. - Previously the timeout was triggered even if the connection - didn't stall. Reported by cyberpatrol. -- The Connection: keep-alive code properly deals with files - larger than 2GB. Previously the connection was closed too - early. -- The content length for files above 2GB is logged correctly. -- The user-manual directive on the show-status page links to - the documentation location specified with the directive, - not to the Privoxy website. -- When running in daemon mode, Privoxy doesn't log anything - to the console unless there are errors before the logfile - has been opened. -- The show-status page prints warnings about invalid directives - on the same line as the directives themselves. -- Fixed several justified (but harmless) compiler warnings, - mostly on 64 bit platforms. -- The mingw32 version explicitly requests the default charset - to prevent display problems with some fonts available on more - recent Windows versions. Patch by Burberry. -- The mingw32 version uses the Privoxy icon in the alt-tab - windows. Patch by Burberry. -- The timestamp and the thread id is omitted in the "Fatal error" - message box on mingw32. -- Fixed two related mingw32-only buffer overflows. Triggering - them required control over the configuration file, therefore - this isn't seen as a security issue. -- In verbose mode, or if the new option --show-skipped-tests - is used, Privoxy-Regression-Test logs skipped tests and the - skip reason. +- Bug fixes: + - Prevent a segmentation fault when de-chunking buffered content. + It could be triggered by malicious web servers if Privoxy was + configured to filter the content and running on a platform + where SIZE_T_MAX isn't larger than UINT_MAX, which probably + includes most 32-bit systems. On those platforms, all Privoxy + versions before 3.0.19 appear to be affected. + To be on the safe side, this bug should be presumed to allow + code execution as proving that it doesn't seems unrealistic. + - Do not expect a response from the SOCKS4/4A server until it + got something to respond to. This regression was introduced + in 3.0.18 and prevented the SOCKS4/4A negotiation from working. + Reported by qqqqqw in #3459781. +- General improvements: + - Fix an off-by-one in an error message about connect failures. + - Use a GNUMakefile variable for the webserver root directory and + update the path. Sourceforge changed it which broke various + web-related targets. + - Update the CODE_STATUS description. + +*** Version 3.0.18 stable *** + +- Bug fixes: + - If a generated redirect URL contains characters RFC 3986 doesn't + permit, they are (re)encoded. Not doing this makes Privoxy versions + from 3.0.5 to 3.0.17 susceptible to HTTP response splitting (CWE-113) + attacks if the +fast-redirects{check-decoded-url} action is used. + - Fix a logic bug that could cause Privoxy to reuse a server + socket after it got tainted by a server-header-tagger-induced + block that was triggered before the whole server response had + been read. If keep-alive was enabled and the request following + the blocked one was to the same host and using the same forwarding + settings, Privoxy would send it on the tainted server socket. + While the server would simply treat it as a pipelined request, + Privoxy would later on fail to properly parse the server's + response as it would try to parse the unread data from the + first response as server headers for the second one. + Regression introduced in 3.0.17. + - When implying keep-alive in client_connection(), remember that + the client didn't. Fixes a regression introduced in 3.0.13 that + would cause Privoxy to wait for additional client requests after + receiving a HTTP/1.1 request with "Connection: close" set + and connection sharing enabled. + With clients which terminates the client connection after detecting + that the whole body has been received it doesn't really matter, + but with clients that don't the connection would be kept open until + it timed out. + - Fix a subtle race condition between prepare_csp_for_next_request() + and sweep(). A thread preparing itself for the next client request + could briefly appear to be inactive. + If all other threads were already using more recent files, + the thread could get its files swept away under its feet. + So far this has only been reproduced while stress testing in + valgrind while touching action files in a loop. It's unlikely + to have caused any actual problems in the real world. + - Disable filters if SDCH compression is used unless filtering is forced. + If SDCH was combined with a supported compression algorithm, Privoxy + previously could try to decompress it and ditch the Content-Encoding + header even though the SDCH compression wasn't dealt with. + Reported by zebul666 in #3225863. + - Make a copy of the --user value and only mess with that when splitting + user and group. On some operating systems modifying the value directly + is reflected in the output of ps and friends and can be misleading. + Reported by zepard in #3292710. + - If forwarded-connect-retries is set, only retry if Privoxy is actually + forwarding the request. Previously direct connections would be retried + as well. + - Fixed a small memory leak when retrying connections with IPv6 + support enabled. + - Remove an incorrect assertion in compile_dynamic_pcrs_job_list() + It could be triggered by a pcrs job with an invalid pcre + pattern (for example one that contains a lone quantifier). + - If the --user argument user[.group] contains a dot, always bail out + if no group has been specified. Previously the intended, but undocumented + (and apparently untested), behaviour was to try interpreting the whole + argument as user name, but the detection was flawed and checked for '0' + instead of '\0', thus merely preventing group names beginning with a zero. + - In html_code_map[], use a numeric character reference instead of ' + which wasn't standardized before XHTML 1.0. + - Fix an invalid free when compiled with FEATURE_GRACEFUL_TERMINATION + and shut down through http://config.privoxy.org/die + - In get_actions(), fix the "temporary" backwards compatibility hack + to accept block actions without reason. + It also covered other actions that should be rejected as invalid. + Reported by Billy Crook. + +- General improvements: + - Privoxy can (re)compress buffered content before delivering + it to the client. Disabled by default as most users wouldn't + benefit from it. + - The +fast-redirects{check-decoded-url} action checks URL + segments separately. If there are other parameters behind + the redirect URL, this makes it unnecessary to cut them off + by additionally using a +redirect{} pcrs command. + Initial patch submitted by Jamie Zawinski in #3429848. + - When loading action sections, verify that the referenced filters + exist. Currently missing filters only result in an error message, + but eventually the severity will be upgraded to fatal. + - Allow to bind to multiple separate addresses. + Patch set submitted by Petr Pisar in #3354485. + - Set socket_error to errno if connecting fails in rfc2553_connect_to(). + Previously rejected direct connections could be incorrectly reported + as DNS issues if Privoxy was compiled with IPv6 support. + - Adjust url_code_map[] so spaces are replaced with %20 instead of '+' + While '+' can be used by client's submitting form data, this is not + actually what Privoxy is using the lookups for. This is more of a + cosmetic issue and doesn't fix any known problems. + - When compiled without FEATURE_FAST_REDIRECTS, do not silently + ignore +fast-redirect{} directives + - Added a workaround for GNU libc's strptime() reporting negative + year values when the parsed year is only specified with two digits. + On affected systems cookies with such a date would not be turned + into session cookies by the +session-cookies-only action. + Reported by Vaeinoe in #3403560 + - Fixed bind failures with certain GNU libc versions if no non-loopback + IP address has been configured on the system. This is mainly an issue + if the system is using DHCP and Privoxy is started before the network + is completely configured. + Reported by Raphael Marichez in #3349356. + Additional insight from Petr Pisar. + - Privoxy log messages now use the ISO 8601 date format %Y-%m-%d. + It's only slightly longer than the old format, but contains + the full date including the year and allows sorting by date + (when grepping in multiple log files) without hassle. + - In get_last_url(), do not bother trying to decode URLs that do + not contain at least one '%' sign. It reduces the log noise and + a number of unnecessary memory allocations. + - In case of SOCKS5 failures, dump the socks response in the log message. + - Simplify the signal setup in main(). + - Streamline socks5_connect() slightly. + - In socks5_connect(), require a complete socks response from the server. + Previously Privoxy didn't care how much data the server response + contained as long as the first two bytes contained the expected + values. While at it, shrink the buffer size so Privoxy can't read + more than a whole socks response. + - In chat(), do not bother to generate a client request in case of + direct CONNECT requests. It will not be used anyway. + - Reduce server_last_modified()'s stack size. + - Shorten get_http_time() by using strftime(). + - Constify the known_http_methods pointers in unknown_method(). + - Constify the time_formats pointers in parse_header_time(). + - Constify the formerly_valid_actions pointers in action_used_to_be_valid(). + - Introduce a GNUMakefile MAN_PAGE variable that defaults to privoxy.1. + The Debian package uses section 8 for the man page and this + should simplify the patch. + - Deduplicate the INADDR_NONE definition for Solaris by moving it to jbsockets.h + - In block_url(), ditch the obsolete workaround for ancient Netscape versions + that supposedly couldn't properly deal with status code 403. + - Remove a useless NULL pointer check in load_trustfile(). + - Remove two useless NULL pointer checks in load_one_re_filterfile(). + - Change url_code_map[] from an array of pointers to an array of arrays + It removes an unnecessary layer of indirection and on 64bit system reduces + the size of the binary a bit. + - Fix various typos. Fixes taken from Debian's 29_typos.dpatch by Roland Rosenfeld. + - Add a dok-tidy GNUMakefile target to clean up the messy HTML + generated by the other dok targets. + - GNUisms in the GNUMakefile have been removed. + - Change the HTTP version in static responses to 1.1 + - Synced config.sub and config.guess with upstream + 2011-11-11/386c7218162c145f5f9e1ff7f558a3fbb66c37c5. + - Add a dedicated function to parse the values of toggles. Reduces duplicated + code in load_config() and provides better error handling. Invalid or missing + toggle values are now a fatal error instead of being silently ignored. + - Terminate HTML lines in static error messages with \n instead of \r\n. + - Simplify cgi_error_unknown() a bit. + - In LogPutString(), don't bother looking at pszText when not + actually logging anything. + - Change ssplit()'s fourth parameter from int to size_t. + Fixes a clang complaint. + - Add a warning that the statistics currently can't be trusted. + Mention Privoxy-Log-Parser's --statistics option as + an alternative for the time being. + - In rfc2553_connect_to(), start setting cgi->error_message on error. + - Change the expected status code returned for http://p.p/die depending + on whether or not FEATURE_GRACEFUL_TERMINATION is available. + - In cgi_die(), mark the client connection for closing. + If the client will fetch the style sheet through another connection + it gets the main thread out of the accept() state and should thus + trigger the actual shutdown. + - Add a proper CGI message for cgi_die(). + - Don't enforce a logical line length limit in read_config_line(). + - Slightly refactor server_last_modified() to remove useless gmtime*() calls. + - In get_content_type(), also recognize '.jpeg' as JPEG extension. + - Add '.png' to the list of recognized file extensions in get_content_type(). + - In block_url(), consistently use the block reason "Request blocked by Privoxy" + In two places the reason was "Request for blocked URL" which hides the + fact that the request got blocked by Privoxy and isn't necessarily + correct as the block may be due to tags. + - In listen_loop(), reload the configuration files after accepting + a new connection instead of before. + Previously the first connection that arrived after a configuration + change would still be handled with the old configuration. + - In chat()'s receive-data loop, skip a client socket check if + the socket will be written to right away anyway. This can + increase the transfer speed for unfiltered content on fast + network connections. + - The socket timeout is used for SOCKS negotiations as well which + previously couldn't timeout. + - Don't keep the client connection alive if any configuration file + changed since the time the connection came in. This is closer to + Privoxy's behaviour before keep-alive support for client connection + has been added and also less confusing in general. + - Treat all Content-Type header values containing the pattern + 'script' as a sign of text. Reported by pribog in #3134970. + +- Action file improvements: + - Moved the site-specific block pattern section below the one for the + generic patterns so for requests that are matched in both, the block + reason for the domain is shown which is usually more useful than showing + the one for the generic pattern. + - Remove -prevent-compression from the fragile alias. It's no longer + used anywhere by default and isn't known to break stuff anyway. + - Add a (disabled) section to block various Facebook tracking URLs. + Reported by Dan Stahlke in #3421764. + - Add a (disabled) section to rewrite and redirect click-tracking + URLs used on news.google.com. + Reported by Dan Stahlke in #3421755. + - Unblock linuxcounter.net/. + Reported by Dan Stahlke in #3422612. + - Block 'www91.intel.com/' which is used by Omniture. + Reported by Adam Piggott in #3167370. + - Disable the handle-as-empty-doc-returns-ok option and mark it as deprecated. + Reminded by tceverling in #2790091. + - Add ".ivwbox.de/" to the "Cross-site user tracking" section. + Reported by Nettozahler in #3172525. + - Unblock and fast-redirect ".awin1.com/.*=http://". + Reported by Adam Piggott in #3170921. + - Block "b.collective-media.net/". + - Widen the Debian popcon exception to "qa.debian.org/popcon". + Seen in Debian's 05_default_action.dpatch by Roland Rosenfeld. + - Block ".gemius.pl/" which only seems to be used for user tracking. + Reported by johnd16 in #3002731. Additional input from Lee and movax. + - Disable banners-by-size filters for '.thinkgeek.com/'. + The filter only seems to catch pictures of the inventory. + - Block requests for 'go.idmnet.bbelements.com/please/showit/'. + Reported by kacperdominik in #3372959. + - Unblock adainitiative.org/. + - Add a fast-redirects exception for '.googleusercontent.com/.*=cache'. + - Add a fast-redirects exception for webcache.googleusercontent.com/. + - Unblock http://adassier.wordpress.com/ and http://adassier.files.wordpress.com/. + +- Filter file improvements: + - Let the yahoo filter hide '.ads'. + - Let the msn filter hide overlay ads for Facebook 'likes' in search + results and elements with the id 's_notf_div'. They only seem to be + used to advertise site 'enhancements'. + - Let the js-events filter additionally disarm setInterval(). + Suggested by dg1727 in #3423775. + +- Documentation improvements: + - Clarify the effect of compiling Privoxy with zlib support. + Suggested by dg1727 in #3423782. + - Point out that the SourceForge messaging system works like a black + hole and should thus not be used to contact individual developers. + - Mention some of the problems one can experience when not explicitly + configuring an IP addresses as listen address. + - Explicitly mention that hostnames can be used instead of IP addresses + for the listen-address, that only the first address returned will be + used and what happens if the address is invalid. + Requested by Calestyo in #3302213. + +- Log message improvements: + - If only the server connection is kept alive, do not pretend to + wait for a new client request. + - Remove a superfluous log message in forget_connection(). + - In chat(), properly report missing server responses as such + instead of calling them empty. + - In forwarded_connect(), fix a log message nobody should ever see. + - Fix a log message in socks5_connect(), a failed write operation + was logged as failed read operation. + - Let load_one_actions_file() properly complain about a missing + '{' at the beginning of the file. + Simply stating that a line is invalid isn't particularly helpful. + - Do not claim to listen on a socket until Privoxy actually does. + Patch submitted by Petr Pisar #3354485 + - Prevent a duplicated LOG_LEVEL_CLF message when sending out + the "no-server-data" response. + - Also log the client socket when dropping a connection. + - Include the destination host in the 'Request ... marked for + blocking. limit-connect{...} doesn't allow CONNECT ...' message + Patch submitted by Saperski in #3296250. + - Prevent a duplicated log message if none of the resolved IP + addresses were reachable. + - In connect_to(), do not pretend to retry if forwarded-connect-retries + is zero or unset. + - When a specified user or group can't be found, put the name in + single-quotes when logging it. + - In rfc2553_connect_to(), explain getnameinfo() errors better. + - Remove a useless log message in chat(). + - When retrying to connect, also log the maximum number of connection + attempts. + - Rephrase a log message in compile_dynamic_pcrs_job_list(). + Divide the error code and its meaning with a colon. Call the pcrs + job dynamic and not the filter. Filters may contain dynamic and + non-dynamic pcrs jobs at the same time. Only mention the name of + the filter or tagger, but don't claim it's a filter when it could + be a tagger. + - In a fatal error message in load_one_actions_file(), cover both + URL and TAG patterns. + - In pcrs_strerror(), properly report unknown positive error code + values as such. Previously they were handled like 0 (no error). + - In compile_dynamic_pcrs_job_list(), also log the actual error code as + pcrs_strerror() doesn't handle all errors reported by pcre. + - Don't bother trying to continue chatting if the client didn't ask for it. + Reduces log noise a bit. + - Make two fatal error message in load_one_actions_file() more descriptive. + - In cgi_send_user_manual(), log when rejecting a file name due to '/' or '..'. + - In load_file(), log a message if opening a file failed. + The CGI error message alone isn't too helpful. + - In connection_destination_matches(), improve two log messages + to help understand why the destinations don't match. + - Rephrase a log message in serve(). Client request arrival + should be differentiated from closed client connections now. + - In serve(), log if a client connection isn't reused due to a + configuration file change. + - Let mark_server_socket_tainted() always mark the server socket tainted, + just don't talk about it in cases where it has no effect. It doesn't change + Privoxy's behaviour, but makes understanding the log file easier. + +- configure: + - Added a --disable-ipv6-support switch for platforms where support + is detected but doesn't actually work. + - Do not check for the existence of strerror() and memmove() twice + - Remove a useless test for setpgrp(2). Privoxy doesn't need it and + it can cause problems when cross-compiling. + - Rename the --disable-acl-files switch to --disable-acl-support. + Since about 2001, ACL directives are specified in the standard + config file. + - Update the URL of the 'Removing outdated PCRE version after the + next stable release' posting. The old URL stopped working after + one of SF's recent site "optimizations". Reported by Han Liu. + +- Privoxy-Regression-Test: + - Added --shuffle-tests option to increase the chances of detection race conditions. + - Added a --local-test-file option that allows to use Privoxy-Regression-Test without Privoxy. + - Added tests for missing socks4 and socks4a forwarders. + - The --privoxy-address option now works with IPv6 addresses containing brackets, too. + - Perform limited sanity checks for parameters that are supposed to have numerical values. + - Added a --sleep-time option to specify a number of seconds to + sleep between tests, defaults to 0. + - Disable the range-requests tagger for tests that break if it's enabled. + - Log messages use the ISO 8601 date format %Y-%m-%d. + - Fix spelling in two error messages. + - In the --help output, include a list of supported tests and their default levels. + - Adjust the tests to properly deal with FEATURE_TOGGLE being disabled. + +- Privoxy-Log-Parser: + - Perform limited sanity checks for command line parameters that + are supposed to have numerical values. + - Implement a --unbreak-lines-only option to try to revert MUA breakage. + - Accept and highlight: Added header: Content-Encoding: deflate + - Accept and highlight: Compressed content from 29258 to 8630 bytes. + - Accept and highlight: Client request arrived in time on socket 21. + - Highlight: Didn't receive data in time: a.fsdn.com:443 + - Accept log messages with ISO 8601 time stamps, too. + +- uagen: + - Bump generated Firefox version to 8.0. + - Only randomize the release date if the new --randomize-release-date + option is enabled. Firefox versions after 4 use a fixed date string + without meaning. ----------------------------------------------------------------- About Privoxy: @@ -54,13 +383,18 @@ flexible configuration and can be customized to suit individual needs and tastes. It has application for both stand-alone systems and multi-user networks. -Privoxy is Free Software and licensed under the GPL2. +Privoxy is Free Software and licensed under the GNU GPLv2. Privoxy is an associated project of Software in the Public Interest (SPI). -Donations are welcome: http://www.privoxy.org/faq/general.html#DONATE + +Helping hands and donations are welcome: + + * http://www.privoxy.org/faq/general.html#PARTICIPATE + + * http://www.privoxy.org/faq/general.html#DONATE At present, Privoxy is known to run on Windows(95, 98, ME, 2000, -XP, Vista), Linux (Ubuntu, RedHat, SuSE, Debian, Fedora, Gentoo and +XP, Vista), GNU/Linux (Ubuntu, RedHat, SuSE, Debian, Fedora, Gentoo and others), Mac OSX, OS/2, AmigaOS, FreeBSD, NetBSD, OpenBSD, Solaris, and various other flavors of Unix. @@ -69,7 +403,12 @@ Privoxy provides many supplemental features, that give the end-user more control, more privacy and more freedom: - * Can keep outgoing connections alive and reuse them later on. + * Supports "Connection: keep-alive". Outgoing connections can be kept + alive independently from the client. Currently not available on all + platforms. + + * Supports IPv6, provided the operating system does so too, + and the configure script detects it. * Supports tagging which allows to change the behaviour based on client and server headers. @@ -87,8 +426,7 @@ more control, more privacy and more freedom: tracing of rule and filter effects. Remote toggling. * Web page filtering (text replacements, removes banners based on size, - invisible "web-bugs", JavaScript and HTML annoyances, pop-up windows, - etc.) + invisible web-bugs and HTML annoyances, etc.) * Modularized configuration that allows for standard settings and user settings to reside in separate files, so that installing updated actions @@ -97,23 +435,16 @@ more control, more privacy and more freedom: * Support for Perl Compatible Regular Expressions in the configuration files, and a more sophisticated and flexible configuration syntax. - * Improved cookie management features (e.g. session based cookies). - * GIF de-animation. * Bypass many click-tracking scripts (avoids script redirection). - * Multi-threaded (POSIX and native threads). - * User-customizable HTML templates for most proxy-generated pages (e.g. "blocked" page). * Auto-detection and re-reading of config file changes. - - * Improved signal handling, and a true daemon mode (Unix). - * Every feature now controllable on a per-site or per-location basis, - configuration more powerful and versatile over-all. + * Most features are controllable on a per-site or per-location basis. Download location: diff --git a/external/privoxy/doc/webserver/developer-manual/coding.html b/external/privoxy/doc/webserver/developer-manual/coding.html index 48259edf..345c7398 100644 --- a/external/privoxy/doc/webserver/developer-manual/coding.html +++ b/external/privoxy/doc/webserver/developer-manual/coding.html @@ -1,218 +1,142 @@ - -Coding Guidelines
Privoxy Developer Manual
PrevNext

4. Coding Guidelines

4.1. Introduction

This set of standards is designed to make our lives easier. It is - developed with the simple goal of helping us keep the "new and improved - Privoxy" consistent and reliable. Thus making - maintenance easier and increasing chances of success of the - project.

And that of course comes back to us as individuals. If we can - increase our development and product efficiencies then we can solve more - of the request for changes/improvements and in general feel good about - ourselves. ;->

4.2. Using Comments

4.2.1. Comment, Comment, Comment

Explanation:

Comment as much as possible without commenting the obvious. - For example do not comment "variable_a is equal to variable_b". - Instead explain why variable_a should be equal to the variable_b. - Just because a person can read code does not mean they will - understand why or what is being done. A reader may spend a lot - more time figuring out what is going on when a simple comment - or explanation would have prevented the extra research. Please - help your brother IJB'ers out!

The comments will also help justify the intent of the code. - If the comment describes something different than what the code - is doing then maybe a programming error is occurring.

Example:

+ +
/* if page size greater than 1k ... */
-if ( page_length() > 1024 )
+
+
+
+
+  
+
+  Coding Guidelines
+  
+  
+  
+  
+  
+  
+  
+
+
+
+  
+
+  
+

4. Coding + Guidelines

+ +
+

4.1. Introduction

+ +

This set of standards is designed to make our lives easier. It is + developed with the simple goal of helping us keep the "new and improved + Privoxy" consistent and reliable. Thus + making maintenance easier and increasing chances of success of the + project.

+ +

And that of course comes back to us as individuals. If we can + increase our development and product efficiencies then we can solve + more of the request for changes/improvements and in general feel good + about ourselves. ;->

+
+ +
+

4.2. Using Comments

+ +
+

4.2.1. Comment, Comment, + Comment

+ +

Explanation:

+ +

Comment as much as possible without commenting the obvious. For + example do not comment "variable_a is equal to variable_b". Instead + explain why variable_a should be equal to the variable_b. Just + because a person can read code does not mean they will understand why + or what is being done. A reader may spend a lot more time figuring + out what is going on when a simple comment or explanation would have + prevented the extra research. Please help your brother IJB'ers + out!

+ +

The comments will also help justify the intent of the code. If the + comment describes something different than what the code is doing + then maybe a programming error is occurring.

+ +

Example:

+ + + +
+
+/* if page size greater than 1k ... */
+if ( page_length() > 1024 )
 {
     ... "block" the page up ...
 }
 
 /* if page size is small, send it in blocks */
-if ( page_length() > 1024 )
+if ( page_length() > 1024 )
 {
     ... "block" the page up ...
 }
 
 This demonstrates 2 cases of "what not to do".  The first is a
 "syntax comment".  The second is a comment that does not fit what
-is actually being done.

4.2.2. Use blocks for comments

Explanation:

Comments can help or they can clutter. They help when they - are differentiated from the code they describe. One line - comments do not offer effective separation between the comment - and the code. Block identifiers do, by surrounding the code - with a clear, definable pattern.

Example:

+ +
/*********************************************************************
+is actually being done.
+
+
+
+ +
+

4.2.2. Use blocks for + comments

+ +

Explanation:

+ +

Comments can help or they can clutter. They help when they are + differentiated from the code they describe. One line comments do not + offer effective separation between the comment and the code. Block + identifiers do, by surrounding the code with a clear, definable + pattern.

+ +

Example:

+ + + +
+
+/*********************************************************************
  * This will stand out clearly in your code!
  *********************************************************************/
 if ( this_variable == that_variable )
@@ -231,65 +155,40 @@ if ( this_variable == that_variable )
 if ( this_variable == that_variable ) /* this may not either */
 {
    do_something_very_important();
-}

Exception:

If you are trying to add a small logic comment and do not - wish to "disrupt" the flow of the code, feel free to use a 1 - line comment which is NOT on the same line as the code.

4.2.3. Keep Comments on their own line

Explanation:

It goes back to the question of readability. If the comment - is on the same line as the code it will be harder to read than - the comment that is on its own line.

There are three exceptions to this rule, which should be - violated freely and often: during the definition of variables, - at the end of closing braces, when used to comment - parameters.

Example:

+ +
/*********************************************************************
+}
+
+
+ +

Exception:

+ +

If you are trying to add a small logic comment and do not wish to + "disrupt" the flow of the code, feel free to use a 1 line comment + which is NOT on the same line as the code.

+
+ +
+

4.2.3. Keep Comments on their + own line

+ +

Explanation:

+ +

It goes back to the question of readability. If the comment is on + the same line as the code it will be harder to read than the comment + that is on its own line.

+ +

There are three exceptions to this rule, which should be violated + freely and often: during the definition of variables, at the end of + closing braces, when used to comment parameters.

+ +

Example:

+ + + +
+
+/*********************************************************************
  * This will stand out clearly in your code,
  * But the second example won't.
  *********************************************************************/
@@ -322,116 +221,74 @@ short do_something_very_important(
 {
    ...code here...
 
-}   /* -END- do_something_very_important */

4.2.4. Comment each logical step

Explanation:

Logical steps should be commented to help others follow the - intent of the written code and comments will make the code more - readable.

If you have 25 lines of code without a comment, you should - probably go back into it to see where you forgot to put - one.

Most "for", "while", "do", etc... loops _probably_ need a - comment. After all, these are usually major logic - containers.

4.2.5. Comment All Functions Thoroughly

Explanation:

A reader of the code should be able to look at the comments - just prior to the beginning of a function and discern the - reason for its existence and the consequences of using it. The - reader should not have to read through the code to determine if - a given function is safe for a desired use. The proper - information thoroughly presented at the introduction of a - function not only saves time for subsequent maintenance or - debugging, it more importantly aids in code reuse by allowing a - user to determine the safety and applicability of any function - for the problem at hand. As a result of such benefits, all - functions should contain the information presented in the - addendum section of this document.

4.2.6. Comment at the end of braces if the - content is more than one screen length

Explanation:

Each closing brace should be followed on the same line by a - comment that describes the origination of the brace if the - original brace is off of the screen, or otherwise far away from - the closing brace. This will simplify the debugging, - maintenance, and readability of the code.

As a suggestion , use the following flags to make the - comment and its brace more readable:

use following a closing brace: } /* -END- if() or while () - or etc... */

Example:

+ +
if ( 1 == X )
+}   /* -END- do_something_very_important */
+
+
+
+ +
+

4.2.4. Comment each logical + step

+ +

Explanation:

+ +

Logical steps should be commented to help others follow the intent + of the written code and comments will make the code more + readable.

+ +

If you have 25 lines of code without a comment, you should + probably go back into it to see where you forgot to put one.

+ +

Most "for", "while", "do", etc... loops _probably_ need a comment. + After all, these are usually major logic containers.

+
+ +
+

4.2.5. Comment All Functions + Thoroughly

+ +

Explanation:

+ +

A reader of the code should be able to look at the comments just + prior to the beginning of a function and discern the reason for its + existence and the consequences of using it. The reader should not + have to read through the code to determine if a given function is + safe for a desired use. The proper information thoroughly presented + at the introduction of a function not only saves time for subsequent + maintenance or debugging, it more importantly aids in code reuse by + allowing a user to determine the safety and applicability of any + function for the problem at hand. As a result of such benefits, all + functions should contain the information presented in the addendum + section of this document.

+
+ +
+

4.2.6. Comment at the end of + braces if the content is more than one screen length

+ +

Explanation:

+ +

Each closing brace should be followed on the same line by a + comment that describes the origination of the brace if the original + brace is off of the screen, or otherwise far away from the closing + brace. This will simplify the debugging, maintenance, and readability + of the code.

+ +

As a suggestion , use the following flags to make the comment and + its brace more readable:

+ +

use following a closing brace: } /* -END- if() or while () or + etc... */

+ +

Example:

+ + + +
+
+if ( 1 == X )
 {
    do_something_very_important();
    ...some long list of commands...
@@ -443,735 +300,423 @@ if ( 1 == X )
 {
    do_something_very_important();
    ...some long list of commands...
-} /* -END- if ( 1 == X ) */

4.3. Naming Conventions

4.3.1. Variable Names

Explanation:

Use all lowercase, and separate words via an underscore - ('_'). Do not start an identifier with an underscore. (ANSI C - reserves these for use by the compiler and system headers.) Do - not use identifiers which are reserved in ANSI C++. (E.g. - template, class, true, false, ...). This is in case we ever - decide to port Privoxy to C++.

Example:

int ms_iis5_hack = 0;

Instead of:

int msiis5hack = 0; int msIis5Hack = 0;

4.3.2. Function Names

Explanation:

Use all lowercase, and separate words via an underscore - ('_'). Do not start an identifier with an underscore. (ANSI C - reserves these for use by the compiler and system headers.) Do - not use identifiers which are reserved in ANSI C++. (E.g. - template, class, true, false, ...). This is in case we ever - decide to port Privoxy to C++.

Example:

int load_some_file( struct client_state *csp )

Instead of:

int loadsomefile( struct client_state *csp )
-int loadSomeFile( struct client_state *csp )

4.3.3. Header file prototypes

Explanation:

Use a descriptive parameter name in the function prototype - in header files. Use the same parameter name in the header file - that you use in the c file.

Example:

(.h) extern int load_aclfile( struct client_state *csp );
-(.c) int load_aclfile( struct client_state *csp )

Instead of: -
(.h) extern int load_aclfile( struct client_state * ); or 
-(.h) extern int load_aclfile(); 
-(.c) int load_aclfile( struct client_state *csp )

4.3.4. Enumerations, and #defines

Explanation:

Use all capital letters, with underscores between words. Do - not start an identifier with an underscore. (ANSI C reserves - these for use by the compiler and system headers.)

Example:

(enumeration) : enum Boolean { FALSE, TRUE };
-(#define) : #define DEFAULT_SIZE 100;

Note: We have a standard naming scheme for #defines - that toggle a feature in the preprocessor: FEATURE_>, where - > is a short (preferably 1 or 2 word) description.

Example:

+ +
#define FEATURE_FORCE 1
+} /* -END- if ( 1 == X ) */
+
+
+
+
+ +
+

4.3. Naming Conventions

+ +
+

4.3.1. Variable + Names

+ +

Explanation:

+ +

Use all lowercase, and separate words via an underscore ('_'). Do + not start an identifier with an underscore. (ANSI C reserves these + for use by the compiler and system headers.) Do not use identifiers + which are reserved in ANSI C++. (E.g. template, class, true, false, + ...). This is in case we ever decide to port Privoxy to C++.

+ +

Example:

+ + + + + +
+
+int ms_iis5_hack = 0;
+
+
+ +

Instead of:

+ + + + + +
+
+int msiis5hack = 0; int msIis5Hack = 0;
+
+
+
+ +
+

4.3.2. Function + Names

+ +

Explanation:

+ +

Use all lowercase, and separate words via an underscore ('_'). Do + not start an identifier with an underscore. (ANSI C reserves these + for use by the compiler and system headers.) Do not use identifiers + which are reserved in ANSI C++. (E.g. template, class, true, false, + ...). This is in case we ever decide to port Privoxy to C++.

+ +

Example:

+ + + + + +
+
+int load_some_file( struct client_state *csp )
+
+
+ +

Instead of:

+ + + + + +
+
+int loadsomefile( struct client_state *csp )
+int loadSomeFile( struct client_state *csp )
+
+
+
+ +
+

4.3.3. Header file + prototypes

+ +

Explanation:

+ +

Use a descriptive parameter name in the function prototype in + header files. Use the same parameter name in the header file that you + use in the c file.

+ +

Example:

+ + + + + +
+
+(.h) extern int load_aclfile( struct client_state *csp );
+(.c) int load_aclfile( struct client_state *csp )
+
+
+ +

Instead of:

+ + + + + +
+
+(.h) extern int load_aclfile( struct client_state * ); or
+(.h) extern int load_aclfile();
+(.c) int load_aclfile( struct client_state *csp )
+
+
+
+ +
+

4.3.4. Enumerations, and + #defines

+ +

Explanation:

+ +

Use all capital letters, with underscores between words. Do not + start an identifier with an underscore. (ANSI C reserves these for + use by the compiler and system headers.)

+ +

Example:

+ + + + + +
+
+(enumeration) : enum Boolean { FALSE, TRUE };
+(#define) : #define DEFAULT_SIZE 100;
+
+
+ +

Note: We have a standard + naming scheme for #defines that toggle a feature in the preprocessor: + FEATURE_>, where > is a short (preferably 1 or 2 word) + description.

+ +

Example:

+ + + +
+
+#define FEATURE_FORCE 1
 
 #ifdef FEATURE_FORCE
 #define FORCE_PREFIX blah
-#endif /* def FEATURE_FORCE */

4.3.5. Constants

Explanation:

Spell common words out entirely (do not remove vowels).

Use only widely-known domain acronyms and abbreviations. - Capitalize all letters of an acronym.

Use underscore (_) to separate adjacent acronyms and - abbreviations. Never terminate a name with an underscore.

Example:

#define USE_IMAGE_LIST 1

Instead of:

+ +
#define USE_IMG_LST 1 or 
+#endif /* def FEATURE_FORCE */
+
+
+

+ +
+

4.3.5. Constants

+ +

Explanation:

+ +

Spell common words out entirely (do not remove vowels).

+ +

Use only widely-known domain acronyms and abbreviations. + Capitalize all letters of an acronym.

+ +

Use underscore (_) to separate adjacent acronyms and + abbreviations. Never terminate a name with an underscore.

+ +

Example:

+ + + + + +
+
+#define USE_IMAGE_LIST 1
+
+
+ +

Instead of:

+ + + +
+
+#define USE_IMG_LST 1 or
 #define _USE_IMAGE_LIST 1 or
-#define USE_IMAGE_LIST_ 1 or 
+#define USE_IMAGE_LIST_ 1 or
 #define use_image_list 1 or
-#define UseImageList 1

4.4. Using Space

4.4.1. Put braces on a line by themselves.

Explanation:

The brace needs to be on a line all by itself, not at the - end of the statement. Curly braces should line up with the - construct that they're associated with. This practice makes it - easier to identify the opening and closing braces for a - block.

Example:

+ +
if ( this == that )
+#define UseImageList 1
+
+
+
+
+ +
+

4.4. Using Space

+ +
+

4.4.1. Put braces on a line + by themselves.

+ +

Explanation:

+ +

The brace needs to be on a line all by itself, not at the end of + the statement. Curly braces should line up with the construct that + they're associated with. This practice makes it easier to identify + the opening and closing braces for a block.

+ +

Example:

+ + + +
+
+if ( this == that )
 {
    ...
-}

Instead of:

if ( this == that ) { ... }

or

if ( this == that ) { ... }

Note: In the special case that the if-statement is - inside a loop, and it is trivial, i.e. it tests for a - condition that is obvious from the purpose of the block, - one-liners as above may optically preserve the loop structure - and make it easier to read.

Status: developer-discretion.

Example exception:

+ +
while ( more lines are read )
+}
+
+
+ +

Instead of:

+ +

if ( this == that ) { ... }

+ +

or

+ +

if ( this == that ) { ... }

+ +

Note: In the special + case that the if-statement is inside a loop, and it is trivial, i.e. + it tests for a condition that is obvious from the purpose of the + block, one-liners as above may optically preserve the loop structure + and make it easier to read.

+ +

Status: + developer-discretion.

+ +

Example exception:

+ + + +
+
+while ( more lines are read )
 {
    /* Please document what is/is not a comment line here */
    if ( it's a comment ) continue;
 
    do_something( line );
-}

4.4.2. ALL control statements should have a - block

Explanation:

Using braces to make a block will make your code more - readable and less prone to error. All control statements should - have a block defined.

Example:

+ +
if ( this == that )
+}
+
+
+
+ +
+

4.4.2. ALL control + statements should have a block

+ +

Explanation:

+ +

Using braces to make a block will make your code more readable and + less prone to error. All control statements should have a block + defined.

+ +

Example:

+ + + +
+
+if ( this == that )
 {
    do_something();
    do_something_else();
-}

Instead of:

if ( this == that ) do_something(); do_something_else();

or

if ( this == that ) do_something();

Note: The first example in "Instead of" will execute - in a manner other than that which the developer desired (per - indentation). Using code braces would have prevented this - "feature". The "explanation" and "exception" from the point - above also applies.

4.4.3. Do not belabor/blow-up boolean - expressions

Example:

structure->flag = ( condition );

Instead of:

if ( condition ) { structure->flag = 1; } else { - structure->flag = 0; }

Note: The former is readable and concise. The later - is wordy and inefficient. Please assume that any developer new - to the project has at least a "good" knowledge of C/C++. (Hope - I do not offend by that last comment ... 8-)

4.4.4. Use white space freely because it is - free

Explanation:

Make it readable. The notable exception to using white space - freely is listed in the next guideline.

Example:

+ +
int first_value   = 0;
+}
+
+
+ +

Instead of:

+ +

if ( this == that ) do_something(); do_something_else();

+ +

or

+ +

if ( this == that ) do_something();

+ +

Note: The first example + in "Instead of" will execute in a manner other than that which the + developer desired (per indentation). Using code braces would have + prevented this "feature". The "explanation" and "exception" from the + point above also applies.

+
+ +
+

4.4.3. Do not + belabor/blow-up boolean expressions

+ +

Example:

+ + + + + +
+
+structure->flag = ( condition );
+
+
+ +

Instead of:

+ +

if ( condition ) { structure->flag = 1; } else { + structure->flag = 0; }

+ +

Note: The former is + readable and concise. The later is wordy and inefficient. Please + assume that any developer new to the project has at least a "good" + knowledge of C/C++. (Hope I do not offend by that last comment ... + 8-)

+
+ +
+

4.4.4. Use white space + freely because it is free

+ +

Explanation:

+ +

Make it readable. The notable exception to using white space + freely is listed in the next guideline.

+ +

Example:

+ + + +
+
+int first_value   = 0;
 int some_value    = 0;
 int another_value = 0;
 int this_variable = 0;
 
 if ( this_variable == this_variable )
 
-first_value = old_value + ( ( some_value - another_value ) - whatever )

4.4.5. Don't use white space around structure - operators

Explanation:

- structure pointer operator ( "->" ) - member operator ( - "." ) - functions and parentheses

It is a general coding practice to put pointers, references, - and function parentheses next to names. With spaces, the - connection between the object and variable/function name is not - as clear.

Example:

+ +
a_struct->a_member;
+first_value = old_value + ( ( some_value - another_value ) - whatever )
+
+
+
+ +
+

4.4.5. Don't use white space + around structure operators

+ +

Explanation:

+ +

- structure pointer operator ( "->" ) - member operator ( "." ) + - functions and parentheses

+ +

It is a general coding practice to put pointers, references, and + function parentheses next to names. With spaces, the connection + between the object and variable/function name is not as clear.

+ +

Example:

+ + + +
+
+a_struct->a_member;
 a_struct.a_member;
-function_name();

Instead of: a_struct -> a_member; a_struct . a_member; - function_name ();

4.4.6. Make the last brace of a function stand - out

Example:

+ +
int function1( ... )
+function_name();
+
+
+ +

Instead of: a_struct + -> a_member; a_struct . a_member; function_name ();

+
+ +
+

4.4.6. Make the last brace + of a function stand out

+ +

Example:

+ + + +
+
+int function1( ... )
 {
    ...code...
    return( ret_code );
@@ -1181,83 +726,48 @@ CLASS="PROGRAMLISTING"
 
 int function2( ... )
 {
-}   /* -END- function2 */

Instead of:

int function1( ... ) { ...code... return( ret_code ); } int - function2( ... ) { }

Note: Use 1 blank line before the closing brace and 2 - lines afterward. This makes the end of function standout to - the most casual viewer. Although function comments help - separate functions, this is still a good coding practice. In - fact, I follow these rules when using blocks in "for", "while", - "do" loops, and long if {} statements too. After all whitespace - is free!

Status: developer-discretion on the number of blank - lines. Enforced is the end of function comments.

4.4.7. Use 3 character indentions

Explanation:

If some use 8 character TABs and some use 3 character TABs, - the code can look *very* ragged. So use 3 character indentions - only. If you like to use TABs, pass your code through a filter - such as "expand -t3" before checking in your code.

Example:

+ +
static const char * const url_code_map[256] =
+}   /* -END- function2 */
+
+
+ +

Instead of:

+ +

int function1( ... ) { ...code... return( ret_code ); } int + function2( ... ) { }

+ +

Note: Use 1 blank line + before the closing brace and 2 lines afterward. This makes the end of + function standout to the most casual viewer. Although function + comments help separate functions, this is still a good coding + practice. In fact, I follow these rules when using blocks in "for", + "while", "do" loops, and long if {} statements too. After all + whitespace is free!

+ +

Status: + developer-discretion on the number of blank lines. Enforced is the + end of function comments.

+
+ +
+

4.4.7. Use 3 character + indentions

+ +

Explanation:

+ +

If some use 8 character TABs and some use 3 character TABs, the + code can look *very* ragged. So use 3 character indentions only. If + you like to use TABs, pass your code through a filter such as "expand + -t3" before checking in your code.

+ +

Example:

+ + + +
+
+static const char * const url_code_map[256] =
 {
    NULL, ...
 };
@@ -1276,477 +786,273 @@ int function1( ... )
 
    return( NEVER_GETS_HERE );
 
-}

4.5. Initializing

4.5.1. Initialize all variables

Explanation:

Do not assume that the variables declared will not be used - until after they have been assigned a value somewhere else in - the code. Remove the chance of accidentally using an unassigned - variable.

Example:

short a_short = 0;
-float a_float  = 0;
-struct *ptr = NULL;

Note: It is much easier to debug a SIGSEGV if the - message says you are trying to access memory address 00000000 - and not 129FA012; or array_ptr[20] causes a SIGSEV vs. - array_ptr[0].

Status: developer-discretion if and only if the - variable is assigned a value "shortly after" declaration.

4.6. Functions

4.6.1. Name functions that return a boolean as a - question.

Explanation:

Value should be phrased as a question that would logically - be answered as a true or false statement

Example:

should_we_block_this();
-contains_an_image();
-is_web_page_blank();

4.6.2. Always specify a return type for a - function.

Explanation:

The default return for a function is an int. To avoid - ambiguity, create a return for a function when the return has a - purpose, and create a void return type if the function does not - need to return anything.

4.6.3. Minimize function calls when iterating by - using variables

Explanation:

It is easy to write the following code, and a clear argument - can be made that the code is easy to understand:

Example:

for ( size_t cnt = 0; cnt < block_list_length(); cnt++ )
-{
-   ....
-}

Note: Unfortunately, this makes a function call for - each and every iteration. This increases the overhead in the - program, because the compiler has to look up the function each - time, call it, and return a value. Depending on what occurs in - the block_list_length() call, it might even be creating and - destroying structures with each iteration, even though in each - case it is comparing "cnt" to the same value, over and over. - Remember too - even a call to block_list_length() is a function - call, with the same overhead.

Instead of using a function call during the iterations, - assign the value to a variable, and evaluate using the - variable.

Example:

+ +
size_t len = block_list_length();
+}
+
+
+
+
-for ( size_t cnt = 0; cnt < len; cnt++ ) +
+

4.5. Initializing

+ +
+

4.5.1. Initialize all + variables

+ +

Explanation:

+ +

Do not assume that the variables declared will not be used until + after they have been assigned a value somewhere else in the code. + Remove the chance of accidentally using an unassigned variable.

+ +

Example:

+ + + + + +
+
+short a_short = 0;
+float a_float  = 0;
+struct *ptr = NULL;
+
+
+ +

Note: It is much easier + to debug a SIGSEGV if the message says you are trying to access + memory address 00000000 and not 129FA012; or array_ptr[20] causes a + SIGSEV vs. array_ptr[0].

+ +

Status: + developer-discretion if and only if the variable is assigned a value + "shortly after" declaration.

+
+
+ +
+

4.6. Functions

+ +
+

4.6.1. Name functions that + return a boolean as a question.

+ +

Explanation:

+ +

Value should be phrased as a question that would logically be + answered as a true or false statement

+ +

Example:

+ + + + + +
+
+should_we_block_this();
+contains_an_image();
+is_web_page_blank();
+
+
+
+ +
+

4.6.2. Always specify a + return type for a function.

+ +

Explanation:

+ +

The default return for a function is an int. To avoid ambiguity, + create a return for a function when the return has a purpose, and + create a void return type if the function does not need to return + anything.

+
+ +
+

4.6.3. Minimize function + calls when iterating by using variables

+ +

Explanation:

+ +

It is easy to write the following code, and a clear argument can + be made that the code is easy to understand:

+ +

Example:

+ + + +
+
+for ( size_t cnt = 0; cnt < block_list_length(); cnt++ )
 {
    ....
-}

Exceptions: if the value of block_list_length() - *may* change or could *potentially* change, then you must code the - function call in the for/while loop.

4.6.4. Pass and Return by Const Reference

Explanation:

This allows a developer to define a const pointer and call - your function. If your function does not have the const - keyword, we may not be able to use your function. Consider - strcmp, if it were defined as: extern int strcmp( char *s1, - char *s2 );

I could then not use it to compare argv's in main: int main( - int argc, const char *argv[] ) { strcmp( argv[0], "privoxy" - ); }

Both these pointers are *const*! If the c runtime library - maintainers do it, we should too.

4.6.5. Pass and Return by Value

Explanation:

Most structures cannot fit onto a normal stack entry (i.e. - they are not 4 bytes or less). Aka, a function declaration - like: int load_aclfile( struct client_state csp )

would not work. So, to be consistent, we should declare all - prototypes with "pass by value": int load_aclfile( struct - client_state *csp )

4.6.6. Names of include files

Explanation:

Your include statements should contain the file name without - a path. The path should be listed in the Makefile, using -I as - processor directive to search the indicated paths. An exception - to this would be for some proprietary software that utilizes a - partial path to distinguish their header files from system or - other header files.

Example:

#include <iostream.h>     /* This is not a local include */
-#include "config.h"       /* This IS a local include */

Exception:

/* This is not a local include, but requires a path element. */ 
-#include <sys/fileName.h>

Note: Please! do not add "-I." to the Makefile - without a _very_ good reason. This duplicates the #include - "file.h" behavior.

4.6.7. Provide multiple inclusion - protection

Explanation:

Prevents compiler and linker errors resulting from - redefinition of items.

Wrap each header file with the following syntax to prevent - multiple inclusions of the file. Of course, replace PROJECT_H - with your file name, with "." Changed to "_", and make it - uppercase.

Example:

+ +
#ifndef PROJECT_H_INCLUDED
+}
+
+
+ +

Note: Unfortunately, + this makes a function call for each and every iteration. This + increases the overhead in the program, because the compiler has to + look up the function each time, call it, and return a value. + Depending on what occurs in the block_list_length() call, it might + even be creating and destroying structures with each iteration, even + though in each case it is comparing "cnt" to the same value, over and + over. Remember too - even a call to block_list_length() is a function + call, with the same overhead.

+ +

Instead of using a function call during the iterations, assign the + value to a variable, and evaluate using the variable.

+ +

Example:

+ + + + + +
+
+size_t len = block_list_length();
+
+for ( size_t cnt = 0; cnt < len; cnt++ )
+{
+   ....
+}
+
+
+ +

Exceptions: if the value + of block_list_length() *may* change or could *potentially* change, + then you must code the function call in the for/while loop.

+
+ +
+

4.6.4. Pass and Return by + Const Reference

+ +

Explanation:

+ +

This allows a developer to define a const pointer and call your + function. If your function does not have the const keyword, we may + not be able to use your function. Consider strcmp, if it were defined + as: extern int strcmp( char *s1, char *s2 );

+ +

I could then not use it to compare argv's in main: int main( int + argc, const char *argv[] ) { strcmp( argv[0], "privoxy" ); }

+ +

Both these pointers are *const*! If the c runtime library + maintainers do it, we should too.

+
+ +
+

4.6.5. Pass and Return by + Value

+ +

Explanation:

+ +

Most structures cannot fit onto a normal stack entry (i.e. they + are not 4 bytes or less). Aka, a function declaration like: int + load_aclfile( struct client_state csp )

+ +

would not work. So, to be consistent, we should declare all + prototypes with "pass by value": int load_aclfile( struct + client_state *csp )

+
+ +
+

4.6.6. Names of include + files

+ +

Explanation:

+ +

Your include statements should contain the file name without a + path. The path should be listed in the Makefile, using -I as + processor directive to search the indicated paths. An exception to + this would be for some proprietary software that utilizes a partial + path to distinguish their header files from system or other header + files.

+ +

Example:

+ + + + + +
+
+#include <iostream.h>     /* This is not a local include */
+#include "config.h"       /* This IS a local include */
+
+
+ +

Exception:

+ + + + + +
+
+/* This is not a local include, but requires a path element. */
+#include <sys/fileName.h>
+
+
+ +

Note: Please! do not add + "-I." to the Makefile without a _very_ good reason. This duplicates + the #include "file.h" behavior.

+
+ +
+

4.6.7. Provide multiple + inclusion protection

+ +

Explanation:

+ +

Prevents compiler and linker errors resulting from redefinition of + items.

+ +

Wrap each header file with the following syntax to prevent + multiple inclusions of the file. Of course, replace PROJECT_H with + your file name, with "." Changed to "_", and make it uppercase.

+ +

Example:

+ + + +
+
+#ifndef PROJECT_H_INCLUDED
 #define PROJECT_H_INCLUDED
  ...
-#endif /* ndef PROJECT_H_INCLUDED */

4.6.8. Use `extern "C"` when appropriate

Explanation:

If our headers are included from C++, they must declare our - functions as `extern "C"`. This has no cost in C, but increases - the potential re-usability of our code.

Example:

+ +
#ifdef __cplusplus
+#endif /* ndef PROJECT_H_INCLUDED */
+
+
+
+ +
+

4.6.8. Use `extern "C"` when + appropriate

+ +

Explanation:

+ +

If our headers are included from C++, they must declare our + functions as `extern "C"`. This has no cost in C, but increases the + potential re-usability of our code.

+ +

Example:

+ + + +
+
+#ifdef __cplusplus
 extern "C"
 {
 #endif /* def __cplusplus */
@@ -1755,145 +1061,81 @@ extern "C"
 
 #ifdef __cplusplus
 }
-#endif /* def __cplusplus */

4.6.9. Where Possible, Use Forward Struct - Declaration Instead of Includes

Explanation:

Useful in headers that include pointers to other struct's. - Modifications to excess header files may cause needless - compiles.

Example:

+ +
/*********************************************************************
+#endif /* def __cplusplus */
+
+
+
+ +
+

4.6.9. Where Possible, Use + Forward Struct Declaration Instead of Includes

+ +

Explanation:

+ +

Useful in headers that include pointers to other struct's. + Modifications to excess header files may cause needless compiles.

+ +

Example:

+ + + +
+
+/*********************************************************************
  * We're avoiding an include statement here!
  *********************************************************************/
 struct file_list;
-extern file_list *xyz;

Note: If you declare "file_list xyz;" (without the - pointer), then including the proper header file is necessary. - If you only want to prototype a pointer, however, the header - file is unnecessary.

Status: Use with discretion.

4.7. General Coding Practices

4.7.1. Turn on warnings

Explanation

Compiler warnings are meant to help you find bugs. You - should turn on as many as possible. With GCC, the switch is - "-Wall". Try and fix as many warnings as possible.

4.7.2. Provide a default case for all switch - statements

Explanation:

What you think is guaranteed is never really guaranteed. The - value that you don't think you need to check is the one that - someday will be passed. So, to protect yourself from the - unknown, always have a default step in a switch statement.

Example:

+ +
switch( hash_string( cmd ) )
+extern file_list *xyz;
+
+
+ +

Note: If you declare + "file_list xyz;" (without the pointer), then including the proper + header file is necessary. If you only want to prototype a pointer, + however, the header file is unnecessary.

+ +

Status: Use with + discretion.

+
+
+ +
+

4.7. General Coding + Practices

+ +
+

4.7.1. Turn on + warnings

+ +

Explanation

+ +

Compiler warnings are meant to help you find bugs. You should turn + on as many as possible. With GCC, the switch is "-Wall". Try and fix + as many warnings as possible.

+
+ +
+

4.7.2. Provide a default + case for all switch statements

+ +

Explanation:

+ +

What you think is guaranteed is never really guaranteed. The value + that you don't think you need to check is the one that someday will + be passed. So, to protect yourself from the unknown, always have a + default step in a switch statement.

+ +

Example:

+ + + +
+
+switch( hash_string( cmd ) )
 {
    case hash_actions_file :
       ... code ...
@@ -1908,435 +1150,243 @@ CLASS="PROGRAMLISTING"
       ... anomaly code goes here ...
       continue; / break; / exit( 1 ); / etc ...
 
-} /* end switch( hash_string( cmd ) ) */

Note: If you already have a default condition, you - are obviously exempt from this point. Of note, most of the - WIN32 code calls `DefWindowProc' after the switch statement. - This API call *should* be included in a default statement.

Another Note: This is not so much a readability issue - as a robust programming issue. The "anomaly code goes here" may - be no more than a print to the STDERR stream (as in - load_config). Or it may really be an abort condition.

Status: Programmer discretion is advised.

4.7.3. Try to avoid falling through cases in a - switch statement.

Explanation:

In general, you will want to have a 'break' statement within - each 'case' of a switch statement. This allows for the code to - be more readable and understandable, and furthermore can - prevent unwanted surprises if someone else later gets creative - and moves the code around.

The language allows you to plan the fall through from one - case statement to another simply by omitting the break - statement within the case statement. This feature does have - benefits, but should only be used in rare cases. In general, - use a break statement for each case statement.

If you choose to allow fall through, you should comment both - the fact of the fall through and reason why you felt it was - necessary.

4.7.4. Use 'long' or 'short' Instead of - 'int'

Explanation:

On 32-bit platforms, int usually has the range of long. On - 16-bit platforms, int has the range of short.

Status: open-to-debate. In the case of most FSF - projects (including X/GNU-Emacs), there are typedefs to int4, - int8, int16, (or equivalence ... I forget the exact typedefs - now). Should we add these to IJB now that we have a "configure" - script?

4.7.5. Don't mix size_t and other types

Explanation:

The type of size_t varies across platforms. Do not make - assumptions about whether it is signed or unsigned, or about - how long it is. Do not compare a size_t against another - variable of a different type (or even against a constant) - without casting one of the values.

4.7.6. Declare each variable and struct on its - own line.

Explanation:

It can be tempting to declare a series of variables all on - one line. Don't.

Example:

+ +
long a = 0;
+} /* end switch( hash_string( cmd ) ) */
+
+
+ +

Note: If you already + have a default condition, you are obviously exempt from this point. + Of note, most of the WIN32 code calls `DefWindowProc' after the + switch statement. This API call *should* be included in a default + statement.

+ +

Another Note: This is + not so much a readability issue as a robust programming issue. The + "anomaly code goes here" may be no more than a print to the STDERR + stream (as in load_config). Or it may really be an abort + condition.

+ +

Status: Programmer + discretion is advised.

+
+ +
+

4.7.3. Try to avoid falling + through cases in a switch statement.

+ +

Explanation:

+ +

In general, you will want to have a 'break' statement within each + 'case' of a switch statement. This allows for the code to be more + readable and understandable, and furthermore can prevent unwanted + surprises if someone else later gets creative and moves the code + around.

+ +

The language allows you to plan the fall through from one case + statement to another simply by omitting the break statement within + the case statement. This feature does have benefits, but should only + be used in rare cases. In general, use a break statement for each + case statement.

+ +

If you choose to allow fall through, you should comment both the + fact of the fall through and reason why you felt it was + necessary.

+
+ +
+

4.7.4. Use 'long' or 'short' + Instead of 'int'

+ +

Explanation:

+ +

On 32-bit platforms, int usually has the range of long. On 16-bit + platforms, int has the range of short.

+ +

Status: open-to-debate. + In the case of most FSF projects (including X/GNU-Emacs), there are + typedefs to int4, int8, int16, (or equivalence ... I forget the exact + typedefs now). Should we add these to IJB now that we have a + "configure" script?

+
+ +
+

4.7.5. Don't mix size_t and + other types

+ +

Explanation:

+ +

The type of size_t varies across platforms. Do not make + assumptions about whether it is signed or unsigned, or about how long + it is. Do not compare a size_t against another variable of a + different type (or even against a constant) without casting one of + the values.

+
+ +
+

4.7.6. Declare each variable + and struct on its own line.

+ +

Explanation:

+ +

It can be tempting to declare a series of variables all on one + line. Don't.

+ +

Example:

+ + + +
+
+long a = 0;
 long b = 0;
-long c = 0;

Instead of:

long a, b, c;

Explanation: - there is more room for comments on the - individual variables - easier to add new variables without - messing up the original ones - when searching on a variable to - find its type, there is less clutter to "visually" - eliminate

Exceptions: when you want to declare a bunch of loop - variables or other trivial variables; feel free to declare them - on one line. You should, although, provide a good comment on - their functions.

Status: developer-discretion.

4.7.7. Use malloc/zalloc sparingly

Explanation:

Create a local struct (on the stack) if the variable will - live and die within the context of one function call.

Only "malloc" a struct (on the heap) if the variable's life - will extend beyond the context of one function call.

Example:

If a function creates a struct and stores a pointer to it in a
-list, then it should definitely be allocated via `malloc'.

4.7.8. The Programmer Who Uses 'malloc' is - Responsible for Ensuring 'free'

Explanation:

If you have to "malloc" an instance, you are responsible for - insuring that the instance is `free'd, even if the deallocation - event falls within some other programmer's code. You are also - responsible for ensuring that deletion is timely (i.e. not too - soon, not too late). This is known as "low-coupling" and is a - "good thing (tm)". You may need to offer a - free/unload/destructor type function to accommodate this.

Example:

int load_re_filterfile( struct client_state *csp ) { ... }
-static void unload_re_filterfile( void *f ) { ... }

Exceptions:

The developer cannot be expected to provide `free'ing - functions for C run-time library functions ... such as - `strdup'.

Status: developer-discretion. The "main" use of this - standard is for allocating and freeing data structures (complex - or nested).

4.7.9. Add loaders to the `file_list' structure - and in order

Explanation:

I have ordered all of the "blocker" file code to be in alpha - order. It is easier to add/read new blockers when you expect a - certain order.

Note: It may appear that the alpha order is broken in - places by POPUP tests coming before PCRS tests. But since - POPUPs can also be referred to as KILLPOPUPs, it is clear that - it should come first.

4.7.10. "Uncertain" new code and/or changes to - existing code, use FIXME or XXX

Explanation:

If you have enough confidence in new code or confidence in - your changes, but are not *quite* sure of the repercussions, - add this:

/* FIXME: this code has a logic error on platform XYZ, * - attempting to fix */ #ifdef PLATFORM ...changed code here... - #endif

or:

/* FIXME: I think the original author really meant this... - */ ...changed code here...

or:

/* FIXME: new code that *may* break something else... */ - ...new code here...

Note: If you make it clear that this may or may not - be a "good thing (tm)", it will be easier to identify and - include in the project (or conversely exclude from the - project).

4.8. Addendum: Template for files and function - comment blocks:

Example for file comments:

+ +
const char FILENAME_rcs[] = "$Id: coding.html,v 1.42 2009/03/21 12:59:32 fabiankeil Exp $";
+long c = 0;
+
+
+ +

Instead of:

+ +

long a, b, c;

+ +

Explanation: - there is + more room for comments on the individual variables - easier to add + new variables without messing up the original ones - when searching + on a variable to find its type, there is less clutter to "visually" + eliminate

+ +

Exceptions: when you + want to declare a bunch of loop variables or other trivial variables; + feel free to declare them on one line. You should, although, provide + a good comment on their functions.

+ +

Status: + developer-discretion.

+
+ +
+

4.7.7. Use malloc/zalloc + sparingly

+ +

Explanation:

+ +

Create a local struct (on the stack) if the variable will live and + die within the context of one function call.

+ +

Only "malloc" a struct (on the heap) if the variable's life will + extend beyond the context of one function call.

+ +

Example:

+ + + + + +
+
+If a function creates a struct and stores a pointer to it in a
+list, then it should definitely be allocated via `malloc'.
+
+
+
+ +
+

4.7.8. The Programmer Who + Uses 'malloc' is Responsible for Ensuring 'free'

+ +

Explanation:

+ +

If you have to "malloc" an instance, you are responsible for + insuring that the instance is `free'd, even if the deallocation event + falls within some other programmer's code. You are also responsible + for ensuring that deletion is timely (i.e. not too soon, not too + late). This is known as "low-coupling" and is a "good thing (tm)". + You may need to offer a free/unload/destructor type function to + accommodate this.

+ +

Example:

+ + + + + +
+
+int load_re_filterfile( struct client_state *csp ) { ... }
+static void unload_re_filterfile( void *f ) { ... }
+
+
+ +

Exceptions:

+ +

The developer cannot be expected to provide `free'ing functions + for C run-time library functions ... such as `strdup'.

+ +

Status: + developer-discretion. The "main" use of this standard is for + allocating and freeing data structures (complex or nested).

+
+ +
+

4.7.9. Add loaders to the + `file_list' structure and in order

+ +

Explanation:

+ +

I have ordered all of the "blocker" file code to be in alpha + order. It is easier to add/read new blockers when you expect a + certain order.

+ +

Note: It may appear that + the alpha order is broken in places by POPUP tests coming before PCRS + tests. But since POPUPs can also be referred to as KILLPOPUPs, it is + clear that it should come first.

+
+ +
+

4.7.10. "Uncertain" new code + and/or changes to existing code, use FIXME or XXX

+ +

Explanation:

+ +

If you have enough confidence in new code or confidence in your + changes, but are not *quite* sure of the repercussions, add this:

+ +

/* FIXME: this code has a logic error on platform XYZ, * + attempting to fix */ #ifdef PLATFORM ...changed code here... + #endif

+ +

or:

+ +

/* FIXME: I think the original author really meant this... */ + ...changed code here...

+ +

or:

+ +

/* FIXME: new code that *may* break something else... */ ...new + code here...

+ +

Note: If you make it + clear that this may or may not be a "good thing (tm)", it will be + easier to identify and include in the project (or conversely exclude + from the project).

+
+
+ +
+

4.8. Addendum: Template for + files and function comment blocks:

+ +

Example for file + comments:

+ + + +
+
+const char FILENAME_rcs[] = "$Id: coding.html,v 1.58 2011/12/26 17:06:24 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/doc/webserver/developer-manual/coding.html,v $
@@ -2361,16 +1411,10 @@ CLASS="PROGRAMLISTING"
  *                The GNU General Public License should be included with
  *                this file.  If not, you can view it at
  *                http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
- *                or write to the Free Software Foundation, Inc., 
+ *                or write to the Free Software Foundation, Inc.,
  *                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ,
  *                USA
  *
- * Revisions   :
- *    $Log: coding.html,v $
- *    Revision 1.42  2009/03/21 12:59:32  fabiankeil
- *    Rebuild with recent changes.
- *
- *
  *********************************************************************/
 
 
@@ -2378,52 +1422,33 @@ CLASS="PROGRAMLISTING"
 
    ...necessary include files for us to do our work...
 
-const char FILENAME_h_rcs[] = FILENAME_H_VERSION;

Note: This declares the rcs variables that should be - added to the "show-proxy-args" page. If this is a brand new - creation by you, you are free to change the "Copyright" section - to represent the rights you wish to maintain.

Note: The formfeed character that is present right - after the comment flower box is handy for (X|GNU)Emacs users to - skip the verbiage and get to the heart of the code (via - `forward-page' and `backward-page'). Please include it if you - can.

Example for file header comments:

+ +
#ifndef _FILENAME_H
+const char FILENAME_h_rcs[] = FILENAME_H_VERSION;
+
+
+ +

Note: This declares the + rcs variables that should be added to the "show-proxy-args" page. If + this is a brand new creation by you, you are free to change the + "Copyright" section to represent the rights you wish to maintain.

+ +

Note: The formfeed + character that is present right after the comment flower box is handy + for (X|GNU)Emacs users to skip the verbiage and get to the heart of the + code (via `forward-page' and `backward-page'). Please include it if you + can.

+ +

Example for file header + comments:

+ + + +
+
+#ifndef _FILENAME_H
 #define _FILENAME_H
-#define FILENAME_H_VERSION "$Id: coding.html,v 1.42 2009/03/21 12:59:32 fabiankeil Exp $"
+#define FILENAME_H_VERSION "$Id: coding.html,v 1.58 2011/12/26 17:06:24 fabiankeil Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/doc/webserver/developer-manual/coding.html,v $
@@ -2448,16 +1473,10 @@ CLASS="PROGRAMLISTING"
  *                The GNU General Public License should be included with
  *                this file.  If not, you can view it at
  *                http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
- *                or write to the Free Software Foundation, Inc., 
+ *                or write to the Free Software Foundation, Inc.,
  *                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ,
  *                USA
  *
- * Revisions   :
- *    $Log: coding.html,v $
- *    Revision 1.42  2009/03/21 12:59:32  fabiankeil
- *    Rebuild with recent changes.
- *
- *
  *********************************************************************/
 
 
@@ -2485,27 +1504,20 @@ extern const char FILENAME_h_rcs[];
   Local Variables:
   tab-width: 3
   end:
-*/

Example for function comments:

+ +
/*********************************************************************
+*/
+
+
+ +

Example for function + comments:

+ + + +
+
+/*********************************************************************
  *
  * Function    :  FUNCTION_NAME
  *
@@ -2515,7 +1527,7 @@ CLASS="PROGRAMLISTING"
  *          1  :  param1 = pointer to an important thing
  *          2  :  x      = pointer to something else
  *
- * Returns     :  0 => Ok, everything else is an error.
+ * Returns     :  0 => Ok, everything else is an error.
  *
  *********************************************************************/
 int FUNCTION_NAME( void *param1, const char *x )
@@ -2523,80 +1535,43 @@ int FUNCTION_NAME( void *param1, const char *x )
    ...
    return( 0 );
 
-}

Note: If we all follow this practice, we should be - able to parse our code to create a "self-documenting" web - page.


PrevHomeNext
Documentation Guidelines Testing Guidelines
\ No newline at end of file +} +
+
+ +

Note: If we all follow + this practice, we should be able to parse our code to create a + "self-documenting" web page.

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/developer-manual/contact.html b/external/privoxy/doc/webserver/developer-manual/contact.html index 3d8ddc03..7594f9ab 100644 --- a/external/privoxy/doc/webserver/developer-manual/contact.html +++ b/external/privoxy/doc/webserver/developer-manual/contact.html @@ -1,510 +1,362 @@ - -Contacting the developers, Bug Reporting and Feature Requests
Privoxy Developer Manual
PrevNext

8. Contacting the developers, Bug Reporting and Feature Requests

We value your feedback. In fact, we rely on it to improve - Privoxy and its configuration. - However, please note the following hints, so we can - provide you with the best support:

8.1. Get Support

For casual users, our - support forum at SourceForge - is probably best suited: - http://sourceforge.net/tracker/?group_id=11118&atid=211118

All users are of course welcome to discuss their issues on the users - mailing list, where the developers also hang around.

Please don't sent private support requests to individual Privoxy - developers, either use the mailing lists or the support trackers.

Note that the Privoxy mailing lists are moderated. Posts from unsubscribed - addresses have to be accepted manually by a moderator. This may cause a - delay of several days and if you use a subject that doesn't clearly - mention Privoxy or one of its features, your message may be accidentally - discarded as spam.

If you aren't subscribed, you should therefore spend a few seconds - to come up with a proper subject. Additionally you should make it clear - that you want to get CC'd. Otherwise some responses will be directed to - the mailing list only, and you won't see them.

8.2. Reporting Problems

"Problems" for our purposes, come in two forms:

  • Configuration issues, such as ads that slip through, or sites that - don't function properly due to one Privoxy - "action" or another being turned "on". -

  • "Bugs" in the programming code that makes up - Privoxy, such as that might cause a crash. -

8.2.1. Reporting Ads or Other Configuration Problems

Please send feedback on ads that slipped through, innocent images that were - blocked, sites that don't work properly, and other configuration related problem of - default.action file, to - http://sourceforge.net/tracker/?group_id=11118&atid=460288, - the Actions File Tracker.

New, improved default.action files may occasionally be made - available based on your feedback. These will be announced on the ijbswa-announce - list and available from our the files section of - our project page.

8.2.2. Reporting Bugs

Please report all bugs through our bug tracker: - http://sourceforge.net/tracker/?group_id=11118&atid=111118.

Before doing so, please make sure that the bug has not already been submitted - and observe the additional hints at the top of the submit - form. If already submitted, please feel free to add any info to the - original report that might help to solve the issue.

Please try to verify that it is a Privoxy bug, - and not a browser or site bug or documented behaviour that just happens - to be different than what you expected. If unsure, - try toggling - off Privoxy, and see if the problem persists.

If you are using your own custom configuration, please try - the stock configs to see if the problem is configuration related. - If you're having problems with a feature that is disabled by default, - please ask around on the mailing list if others can reproduce the problem.

If you aren't using the latest Privoxy version, the bug may have been found - and fixed in the meantime. We would appreciate if you could take the time - to upgrade - to the latest version (or even the latest CVS snapshot) and verify - that your bug still exists.

Please be sure to provide the following information:

  • The exact Privoxy version you are using - (if you got the source from CVS, please also provide the source code revisions - as shown in http://config.privoxy.org/show-version). -

  • The operating system and versions you run - Privoxy on, (e.g. Windows - XP SP2), if you are using a Unix flavor, - sending the output of "uname -a" should do, - in case of GNU/Linux, please also name the distribution. -

  • The name, platform, and version of the browser - you were using (e.g. Internet Explorer v5.5 for Mac). -

  • The URL where the problem occurred, or some way for us to duplicate the - problem (e.g. http://somesite.example.com/?somethingelse=123). -

  • Whether your version of Privoxy is one supplied - by the Privoxy developers via SourceForge, - or if you got your copy somewhere else. -

  • Whether you are using Privoxy in tandem with - another proxy such as Tor. If so, please - temporary disable the other proxy to see if the symptoms change. -

  • Whether you are using a personal firewall product. If so, does - Privoxy work without it? -

  • Any other pertinent information to help identify the problem such as config - or log file excerpts (yes, you should have log file entries for each - action taken). -

You don't have to tell us your actual name when filing a problem - report, but please use a nickname so we can differentiate between - your messages and the ones entered by other "anonymous" users that - may respond to your request if they have the same problem or already - found a solution.

Please also check the status of your request a few days after submitting - it, as we may request additional information. If you use a SF id, - you should automatically get a mail when someone responds to your request.

The appendix - of the Privoxy User Manual also has helpful information - on understanding actions, and action debugging.

8.3. Request New Features

You are welcome to submit ideas on new features or other proposals - for improvement through our feature request tracker at - http://sourceforge.net/tracker/?atid=361118&group_id=11118.

8.4. Other

For any other issues, feel free to use the mailing lists. Technically interested users -and people who wish to contribute to the project are also welcome on the developers list! -You can find an overview of all Privoxy-related mailing lists, -including list archives, at: -http://sourceforge.net/mail/?group_id=11118.


PrevHomeNext
Update the Webserver Privoxy Copyright, License and History
\ No newline at end of file + + + + + + + Contacting the developers, Bug Reporting and Feature + Requests + + + + + + + + + + + + +
+

8. Contacting the + developers, Bug Reporting and Feature Requests

+ +

We value your feedback. In fact, we rely on it to improve Privoxy and its configuration. However, please note + the following hints, so we can provide you with the best support:

+ +
+

8.1. + Get Support

+ +

For casual users, our support forum at SourceForge is probably best suited: + http://sourceforge.net/tracker/?group_id=11118&atid=211118

+ +

All users are of course welcome to discuss their issues on the + users mailing list, where the developers also hang + around.

+ +

Please don't sent private support requests to individual Privoxy + developers, either use the mailing lists or the support trackers.

+ +

If you have to contact a Privoxy developer directly for other + reasons, please send a real mail and do not bother with SourceForge's + messaging system. Answers to SourceForge messages are usually bounced + by SourceForge's mail server in which case the developer wasted time + writing a response you don't get. From your point of view it will look + like your message has been completely ignored, so this is frustrating + for all parties involved.

+ +

Note that the Privoxy mailing lists are moderated. Posts from + unsubscribed addresses have to be accepted manually by a moderator. + This may cause a delay of several days and if you use a subject that + doesn't clearly mention Privoxy or one of its features, your message + may be accidentally discarded as spam.

+ +

If you aren't subscribed, you should therefore spend a few seconds + to come up with a proper subject. Additionally you should make it clear + that you want to get CC'd. Otherwise some responses will be directed to + the mailing list only, and you won't see them.

+
+ +
+

8.2. Reporting + Problems

+ +

"Problems" for our purposes, come in two + forms:

+ +
    +
  • +

    Configuration issues, such as ads that slip through, or sites + that don't function properly due to one Privoxy "action" or + another being turned "on".

    +
  • + +
  • +

    "Bugs" in the programming code that + makes up Privoxy, such as that + might cause a crash.

    +
  • +
+ +
+

8.2.1. + Reporting Ads or Other Configuration Problems

+ +

Please send feedback on ads that slipped through, innocent images + that were blocked, sites that don't work properly, and other + configuration related problem of default.action file, to http://sourceforge.net/tracker/?group_id=11118&atid=460288, + the Actions File Tracker.

+ +

New, improved default.action files may + occasionally be made available based on your feedback. These will be + announced on the ijbswa-announce list and available from our the files section of our project page.

+
+ +
+

8.2.2. + Reporting Bugs

+ +

Please report all bugs through our bug tracker: http://sourceforge.net/tracker/?group_id=11118&atid=111118.

+ +

Before doing so, please make sure that the bug has not already been submitted and observe + the additional hints at the top of the submit form. If already submitted, please feel free + to add any info to the original report that might help to solve the + issue.

+ +

Please try to verify that it is a Privoxy bug, and not a browser or site bug or + documented behaviour that just happens to be different than what you + expected. If unsure, try toggling + off Privoxy, and see if the + problem persists.

+ +

If you are using your own custom configuration, please try the + stock configs to see if the problem is configuration related. If + you're having problems with a feature that is disabled by default, + please ask around on the mailing list if others can reproduce the + problem.

+ +

If you aren't using the latest Privoxy version, the bug may have + been found and fixed in the meantime. We would appreciate if you + could take the time to upgrade to the latest version (or even the latest CVS + snapshot) and verify that your bug still exists.

+ +

Please be sure to provide the following information:

+ +
    +
  • +

    The exact Privoxy version you + are using (if you got the source from CVS, please also provide + the source code revisions as shown in http://config.privoxy.org/show-version).

    +
  • + +
  • +

    The operating system and versions you run Privoxy on, (e.g. Windows XP SP2), if you are using a Unix + flavor, sending the output of "uname + -a" should do, in case of GNU/Linux, please also name the + distribution.

    +
  • + +
  • +

    The name, platform, and version of the browser you were using (e.g. Internet Explorer v5.5 for Mac).

    +
  • + +
  • +

    The URL where the problem occurred, or some way for us to + duplicate the problem (e.g. http://somesite.example.com/?somethingelse=123).

    +
  • + +
  • +

    Whether your version of Privoxy is one supplied by the Privoxy developers via SourceForge, or if + you got your copy somewhere else.

    +
  • + +
  • +

    Whether you are using Privoxy + in tandem with another proxy such as Tor. If so, please temporary disable the + other proxy to see if the symptoms change.

    +
  • + +
  • +

    Whether you are using a personal firewall product. If so, does + Privoxy work without it?

    +
  • + +
  • +

    Any other pertinent information to help identify the problem + such as config or log file excerpts (yes, you should have log + file entries for each action taken). To get a meaningful logfile, + please make sure that the logfile + directive is being used and the following debug + options are enabled:

    + +

    + debug     1 # Log the destination for each request Privoxy let through. See also debug 1024.
    + + debug     2 # show each connection status
    + + debug     4 # show I/O status
    + + debug     8 # show header parsing
    + + debug   128 # debug redirects
    + debug   256 # debug GIF de-animation
    + + debug   512 # Common Log Format
    + + debug  1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
    + + debug  4096 # Startup banner and warnings.
    + + debug  8192 # Non-fatal errors

    If you + are having trouble with a filter, please additionally enable + +

    + debug    64 # debug regular expression filters

    If + you are using Privoxy 3.0.17 or later and suspect that it + interprets the request or the response incorrectly, please enable + +

    + debug 32768 # log all data read from the network

    Note + that Privoxy log files may contain sensitive information so + please don't submit any logfiles you didn't read first. You can + mask sensitive information as long as it's clear that you removed + something. +
  • +
+ +

You don't have to tell us your actual name when filing a problem + report, but if you don't, please use a nickname so we can + differentiate between your messages and the ones entered by other + "anonymous" users that may respond to your request if they have the + same problem or already found a solution. Note that due to spam the + trackers may not always allow to post without being logged into + SourceForge. If that's the case, you are still free to create a login + that isn't directly linked to your name, though.

+ +

Please also check the status of your request a few days after + submitting it, as we may request additional information. If you use a + SF id, you should automatically get a mail when someone responds to + your request. Please don't bother to add an email address when using + the tracker. If you prefer to communicate through email, just use one + of the mailing lists directly.

+ +

If you are new to reporting problems, you might be interested in + How to Report Bugs Effectively.

+ +

The appendix of the Privoxy User Manual also has + helpful information on understanding actions, and action + debugging.

+
+
+ +
+

8.3. + Request New Features

+ +

You are welcome to submit ideas on new features or other proposals + for improvement through our feature request tracker at http://sourceforge.net/tracker/?atid=361118&group_id=11118.

+
+ +
+

8.4. + Mailing Lists

+ +

If you prefer to communicate through email, instead of using a web + interface, feel free to use one of the mailing lists. To discuss issues + that haven't been completely diagnosed yet, please use the Privoxy + users list. Technically interested users and people who wish to + contribute to the project are always welcome on the developers list. + You can find an overview of all Privoxy-related mailing lists, including list + archives, at: http://sourceforge.net/mail/?group_id=11118.

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/developer-manual/copyright.html b/external/privoxy/doc/webserver/developer-manual/copyright.html index 5fbe9a40..f6d39e60 100644 --- a/external/privoxy/doc/webserver/developer-manual/copyright.html +++ b/external/privoxy/doc/webserver/developer-manual/copyright.html @@ -1,298 +1,161 @@ - -Privoxy Copyright, License and History
Privoxy Developer Manual
PrevNext

9. Privoxy Copyright, License and History

Copyright Š 2001-2009 by Privoxy Developers <ijbswa-developers@lists.sourceforge.net>

Some source code is based on code Copyright Š 1997 by Anonymous Coders - and Junkbusters, Inc. and licensed under the GNU General Public - License.

9.1. License

Privoxy is free software; you can - redistribute it and/or modify it under the terms of the - GNU General Public License, version 2, - as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.

You should have received a copy of the GNU GPL - along with this program; if not, write to the

 Free Software
- Foundation, Inc. 51 Franklin Street, Fifth Floor
BostonMA 02110-1301
USA 

9.2. History

A long time ago, there was the - Internet Junkbuster, - by Anonymous Coders and Junkbusters - Corporation. This saved many users a lot of pain in the early days of - web advertising and user tracking.

But the web, its protocols and standards, and with it, the techniques for - forcing ads on users, give up autonomy over their browsing, and - for tracking them, keeps evolving. Unfortunately, the Internet - Junkbuster did not. Version 2.0.2, published in 1998, was - (and is) the last official - release - available from Junkbusters Corporation. - Fortunately, it had been released under the GNU - GPL, - which allowed further development by others.

So Stefan Waldherr started maintaining an improved version of the - software, to which eventually a number of people contributed patches. - It could already replace banners with a transparent image, and had a first - version of pop-up killing, but it was still very closely based on the - original, with all its limitations, such as the lack of HTTP/1.1 support, - flexible per-site configuration, or content modification. The last release - from this effort was version 2.0.2-10, published in 2000.

Then, some - developers - picked up the thread, and started turning the software inside out, upside down, - and then reassembled it, adding many - new - features along the way.

The result of this is Privoxy, whose first - stable version, 3.0, was released August, 2002. -


PrevHomeNext
Contacting the developers, Bug Reporting and Feature Requests See also
\ No newline at end of file + + + + + + + Privoxy Copyright, License and History + + + + + + + + + + + + +
+

9. Privoxy + Copyright, License and History

+ +

Copyright © 2001-2011 by Privoxy Developers <ijbswa-developers@lists.sourceforge.net>

+ +

Some source code is based on code Copyright © 1997 by Anonymous + Coders and Junkbusters, Inc. and licensed under the GNU General Public License.

+ +
+

9.1. License

+ +

Privoxy is free software; you can + redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by + the Free Software Foundation.

+ +

This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.

+ +

You should have received a copy of the GNU + GPL along with this program; if not, write to the

+ +

 Free Software
+  Foundation, Inc. 51 Franklin + Street, Fifth Floor
+  BostonMA 02110-1301
+  USA 

+
+ +
+

9.2. History

+ +

A long time ago, there was the Internet Junkbuster, by Anonymous Coders and + Junkbusters + Corporation. This saved many users a lot of pain in the early days + of web advertising and user tracking.

+ +

But the web, its protocols and standards, and with it, the + techniques for forcing ads on users, give up autonomy over their + browsing, and for tracking them, keeps evolving. Unfortunately, the + Internet Junkbuster did not. Version + 2.0.2, published in 1998, was (and is) the last official release available from Junkbusters Corporation. Fortunately, it had been + released under the GNU GPL, which allowed further development by others.

+ +

So Stefan Waldherr started maintaining an improved version of the + software, to which eventually a number of people contributed patches. + It could already replace banners with a transparent image, and had a + first version of pop-up killing, but it was still very closely based on + the original, with all its limitations, such as the lack of HTTP/1.1 + support, flexible per-site configuration, or content modification. The + last release from this effort was version 2.0.2-10, published in + 2000.

+ +

Then, some developers picked up the thread, and started turning the + software inside out, upside down, and then reassembled it, adding many + new features along the way.

+ +

The result of this is Privoxy, + whose first stable version, 3.0, was released August, 2002.

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/developer-manual/cvs.html b/external/privoxy/doc/webserver/developer-manual/cvs.html index db1fb9e9..5a0f571e 100644 --- a/external/privoxy/doc/webserver/developer-manual/cvs.html +++ b/external/privoxy/doc/webserver/developer-manual/cvs.html @@ -1,330 +1,189 @@ - -The CVS Repository
Privoxy Developer Manual
PrevNext

2. The CVS Repository

If you become part of the active development team, you will eventually - need write access to our holy grail, the CVS repository. One of the - team members will need to set this up for you. Please read - this chapter completely before accessing via CVS. -

2.1. Access to CVS

The project's CVS repository is hosted on - SourceForge. - Please refer to the chapters 6 and 7 in - SF's site - documentation for the technical access details for your - operating system. For historical reasons, the CVS server is - called ijbswa.cvs.sourceforge.net, the repository is - called ijbswa, and the source tree module is called - current. -

2.2. Branches

Within the CVS repository, there are modules and branches. As - mentioned, the sources are in the current - "module". Other modules are present for platform specific - issues. There is a webview of the CVS hierarchy at http://ijbswa.cvs.sourceforge.net/ijbswa/, - which might help with visualizing how these pieces fit together. -

Branches are used to fork a sub-development path from the main trunk. - Within the current module where the sources are, there - is always at least one "branch" from the main trunk - devoted to a stable release series. The main trunk is where active - development takes place for the next stable series (e.g. 3.2.x). - So just prior to each stable series (e.g. 3.0.x), a branch is created - just for stable series releases (e.g. 3.0.0 -> 3.0.1 -> 3.0.2, etc). - Once the initial stable release of any stable branch has taken place, - this branch is only used for bugfixes, which have - had prior testing before being committed to CVS. (See Version Numbers below for details on - versioning.) -

At one time there were two distinct branches: stable and unstable. The - more drastic changes were to be in the unstable branch. These branches - have now been merged to minimize time and effort of maintaining two - branches. -

2.3. CVS Commit Guidelines

The source tree is the heart of every software project. Every effort must - be made to ensure that it is readable, compilable and consistent at all - times. There are differing guidelines for the stable branch and the - main development trunk, and we ask anyone with CVS access to strictly - adhere to the following guidelines: -

Basic Guidelines, for all branches: -

  • Please don't commit even - a small change without testing it thoroughly first. When we're - close to a public release, ask a fellow developer to review your - changes. -

  • Your commit message should give a concise overview of what you - changed (no big details) and why you changed it - Just check previous messages for good examples. -

  • Don't use the same message on multiple files, unless it equally applies to - all those files. -

  • If your changes span multiple files, and the code won't recompile unless - all changes are committed (e.g. when changing the signature of a function), - then commit all files one after another, without long delays in between. - If necessary, prepare the commit messages in advance. -

  • Before changing things on CVS, make sure that your changes are in line - with the team's general consensus on what should be done. -

  • Note that near a major public release, we get more cautious. - There is always the possibility to submit a patch to the patch - tracker instead. -

-


PrevHomeNext
Introduction Documentation Guidelines
\ No newline at end of file + + + + + + + The CVS Repository + + + + + + + + + + + + +
+

2. The CVS Repository

+ +

If you become part of the active development team, you will eventually + need write access to our holy grail, the CVS repository. One of the team + members will need to set this up for you. Please read this chapter + completely before accessing via CVS.

+ +
+

2.1. Access to + CVS

+ +

The project's CVS repository is hosted on SourceForge. Please refer + to the chapters 6 and 7 in SF's site + documentation for the technical access details for your operating + system. For historical reasons, the CVS server is called ijbswa.cvs.sourceforge.net, the repository is called + ijbswa, and the source tree module is called + current.

+
+ +
+

2.2. + Branches

+ +

Within the CVS repository, there are modules and branches. As + mentioned, the sources are in the current + "module". Other modules are present for + platform specific issues. There is a webview of the CVS hierarchy at + http://ijbswa.cvs.sourceforge.net/ijbswa/, which might help + with visualizing how these pieces fit together.

+ +

Branches are used to fork a sub-development path from the main + trunk. Within the current module where the + sources are, there is always at least one "branch" from the main trunk devoted to a stable release + series. The main trunk is where active development takes place for the + next stable series (e.g. 3.2.x). So just prior to each stable series + (e.g. 3.0.x), a branch is created just for stable series releases (e.g. + 3.0.0 -> 3.0.1 -> 3.0.2, etc). Once the initial stable release of + any stable branch has taken place, this branch is only used for bugfixes, which have had + prior testing before being committed to CVS. (See Version Numbers below for details + on versioning.)

+ +

At one time there were two distinct branches: stable and unstable. + The more drastic changes were to be in the unstable branch. These + branches have now been merged to minimize time and effort of + maintaining two branches.

+
+ +
+

2.3. CVS Commit + Guidelines

+ +

The source tree is the heart of every software project. Every effort + must be made to ensure that it is readable, compilable and consistent + at all times. There are differing guidelines for the stable branch and + the main development trunk, and we ask anyone with CVS access to + strictly adhere to the following guidelines:

+ +

Basic Guidelines, for all branches:

+ +
    +
  • +

    Please don't commit even a small change without testing it + thoroughly first. When we're close to a public release, ask a + fellow developer to review your changes.

    +
  • + +
  • +

    Your commit message should give a concise overview of + what you changed (no big + details) and why you changed + it Just check previous messages for good examples.

    +
  • + +
  • +

    Don't use the same message on multiple files, unless it equally + applies to all those files.

    +
  • + +
  • +

    If your changes span multiple files, and the code won't + recompile unless all changes are committed (e.g. when changing the + signature of a function), then commit all files one after another, + without long delays in between. If necessary, prepare the commit + messages in advance.

    +
  • + +
  • +

    Before changing things on CVS, make sure that your changes are + in line with the team's general consensus on what should be + done.

    +
  • + +
  • +

    Note that near a major public release, we get more cautious. + There is always the possibility to submit a patch to the patch tracker instead.

    +
  • +
+
+
+ + + + diff --git a/external/privoxy/doc/webserver/developer-manual/documentation.html b/external/privoxy/doc/webserver/developer-manual/documentation.html index d547c236..bcd57d15 100644 --- a/external/privoxy/doc/webserver/developer-manual/documentation.html +++ b/external/privoxy/doc/webserver/developer-manual/documentation.html @@ -1,944 +1,464 @@ - -Documentation Guidelines
Privoxy Developer Manual
PrevNext

3. Documentation Guidelines

All formal documents are maintained in Docbook SGML and located in the - doc/source/* directory. You will need - Docbook, the Docbook + + + + + + + Documentation Guidelines + + + + + + + + + + +

+ +
+

3. + Documentation Guidelines

+ +

All formal documents are maintained in Docbook SGML and located in the + doc/source/* directory. You will need + Docbook, the Docbook DTD's and the Docbook modular stylesheets (or comparable alternatives), - and either jade or - openjade (recommended) installed in order to - build docs from source. Currently there is user-manual, - FAQ, and, of - course this, the developer-manual in this format. - The README, AUTHORS, - INSTALL, - privoxy.1 (man page), and - config files are also now maintained as Docbook - SGML. These files, when built, in the top-level source directory are - generated files! Also, the Privoxy index.html (and a - variation on this file, privoxy-index.html, - meant for inclusion with doc packages), are maintained as SGML as well. - DO NOT edit these directly. Edit the SGML source, or - contact someone involved in the documentation. -

config requires some special handling. The reason it - is maintained this way is so that the extensive comments in the file - mirror those in user-manual. But the conversion - process requires going from SGML to HTML to text to special formatting - required for the embedded comments. Some of this does not survive so - well. Especially some of the examples that are longer than 80 characters. - The build process for this file outputs to config.new, - which should be reviewed for errors and mis-formatting. Once satisfied - that it is correct, then it should be hand copied to - config. -

Other, less formal documents (e.g. LICENSE) are - maintained as plain text files in the top-level source directory. -

Packagers are encouraged to include this documentation. For those without - the ability to build the docs locally, text versions of each are kept in - CVS. HTML versions are also being kept in CVS under - doc/webserver/*. And PDF version are kept in - doc/pdf/*. -

Formal documents are built with the Makefile targets of - make dok, or alternately - make redhat-dok. If you have problems, - try both. The build process uses the document SGML sources in - doc/source/*/* to update all text files in - doc/text/ and to update all HTML - documents in doc/webserver/. -

Documentation writers should please make sure documents build - successfully before committing to CVS, if possible. -

How do you update the webserver (i.e. the pages on privoxy.org)? - -

  1. First, build the docs by running make - dok (or alternately make - redhat-dok). For PDF docs, do make - dok-pdf. -

  2. Run make webserver which copies all - files from doc/webserver to the - sourceforge webserver via scp. -

-

Finished docs should be occasionally submitted to CVS - (doc/webserver/*/*.html) so that those without - the ability to build them locally, have access to them if needed. - This is especially important just prior to a new release! Please - do this after the $VERSION and - other release specific data in configure.in has been - updated (this is done just prior to a new release). -

3.1. Quickstart to Docbook and SGML

If you are not familiar with SGML, it is a markup language similar to HTML. - Actually, not a mark up language per se, but a language used to define - markup languages. In fact, HTML is an SGML application. Both will use - "tags" to format text and other content. SGML tags can be much - more varied, and flexible, but do much of the same kinds of things. The tags, - or "elements", are definable in SGML. There is no set - "standards". Since we are using - Docbook, our tags are those that are defined by - Docbook. Much of how the finish document is - rendered is determined by the "stylesheets". - The stylesheets determine how each tag gets translated to HTML, or other - formats.

Tags in Docbook SGML need to be always "closed". If not, you - will likely generate errors. Example: <title>My - Title</title>. They are also case-insensitive, but we - strongly suggest using all lower case. This keeps compatibility with - [Docbook] XML.

Our documents use "sections" for the most part. Sections - will be processed into HTML headers (e.g. h1 for - sect1). The Docbook stylesheets - will use these to also generate the Table of Contents for each doc. Our - TOC's are set to a depth of three. Meaning sect1, - sect2, and sect3 will have TOC - entries, but sect4 will not. Each section requires - a <title> element, and at least one - <para>. There is a limit of five section - levels in Docbook, but generally three should be sufficient for our - purposes.

Some common elements that you likely will use:

<para></para>, paragraph delimiter. Most - text needs to be within paragraph elements (there are some exceptions). -
<emphasis></emphasis>, the stylesheets - make this italics. -
<filename></filename>, files and directories. -
<command></command>, command examples. -
<literallayout></literallayout>, like - <pre>, more or less. -
<itemizedlist></itemizedlist>, list with bullets. -
<listitem></listitem>, member of the above. -
<screen></screen>, screen output, implies - <literallayout>. -
<ulink url="example.com"></ulink>, like - HTML <a> tag. -
<quote></quote>, for, doh, quoting text. -

Look at any of the existing docs for examples of all these and more.

You might also find "Writing Documentation - Using DocBook - A Crash Course" useful.

3.2. Privoxy Documentation Style

It will be easier if everyone follows a similar writing style. This - just makes it easier to read what someone else has written if it - is all done in a similar fashion. -

Here it is: -

  • All tags should be lower case. -

  • Tags delimiting a block of text (even small - blocks) should be on their own line. Like: -

     <para>
    -  Some text goes here.
    - </para>
    -       

    - Tags marking individual words, or few words, should be in-line: -

      Just to <emphasis>emphasize</emphasis>, some text goes here.
    -       

    -

  • Tags should be nested and step indented for block text like: (except - in-line tags) -

     <para>
    -  <itemizedlist>
    -   <para>
    -    <listitem>
    -      Some text goes here in our list example.
    -     </listitem>
    -   </para>
    -  </itemizedlist>
    - </para>
    -       

    - This makes it easier to find the text amongst the tags ;-) -

  • Use white space to separate logical divisions within a document, - like between sections. Running everything together consistently - makes it harder to read and work on. -

  • Do not hesitate to make comments. Comments can either use the - <comment> element, or the <!-- --> style comment - familiar from HTML. (Note in Docbook v4.x <comment> is - replaced by <remark>.) -

  • We have an international audience. Refrain from slang, or English - idiosyncrasies (too many to list :). Humor also does not translate - well sometimes. -

  • Try to keep overall line lengths in source files to 80 characters or less - for obvious reasons. This is not always possible, with lengthy URLs for - instance. -

  • Our documents are available in differing formats. Right now, they - are just plain text, HTML, and PDF, but others are always a - future possibility. Be careful with URLs (<ulink>), and avoid - this mistake: -

    My favorite site is <ulink url="http://example.com">here</ulink>. -

    This will render as "My favorite site is here", which is - not real helpful in a text doc. Better like this: -

    My favorite site is <ulink url="http://example.com">example.com</ulink>. -

  • All documents should be spell checked occasionally. - aspell can check SGML with the - -H option. (ispell I think - too.) -

-

3.3. Privoxy Custom Entities

Privoxy documentation is using - a number of customized "entities" to facilitate - documentation maintenance. -

We are using a set of "boilerplate" files with generic text, - that is used by multiple docs. This way we can write something once, and use - it repeatedly without having to re-write the same content over and over again. - If editing such a file, keep in mind that it should be - generic. That is the purpose; so it can be used in varying - contexts without additional modifications. -

We are also using what Docbook calls - "internal entities". These are like variables in - programming. Well, sort of. For instance, we have the - p-version entity that contains the current - Privoxy version string. You are strongly - encouraged to use these where possible. Some of these obviously - require re-setting with each release (done by the Makefile). A sampling of - custom entities are listed below. See any of the main docs for examples. -

  • Re- "boilerplate" text entities are defined like: -

    <!entity supported SYSTEM "supported.sgml"> -

    In this example, the contents of the file, - supported.sgml is available for inclusion anywhere - in the doc. To make this happen, just reference the now defined - entity: &supported; (starts with an ampersand - and ends with a semi-colon), and the contents will be dumped into - the finished doc at that point. -

  • Commonly used "internal entities": -

    p-version: the Privoxy - version string, e.g. "3.0.12". -
    p-status: the project status, either - "alpha", "beta", or "stable". -
    p-not-stable: use to conditionally include - text in "not stable" releases (e.g. "beta"). -
    p-stable: just the opposite. -
    p-text: this doc is only generated as text. -

-

There are others in various places that are defined for a specific - purpose. Read the source! -


PrevHomeNext
The CVS Repository Coding Guidelines
\ No newline at end of file + and either jade or openjade (recommended) installed in order to build + docs from source. Currently there is user-manual, FAQ, and, of + course this, the developer-manual in this + format. The README, AUTHORS, INSTALL, privoxy.1 (man page), and config + files are also now maintained as Docbook SGML. These files, when built, + in the top-level source directory are generated files! Also, the + Privoxy index.html (and a variation on this file, privoxy-index.html, meant for inclusion with doc + packages), are maintained as SGML as well. DO NOT edit these directly. Edit the SGML + source, or contact someone involved in the documentation.

+ +

config requires some special handling. The + reason it is maintained this way is so that the extensive comments in the + file mirror those in user-manual. But the + conversion process requires going from SGML to HTML to text to special + formatting required for the embedded comments. Some of this does not + survive so well. Especially some of the examples that are longer than 80 + characters. The build process for this file outputs to config.new, which should be reviewed for errors and + mis-formatting. Once satisfied that it is correct, then it should be hand + copied to config.

+ +

Other, less formal documents (e.g. LICENSE) + are maintained as plain text files in the top-level source directory.

+ +

Packagers are encouraged to include this documentation. For those + without the ability to build the docs locally, text versions of each are + kept in CVS. HTML versions are also being kept in CVS under doc/webserver/*. And PDF version are kept in doc/pdf/*.

+ +

Formal documents are built with the Makefile targets of make dok, or alternately make redhat-dok. If you have problems, try both. + The build process uses the document SGML sources in doc/source/*/* to update all text files in + doc/text/ and to update all HTML + documents in doc/webserver/.

+ +

Documentation writers should please make sure documents build + successfully before committing to CVS, if possible.

+ +

How do you update the webserver (i.e. the pages on privoxy.org)?

+ +
    +
  1. +

    First, build the docs by running make + dok (or alternately make + redhat-dok). For PDF docs, do make dok-pdf.

    +
  2. + +
  3. +

    Run make webserver which + copies all files from doc/webserver to the sourceforge webserver + via scp.

    +
  4. +
+ +

Finished docs should be occasionally submitted to CVS (doc/webserver/*/*.html) so that those without the ability + to build them locally, have access to them if needed. This is especially + important just prior to a new release! Please do this after the $VERSION + and other release specific data in configure.in + has been updated (this is done just prior to a new release).

+ +
+

3.1. Quickstart to Docbook + and SGML

+ +

If you are not familiar with SGML, it is a markup language similar + to HTML. Actually, not a mark up language per se, but a language used + to define markup languages. In fact, HTML is an SGML application. Both + will use "tags" to format text and other + content. SGML tags can be much more varied, and flexible, but do much + of the same kinds of things. The tags, or "elements", are definable in SGML. There is no set + "standards". Since we are using Docbook, our tags are those that are defined by + Docbook. Much of how the finish + document is rendered is determined by the "stylesheets". The stylesheets determine how each tag + gets translated to HTML, or other formats.

+ +

Tags in Docbook SGML need to be always "closed". If not, you will likely generate errors. + Example: <title>My Title</title>. + They are also case-insensitive, but we strongly suggest using all lower + case. This keeps compatibility with [Docbook] XML.

+ +

Our documents use "sections" for the most + part. Sections will be processed into HTML headers (e.g. h1 for sect1). The Docbook stylesheets will use these to also + generate the Table of Contents for each doc. Our TOC's are set to a + depth of three. Meaning sect1, sect2, and sect3 will have TOC + entries, but sect4 will not. Each section + requires a <title> element, and at least + one <para>. There is a limit of five + section levels in Docbook, but generally three should be sufficient for + our purposes.

+ +

Some common elements that you likely will use:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<para></para>, + paragraph delimiter. Most text needs to be within paragraph + elements (there are some exceptions).
<emphasis></emphasis>, + the stylesheets make this italics.
<filename></filename>, + files and directories.
<command></command>, + command examples.
<literallayout></literallayout>, + like <pre>, more or less.
<itemizedlist></itemizedlist>, + list with bullets.
<listitem></listitem>, + member of the above.
<screen></screen>, + screen output, implies <literallayout>.
<ulink + url="example.com"></ulink>, like HTML <a> tag.
<quote></quote>, for, + doh, quoting text.
+ +

Look at any of the existing docs for examples of all these and + more.

+ +

You might also find "Writing Documentation Using DocBook - A Crash Course" + useful.

+
+ +
+

3.2. Privoxy Documentation Style

+ +

It will be easier if everyone follows a similar writing style. This + just makes it easier to read what someone else has written if it is all + done in a similar fashion.

+ +

Here it is:

+ +
    +
  • +

    All tags should be lower case.

    +
  • + +
  • +

    Tags delimiting a block of text (even small blocks) + should be on their own line. Like:

    + +

     <para>
    +   Some text goes here.
    +  </para>
    +        

    Tags marking + individual words, or few words, should be in-line: + +

    +   Just to <emphasis>emphasize</emphasis>, some text goes here.
    + +        

    +
  • + +
  • +

    Tags should be nested and step indented for block text like: + (except in-line tags)

    + +

     <para>
    +   <itemizedlist>
    +    <para>
    +     <listitem>
    +       Some text goes here in our list example.
    + +      </listitem>
    +    </para>
    +   </itemizedlist>
    +  </para>
    +        

    This makes it easier + to find the text amongst the tags ;-) +
  • + +
  • +

    Use white space to separate logical divisions within a document, + like between sections. Running everything together consistently + makes it harder to read and work on.

    +
  • + +
  • +

    Do not hesitate to make comments. Comments can either use the + <comment> element, or the <!-- --> style comment + familiar from HTML. (Note in Docbook v4.x <comment> is + replaced by <remark>.)

    +
  • + +
  • +

    We have an international audience. Refrain from slang, or + English idiosyncrasies (too many to list :). Humor also does not + translate well sometimes.

    +
  • + +
  • +

    Try to keep overall line lengths in source files to 80 + characters or less for obvious reasons. This is not always + possible, with lengthy URLs for instance.

    +
  • + +
  • +

    Our documents are available in differing formats. Right now, + they are just plain text, HTML, and PDF, but others are always a + future possibility. Be careful with URLs (<ulink>), and avoid + this mistake:

    + +

    My favorite site is <ulink + url="http://example.com">here</ulink>.

    + +

    This will render as "My favorite site is + here", which is not real helpful in a text doc. Better like + this:

    + +

    My favorite site is <ulink + url="http://example.com">example.com</ulink>.

    +
  • + +
  • +

    All documents should be spell checked occasionally. aspell can check SGML with the -H option. (ispell + I think too.)

    +
  • +
+
+ +
+

3.3. Privoxy Custom + Entities

+ +

Privoxy documentation is using a + number of customized "entities" to + facilitate documentation maintenance.

+ +

We are using a set of "boilerplate" files + with generic text, that is used by multiple docs. This way we can write + something once, and use it repeatedly without having to re-write the + same content over and over again. If editing such a file, keep in mind + that it should be generic. + That is the purpose; so it can be used in varying contexts without + additional modifications.

+ +

We are also using what Docbook + calls "internal entities". These are like + variables in programming. Well, sort of. For instance, we have the + p-version entity that contains the current + Privoxy version string. You are + strongly encouraged to use these where possible. Some of these + obviously require re-setting with each release (done by the Makefile). + A sampling of custom entities are listed below. See any of the main + docs for examples.

+ +
    +
  • +

    Re- "boilerplate" text entities are + defined like:

    + +

    <!entity supported SYSTEM + "supported.sgml">

    + +

    In this example, the contents of the file, supported.sgml is available for inclusion anywhere + in the doc. To make this happen, just reference the now defined + entity: &supported; (starts with an + ampersand and ends with a semi-colon), and the contents will be + dumped into the finished doc at that point.

    +
  • + +
  • +

    Commonly used "internal + entities":

    + + + + + + + + + + + + + + + + + + + + + + + +
    p-version: the + Privoxy version string, e.g. + "3.0.19".
    p-status: the + project status, either "alpha", + "beta", or "stable".
    p-not-stable: + use to conditionally include text in "not + stable" releases (e.g. "beta").
    p-stable: just + the opposite.
    p-text: this + doc is only generated as text.
    +
  • +
+ +

There are others in various places that are defined for a specific + purpose. Read the source!

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/developer-manual/index.html b/external/privoxy/doc/webserver/developer-manual/index.html index 4360e6b4..07858e39 100644 --- a/external/privoxy/doc/webserver/developer-manual/index.html +++ b/external/privoxy/doc/webserver/developer-manual/index.html @@ -1,688 +1,406 @@ - -Privoxy Developer Manual

Privoxy Developer Manual

- - Copyright Š 2001-2009 by - Privoxy Developers - -

$Id: index.html,v 1.42 2009/03/21 12:59:32 fabiankeil Exp $

The developer manual provides guidance on coding, testing, packaging, documentation - and other issues of importance to those involved with - Privoxy development. It is mandatory (and helpful!) reading - for anyone who wants to join the team. Note that it's currently out of date - and may not be entirely correct. As always, patches are welcome.

Please note that this document is constantly evolving. This copy represents - the state at the release of version 3.0.12. - You can find the latest version of the this manual at http://www.privoxy.org/developer-manual/. - Please see the Contact section - on how to contact the developers.


Table of Contents
1. Introduction
1.1. Quickstart to Privoxy Development
2. The CVS Repository
2.1. Access to CVS
2.2. Branches
2.3. CVS Commit Guidelines
3. Documentation Guidelines
3.1. Quickstart to Docbook and SGML
3.2. Privoxy Documentation Style
3.3. Privoxy Custom Entities
4. Coding Guidelines
4.1. Introduction
4.2. Using Comments
4.2.1. Comment, Comment, Comment
4.2.2. Use blocks for comments
4.2.3. Keep Comments on their own line
4.2.4. Comment each logical step
4.2.5. Comment All Functions Thoroughly
4.2.6. Comment at the end of braces if the - content is more than one screen length
4.3. Naming Conventions
4.3.1. Variable Names
4.3.2. Function Names
4.3.3. Header file prototypes
4.3.4. Enumerations, and #defines
4.3.5. Constants
4.4. Using Space
4.4.1. Put braces on a line by themselves.
4.4.2. ALL control statements should have a - block
4.4.3. Do not belabor/blow-up boolean - expressions
4.4.4. Use white space freely because it is - free
4.4.5. Don't use white space around structure - operators
4.4.6. Make the last brace of a function stand - out
4.4.7. Use 3 character indentions
4.5. Initializing
4.5.1. Initialize all variables
4.6. Functions
4.6.1. Name functions that return a boolean as a - question.
4.6.2. Always specify a return type for a - function.
4.6.3. Minimize function calls when iterating by - using variables
4.6.4. Pass and Return by Const Reference
4.6.5. Pass and Return by Value
4.6.6. Names of include files
4.6.7. Provide multiple inclusion - protection
4.6.8. Use `extern "C"` when appropriate
4.6.9. Where Possible, Use Forward Struct - Declaration Instead of Includes
4.7. General Coding Practices
4.7.1. Turn on warnings
4.7.2. Provide a default case for all switch - statements
4.7.3. Try to avoid falling through cases in a - switch statement.
4.7.4. Use 'long' or 'short' Instead of - 'int'
4.7.5. Don't mix size_t and other types
4.7.6. Declare each variable and struct on its - own line.
4.7.7. Use malloc/zalloc sparingly
4.7.8. The Programmer Who Uses 'malloc' is - Responsible for Ensuring 'free'
4.7.9. Add loaders to the `file_list' structure - and in order
4.7.10. "Uncertain" new code and/or changes to - existing code, use FIXME or XXX
4.8. Addendum: Template for files and function - comment blocks:
5. Testing Guidelines
5.1. Testplan for releases
5.2. Test reports
6. Releasing a New Version
6.1. Version numbers
6.2. Before the Release: Freeze
6.3. Building and Releasing the Packages
6.3.1. Note on Privoxy Packaging
6.3.2. Source Tarball
6.3.3. SuSE, Conectiva or Red Hat RPM
6.3.4. OS/2
6.3.5. Solaris
6.3.6. Windows
6.3.7. Debian
6.3.8. Mac OS X
6.3.9. FreeBSD
6.3.10. HP-UX 11
6.3.11. Amiga OS
6.3.12. AIX
6.4. Uploading and Releasing Your Package
6.5. After the Release
7. Update the Webserver
8. Contacting the developers, Bug Reporting and Feature Requests
8.1. Get Support
8.2. Reporting Problems
8.2.1. Reporting Ads or Other Configuration Problems
8.2.2. Reporting Bugs
8.3. Request New Features
8.4. Other
9. Privoxy Copyright, License and History
9.1. License
9.2. History
10. See also

  Next
  Introduction
\ No newline at end of file + + + + + + + Privoxy Developer Manual + + + + + + + + +
+
+

Privoxy Developer + Manual

+ +

Copyright © + 2001-2009 by Privoxy + Developers

+ +

$Id: developer-manual.sgml,v 2.37 2011/11/13 + 17:03:54 fabiankeil Exp $

+ +
+ + +

The developer manual provides guidance on coding, testing, + packaging, documentation and other issues of importance to those + involved with Privoxy development. + It is mandatory (and helpful!) reading for anyone who wants to join + the team. Note that it's currently out of date and may not be + entirely correct. As always, patches are welcome.

+ +

Please note that this document is constantly evolving. This copy + represents the state at the release of version 3.0.19. You can find + the latest version of the this manual at http://www.privoxy.org/developer-manual/. Please see + the Contact section on how to contact the + developers.

+
+
+
+ +
+
+
Table of Contents
+ +
1. Introduction
+ +
+
+
1.1. Quickstart to + Privoxy Development
+
+
+ +
2. The CVS Repository
+ +
+
+
2.1. Access to CVS
+ +
2.2. Branches
+ +
2.3. CVS Commit + Guidelines
+
+
+ +
3. Documentation Guidelines
+ +
+
+
3.1. Quickstart to Docbook + and SGML
+ +
3.2. Privoxy Documentation Style
+ +
3.3. Privoxy Custom + Entities
+
+
+ +
4. Coding Guidelines
+ +
+
+
4.1. Introduction
+ +
4.2. Using Comments
+ +
+
+
4.2.1. Comment, Comment, + Comment
+ +
4.2.2. Use blocks for + comments
+ +
4.2.3. Keep Comments on their + own line
+ +
4.2.4. Comment each logical + step
+ +
4.2.5. Comment All Functions + Thoroughly
+ +
4.2.6. Comment at the end of + braces if the content is more than one screen length
+
+
+ +
4.3. Naming Conventions
+ +
+
+
4.3.1. Variable Names
+ +
4.3.2. Function Names
+ +
4.3.3. Header file + prototypes
+ +
4.3.4. Enumerations, and + #defines
+ +
4.3.5. Constants
+
+
+ +
4.4. Using Space
+ +
+
+
4.4.1. Put braces on a line by + themselves.
+ +
4.4.2. ALL control statements + should have a block
+ +
4.4.3. Do not belabor/blow-up + boolean expressions
+ +
4.4.4. Use white space freely + because it is free
+ +
4.4.5. Don't use white space + around structure operators
+ +
4.4.6. Make the last brace of a + function stand out
+ +
4.4.7. Use 3 character + indentions
+
+
+ +
4.5. Initializing
+ +
+
+
4.5.1. Initialize all + variables
+
+
+ +
4.6. Functions
+ +
+
+
4.6.1. Name functions that + return a boolean as a question.
+ +
4.6.2. Always specify a return + type for a function.
+ +
4.6.3. Minimize function calls + when iterating by using variables
+ +
4.6.4. Pass and Return by Const + Reference
+ +
4.6.5. Pass and Return by + Value
+ +
4.6.6. Names of include + files
+ +
4.6.7. Provide multiple + inclusion protection
+ +
4.6.8. Use `extern "C"` when + appropriate
+ +
4.6.9. Where Possible, Use + Forward Struct Declaration Instead of Includes
+
+
+ +
4.7. General Coding + Practices
+ +
+
+
4.7.1. Turn on + warnings
+ +
4.7.2. Provide a default case + for all switch statements
+ +
4.7.3. Try to avoid falling + through cases in a switch statement.
+ +
4.7.4. Use 'long' or 'short' + Instead of 'int'
+ +
4.7.5. Don't mix size_t and + other types
+ +
4.7.6. Declare each variable + and struct on its own line.
+ +
4.7.7. Use malloc/zalloc + sparingly
+ +
4.7.8. The Programmer Who Uses + 'malloc' is Responsible for Ensuring 'free'
+ +
4.7.9. Add loaders to the + `file_list' structure and in order
+ +
4.7.10. "Uncertain" new code + and/or changes to existing code, use FIXME or XXX
+
+
+ +
4.8. Addendum: Template for files + and function comment blocks:
+
+
+ +
5. Testing Guidelines
+ +
+
+
5.1. Testplan for + releases
+ +
5.2. Test + reports
+
+
+ +
6. Releasing a New Version
+ +
+
+
6.1. Version + numbers
+ +
6.2. Before the + Release: Freeze
+ +
6.3. Building and + Releasing the Packages
+ +
+
+
6.3.1. Note on + Privoxy Packaging
+ +
6.3.2. Source Tarball
+ +
6.3.3. SuSE, + Conectiva or Red Hat RPM
+ +
6.3.4. OS/2
+ +
6.3.5. Solaris
+ +
6.3.6. Windows
+ +
6.3.7. Debian
+ +
6.3.8. Mac OS + X
+ +
6.3.9. FreeBSD
+ +
6.3.10. HP-UX + 11
+ +
6.3.11. Amiga + OS
+ +
6.3.12. AIX
+
+
+ +
6.4. Uploading and + Releasing Your Package
+ +
6.5. After the + Release
+
+
+ +
7. Update the Webserver
+ +
8. Contacting the developers, Bug + Reporting and Feature Requests
+ +
+
+
8.1. Get + Support
+ +
8.2. Reporting + Problems
+ +
+
+
8.2.1. Reporting Ads + or Other Configuration Problems
+ +
8.2.2. Reporting + Bugs
+
+
+ +
8.3. Request New + Features
+ +
8.4. Mailing + Lists
+
+
+ +
9. Privoxy Copyright, License and + History
+ +
+
+
9.1. License
+ +
9.2. History
+
+
+ +
10. See also
+
+
+
+ + + + diff --git a/external/privoxy/doc/webserver/developer-manual/introduction.html b/external/privoxy/doc/webserver/developer-manual/introduction.html index 5ac1e59b..468f2fa6 100644 --- a/external/privoxy/doc/webserver/developer-manual/introduction.html +++ b/external/privoxy/doc/webserver/developer-manual/introduction.html @@ -1,199 +1,116 @@ - -Introduction
Privoxy Developer Manual
PrevNext

1. Introduction

Privoxy, as an heir to - Junkbuster, is a Free Software project - and the code is licensed under the GNU General Public License version 2. - As such, Privoxy development is potentially open - to anyone who has the time, knowledge, and desire to contribute - in any capacity. Our goals are simply to continue the mission, - to improve Privoxy, and - to make it available to as wide an audience as possible. -

One does not have to be a programmer to contribute. Packaging, testing, - documenting and porting, are all important jobs as well. -

1.1. Quickstart to Privoxy Development

The first step is to join the developer's mailing list. - You can submit your ideas, or even better patches. Patches are best - submitted to the Sourceforge tracker set up for this purpose, but - can be sent to the list for review too. -

You will also need to have a cvs package installed, which will - entail having ssh installed as well (which seems to be a requirement of - SourceForge), in order to access the cvs repository. Having the GNU build - tools is also going to be important (particularly, autoconf and gmake). -

For the time being (read, this section is under construction), you can - also refer to the extensive comments in the source code. In fact, - reading the code is recommended in any case. -


PrevHomeNext
Privoxy Developer Manual The CVS Repository
\ No newline at end of file + + + + + + + Introduction + + + + + + + + + + + + +
+

1. + Introduction

+ +

Privoxy, as an heir to Junkbuster, is a Free Software project and the code + is licensed under the GNU General Public License version 2. As such, + Privoxy development is potentially open + to anyone who has the time, knowledge, and desire to contribute in any + capacity. Our goals are simply to continue the mission, to improve + Privoxy, and to make it available to as + wide an audience as possible.

+ +

One does not have to be a programmer to contribute. Packaging, + testing, documenting and porting, are all important jobs as well.

+ +
+

1.1. Quickstart + to Privoxy Development

+ +

The first step is to join the developer's mailing list. You can submit your ideas, or even + better patches. Patches are best submitted to the Sourceforge tracker + set up for this purpose, but can be sent to the list for review + too.

+ +

You will also need to have a cvs package installed, which will + entail having ssh installed as well (which seems to be a requirement of + SourceForge), in order to access the cvs repository. Having the GNU + build tools is also going to be important (particularly, autoconf and + gmake).

+ +

For the time being (read, this section is under construction), you + can also refer to the extensive comments in the source code. In fact, + reading the code is recommended in any case.

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/developer-manual/newrelease.html b/external/privoxy/doc/webserver/developer-manual/newrelease.html index 0cdb4851..e4655fea 100644 --- a/external/privoxy/doc/webserver/developer-manual/newrelease.html +++ b/external/privoxy/doc/webserver/developer-manual/newrelease.html @@ -1,1956 +1,1089 @@ - -Releasing a New Version
Privoxy Developer Manual
PrevNext

6. Releasing a New Version

When we release versions of Privoxy, - our work leaves our cozy secret lab and has to work in the cold - RealWorld[tm]. Once it is released, there is no way to call it - back, so it is very important that great care is taken to ensure - that everything runs fine, and not to introduce problems in the - very last minute. -

So when releasing a new version, please adhere exactly to the - procedure outlined in this chapter. -

The following programs are required to follow this process: - ncftpput (ncftp), scp, ssh (ssh), - gmake (GNU's version of make), autoconf, cvs. -

6.1. Version numbers

First you need to determine which version number the release will have. - Privoxy version numbers consist of three numbers, - separated by dots, like in X.Y.Z (e.g. 3.0.0), where: -

  • X, the version major, is rarely ever changed. It is increased by one if - turning a development branch into stable substantially changes the functionality, - user interface or configuration syntax. Majors 1 and 2 were - Junkbuster, and 3 will be the first stable - Privoxy release. -

  • Y, the version minor, represents the branch within the major version. - At any point in time, there are two branches being maintained: - The stable branch, with an even minor, say, 2N, in which no functionality is - being added and only bug-fixes are made, and 2N+1, the development branch, in - which the further development of Privoxy takes - place. - This enables us to turn the code upside down and inside out, while at the same time - providing and maintaining a stable version. - The minor is reset to zero (and one) when the major is incremented. When a development - branch has matured to the point where it can be turned into stable, the old stable branch - 2N is given up (i.e. no longer maintained), the former development branch 2N+1 becomes the - new stable branch 2N+2, and a new development branch 2N+3 is opened. -

  • Z, the point or sub version, represents a release of the software within a branch. - It is therefore incremented immediately before each code freeze. - In development branches, only the even point versions correspond to actual releases, - while the odd ones denote the evolving state of the sources on CVS in between. - It follows that Z is odd on CVS in development branches most of the time. There, it gets - increased to an even number immediately before a code freeze, and is increased to an odd - number again immediately thereafter. - This ensures that builds from CVS snapshots are easily distinguished from released versions. - The point version is reset to zero when the minor changes. -

    Stable branches work a little differently, since there should be - little to no development happening in such branches. Remember, - only bugfixes, which presumably should have had some testing - before being committed. Stable branches will then have their - version reported as 0.0.0, during that period - between releases when changes are being added. This is to denote - that this code is not for release. Then - as the release nears, the version is bumped according: e.g. - 3.0.1 -> 0.0.0 -> 3.0.2. -

-

In summary, the main CVS trunk is the development branch where new - features are being worked on for the next stable series. This should - almost always be where the most activity takes place. There is always at - least one stable branch from the trunk, e.g now it is - 3.0, which is only used to release stable versions. - Once the initial *.0 release of the stable branch has been done, then as a - rule, only bugfixes that have had prior testing should be committed to - the stable branch. Once there are enough bugfixes to justify a new - release, the version of this branch is again incremented Example: 3.0.0 - -> 3.0.1 -> 3.0.2, etc are all stable releases from within the stable - branch. 3.1.x is currently the main trunk, and where work on 3.2.x is - taking place. If any questions, please post to the devel list - before committing to a stable branch! -

Developers should remember too that if they commit a bugfix to the stable - branch, this will more than likely require a separate submission to the - main trunk, since these are separate development trees within CVS. If you - are working on both, then this would require at least two separate check - outs (i.e main trunk, and the stable release branch, - which is v_3_0_branch at the moment). -

6.2. Before the Release: Freeze

The following must be done by one of the - developers prior to each new release. -

  • Make sure that everybody who has worked on the code in the last - couple of days has had a chance to yell "no!" in case - they have pending changes/fixes in their pipelines. Announce the - freeze so that nobody will interfere with last minute changes. -

  • Increment the version number (point from odd to even in development - branches!) in configure.in. (RPM spec files - will need to be incremented as well.) -

  • If default.action has changed since last - release (i.e. software release or standalone actions file release), - bump up its version info to A.B in this line: -

    -
      {+add-header{X-Actions-File-Version: A.B} -filter -no-popups}
    -

    - Then change the version info in doc/webserver/actions/index.php, - line: '$required_actions_file_version = "A.B";' -

  • All documentation should be rebuild after the version bump. - Finished docs should be then be committed to CVS (for those - without the ability to build these). Some docs may require - rather obscure processing tools. config, - the man page (and the html version of the man page), and the PDF docs - fall in this category. REAMDE, the man page, AUTHORS, and config - should all also be committed to CVS for other packagers. The - formal docs should be uploaded to the webserver. See the - Section "Updating the webserver" in this manual for details. -

  • The User Manual is also used for context - sensitive help for the CGI editor. This is version sensitive, so that - the user will get appropriate help for his/her release. So with - each release a fresh version should be uploaded to the webserver - (this is in addition to the main User Manual - link from the main page since we need to keep manuals for various - versions available). The CGI pages will link to something like - http://privoxy.org/$(VERSION)/user-manual/. This - will need to be updated for each new release. There is no Makefile - target for this at this time!!! It needs to be done manually. -

  • All developers should look at the ChangeLog and - make sure noteworthy changes are referenced. -

  • Commit all files that were changed in the above steps! -

  • Tag all files in CVS with the version number with - "cvs tag v_X_Y_Z". - Don't use vX_Y_Z, ver_X_Y_Z, v_X.Y.Z (won't work) etc. -

  • If the release was in a development branch, increase the point version - from even to odd (X.Y.(Z+1)) again in configure.in and - commit your change. -

  • On the webserver, copy the user manual to a new top-level directory - called X.Y.Z. This ensures that help links from the CGI - pages, which have the version as a prefix, will go into the right version of the manual. - If this is a development branch release, also symlink X.Y.(Z-1) - to X.Y.Z and X.Y.(Z+1) to - . (i.e. dot). -

-

6.3. Building and Releasing the Packages

Now the individual packages can be built and released. Note that for - GPL reasons the first package to be released is always the source tarball. -

For all types of packages, including the source tarball, - you must make sure that you build from clean sources by exporting - the right version from CVS into an empty directory (just press return when - asked for a password): -

+ +
  mkdir dist # delete or choose different name if it already exists
+
+
+
+
+  
+
+  Releasing a New Version
+  
+  
+  
+  
+  
+  
+  
+
+
+
+  
+
+  
+

6. Releasing a New + Version

+ +

When we release versions of Privoxy, + our work leaves our cozy secret lab and has to work in the cold + RealWorld[tm]. Once it is released, there is no way to call it back, so + it is very important that great care is taken to ensure that everything + runs fine, and not to introduce problems in the very last minute.

+ +

So when releasing a new version, please adhere exactly to the + procedure outlined in this chapter.

+ +

The following programs are required to follow this process: ncftpput (ncftp), scp, ssh + (ssh), gmake (GNU's version of make), autoconf, + cvs.

+ +
+

6.1. + Version numbers

+ +

First you need to determine which version number the release will + have. Privoxy version numbers consist + of three numbers, separated by dots, like in X.Y.Z (e.g. 3.0.0), + where:

+ +
    +
  • +

    X, the version major, is rarely ever changed. It is increased by + one if turning a development branch into stable substantially + changes the functionality, user interface or configuration syntax. + Majors 1 and 2 were Junkbuster, + and 3 will be the first stable Privoxy release.

    +
  • + +
  • +

    Y, the version minor, represents the branch within the major + version. At any point in time, there are two branches being + maintained: The stable branch, with an even minor, say, 2N, in + which no functionality is being added and only bug-fixes are made, + and 2N+1, the development branch, in which the further development + of Privoxy takes place. This + enables us to turn the code upside down and inside out, while at + the same time providing and maintaining a stable version. The minor + is reset to zero (and one) when the major is incremented. When a + development branch has matured to the point where it can be turned + into stable, the old stable branch 2N is given up (i.e. no longer + maintained), the former development branch 2N+1 becomes the new + stable branch 2N+2, and a new development branch 2N+3 is + opened.

    +
  • + +
  • +

    Z, the point or sub version, represents a release of the + software within a branch. It is therefore incremented immediately + before each code freeze. In development branches, only the even + point versions correspond to actual releases, while the odd ones + denote the evolving state of the sources on CVS in between. It + follows that Z is odd on CVS in development branches most of the + time. There, it gets increased to an even number immediately before + a code freeze, and is increased to an odd number again immediately + thereafter. This ensures that builds from CVS snapshots are easily + distinguished from released versions. The point version is reset to + zero when the minor changes.

    + +

    Stable branches work a little differently, since there should be + little to no development happening in such branches. Remember, only + bugfixes, which presumably should have had some testing before + being committed. Stable branches will then have their version + reported as 0.0.0, during that period + between releases when changes are being added. This is to denote + that this code is not for + release. Then as the release nears, the version is bumped + according: e.g. 3.0.1 -> 0.0.0 -> + 3.0.2.

    +
  • +
+ +

In summary, the main CVS trunk is the development branch where new + features are being worked on for the next stable series. This should + almost always be where the most activity takes place. There is always + at least one stable branch from the trunk, e.g now it is 3.0, which is only used to release stable versions. Once + the initial *.0 release of the stable branch has been done, then as a + rule, only bugfixes that have had prior testing should be committed to + the stable branch. Once there are enough bugfixes to justify a new + release, the version of this branch is again incremented Example: 3.0.0 + -> 3.0.1 -> 3.0.2, etc are all stable releases from within the + stable branch. 3.1.x is currently the main trunk, and where work on + 3.2.x is taking place. If any questions, please post to the devel list + before committing to a stable + branch!

+ +

Developers should remember too that if they commit a bugfix to the + stable branch, this will more than likely require a separate submission + to the main trunk, since these are separate development trees within + CVS. If you are working on both, then this would require at least two + separate check outs (i.e main trunk, and the stable release branch, which is + v_3_0_branch at the moment).

+
+ +
+

6.2. + Before the Release: Freeze

+ +

The following must be done by one + of the developers prior to each new release.

+ +
    +
  • +

    Make sure that everybody who has worked on the code in the last + couple of days has had a chance to yell "no!" in case they have pending changes/fixes in + their pipelines. Announce the freeze so that nobody will interfere + with last minute changes.

    +
  • + +
  • +

    Increment the version number (point from odd to even in + development branches!) in configure.in. + (RPM spec files will need to be incremented as well.)

    +
  • + +
  • +

    If default.action has changed since + last release (i.e. software release or standalone actions file + release), bump up its version info to A.B in this line:

    + + + + + +
    +
    +  {+add-header{X-Actions-File-Version: A.B} -filter -no-popups}
    +
    +
    + +

    Then change the version info in doc/webserver/actions/index.php, + line: '$required_actions_file_version = "A.B";'

    +
  • + +
  • +

    All documentation should be rebuild after the version bump. + Finished docs should be then be committed to CVS (for those without + the ability to build these). Some docs may require rather obscure + processing tools. config, the man page + (and the html version of the man page), and the PDF docs fall in + this category. REAMDE, the man page, AUTHORS, and config should all + also be committed to CVS for other packagers. The formal docs + should be uploaded to the webserver. See the Section "Updating the + webserver" in this manual for details.

    +
  • + +
  • +

    The User Manual is also used for + context sensitive help for the CGI editor. This is version + sensitive, so that the user will get appropriate help for his/her + release. So with each release a fresh version should be uploaded to + the webserver (this is in addition to the main User Manual link from the main page since we need + to keep manuals for various versions available). The CGI pages will + link to something like http://privoxy.org/$(VERSION)/user-manual/. This + will need to be updated for each new release. There is no Makefile + target for this at this time!!! It needs to be done manually.

    +
  • + +
  • +

    All developers should look at the ChangeLog and make sure noteworthy changes are + referenced.

    +
  • + +
  • +

    Commit all files that were + changed in the above steps!

    +
  • + +
  • +

    Tag all files in CVS with the version number with "cvs tag v_X_Y_Z". Don't use + vX_Y_Z, ver_X_Y_Z, v_X.Y.Z (won't work) etc.

    +
  • + +
  • +

    If the release was in a development branch, increase the point + version from even to odd (X.Y.(Z+1)) again in configure.in and commit your change.

    +
  • + +
  • +

    On the webserver, copy the user manual to a new top-level + directory called X.Y.Z. This ensures that + help links from the CGI pages, which have the version as a prefix, + will go into the right version of the manual. If this is a + development branch release, also symlink X.Y.(Z-1) to X.Y.Z and + X.Y.(Z+1) to . + (i.e. dot).

    +
  • +
+
+ +
+

6.3. Building + and Releasing the Packages

+ +

Now the individual packages can be built and released. Note that for + GPL reasons the first package to be released is always the source + tarball.

+ +

For all types of packages, + including the source tarball, you + must make sure that you build from clean sources by exporting the right + version from CVS into an empty directory (just press return when + asked for a password):

+ + + +
+
+  mkdir dist # delete or choose different name if it already exists
   cd dist
   cvs -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa login
-  cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa export -r v_X_Y_Z current
-

Do NOT change a single bit, including, but not limited to - version information after export from CVS. This is to make sure that - all release packages, and with them, all future bug reports, are based - on exactly the same code. -

Warning

Every significant release of Privoxy has included at least one - package that either had incorrect versions of files, missing files, - or incidental leftovers from a previous build process that gave - unknown numbers of users headaches to try to figure out what was - wrong. PLEASE, make sure you are using pristene sources, and are - following the prescribed process! -

Please find additional instructions for the source tarball and the - individual platform dependent binary packages below. And details - on the Sourceforge release process below that. -

6.3.1. Note on Privoxy Packaging

Please keep these general guidelines in mind when putting together - your package. These apply to all platforms! -

  • Privoxy requires - write access to: all *.action files, all - logfiles, and the trust file. You will - need to determine the best way to do this for your platform. -

  • Please include up to date documentation. At a bare minimum: -

    LICENSE (top-level directory) -

    README (top-level directory) -

    AUTHORS (top-level directory) -

    man page (top-level directory, Unix-like - platforms only) -

    The User Manual (doc/webserver/user-manual/) -

    FAQ (doc/webserver/faq/) -

    Also suggested: Developer Manual - (doc/webserver/developer-manual) and ChangeLog - (top-level directory). FAQ and the manuals are - HTML docs. There are also text versions in - doc/text/ which could conceivably also be - included. -

    The documentation has been designed such that the manuals are linked - to each other from parallel directories, and should be packaged - that way. privoxy-index.html can also be - included and can serve as a focal point for docs and other links of - interest (and possibly renamed to index.html). - This should be one level up from the manuals. There is a link also - on this page to an HTMLized version of the man page. To avoid 404 for - this, it is in CVS as - doc/webserver/man-page/privoxy-man-page.html, - and should be included along with the manuals. There is also a - css stylesheets that can be included for better presentation: - p_doc.css. This should be in the same directory - with privoxy-index.html, (i.e. one level up from - the manual directories). -

  • user.action and user.filter - are designed for local preferences. Make sure these do not get overwritten! - config should not be overwritten either. This - has especially important configuration data in it. - trust should be left in tact as well. -

  • Other configuration files (default.action and - default.filter) should be installed as the new - defaults, but all previously installed configuration files should be - preserved as backups. This is just good manners :-) These files are - likely to change between releases and contain important new features - and bug fixes. -

  • Please check platform specific notes in this doc, if you haven't - done "Privoxy" packaging before for other platform - specific issues. Conversely, please add any notes that you know - are important for your platform (or contact one of the doc - maintainers to do this if you can't). -

  • Packagers should do a "clean" install of their - package after building it. So any previous installs should be - removed first to ensure the integrity of the newly built package. - Then run the package for a while to make sure there are no - obvious problems, before uploading. -

-

6.3.2. Source Tarball

First, make sure that you have freshly exported the right - version into an empty directory. (See "Building and releasing - packages" above). Then run: -

  cd current
-  autoheader && autoconf && ./configure
-

Then do: -

  make tarball-dist
-

To upload the package to Sourceforge, simply issue -

  make tarball-upload
-

Go to the displayed URL and release the file publicly on Sourceforge. - For the change log field, use the relevant section of the - ChangeLog file. -

6.3.3. SuSE, Conectiva or Red Hat RPM

In following text, replace dist - with either "rh" for Red Hat or "suse" for SuSE. -

First, make sure that you have freshly exported the right - version into an empty directory. (See "Building and releasing - packages" above). -

As the only exception to not changing anything after export from CVS, - now examine the file privoxy-dist.spec - and make sure that the version information and the RPM release number are - correct. The RPM release numbers for each version start at one. Hence it must - be reset to one if this is the first RPM for - dist which is built from version - X.Y.Z. Check the - file - list if unsure. Else, it must be set to the highest already available RPM - release number for that version plus one. -

Then run: -

  cd current
-  autoheader && autoconf && ./configure
-

Then do -

  make dist-dist
-

To upload the package to Sourceforge, simply issue -

  make dist-upload rpm_packagerev
-

where rpm_packagerev is the - RPM release number as determined above. - Go to the displayed URL and release the file publicly on Sourceforge. - Use the release notes and change log from the source tarball package. -

6.3.4. OS/2

First, make sure that you have freshly exported the right - version into an empty directory. (See "Building and releasing - packages" above). Then get the OS/2 Setup module: -

  cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co os2setup
-

You will need a mix of development tools. - The main compilation takes place with IBM Visual Age C++. - Some ancillary work takes place with GNU tools, available from - various sources like hobbes.nmsu.edu. - Specificially, you will need autoheader, - autoconf and sh tools. - The packaging takes place with WarpIN, available from various sources, including - its home page: xworkplace. -

Change directory to the os2setup directory. - Edit the os2build.cmd file to set the final executable filename. - For example, -

  installExeName='privoxyos2_setup_X.Y.Z.exe'
-

Next, edit the IJB.wis file so the release number matches - in the PACKAGEID section: -

  PACKAGEID="Privoxy Team\Privoxy\Privoxy Package\X\Y\Z"
-

You're now ready to build. Run: -

  os2build
-

You will find the WarpIN-installable executable in the - ./files directory. Upload this anonymously to - uploads.sourceforge.net/incoming, create a release - for it, and you're done. Use the release notes and Change Log from the - source tarball package. -

6.3.5. Solaris

Login to Sourceforge's compilefarm via ssh: -

  ssh cf.sourceforge.net
-

Choose the right operating system (not the Debian one). - When logged in, make sure that you have freshly exported the right - version into an empty directory. (See "Building and releasing - packages" above). Then run: -

  cd current
-  autoheader && autoconf && ./configure
-

Then run -

  gmake solaris-dist
-

which creates a gzip'ed tar archive. Sadly, you cannot use make - solaris-upload on the Sourceforge machine (no ncftpput). You now have - to manually upload the archive to Sourceforge's ftp server and release - the file publicly. Use the release notes and Change Log from the - source tarball package. -

6.3.6. Windows

You should ensure you have the latest version of Cygwin (from - http://www.cygwin.com/). - Run the following commands from within a Cygwin bash shell. -

First, make sure that you have freshly exported the right - version into an empty directory. (See "Building and releasing - packages" above). Then get the Windows setup module: -

  cvs -z3  -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co winsetup
-

Then you can build the package. This is fully automated, and is - controlled by winsetup/GNUmakefile. - All you need to do is: -

  cd winsetup
-  make
-

Now you can manually rename privoxy_setup.exe to - privoxy_setup_X_Y_Z.exe, and upload it to - SourceForge. When releasing the package on SourceForge, use the release notes - and Change Log from the source tarball package. -

6.3.7. Debian

First, make sure that you have freshly exported the - right version into an empty directory. (See - "Building and releasing packages" above). Then add a log - entry to debian/changelog, if it is not - already there, for example by running: -

  debchange -v 3.0.12-stable-1 "New upstream version"
-

Then, run: -

  dpkg-buildpackage -rfakeroot -us -uc -b
-

This will create - ../privoxy_3.0.12-stable-1_i386.deb - which can be uploaded. To upload the package to Sourceforge, simply - issue -

  make debian-upload
-

6.3.8. Mac OS X

First, make sure that you have freshly exported the right - version into an empty directory. (See "Building and releasing - packages" above). Then get the Mac OS X setup module: -

  cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co osxsetup
-

Then run: -

  cd osxsetup
-  build
-

This will run autoheader, autoconf and - configure as well as make. - Finally, it will copy over the necessary files to the ./osxsetup/files directory - for further processing by PackageMaker. -

Bring up PackageMaker with the PrivoxyPackage.pmsp definition file, modify the package - name to match the release, and hit the "Create package" button. - If you specify ./Privoxy.pkg as the output package name, you can then create - the distributable zip file with the command: -

  zip -r privoxyosx_setup_x.y.z.zip Privoxy.pkg
-

You can then upload privoxyosx_setup_x.y.z.zip anonymously to - uploads.sourceforge.net/incoming, - create a release for it, and you're done. Use the release notes - and Change Log from the source tarball package. -

6.3.9. FreeBSD

Login to Sourceforge's compile-farm via ssh: -

  ssh cf.sourceforge.net
-

Choose the right operating system. - When logged in, make sure that you have freshly exported the right - version into an empty directory. (See "Building and releasing - packages" above). Then run: -

  cd current
-  autoheader && autoconf && ./configure
-

Then run: -

  gmake freebsd-dist
-

which creates a gzip'ed tar archive. Sadly, you cannot use make - freebsd-upload on the Sourceforge machine (no ncftpput). You now have - to manually upload the archive to Sourceforge's ftp server and release - the file publicly. Use the release notes and Change Log from the - source tarball package. -

6.3.10. HP-UX 11

First, make sure that you have freshly exported the right - version into an empty directory. (See "Building and releasing - packages" above). Then run: -

  cd current
-  autoheader && autoconf && ./configure
-

Then do FIXME. -

6.3.11. Amiga OS

First, make sure that you have freshly exported the right - version into an empty directory. (See "Building and releasing - packages" above). Then run: -

  cd current
-  autoheader && autoconf && ./configure
-

Then do FIXME. -

6.3.12. AIX

Login to Sourceforge's compilefarm via ssh: -

  ssh cf.sourceforge.net
-

Choose the right operating system. - When logged in, make sure that you have freshly exported the right - version into an empty directory. (See "Building and releasing - packages" above). Then run: -

  cd current
-  autoheader && autoconf && ./configure
-

Then run: -

  make aix-dist
-

which creates a gzip'ed tar archive. Sadly, you cannot use make - aix-upload on the Sourceforge machine (no ncftpput). You now have - to manually upload the archive to Sourceforge's ftp server and release - the file publicly. Use the release notes and Change Log from the - source tarball package. -

6.4. Uploading and Releasing Your Package

After the package is ready, it is time to upload it - to SourceForge, and go through the release steps. The upload - is done via FTP: -

-

Or use the make targets as described above. -

Once this done go to https://sourceforge.net/project/admin/editpackages.php?group_id=11118, - making sure you are logged in. Find your target platform in the - second column, and click Add Release. You will - then need to create a new release for your package, using the format - of $VERSION ($CODE_STATUS), e.g. 3.0.12 - (beta). -

Now just follow the prompts. Be sure to add any appropriate Release - notes. You should see your freshly uploaded packages in - "Step 2. Add Files To This Release". Check the - appropriate box(es). Remember at each step to hit the - "Refresh/Submit" buttons! You should now see your - file(s) listed in Step 3. Fill out the forms with the appropriate - information for your platform, being sure to hit "Update" - for each file. If anyone is monitoring your platform, check the - "email" box at the very bottom to notify them of - the new package. This should do it! -

If you have made errors, or need to make changes, you can go through - essentially the same steps, but select Edit Release, - instead of Add Release. -

6.5. After the Release

When all (or: most of the) packages have been uploaded and made available, - send an email to the announce - mailing list, Subject: "Version X.Y.Z available for download". Be sure to - include the - download - location, the release notes and the Changelog. Also, post an - updated News item on the project page Sourceforge, and update the Home - page and docs linked from the Home page (see below). Other news sites - and release oriented sites, such as Freshmeat, should also be notified. -


PrevHomeNext
Testing Guidelines Update the Webserver
\ No newline at end of file + cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa export -r v_X_Y_Z current +
+
+ +

Do NOT change a single + bit, including, but not limited to version information after export + from CVS. This is to make sure that all release packages, and with + them, all future bug reports, are based on exactly the same code.

+ +
+ + + + + + + + +
Warning
+

Every significant release of Privoxy has included at least + one package that either had incorrect versions of files, + missing files, or incidental leftovers from a previous build + process that gave unknown numbers of users headaches to try to + figure out what was wrong. PLEASE, make sure you are using + pristene sources, and are following the prescribed process!

+
+
+ +

Please find additional instructions for the source tarball and the + individual platform dependent binary packages below. And details on the + Sourceforge release process below that.

+ +
+

6.3.1. Note on Privoxy Packaging

+ +

Please keep these general guidelines in mind when putting together + your package. These apply to all platforms!

+ +
    +
  • +

    Privoxy requires write access to: all + *.action files, all logfiles, and the + trust file. You will need to determine + the best way to do this for your platform.

    +
  • + +
  • +

    Please include up to date documentation. At a bare + minimum:

    + + + + + + + +
    LICENSE (top-level + directory)
    + + + + + + + +
    README (top-level + directory)
    + + + + + + + +
    AUTHORS (top-level + directory)
    + + + + + + + +
    man page (top-level + directory, Unix-like platforms only)
    + + + + + + + +
    The User Manual + (doc/webserver/user-manual/)
    + + + + + + + +
    FAQ (doc/webserver/faq/)
    + +

    Also suggested: Developer Manual + (doc/webserver/developer-manual) and ChangeLog (top-level directory). FAQ and the manuals are HTML docs. There are also + text versions in doc/text/ which could + conceivably also be included.

    + +

    The documentation has been designed such that the manuals are + linked to each other from parallel directories, and should be + packaged that way. privoxy-index.html + can also be included and can serve as a focal point for docs and + other links of interest (and possibly renamed to index.html). This should be one level up from the + manuals. There is a link also on this page to an HTMLized version + of the man page. To avoid 404 for this, it is in CVS as + doc/webserver/man-page/privoxy-man-page.html, + and should be included along with the manuals. There is also a + css stylesheets that can be included for better presentation: + p_doc.css. This should be in the same + directory with privoxy-index.html, + (i.e. one level up from the manual directories).

    +
  • + +
  • +

    user.action and user.filter are designed for local preferences. + Make sure these do not get overwritten! config should not be overwritten either. This has + especially important configuration data in it. trust should be left in tact as well.

    +
  • + +
  • +

    Other configuration files (default.action and default.filter) should be installed as the new + defaults, but all previously installed configuration files should + be preserved as backups. This is just good manners :-) These + files are likely to change between releases and contain important + new features and bug fixes.

    +
  • + +
  • +

    Please check platform specific notes in this doc, if you + haven't done "Privoxy" packaging + before for other platform specific issues. Conversely, please add + any notes that you know are important for your platform (or + contact one of the doc maintainers to do this if you can't).

    +
  • + +
  • +

    Packagers should do a "clean" + install of their package after building it. So any previous + installs should be removed first to ensure the integrity of the + newly built package. Then run the package for a while to make + sure there are no obvious problems, before uploading.

    +
  • +
+
+ +
+

6.3.2. Source Tarball

+ +

First, make sure that you have + freshly exported the right version into an empty directory. + (See "Building and releasing packages" above). Then run:

+ + + + + +
+
+  cd current
+  autoheader && autoconf && ./configure
+
+
+ +

Then do:

+ + + + + +
+
+  make tarball-dist
+
+
+ +

To upload the package to Sourceforge, simply issue

+ + + + + +
+
+  make tarball-upload
+
+
+ +

Go to the displayed URL and release the file publicly on + Sourceforge. For the change log field, use the relevant section of + the ChangeLog file.

+
+ +
+

6.3.3. + SuSE, Conectiva or Red Hat RPM

+ +

In following text, replace dist + with either "rh" for Red Hat or + "suse" for SuSE.

+ +

First, make sure that you have + freshly exported the right version into an empty directory. + (See "Building and releasing packages" above).

+ +

As the only exception to not changing anything after export from + CVS, now examine the file privoxy-dist.spec + and make sure that the version information and the RPM release number + are correct. The RPM release numbers for each version start at one. + Hence it must be reset to one if this is the first RPM for dist which is built from version X.Y.Z. Check + the file list if unsure. Else, it must be set to the highest + already available RPM release number for that version plus one.

+ +

Then run:

+ + + + + +
+
+  cd current
+  autoheader && autoconf && ./configure
+
+
+ +

Then do

+ + + + + +
+
+  make dist-dist
+
+
+ +

To upload the package to Sourceforge, simply issue

+ + + + + +
+
+  make dist-upload rpm_packagerev
+
+
+ +

where rpm_packagerev is the RPM + release number as determined above. Go to the displayed URL and + release the file publicly on Sourceforge. Use the release notes and + change log from the source tarball package.

+
+ +
+

6.3.4. + OS/2

+ +

First, make sure that you have + freshly exported the right version into an empty directory. + (See "Building and releasing packages" above). Then get the OS/2 + Setup module:

+ + + + + +
+
+  cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co os2setup
+
+
+ +

You will need a mix of development tools. The main compilation + takes place with IBM Visual Age C++. Some ancillary work takes place + with GNU tools, available from various sources like hobbes.nmsu.edu. + Specificially, you will need autoheader, + autoconf and sh + tools. The packaging takes place with WarpIN, available from various + sources, including its home page: xworkplace.

+ +

Change directory to the os2setup + directory. Edit the os2build.cmd file to set the final executable + filename. For example,

+ + + + + +
+
+  installExeName='privoxyos2_setup_X.Y.Z.exe'
+
+
+ +

Next, edit the IJB.wis file so the + release number matches in the PACKAGEID + section:

+ + + + + +
+
+  PACKAGEID="Privoxy Team\Privoxy\Privoxy Package\X\Y\Z"
+
+
+ +

You're now ready to build. Run:

+ + + + + +
+
+  os2build
+
+
+ +

You will find the WarpIN-installable executable in the ./files directory. Upload this anonymously to + uploads.sourceforge.net/incoming, create a + release for it, and you're done. Use the release notes and Change Log + from the source tarball package.

+
+ +
+

6.3.5. Solaris

+ +

Login to Sourceforge's compilefarm via ssh:

+ + + + + +
+
+  ssh cf.sourceforge.net
+
+
+ +

Choose the right operating system (not the Debian one). When + logged in, make sure that you have + freshly exported the right version into an empty directory. + (See "Building and releasing packages" above). Then run:

+ + + + + +
+
+  cd current
+  autoheader && autoconf && ./configure
+
+
+ +

Then run

+ + + + + +
+
+  gmake solaris-dist
+
+
+ +

which creates a gzip'ed tar archive. Sadly, you cannot use + make solaris-upload on the Sourceforge machine + (no ncftpput). You now have to manually upload the archive to + Sourceforge's ftp server and release the file publicly. Use the + release notes and Change Log from the source tarball package.

+
+ +
+

6.3.6. Windows

+ +

You should ensure you have the latest version of Cygwin (from + http://www.cygwin.com/). Run the following commands from + within a Cygwin bash shell.

+ +

First, make sure that you have + freshly exported the right version into an empty directory. + (See "Building and releasing packages" above). Then get the Windows + setup module:

+ + + + + +
+
+  cvs -z3  -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co winsetup
+
+
+ +

Then you can build the package. This is fully automated, and is + controlled by winsetup/GNUmakefile. All you + need to do is:

+ + + + + +
+
+  cd winsetup
+  make
+
+
+ +

Now you can manually rename privoxy_setup.exe to privoxy_setup_X_Y_Z.exe, and upload it to + SourceForge. When releasing the package on SourceForge, use the + release notes and Change Log from the source tarball package.

+
+ +
+

6.3.7. Debian

+ +

First, make sure that you have + freshly exported the right version into an empty directory. + (See "Building and releasing packages" above). Then add a log entry + to debian/changelog, if it is not already + there, for example by running:

+ + + + + +
+
+  debchange -v 3.0.19-stable-1 "New upstream version"
+
+
+ +

Then, run:

+ + + + + +
+
+  dpkg-buildpackage -rfakeroot -us -uc -b
+
+
+ +

This will create ../privoxy_3.0.19-stable-1_i386.deb which can be + uploaded. To upload the package to Sourceforge, simply issue

+ + + + + +
+
+  make debian-upload
+
+
+
+ +
+

6.3.8. Mac OS X

+ +

First, make sure that you have + freshly exported the right version into an empty directory. + (See "Building and releasing packages" above). Then get the Mac OS X + setup module:

+ + + + + +
+
+  cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co osxsetup
+
+
+ +

Then run:

+ + + + + +
+
+  cd osxsetup
+  build
+
+
+ +

This will run autoheader, autoconf and configure as + well as make. Finally, it will copy over + the necessary files to the ./osxsetup/files directory for further + processing by PackageMaker.

+ +

Bring up PackageMaker with the PrivoxyPackage.pmsp definition + file, modify the package name to match the release, and hit the + "Create package" button. If you specify ./Privoxy.pkg as the output + package name, you can then create the distributable zip file with the + command:

+ + + + + +
+
+  zip -r privoxyosx_setup_x.y.z.zip Privoxy.pkg
+
+
+ +

You can then upload privoxyosx_setup_x.y.z.zip anonymously to uploads.sourceforge.net/incoming, create a release + for it, and you're done. Use the release notes and Change Log from + the source tarball package.

+
+ +
+

6.3.9. FreeBSD

+ +

Login to Sourceforge's compile-farm via ssh:

+ + + + + +
+
+  ssh cf.sourceforge.net
+
+
+ +

Choose the right operating system. When logged in, make sure that you have freshly exported the + right version into an empty directory. (See "Building and + releasing packages" above). Then run:

+ + + + + +
+
+  cd current
+  autoheader && autoconf && ./configure
+
+
+ +

Then run:

+ + + + + +
+
+  gmake freebsd-dist
+
+
+ +

which creates a gzip'ed tar archive. Sadly, you cannot use + make freebsd-upload on the Sourceforge machine + (no ncftpput). You now have to manually upload the archive to + Sourceforge's ftp server and release the file publicly. Use the + release notes and Change Log from the source tarball package.

+
+ +
+

6.3.10. HP-UX 11

+ +

First, make sure that you have + freshly exported the right version into an empty directory. + (See "Building and releasing packages" above). Then run:

+ + + + + +
+
+  cd current
+  autoheader && autoconf && ./configure
+
+
+ +

Then do FIXME.

+
+ +
+

6.3.11. Amiga OS

+ +

First, make sure that you have + freshly exported the right version into an empty directory. + (See "Building and releasing packages" above). Then run:

+ + + + + +
+
+  cd current
+  autoheader && autoconf && ./configure
+
+
+ +

Then do FIXME.

+
+ +
+

6.3.12. AIX

+ +

Login to Sourceforge's compilefarm via ssh:

+ + + + + +
+
+  ssh cf.sourceforge.net
+
+
+ +

Choose the right operating system. When logged in, make sure that you have freshly exported the + right version into an empty directory. (See "Building and + releasing packages" above). Then run:

+ + + + + +
+
+  cd current
+  autoheader && autoconf && ./configure
+
+
+ +

Then run:

+ + + + + +
+
+  make aix-dist
+
+
+ +

which creates a gzip'ed tar archive. Sadly, you cannot use + make aix-upload on the Sourceforge machine (no + ncftpput). You now have to manually upload the archive to + Sourceforge's ftp server and release the file publicly. Use the + release notes and Change Log from the source tarball package.

+
+
+ +
+

6.4. Uploading and + Releasing Your Package

+ +

After the package is ready, it is time to upload it to SourceForge, + and go through the release steps. The upload is done via FTP:

+ + + +

Or use the make targets as described + above.

+ +

Once this done go to https://sourceforge.net/project/admin/editpackages.php?group_id=11118, + making sure you are logged in. Find your target platform in the second + column, and click Add Release. You will then + need to create a new release for your package, using the format of + $VERSION ($CODE_STATUS), e.g. 3.0.19 (beta).

+ +

Now just follow the prompts. Be sure to add any appropriate Release + notes. You should see your freshly uploaded packages in "Step 2. Add Files To This Release". Check the + appropriate box(es). Remember at each step to hit the "Refresh/Submit" buttons! You should now see your + file(s) listed in Step 3. Fill out the forms with the appropriate + information for your platform, being sure to hit "Update" for each file. If anyone is monitoring your + platform, check the "email" box at the very + bottom to notify them of the new package. This should do it!

+ +

If you have made errors, or need to make changes, you can go through + essentially the same steps, but select Edit + Release, instead of Add Release.

+
+ +
+

6.5. After + the Release

+ +

When all (or: most of the) packages have been uploaded and made + available, send an email to the announce + mailing list, Subject: "Version X.Y.Z available for download". Be + sure to include the download location, the release notes and the Changelog. + Also, post an updated News item on the project page Sourceforge, and + update the Home page and docs linked from the Home page (see below). + Other news sites and release oriented sites, such as Freshmeat, should + also be notified.

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/developer-manual/quickstart.html b/external/privoxy/doc/webserver/developer-manual/quickstart.html deleted file mode 100644 index ba84f139..00000000 --- a/external/privoxy/doc/webserver/developer-manual/quickstart.html +++ /dev/null @@ -1,150 +0,0 @@ -Quickstart to Privoxy Development
Privoxy Developer Manual
PrevNext

3. Quickstart to Privoxy Development

You'll need an account on Sourceforge to support our - development. Mail your ID to the list and wait until a - project manager has added you. -

For the time being (read, this section is under construction), please - refer to the extensive comments in the source code. -


PrevHomeNext
Introduction The CVS Repository
\ No newline at end of file diff --git a/external/privoxy/doc/webserver/developer-manual/seealso.html b/external/privoxy/doc/webserver/developer-manual/seealso.html index 35ee27cb..ee706f56 100644 --- a/external/privoxy/doc/webserver/developer-manual/seealso.html +++ b/external/privoxy/doc/webserver/developer-manual/seealso.html @@ -1,405 +1,204 @@ - -See also
Privoxy Developer Manual
Prev 

10. See also

Other references and sites of interest to Privoxy - users:

http://www.privoxy.org/, - the Privoxy Home page. -

-

http://www.privoxy.org/faq/, - the Privoxy FAQ. -

-

http://www.privoxy.org/developer-manual/, - the Privoxy developer manual. -

-

https://sourceforge.net/projects/ijbswa/, - the Project Page for Privoxy on - SourceForge. -

-

http://config.privoxy.org/, - the web-based user interface. Privoxy must be - running for this to work. Shortcut: http://p.p/ -

-

https://sourceforge.net/tracker/?group_id=11118&atid=460288, to submit "misses" and other - configuration related suggestions to the developers. -

- - -

http://www.junkbusters.com/ht/en/cookies.html, - an explanation how cookies are used to track web users. -

-

http://www.junkbusters.com/ijb.html, - the original Internet Junkbuster. -

-

http://www.squid-cache.org/, a popular - caching proxy, which is often used together with Privoxy. -

-

http://www.pps.jussieu.fr/~jch/software/polipo/, - Polipo is a caching proxy with advanced features - like pipelining, multiplexing and caching of partial instances. In many setups - it can be used as Squid replacement. -

-

https://www.torproject.org/, - Tor can help anonymize web browsing, - web publishing, instant messaging, IRC, SSH, and other applications. -

-


PrevHome 
Privoxy Copyright, License and History  
\ No newline at end of file + + + + + + + See also + + + + + + + + + + + +
+

10. See also

+ +

Other references and sites of interest to Privoxy users:

+ + + + + + + +
http://www.privoxy.org/, the Privoxy Home page.
+ + + + + + + +
http://www.privoxy.org/faq/, the Privoxy FAQ.
+ + + + + + + +
http://www.privoxy.org/developer-manual/, the + Privoxy developer manual.
+ + + + + + + +
https://sourceforge.net/projects/ijbswa/, the Project + Page for Privoxy on SourceForge.
+ + + + + + + +
http://config.privoxy.org/, the web-based user + interface. Privoxy must be running + for this to work. Shortcut: http://p.p/
+ + + + + + + +
https://sourceforge.net/tracker/?group_id=11118&atid=460288, + to submit "misses" and other + configuration related suggestions to the developers.
+ + + + + + + +
http://www.junkbusters.com/ht/en/cookies.html, an + explanation how cookies are used to track web users.
+ + + + + + + +
http://www.junkbusters.com/ijb.html, the original + Internet Junkbuster.
+ + + + + + + +
http://www.squid-cache.org/, a popular caching proxy, + which is often used together with Privoxy.
+ + + + + + + +
http://www.pps.jussieu.fr/~jch/software/polipo/, + Polipo is a caching proxy with + advanced features like pipelining, multiplexing and caching of + partial instances. In many setups it can be used as Squid replacement.
+ + + + + + + +
https://www.torproject.org/, Tor can help anonymize web browsing, web + publishing, instant messaging, IRC, SSH, and other + applications.
+
+ + + + diff --git a/external/privoxy/doc/webserver/developer-manual/testing.html b/external/privoxy/doc/webserver/developer-manual/testing.html index 80d3f292..9f8abf6c 100644 --- a/external/privoxy/doc/webserver/developer-manual/testing.html +++ b/external/privoxy/doc/webserver/developer-manual/testing.html @@ -1,259 +1,169 @@ - -Testing Guidelines
Privoxy Developer Manual
PrevNext

5. Testing Guidelines

To be filled.

5.1. Testplan for releases

Explain release numbers. major, minor. developer releases. etc. + -

  1. Remove any existing rpm with rpm -e

  2. Remove any file that was left over. This includes (but is not limited to) -

    • /var/log/privoxy

    • /etc/privoxy

    • /usr/sbin/privoxy

    • /etc/init.d/privoxy

    • /usr/doc/privoxy*

  3. Install the rpm. Any error messages?

  4. start,stop,status Privoxy with the specific script - (e.g. /etc/rc.d/init/privoxy stop). Reboot your machine. Does - autostart work?

  5. Start browsing. Does Privoxy work? Logfile written?

  6. Remove the rpm. Any error messages? All files removed?

5.2. Test reports

Please submit test reports only with the test form -at sourceforge. Three simple steps: -

  • Select category: the distribution you test on.

  • Select group: the version of Privoxy that we are about to release.

  • Fill the Summary and Detailed Description with something - intelligent (keep it short and precise).

- Do not mail to the mailing list (we cannot keep track on issues there). -


PrevHomeNext
Coding Guidelines Releasing a New Version
\ No newline at end of file + + + + + Testing Guidelines + + + + + + + + + + + + +
+

5. Testing + Guidelines

+ +

To be filled.

+ +
+

5.1. + Testplan for releases

+ +

Explain release numbers. major, minor. developer releases. etc.

+ +
    +
  1. +

    Remove any existing rpm with rpm -e

    +
  2. + +
  3. +

    Remove any file that was left over. This includes (but is not + limited to)

    + +
      +
    • +

      /var/log/privoxy

      +
    • + +
    • +

      /etc/privoxy

      +
    • + +
    • +

      /usr/sbin/privoxy

      +
    • + +
    • +

      /etc/init.d/privoxy

      +
    • + +
    • +

      /usr/doc/privoxy*

      +
    • +
    +
  4. + +
  5. +

    Install the rpm. Any error messages?

    +
  6. + +
  7. +

    start,stop,status Privoxy with + the specific script (e.g. /etc/rc.d/init/privoxy stop). Reboot your + machine. Does autostart work?

    +
  8. + +
  9. +

    Start browsing. Does Privoxy + work? Logfile written?

    +
  10. + +
  11. +

    Remove the rpm. Any error messages? All files removed?

    +
  12. +
+
+ +
+

5.2. + Test reports

+ +

Please submit test reports only with the test form at sourceforge. Three simple steps:

+ +
    +
  • +

    Select category: the distribution you test on.

    +
  • + +
  • +

    Select group: the version of Privoxy that we are about to release.

    +
  • + +
  • +

    Fill the Summary and Detailed Description with something + intelligent (keep it short and precise).

    +
  • +
Do not mail to the mailing list (we cannot keep track on issues + there). +
+
+ + + + diff --git a/external/privoxy/doc/webserver/developer-manual/webserver-update.html b/external/privoxy/doc/webserver/developer-manual/webserver-update.html index b54d6462..76b66908 100644 --- a/external/privoxy/doc/webserver/developer-manual/webserver-update.html +++ b/external/privoxy/doc/webserver/developer-manual/webserver-update.html @@ -1,260 +1,147 @@ - -Update the Webserver
Privoxy Developer Manual
PrevNext

7. Update the Webserver

The webserver should be updated at least with each stable release. When - updating, please follow these steps to make sure that no broken links, - inconsistent contents or permission problems will occur (as it has many - times in the past!): -

If you have changed anything in the stable-branch documentation source - SGML files, do: -

  make dok dok-pdf # (or 'make redhat-dok dok-pdf' if 'make dok' doesn't work for you)
-

That will generate doc/webserver/user-manual, - doc/webserver/developer-manual, - doc/webserver/faq, - doc/pdf/*.pdf and - doc/webserver/index.html automatically. -

If you changed the manual page sources, generate - doc/webserver/man-page/privoxy-man-page.html - by running "make man". (This is - a separate target due to dependencies on some obscure perl scripts - [now in CVS, but not well tested]. See comments in GNUmakefile.) -

If you want to add new files to the webserver, create them locally in - the doc/webserver/* directory (or - create new directories under doc/webserver). -

Next, commit any changes from the above steps to CVS. All set? - If these are docs in the stable branch, then do: -

  make webserver
-

This will do the upload to the - webserver (www.privoxy.org) and ensure all files and directories - there are group writable. -

Please do NOT use any other means of transferring - files to the webserver to avoid permission problems. Also, please do not - upload docs from development branches or versions. The publicly posted - docs should be in sync with the last official release. -


PrevHomeNext
Releasing a New Version Contacting the developers, Bug Reporting and Feature Requests
\ No newline at end of file + + + + + + + Update the Webserver + + + + + + + + + + + + +
+

7. + Update the Webserver

+ +

The webserver should be updated at least with each stable release. + When updating, please follow these steps to make sure that no broken + links, inconsistent contents or permission problems will occur (as it has + many times in the past!):

+ +

If you have changed anything in the stable-branch documentation source + SGML files, do:

+ + + + + +
+
+  make dok dok-pdf # (or 'make redhat-dok dok-pdf' if 'make dok' doesn't work for you)
+
+
+ +

That will generate doc/webserver/user-manual, doc/webserver/developer-manual, doc/webserver/faq, doc/pdf/*.pdf and doc/webserver/index.html automatically.

+ +

If you changed the manual page sources, generate doc/webserver/man-page/privoxy-man-page.html by running + "make man". (This is a + separate target due to dependencies on some obscure perl scripts [now in + CVS, but not well tested]. See comments in GNUmakefile.)

+ +

If you want to add new files to the webserver, create them locally in + the doc/webserver/* directory (or create new + directories under doc/webserver).

+ +

Next, commit any changes from the above steps to CVS. All set? If + these are docs in the stable branch, then do:

+ + + + + +
+
+  make webserver
+
+
+ +

This will do the upload to the webserver (www.privoxy.org) and ensure all files and + directories there are group writable.

+ +

Please do NOT use any other + means of transferring files to the webserver to avoid permission + problems. Also, please do not upload docs from development branches or + versions. The publicly posted docs should be in sync with the last + official release.

+
+ + + + diff --git a/external/privoxy/doc/webserver/faq/configuration.html b/external/privoxy/doc/webserver/faq/configuration.html index 01c001bd..892e46b1 100644 --- a/external/privoxy/doc/webserver/faq/configuration.html +++ b/external/privoxy/doc/webserver/faq/configuration.html @@ -1,1797 +1,900 @@ - -Configuration
Privoxy Frequently Asked Questions
PrevNext

3. Configuration

3.1. What exactly is an "actions" file?

Privoxy utilizes the concept of " actions" - that are used to manipulate and control web page data. - Actions files - are where these actions - that Privoxy could take while processing a certain - request, are configured. Typically, you would define a set of default actions - that apply globally to all URLs, then add exceptions to these defaults where needed. - There is a wide array of actions available that give the user a high degree - of control and flexibility on how to process each and every web page.

Actions can be defined on a URL pattern basis, i.e. - for single URLs, whole web sites, groups or parts thereof etc. Actions can also be - grouped together and then applied to requests matching one or more patterns. - There are many possible actions that might apply to any given site. As an example, - if you are blocking cookies - as one of your default actions, but need to accept cookies from a given site, - you would need to define an exception for this site in one of your actions - files, preferably in user.action.

3.2. The "actions" concept confuses me. Please list -some of these "actions".

For a comprehensive discussion of the actions concept, please refer - to the actions file - chapter in the User - Manual. It includes a list of all actions - and an actions - file tutorial to get you started.

3.3. How are actions files configured? What is the easiest -way to do this?

Actions files are just text files in a special syntax and can be edited - with a text editor. But probably the easiest way is to access - Privoxy's user interface with your web browser - at http://config.privoxy.org/ - (Shortcut: http://p.p/) and then select - "View & - change the current configuration" from the menu. Note - that this feature must be explicitly enabled in the main config file - (see enable-edit-actions).

3.4. There are several different "actions" files. What are -the differences?

Three actions files - are being included by the developers, to be used for - different purposes: These are - default.action, the "main" actions file - which is actively maintained by the Privoxy - developers and typically sets the default policies, user.action, - where users are encouraged to make their private customizations. - Please see the actions chapter - in the User Manual for a more - detailed explanation.

Earlier versions included three different versions of the - default.action file. The new scheme allows for - greater flexibility of local configuration, and for browser based - selection of pre-defined "aggressiveness" levels.

3.5. Where can I get updated Actions Files?

Based on your feedback and the continuing development, updates of - default.action will be - made available from time to time on the files section of - our project page. -

If you wish to receive an email notification whenever we release updates of - Privoxy or the actions file, subscribe - to our announce mailing list, ijbswa-announce@lists.sourceforge.net. -

3.6. Can I use my old config files?

The syntax and purpose of configuration files has remained roughly the - same throughout the 3.x series, but backwards compatibility is not guaranteed. - Also each release contains updated, "improved" versions and it is - therefore strongly recommended to install the newer configuration files - and merge back your modifications. -

3.7. Why is the configuration so complicated?

"Complicated" is in the eye of the beholder. Those that are - familiar with some of the underlying concepts, such as regular expression - syntax, take to it like a fish takes to water. Also, software that tries - hard to be "user friendly", often lacks sophistication and - flexibility. There is always that trade-off there between power vs. - easy-of-use. Furthermore, anyone is welcome to contribute ideas and - implementations to enhance Privoxy. -

3.8. How can I make my Yahoo/Hotmail/Gmail account work?

The default configuration shouldn't impact the usability of any of these services. - It may, however, make all cookies - temporary, so that your browser will forget your - login credentials in between browser sessions. If you would like not to have to log - in manually each time you access those websites, simply turn off all cookie handling - for them in the user.action file. An example for yahoo might - look like: -

+ +
# Allow all cookies for Yahoo login:
+
+
+
+
+  
+
+  Configuration
+  
+  
+  
+  
+  
+  
+  
+
+
+
+  
+
+  
+

3. + Configuration

+ +
+

3.1. What exactly is an + "actions" file?

+ +

Privoxy utilizes the concept of + " actions" that are used to manipulate and control web + page data. Actions files are where these actions + that Privoxy could take while + processing a certain request, are configured. Typically, you would + define a set of default actions that apply globally to all URLs, then + add exceptions to these defaults where needed. There is a wide array of + actions available that give the user a high degree of control and + flexibility on how to process each and every web page.

+ +

Actions can be defined on a URL + pattern basis, i.e. for single URLs, whole web sites, groups or + parts thereof etc. Actions can also be grouped together and then + applied to requests matching one or more patterns. There are many + possible actions that might apply to any given site. As an example, if + you are blocking cookies as one of your default actions, but need to + accept cookies from a given site, you would need to define an exception + for this site in one of your actions files, preferably in user.action.

+
+ +
+

3.2. The + "actions" concept confuses me. Please list + some of these "actions".

+ +

For a comprehensive discussion of the actions concept, please refer + to the actions + file chapter in the User Manual. It includes a list of all + actions and an actions + file tutorial to get you started.

+
+ +
+

3.3. How are actions + files configured? What is the easiest way to do this?

+ +

Actions files are just text files in a special syntax and can be + edited with a text editor. But probably the easiest way is to access + Privoxy's user interface with your web + browser at http://config.privoxy.org/ (Shortcut: http://p.p/) and then select "View & change the current configuration" from the + menu. Note that this feature must be explicitly enabled in the main + config file (see enable-edit-actions).

+
+ +
+

3.4. There are several + different "actions" files. What are the + differences?

+ +

Please have a look at the the actions chapter in the User Manual for a + detailed explanation.

+
+ +
+

3.5. Where can I + get updated Actions Files?

+ +

Based on your feedback and the continuing development, updates of + default.action will be made available from + time to time on the files section of our project page.

+ +

If you wish to receive an email notification whenever we release + updates of Privoxy or the actions + file, subscribe to our announce mailing list, + ijbswa-announce@lists.sourceforge.net.

+
+ +
+

3.6. Can I use my + old config files?

+ +

The syntax and purpose of configuration files has remained roughly + the same throughout the 3.x series, but backwards compatibility is not + guaranteed. Also each release contains updated, "improved" versions and it is therefore strongly + recommended to install the newer configuration files and merge back + your modifications.

+
+ +
+

3.7. Why is the + configuration so complicated?

+ +

"Complicated" is in the eye of the + beholder. Those that are familiar with some of the underlying concepts, + such as regular expression syntax, take to it like a fish takes to + water. Also, software that tries hard to be "user + friendly", often lacks sophistication and flexibility. There is + always that trade-off there between power vs. easy-of-use. Furthermore, + anyone is welcome to contribute ideas and implementations to enhance + Privoxy.

+
+ +
+

3.8. How can I make my + Yahoo/Hotmail/Gmail account work?

+ +

The default configuration shouldn't impact the usability of any of + these services. It may, however, make all cookies + temporary, so that your browser will forget your login credentials in + between browser sessions. If you would like not to have to log in + manually each time you access those websites, simply turn off all + cookie handling for them in the user.action + file. An example for yahoo might look like:

+ + + +
+
+# Allow all cookies for Yahoo login:
 #
-{ -crunch-incoming-cookies -crunch-outgoing-cookies -session-cookies-only }
-.login.yahoo.com
-

These kinds of sites are often quite complex and heavy with - Javascript and - thus "fragile". So if still a problem, - we have an alias just for such - sticky situations: -

+ +
# Gmail is a _fragile_ site:
+{ -crunch-incoming-cookies -crunch-outgoing-cookies -session-cookies-only }
+.login.yahoo.com
+
+
+ +

These kinds of sites are often quite complex and heavy with Javascript + and thus "fragile". So if still a problem, we have an alias just + for such sticky situations:

+ + + +
+
+# Gmail is a _fragile_ site:
 #
-{ fragile }
+{ fragile }
  # Gmail is ...
- mail.google.com
-

Be sure to flush your browser's caches whenever making these kinds of - changes, just to make sure the changes "take". -

Make sure the domain, host and path are appropriate as well. Your browser can - tell you where you are specifically and you should use that information for - your configuration settings. Note that above it is not referenced as - gmail.com, which is a valid domain name. -

3.9. What's the difference between the -"Cautious", "Medium" and "Advanced" defaults?

Configuring Privoxy is not entirely trivial. To - help you get started, we provide you with three different default action - "profiles" in the web based actions file editor at http://config.privoxy.org/show-status. - See the User - Manual for a list of actions, and how the default - profiles are set. -

Where the defaults are likely to break some sites, exceptions for - known popular "problem" sites are included, but in - general, the more aggressive your default settings are, the more exceptions - you will have to make later. New users are best to start off in - "Cautious" setting. This is safest and will have the fewest - problems. See the User Manual - for a more detailed discussion.

It should be noted that the "Advanced" profile (formerly known - as the "Adventuresome" profile) is more - aggressive, and will make use of some of - Privoxy's advanced features. Use at your own risk!

3.10. Why can I change the configuration -with a browser? Does that not raise security issues?

It may seem strange that regular users can edit the config files with their - browsers, although the whole /etc/privoxy hierarchy - belongs to the user "privoxy", with only 644 permissions. -

When you use the browser-based editor, Privoxy - itself is writing to the config files. Because - Privoxy is running as the user "privoxy", - it can update its own config files. -

If you run Privoxy for multiple untrusted users (e.g. in - a LAN) or aren't entirely in control of your own browser, you will probably want - to make sure that the the web-based editor and remote toggle features are - "off" by setting "enable-edit-actions - 0" and "enable-remote-toggle - 0" in the main configuration file. -

As of Privoxy 3.0.7 these options are disabled by default. -

3.11. What is the default.filter file? What is a "filter"?

The default.filter - file is where filters as supplied by the developers are defined. - Filters are a special subset of actions that can be used to modify or - remove web page content or headers on the fly. Content filters can - be applied to anything in the page source, - header filters can be applied to either server or client headers. - Regular expressions are used to accomplish this.

There are a number of pre-defined filters to deal with common annoyances. The - filters are only defined here, to invoke them, you need to use the - filter - action in one of the actions files. Content filtering is automatically - disabled for inappropriate MIME types, but if you now better than Privoxy - what should or should not be filtered you can filter any content you like.

Filters should - not be confused with blocks, which - is a completely different action, and is more typically used to block ads and - unwanted sites.

If you are familiar with regular expressions, and HTML, you can look at - the provided default.filter with a text editor and define - your own filters. This is potentially a very powerful feature, but - requires some expertise in both regular expressions and HTML/HTTP. - You should - place any modifications to the default filters, or any new ones you create - in a separate file, such as user.filter, so they won't - be overwritten during upgrades. - The ability to define multiple filter files - in config is a new feature as of v. 3.0.5.

There is no GUI editor option for this part of the configuration, - but you can disable/enable the various pre-defined filters of the included - default.filter file with the web-based actions file editor. - Note that the custom actions editor must be explicitly enabled in - the main config file (see enable-edit-actions).

If you intend to develop your own filters, you might want to have a look at - Privoxy-Filter-Test.

3.12. How can I set up Privoxy to act as a proxy for my - LAN?

By default, Privoxy only responds to requests - from 127.0.0.1 (localhost). To have it act as a server for - a network, this needs to be changed in the main configuration file. Look for - the listen-address - option, which may be commented out with a "#" symbol. Make sure - it is uncommented, and assign it the address of the LAN gateway interface, - and port number to use. Assuming your LAN address is 192.168.1.1 and you - wish to run Privoxy on port 8118, this line - should look like:

  listen-address  192.168.1.1:8118

Save the file, and restart Privoxy. Configure - all browsers on the network then to use this address and port number.

Alternately, you can have Privoxy listen on - all available interfaces:

  listen-address    :8118

And then use Privoxy's - permit-access - feature to limit connections. A firewall in this situation is recommended - as well.

The above steps should be the same for any TCP network, regardless of - operating system.

If you run Privoxy on a LAN with untrusted users, - we recommend that you double-check the access control and security - options!

3.13. Instead of ads, now I get a checkerboard pattern. I don't want to see anything.

The replacement for blocked images can be controlled with the set-image-blocker - action. You have the choice of a checkerboard pattern, a transparent 1x1 GIF - image (aka "blank"), or a redirect to a custom image of your choice. - Note that this choice only has effect for images which are blocked as images, i.e. - whose URLs match both a handle-as-image - and block action.

If you want to see nothing, then change the set-image-blocker - action to "blank". This can be done by editing the - user.action file, or through the web-based actions file editor.

3.14. Why would anybody want to see a checkerboard pattern?

Remember that telling which image is an ad and which - isn't, is an educated guess. While we hope that the standard configuration - is rather smart, it will make occasional mistakes. The checkerboard image is visually - decent, and it shows you where images have been blocked, which can be very - helpful in case some navigation aid or otherwise innocent image was - erroneously blocked. It is recommended for new users so they can - "see" what is happening. Some people might also enjoy seeing how - many banners they don't have to see.

3.15. I see some images being replaced with text -instead of the checkerboard image. Why and how do I get rid of this?

This happens when the banners are not embedded in the HTML code of the - page itself, but in separate HTML (sub)documents that are loaded into (i)frames - or (i)layers, and these external HTML documents are blocked. Being non-images - they get replaced by a substitute HTML page rather than a substitute image, - which wouldn't work out technically, since the browser expects and accepts - only HTML when it has requested an HTML document.

The substitute page adapts to the available space and shows itself as a - miniature two-liner if loaded into small frames, or full-blown with a - large red "BLOCKED" banner if space allows.

If you prefer the banners to be blocked by images, you must see to it that - the HTML documents in which they are embedded are not blocked. Clicking - the "See why" link offered in the substitute page will show - you which rule blocked the page. After changing the rule and un-blocking - the HTML documents, the browser will try to load the actual banner images - and the usual image blocking will (hopefully!) kick in.

3.16. Can Privoxy run as a service -on Win2K/NT/XP?

Yes. Version 3.0.5 introduces full Windows service - functionality. See the User Manual for details on how to install and configure - Privoxy as a service.

Earlier 3.x versions could run as a system service using srvany.exe. - See the discussion at http://sourceforge.net/tracker/?func=detail&atid=361118&aid=485617&group_id=11118, - for details, and a sample configuration.

3.17. How can I make Privoxy work with other -proxies like Squid or Tor?

This can be done and is often useful to combine the benefits of - Privoxy with those of a another proxy. - See the forwarding chapter - in the User Manual which - describes how to do this, and the How do I use Privoxy together with - Tor section below.

3.18. Can I just set Privoxy to use port 80 -and thus avoid individual browser configuration?

No, its more complicated than that. This only works with special kinds - of proxies known as "intercepting" proxies (see below).

3.19. Can Privoxy run as a "transparent" proxy?

The whole idea of Privoxy is to modify client requests - and server responses in all sorts of ways and therefore - it's not a transparent proxy as described in - RFC 2616.

However, some people say "transparent proxy" when they - mean "intercepting proxy". If you are one of them, - please read the next entry.

3.20. Can Privoxy run as a "intercepting" proxy?

Privoxy can't intercept traffic itself, - but it can handle requests that where intercepted and redirected - with a packet filter (like PF or - iptables), as long as the Host - header is present. -

As the Host header is required by HTTP/1.1 and as most - web sites rely on it anyway, this limitation shouldn't be a problem.

Please refer to your packet filter's documentation to learn how to - intercept and redirect traffic into Privoxy. - Afterward you just have to configure Privoxy to - accept - intercepted requests.

3.21. How can I configure Privoxy for use with Outlook?

Versions of Outlook prior to Office 2007, use - Internet Explorer components to both render HTML, - and fetch any HTTP requests that may be embedded in an HTML email. So however - you have Privoxy configured to work with IE, this - configuration should automatically be shared, at least with older version of - Internet Explorer.

Starting with Office 2007, Microsoft is instead using the MS-Word rendering - engine with Outlook. It is unknown whether this can be configured to use a - proxy. -

3.22. How can I have separate rules just for HTML mail?

The short answer is, you can't. Privoxy has no way - of knowing which particular application makes a request, so there is no way to - distinguish between web pages and HTML mail. - Privoxy just blindly proxies all requests. In the - case of Outlook Express (see above), OE uses - IE anyway, and there is no way for Privoxy to ever - be able to distinguish between them (nor could any other proxy type application for - that matter).

For a good discussion of some of the issues involved (including privacy and - security issues), see - http://sourceforge.net/tracker/?func=detail&atid=211118&aid=629518&group_id=11118.

3.23. I sometimes notice cookies sneaking through. How?

Cookies can be - set in several ways. The classic method is via the - Set-Cookie HTTP header. This is straightforward, and an - easy one to manipulate, such as the Privoxy concept of - session-cookies-only. - There is also the possibility of using - Javascript to - set cookies (Privoxy calls these content-cookies). This - is trickier because the syntax can vary widely, and thus requires a certain - amount of guesswork. It is not realistic to catch all of these short of - disabling Javascript, which would break many sites. And lastly, if the - cookies are embedded in a HTTPS/SSL secure session via Javascript, they are beyond - Privoxy's reach.

All in all, Privoxy can help manage cookies in general, can help minimize - the loss of privacy posed by cookies, but can't realistically stop all - cookies.

3.24. Are all cookies bad? Why?

No, in fact there are many beneficial uses of - cookies. Cookies are just a - method that browsers can use to store data between pages, or between browser - sessions. Sometimes there is a good reason for this, and the user's life is a - bit easier as a result. But there is a long history of some websites taking - advantage of this layer of trust, and using the data they glean from you and - your browsing habits for their own purposes, and maybe to your potential - detriment. Such sites are using you and storing their data on your system. - That is why the privacy conscious watch from whom those cookies come, and why - they really need to be there.

See the - Wikipedia cookie - definition for more.

3.25. How can I allow permanent cookies for my trusted sites?

There are several actions that relate to cookies. The default behavior is to - allow only "session cookies", which means the cookies only last - for the current browser session. This eliminates most kinds of abuse related - to cookies. But there may be cases where you want cookies to last.

To disable all cookie actions, so that cookies are allowed unrestricted, - both in and out, for example.com:

 { -crunch-incoming-cookies -crunch-outgoing-cookies -session-cookies-only -filter{content-cookies} }
-  .example.com

Place the above in user.action. Note that some of these may - be off by default anyway, so this might be redundant, but there is no harm - being explicit in what you want to happen. user.action - includes an alias for this situation, called - allow-all-cookies.

3.26. Can I have separate configurations for different users?

Each instance of Privoxy has its own - configuration, including such attributes as the TCP port that it listens on. - What you can do is run multiple instances of Privoxy, each with - a unique - listen-address - configuration setting, and configuration path, and then - each of these can have their own configurations. Think of it as per-port - configuration.

- Simple enough for a few users, but for large installations, consider having - groups of users that might share like configurations.

3.27. Can I set-up Privoxy as a whitelist of -"good" sites?

Sure. There are a couple of things you can do for simple white-listing. - Here's one real easy one:

+ +
 ############################################################
+ mail.google.com
+
+
+ +

Be sure to flush your browser's caches whenever making these kinds + of changes, just to make sure the changes "take".

+ +

Make sure the domain, host and path are appropriate as well. Your + browser can tell you where you are specifically and you should use that + information for your configuration settings. Note that above it is not + referenced as gmail.com, which is a valid + domain name.

+
+ +
+

3.9. What's + the difference between the "Cautious", + "Medium" and "Advanced" defaults?

+ +

Configuring Privoxy is not entirely + trivial. To help you get started, we provide you with three different + default action "profiles" in the web based + actions file editor at http://config.privoxy.org/show-status. See the + User Manual for a list of actions, and how the default + profiles are set.

+ +

Where the defaults are likely to break some sites, exceptions for + known popular "problem" sites are included, + but in general, the more aggressive your default settings are, the more + exceptions you will have to make later. New users are best to start off + in "Cautious" setting. This is safest and + will have the fewest problems. See the User Manual for a more + detailed discussion.

+ +

It should be noted that the "Advanced" + profile (formerly known as the "Adventuresome" profile) is more aggressive, and will + make use of some of Privoxy's advanced + features. Use at your own risk!

+
+ +
+

3.10. Why + can I change the configuration with a browser? Does that not raise + security issues?

+ +

It may seem strange that regular users can edit the config files + with their browsers, although the whole /etc/privoxy hierarchy belongs to the user "privoxy", with only 644 permissions.

+ +

When you use the browser-based editor, Privoxy itself is writing to the config files. + Because Privoxy is running as the user + "privoxy", it can update its own config + files.

+ +

If you run Privoxy for multiple + untrusted users (e.g. in a LAN) or aren't entirely in control of your + own browser, you will probably want to make sure that the web-based + editor and remote toggle features are "off" + by setting "enable-edit-actions 0" and "enable-remote-toggle 0" in the main configuration + file.

+ +

As of Privoxy 3.0.7 these options + are disabled by default.

+
+ +
+

3.11. What is the + default.filter file? What is a "filter"?

+ +

The default.filter file is where + filters as supplied by the + developers are defined. Filters are a special subset of actions that + can be used to modify or remove web page content or headers on the fly. + Content filters can be applied to anything in the page source, header + filters can be applied to either server or client headers. Regular + expressions are used to accomplish this.

+ +

There are a number of pre-defined filters to deal with common + annoyances. The filters are only defined here, to invoke them, you need + to use the filter action in one of the actions + files. Content filtering is automatically disabled for inappropriate + MIME types, but if you know better than Privoxy what should or should + not be filtered you can filter any content you like.

+ +

Filters should not be + confused with blocks, which is a completely + different action, and is more typically used to block ads and unwanted + sites.

+ +

If you are familiar with regular expressions, and HTML, you can look + at the provided default.filter with a text + editor and define your own filters. This is potentially a very powerful + feature, but requires some expertise in both regular expressions and + HTML/HTTP. You should place any modifications to the default filters, + or any new ones you create in a separate file, such as user.filter, so they won't be overwritten during + upgrades. The ability to define multiple filter files in config is a new feature as of v. 3.0.5.

+ +

There is no GUI editor option for this part of the configuration, + but you can disable/enable the various pre-defined filters of the + included default.filter file with the + web-based + actions file editor. Note that the custom actions editor must be + explicitly enabled in the main config file (see enable-edit-actions).

+ +

If you intend to develop your own filters, you might want to have a + look at Privoxy-Filter-Test.

+
+ +
+

3.12. How can I + set up Privoxy to act as a proxy for my LAN?

+ +

By default, Privoxy only responds + to requests from 127.0.0.1 (localhost). To + have it act as a server for a network, this needs to be changed in the + main configuration + file. Look for the listen-address option, which may be commented out with + a "#" symbol. Make sure it is uncommented, + and assign it the address of the LAN gateway interface, and port number + to use. Assuming your LAN address is 192.168.1.1 and you wish to run + Privoxy on port 8118, this line should + look like:

+ + + + + +
+
+  listen-address  192.168.1.1:8118
+
+
+ +

Save the file, and restart Privoxy. + Configure all browsers on the network then to use this address and port + number.

+ +

Alternately, you can have Privoxy + listen on all available interfaces:

+ + + + + +
+
+  listen-address    :8118
+
+
+ +

And then use Privoxy's permit-access feature to limit connections. A firewall in + this situation is recommended as well.

+ +

The above steps should be the same for any TCP network, regardless + of operating system.

+ +

If you run Privoxy on a LAN with + untrusted users, we recommend that you double-check the access + control and security options!

+
+ +
+

3.13. Instead of ads, + now I get a checkerboard pattern. I don't want to see + anything.

+ +

The replacement for blocked images can be controlled with the + set-image-blocker action. You have + the choice of a checkerboard pattern, a transparent 1x1 GIF image (aka + "blank"), or a redirect to a custom image of + your choice. Note that this choice only has effect for images which are + blocked as images, i.e. whose URLs match both a handle-as-image and block + action.

+ +

If you want to see nothing, then change the set-image-blocker action to + "blank". This can be done by editing the + user.action file, or through the web-based actions + file editor.

+
+ +
+

3.14. Why would anybody + want to see a checkerboard pattern?

+ +

Remember that telling which image + is an ad and which isn't, is an educated guess. While we hope that + the standard configuration is rather smart, it will make occasional + mistakes. The checkerboard image is visually decent, and it shows you + where images have been blocked, which can be very helpful in case some + navigation aid or otherwise innocent image was erroneously blocked. It + is recommended for new users so they can "see" what is happening. Some people might also enjoy + seeing how many banners they don't have to see.

+
+ +
+

3.15. I see some images + being replaced with text instead of the checkerboard image. Why and how + do I get rid of this?

+ +

This happens when the banners are not embedded in the HTML code of + the page itself, but in separate HTML (sub)documents that are loaded + into (i)frames or (i)layers, and these external HTML documents are + blocked. Being non-images they get replaced by a substitute HTML page + rather than a substitute image, which wouldn't work out technically, + since the browser expects and accepts only HTML when it has requested + an HTML document.

+ +

The substitute page adapts to the available space and shows itself + as a miniature two-liner if loaded into small frames, or full-blown + with a large red "BLOCKED" banner if space allows.

+ +

If you prefer the banners to be blocked by images, you must see to + it that the HTML documents in which they are embedded are not blocked. + Clicking the "See why" link offered in the + substitute page will show you which rule blocked the page. After + changing the rule and un-blocking the HTML documents, the browser will + try to load the actual banner images and the usual image blocking will + (hopefully!) kick in.

+
+ +
+

3.16. Can Privoxy run as + a service on Win2K/NT/XP?

+ +

Yes. Version 3.0.5 introduces full Windows service functionality. See the User Manual for details on how + to install and configure Privoxy as a + service.

+ +

Earlier 3.x versions could run as a system service using srvany.exe. See the discussion at http://sourceforge.net/tracker/?func=detail&atid=361118&aid=485617&group_id=11118, + for details, and a sample configuration.

+
+ +
+

3.17. How can I + make Privoxy work with other proxies?

+ +

This can be done and is often useful to combine the benefits of + Privoxy with those of a another proxy, + for example to cache content. See the forwarding + chapter in the User Manual which describes how to do this. If you intend to + use Privoxy with Tor, please also have a look at How do I use Privoxy together with Tor.

+
+ +
+

3.18. Can I just set + Privoxy to use port 80 and thus avoid individual browser + configuration?

+ +

No, its more complicated than that. This only works with special + kinds of proxies known as "intercepting" + proxies (see below).

+
+ +
+

3.19. Can + Privoxy run as a "transparent" + proxy?

+ +

The whole idea of Privoxy is to modify client requests and server + responses in all sorts of ways and therefore it's not a transparent + proxy as described in RFC 2616.

+ +

However, some people say "transparent + proxy" when they mean "intercepting + proxy". If you are one of them, please read the next entry.

+
+ +
+

3.20. Can + Privoxy run as a "intercepting" + proxy?

+ +

Privoxy can't intercept traffic + itself, but it can handle requests that where intercepted and + redirected with a packet filter (like PF or iptables), + as long as the Host header is present.

+ +

As the Host header is required by HTTP/1.1 + and as most web sites rely on it anyway, this limitation shouldn't be a + problem.

+ +

Please refer to your packet filter's documentation to learn how to + intercept and redirect traffic into Privoxy. Afterward you just have to configure + Privoxy to accept intercepted requests.

+
+ +
+

3.21. How can I + configure Privoxy for use with Outlook?

+ +

Versions of Outlook prior to Office + 2007, use Internet Explorer components + to both render HTML, and fetch any HTTP requests that may be embedded + in an HTML email. So however you have Privoxy configured to work with IE, this + configuration should automatically be shared, at least with older + version of Internet Explorer.

+ +

Starting with Office 2007, Microsoft is instead using the MS-Word + rendering engine with Outlook. It is unknown whether this can be + configured to use a proxy.

+
+ +
+

3.22. How + can I have separate rules just for HTML mail?

+ +

The short answer is, you can't. Privoxy has no way of knowing which particular + application makes a request, so there is no way to distinguish between + web pages and HTML mail. Privoxy just + blindly proxies all requests. In the case of Outlook Express (see above), OE uses IE anyway, + and there is no way for Privoxy to + ever be able to distinguish between them (nor could any other proxy + type application for that matter).

+ +

For a good discussion of some of the issues involved (including + privacy and security issues), see http://sourceforge.net/tracker/?func=detail&atid=211118&aid=629518&group_id=11118.

+
+ +
+

3.23. I + sometimes notice cookies sneaking through. How?

+ +

Cookies can be set in several ways. The classic method is + via the Set-Cookie HTTP header. This is + straightforward, and an easy one to manipulate, such as the + Privoxy concept of session-cookies-only. There is also the possibility of using + Javascript to set cookies (Privoxy calls these content-cookies). This is trickier because the syntax + can vary widely, and thus requires a certain amount of guesswork. It is + not realistic to catch all of these short of disabling Javascript, + which would break many sites. And lastly, if the cookies are embedded + in a HTTPS/SSL secure session via Javascript, they are beyond + Privoxy's reach.

+ +

All in all, Privoxy can help manage + cookies in general, can help minimize the loss of privacy posed by + cookies, but can't realistically stop all cookies.

+
+ +
+

3.24. Are + all cookies bad? Why?

+ +

No, in fact there are many beneficial uses of cookies. Cookies are just a method that browsers can use to + store data between pages, or between browser sessions. Sometimes there + is a good reason for this, and the user's life is a bit easier as a + result. But there is a long history of some websites taking advantage + of this layer of trust, and using the data they glean from you and your + browsing habits for their own purposes, and maybe to your potential + detriment. Such sites are using you and storing their data on your + system. That is why the privacy conscious watch from whom those cookies + come, and why they really need to be there.

+ +

See the Wikipedia cookie definition for more.

+
+ +
+

3.25. How + can I allow permanent cookies for my trusted sites?

+ +

There are several actions that relate to cookies. The default + behavior is to allow only "session cookies", + which means the cookies only last for the current browser session. This + eliminates most kinds of abuse related to cookies. But there may be + cases where you want cookies to last.

+ +

To disable all cookie actions, so that cookies are allowed + unrestricted, both in and out, for example.com:

+ + + + + +
+
+ { -crunch-incoming-cookies -crunch-outgoing-cookies -session-cookies-only -filter{content-cookies} }
+  .example.com
+
+
+ +

Place the above in user.action. Note that + some of these may be off by default anyway, so this might be redundant, + but there is no harm being explicit in what you want to happen. + user.action includes an alias for this + situation, called allow-all-cookies.

+
+ +
+

3.26. Can I have + separate configurations for different users?

+ +

Each instance of Privoxy has its + own configuration, including such attributes as the TCP port that it + listens on. What you can do is run multiple instances of Privoxy, each with a unique listen-address configuration setting, and configuration + path, and then each of these can have their own configurations. Think + of it as per-port configuration.

+ +

Simple enough for a few users, but for large installations, consider + having groups of users that might share like configurations.

+
+ +
+

3.27. Can I + set-up Privoxy as a whitelist of "good" + sites?

+ +

Sure. There are a couple of things you can do for simple + white-listing. Here's one real easy one:

+ + + +
+
+ ############################################################
  # Blacklist
  ############################################################
- { +block }
+ { +block }
  / # Block *all* URLs
- 
+
  ############################################################
  # Whitelist
  ############################################################
- { -block }
+ { -block }
   kids.example.com
   toys.example.com
-  games.example.com

This allows access to only those three sites by first blocking all URLs, and - then subsequently allowing three specific exceptions.

Another approach is Privoxy's - trustfile concept, which incorporates the notion of - "trusted referrers". See the Trust documentation - for details.

These are fairly simple approaches and are not completely foolproof. There - are various other configuration options that should be disabled (described - elsewhere here and in the User Manual) - so that users can't modify their own configuration and easily circumvent the - whitelist.

3.28. How can I turn off ad-blocking?

Ad blocking is achieved through a complex application of various Privoxy - actions. These - actions are deployed against simple images, banners, flash animations, - text pages, JavaScript, pop-ups and pop-unders, etc., so its not as simple as - just turning one or two actions off. The various actions that make up - Privoxy ad blocking are hard-coded into the default configuration files. It - has been assumed that everyone using Privoxy is interested in this - particular feature. -

If you want to do without this, there are several approaches you can take: - You can manually undo the many block rules in - default.action. Or even easier, just create your own - default.action file from scratch without the many ad - blocking rules, and corresponding exceptions. Or lastly, if you are not - concerned about the additional blocks that are done for privacy reasons, you - can very easily over-ride all blocking with the - following very simple rule in your user.action: -

 # Unblock everybody, everywhere
- { -block }
- / # UN-Block *all* URLs

- Or even a more comprehensive reversing of various ad related actions:

+ +
 # Unblock everybody, everywhere, and turn off appropriate filtering, etc
- { -block \
-  -filter{banners-by-size} \
-  -filter{banners-by-link} \
-  allow-popups \
+  games.example.com
+
+
+ +

This allows access to only those three sites by first blocking all + URLs, and then subsequently allowing three specific exceptions.

+ +

Another approach is Privoxy's + trustfile concept, which incorporates the + notion of "trusted referrers". See the + Trust + documentation for details.

+ +

These are fairly simple approaches and are not completely foolproof. + There are various other configuration options that should be disabled + (described elsewhere here and in the User Manual) so that users can't modify their own + configuration and easily circumvent the whitelist.

+
+ +
+

3.28. How can I + turn off ad-blocking?

+ +

Ad blocking is achieved through a complex application of various + Privoxy actions. These + actions are deployed against simple images, banners, flash animations, + text pages, JavaScript, pop-ups and pop-unders, etc., so its not as + simple as just turning one or two actions off. The various actions that + make up Privoxy ad blocking are + hard-coded into the default configuration files. It has been assumed + that everyone using Privoxy is + interested in this particular feature.

+ +

If you want to do without this, there are several approaches you can + take: You can manually undo the many block rules in default.action. Or even easier, just create your own + default.action file from scratch without the + many ad blocking rules, and corresponding exceptions. Or lastly, if you + are not concerned about the additional blocks that are done for privacy + reasons, you can very easily over-ride all blocking with the following very + simple rule in your user.action:

+ + + + + +
+
+ # Unblock everybody, everywhere
+ { -block }
+ / # UN-Block *all* URLs
+
+
+ +

Or even a more comprehensive reversing of various ad related + actions:

+ + + +
+
+ # Unblock everybody, everywhere, and turn off appropriate filtering, etc
+ { -block \
+  -filter{banners-by-size} \
+  -filter{banners-by-link} \
+  allow-popups \
  }
- / # UN-Block *all* URLs and allow ads

This last "action" in this compound statement, - allow-popups, is an alias that disables - various pop-up blocking features.

3.29. How can I have custom template pages, like the -BLOCKED page?

Privoxy "templates" are specialized text files utilized by - Privoxy for various purposes and can easily be modified using any text - editor. All the template pages are installed in a sub-directory appropriately - named: templates. Knowing something about HTML syntax - will of course be helpful.

Be forewarned that the default templates are subject to being overwritten - during upgrades. You can, however, create completely new templates, - place them in another directory and specify the alternate path in the main - config. For details, have a look at the templdir option.

3.30. How can I remove the "Go There Anyway" link from -the BLOCKED page?

There is more than one way to do it (although Perl is not involved).

Editing the BLOCKED template page (see above) may dissuade some users, but - this method is easily circumvented. Where you need this level of control, you - might want to build Privoxy from source, and disable various features that are - available as compile-time options. You should - configure the sources as follows:

 ./configure  --disable-toggle  --disable-editor  --disable-force

This will create an executable with hard-coded security features so that - Privoxy does not allow easy bypassing of blocked sites, or changing the - current configuration via any connected user's web browser.

Finally, all of these features can also be toggled on/off via options in - Privoxy's main config file which - means you don't have to recompile anything.


PrevHomeNext
Installation Miscellaneous
\ No newline at end of file + / # UN-Block *all* URLs and allow ads +
+
+ +

This last "action" in this compound + statement, allow-popups, is an alias that + disables various pop-up blocking features.

+
+ +
+

3.29. How can I + have custom template pages, like the BLOCKED page?

+ +

Privoxy "templates" are specialized text files utilized by + Privoxy for various purposes and can + easily be modified using any text editor. All the template pages are + installed in a sub-directory appropriately named: templates. Knowing something about HTML syntax will of + course be helpful.

+ +

Be forewarned that the default templates are subject to being + overwritten during upgrades. You can, however, create completely new + templates, place them in another directory and specify the alternate + path in the main config. For details, have a + look at the templdir option.

+
+ +
+

3.30. How can I + remove the "Go There Anyway" link from the + BLOCKED page?

+ +

There is more than one way to do it (although Perl is not + involved).

+ +

Editing the BLOCKED template page (see above) may dissuade some + users, but this method is easily circumvented. Where you need this + level of control, you might want to build Privoxy from source, and disable various features + that are available as compile-time options. You should configure the sources as follows:

+ + + + + +
+
+ ./configure  --disable-toggle  --disable-editor  --disable-force
+
+
+ +

This will create an executable with hard-coded security features so + that Privoxy does not allow easy + bypassing of blocked sites, or changing the current configuration via + any connected user's web browser.

+ +

Finally, all of these features can also be toggled on/off via + options in Privoxy's main config + file which means you don't have to recompile anything.

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/faq/contact.html b/external/privoxy/doc/webserver/faq/contact.html index c9d18c70..8f97f567 100644 --- a/external/privoxy/doc/webserver/faq/contact.html +++ b/external/privoxy/doc/webserver/faq/contact.html @@ -1,510 +1,363 @@ - -Contacting the developers, Bug Reporting and Feature Requests
Privoxy Frequently Asked Questions
PrevNext

6. Contacting the developers, Bug Reporting and Feature Requests

We value your feedback. In fact, we rely on it to improve - Privoxy and its configuration. - However, please note the following hints, so we can - provide you with the best support:

6.1. Get Support

For casual users, our - support forum at SourceForge - is probably best suited: - http://sourceforge.net/tracker/?group_id=11118&atid=211118

All users are of course welcome to discuss their issues on the users - mailing list, where the developers also hang around.

Please don't sent private support requests to individual Privoxy - developers, either use the mailing lists or the support trackers.

Note that the Privoxy mailing lists are moderated. Posts from unsubscribed - addresses have to be accepted manually by a moderator. This may cause a - delay of several days and if you use a subject that doesn't clearly - mention Privoxy or one of its features, your message may be accidentally - discarded as spam.

If you aren't subscribed, you should therefore spend a few seconds - to come up with a proper subject. Additionally you should make it clear - that you want to get CC'd. Otherwise some responses will be directed to - the mailing list only, and you won't see them.

6.2. Reporting Problems

"Problems" for our purposes, come in two forms:

  • Configuration issues, such as ads that slip through, or sites that - don't function properly due to one Privoxy - "action" or another being turned "on". -

  • "Bugs" in the programming code that makes up - Privoxy, such as that might cause a crash. -

6.2.1. Reporting Ads or Other Configuration Problems

Please send feedback on ads that slipped through, innocent images that were - blocked, sites that don't work properly, and other configuration related problem of - default.action file, to - http://sourceforge.net/tracker/?group_id=11118&atid=460288, - the Actions File Tracker.

New, improved default.action files may occasionally be made - available based on your feedback. These will be announced on the ijbswa-announce - list and available from our the files section of - our project page.

6.2.2. Reporting Bugs

Please report all bugs through our bug tracker: - http://sourceforge.net/tracker/?group_id=11118&atid=111118.

Before doing so, please make sure that the bug has not already been submitted - and observe the additional hints at the top of the submit - form. If already submitted, please feel free to add any info to the - original report that might help to solve the issue.

Please try to verify that it is a Privoxy bug, - and not a browser or site bug or documented behaviour that just happens - to be different than what you expected. If unsure, - try toggling - off Privoxy, and see if the problem persists.

If you are using your own custom configuration, please try - the stock configs to see if the problem is configuration related. - If you're having problems with a feature that is disabled by default, - please ask around on the mailing list if others can reproduce the problem.

If you aren't using the latest Privoxy version, the bug may have been found - and fixed in the meantime. We would appreciate if you could take the time - to upgrade - to the latest version (or even the latest CVS snapshot) and verify - that your bug still exists.

Please be sure to provide the following information:

  • The exact Privoxy version you are using - (if you got the source from CVS, please also provide the source code revisions - as shown in http://config.privoxy.org/show-version). -

  • The operating system and versions you run - Privoxy on, (e.g. Windows - XP SP2), if you are using a Unix flavor, - sending the output of "uname -a" should do, - in case of GNU/Linux, please also name the distribution. -

  • The name, platform, and version of the browser - you were using (e.g. Internet Explorer v5.5 for Mac). -

  • The URL where the problem occurred, or some way for us to duplicate the - problem (e.g. http://somesite.example.com/?somethingelse=123). -

  • Whether your version of Privoxy is one supplied - by the Privoxy developers via SourceForge, - or if you got your copy somewhere else. -

  • Whether you are using Privoxy in tandem with - another proxy such as Tor. If so, please - temporary disable the other proxy to see if the symptoms change. -

  • Whether you are using a personal firewall product. If so, does - Privoxy work without it? -

  • Any other pertinent information to help identify the problem such as config - or log file excerpts (yes, you should have log file entries for each - action taken). -

You don't have to tell us your actual name when filing a problem - report, but please use a nickname so we can differentiate between - your messages and the ones entered by other "anonymous" users that - may respond to your request if they have the same problem or already - found a solution.

Please also check the status of your request a few days after submitting - it, as we may request additional information. If you use a SF id, - you should automatically get a mail when someone responds to your request.

The appendix - of the Privoxy User Manual also has helpful information - on understanding actions, and action debugging.

6.3. Request New Features

You are welcome to submit ideas on new features or other proposals - for improvement through our feature request tracker at - http://sourceforge.net/tracker/?atid=361118&group_id=11118.

6.4. Other

For any other issues, feel free to use the mailing lists. Technically interested users -and people who wish to contribute to the project are also welcome on the developers list! -You can find an overview of all Privoxy-related mailing lists, -including list archives, at: -http://sourceforge.net/mail/?group_id=11118.


PrevHomeNext
Troubleshooting Privoxy Copyright, License and History
\ No newline at end of file + + + + + + + Contacting the developers, Bug Reporting and Feature + Requests + + + + + + + + + + + + +
+

6. Contacting the + developers, Bug Reporting and Feature Requests

+ +

We value your feedback. In fact, we rely on it to improve Privoxy and its configuration. However, please note + the following hints, so we can provide you with the best support:

+ +
+

6.1. + Get Support

+ +

For casual users, our support forum at SourceForge is probably best suited: + http://sourceforge.net/tracker/?group_id=11118&atid=211118

+ +

All users are of course welcome to discuss their issues on the + users mailing list, where the developers also hang + around.

+ +

Please don't sent private support requests to individual Privoxy + developers, either use the mailing lists or the support trackers.

+ +

If you have to contact a Privoxy developer directly for other + reasons, please send a real mail and do not bother with SourceForge's + messaging system. Answers to SourceForge messages are usually bounced + by SourceForge's mail server in which case the developer wasted time + writing a response you don't get. From your point of view it will look + like your message has been completely ignored, so this is frustrating + for all parties involved.

+ +

Note that the Privoxy mailing lists are moderated. Posts from + unsubscribed addresses have to be accepted manually by a moderator. + This may cause a delay of several days and if you use a subject that + doesn't clearly mention Privoxy or one of its features, your message + may be accidentally discarded as spam.

+ +

If you aren't subscribed, you should therefore spend a few seconds + to come up with a proper subject. Additionally you should make it clear + that you want to get CC'd. Otherwise some responses will be directed to + the mailing list only, and you won't see them.

+
+ +
+

6.2. Reporting + Problems

+ +

"Problems" for our purposes, come in two + forms:

+ +
    +
  • +

    Configuration issues, such as ads that slip through, or sites + that don't function properly due to one Privoxy "action" or + another being turned "on".

    +
  • + +
  • +

    "Bugs" in the programming code that + makes up Privoxy, such as that + might cause a crash.

    +
  • +
+ +
+

6.2.1. + Reporting Ads or Other Configuration Problems

+ +

Please send feedback on ads that slipped through, innocent images + that were blocked, sites that don't work properly, and other + configuration related problem of default.action file, to http://sourceforge.net/tracker/?group_id=11118&atid=460288, + the Actions File Tracker.

+ +

New, improved default.action files may + occasionally be made available based on your feedback. These will be + announced on the ijbswa-announce list and available from our the files section of our project page.

+
+ +
+

6.2.2. + Reporting Bugs

+ +

Please report all bugs through our bug tracker: http://sourceforge.net/tracker/?group_id=11118&atid=111118.

+ +

Before doing so, please make sure that the bug has not already been submitted and observe + the additional hints at the top of the submit form. If already submitted, please feel free + to add any info to the original report that might help to solve the + issue.

+ +

Please try to verify that it is a Privoxy bug, and not a browser or site bug or + documented behaviour that just happens to be different than what you + expected. If unsure, try toggling + off Privoxy, and see if the + problem persists.

+ +

If you are using your own custom configuration, please try the + stock configs to see if the problem is configuration related. If + you're having problems with a feature that is disabled by default, + please ask around on the mailing list if others can reproduce the + problem.

+ +

If you aren't using the latest Privoxy version, the bug may have + been found and fixed in the meantime. We would appreciate if you + could take the time to upgrade to the latest version (or even the latest CVS + snapshot) and verify that your bug still exists.

+ +

Please be sure to provide the following information:

+ +
    +
  • +

    The exact Privoxy version you + are using (if you got the source from CVS, please also provide + the source code revisions as shown in http://config.privoxy.org/show-version).

    +
  • + +
  • +

    The operating system and versions you run Privoxy on, (e.g. Windows XP SP2), if you are using a Unix + flavor, sending the output of "uname + -a" should do, in case of GNU/Linux, please also name the + distribution.

    +
  • + +
  • +

    The name, platform, and version of the browser you were using (e.g. Internet Explorer v5.5 for Mac).

    +
  • + +
  • +

    The URL where the problem occurred, or some way for us to + duplicate the problem (e.g. http://somesite.example.com/?somethingelse=123).

    +
  • + +
  • +

    Whether your version of Privoxy is one supplied by the Privoxy developers via SourceForge, or if + you got your copy somewhere else.

    +
  • + +
  • +

    Whether you are using Privoxy + in tandem with another proxy such as Tor. If so, please temporary disable the + other proxy to see if the symptoms change.

    +
  • + +
  • +

    Whether you are using a personal firewall product. If so, does + Privoxy work without it?

    +
  • + +
  • +

    Any other pertinent information to help identify the problem + such as config or log file excerpts (yes, you should have log + file entries for each action taken). To get a meaningful logfile, + please make sure that the logfile + directive is being used and the following debug + options are enabled:

    + +

    + debug     1 # Log the destination for each request Privoxy let through. See also debug 1024.
    + + debug     2 # show each connection status
    + + debug     4 # show I/O status
    + + debug     8 # show header parsing
    + + debug   128 # debug redirects
    + debug   256 # debug GIF de-animation
    + + debug   512 # Common Log Format
    + + debug  1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
    + + debug  4096 # Startup banner and warnings.
    + + debug  8192 # Non-fatal errors

    If you + are having trouble with a filter, please additionally enable + +

    + debug    64 # debug regular expression filters

    If + you are using Privoxy 3.0.17 or later and suspect that it + interprets the request or the response incorrectly, please enable + +

    + debug 32768 # log all data read from the network

    Note + that Privoxy log files may contain sensitive information so + please don't submit any logfiles you didn't read first. You can + mask sensitive information as long as it's clear that you removed + something. +
  • +
+ +

You don't have to tell us your actual name when filing a problem + report, but if you don't, please use a nickname so we can + differentiate between your messages and the ones entered by other + "anonymous" users that may respond to your request if they have the + same problem or already found a solution. Note that due to spam the + trackers may not always allow to post without being logged into + SourceForge. If that's the case, you are still free to create a login + that isn't directly linked to your name, though.

+ +

Please also check the status of your request a few days after + submitting it, as we may request additional information. If you use a + SF id, you should automatically get a mail when someone responds to + your request. Please don't bother to add an email address when using + the tracker. If you prefer to communicate through email, just use one + of the mailing lists directly.

+ +

If you are new to reporting problems, you might be interested in + How to Report Bugs Effectively.

+ +

The appendix of the Privoxy User Manual also has + helpful information on understanding actions, and action + debugging.

+
+
+ +
+

6.3. + Request New Features

+ +

You are welcome to submit ideas on new features or other proposals + for improvement through our feature request tracker at http://sourceforge.net/tracker/?atid=361118&group_id=11118.

+
+ +
+

6.4. + Mailing Lists

+ +

If you prefer to communicate through email, instead of using a web + interface, feel free to use one of the mailing lists. To discuss issues + that haven't been completely diagnosed yet, please use the Privoxy + users list. Technically interested users and people who wish to + contribute to the project are always welcome on the developers list. + You can find an overview of all Privoxy-related mailing lists, including list + archives, at: http://sourceforge.net/mail/?group_id=11118.

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/faq/copyright.html b/external/privoxy/doc/webserver/faq/copyright.html index 39b71a6f..69a87cc8 100644 --- a/external/privoxy/doc/webserver/faq/copyright.html +++ b/external/privoxy/doc/webserver/faq/copyright.html @@ -1,301 +1,165 @@ - -Privoxy Copyright, License and History
Privoxy Frequently Asked Questions
Prev 

7. Privoxy Copyright, License and History

Copyright Š 2001-2009 by Privoxy Developers <ijbswa-developers@lists.sourceforge.net>

Some source code is based on code Copyright Š 1997 by Anonymous Coders - and Junkbusters, Inc. and licensed under the GNU General Public - License.

Portions of this document are "borrowed" from the original - Junkbuster (tm) FAQ, and modified as - appropriate for Privoxy. -

7.1. License

Privoxy is free software; you can - redistribute it and/or modify it under the terms of the - GNU General Public License, version 2, - as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.

You should have received a copy of the GNU GPL - along with this program; if not, write to the

 Free Software
- Foundation, Inc. 51 Franklin Street, Fifth Floor
BostonMA 02110-1301
USA 

7.2. History

A long time ago, there was the - Internet Junkbuster, - by Anonymous Coders and Junkbusters - Corporation. This saved many users a lot of pain in the early days of - web advertising and user tracking.

But the web, its protocols and standards, and with it, the techniques for - forcing ads on users, give up autonomy over their browsing, and - for tracking them, keeps evolving. Unfortunately, the Internet - Junkbuster did not. Version 2.0.2, published in 1998, was - (and is) the last official - release - available from Junkbusters Corporation. - Fortunately, it had been released under the GNU - GPL, - which allowed further development by others.

So Stefan Waldherr started maintaining an improved version of the - software, to which eventually a number of people contributed patches. - It could already replace banners with a transparent image, and had a first - version of pop-up killing, but it was still very closely based on the - original, with all its limitations, such as the lack of HTTP/1.1 support, - flexible per-site configuration, or content modification. The last release - from this effort was version 2.0.2-10, published in 2000.

Then, some - developers - picked up the thread, and started turning the software inside out, upside down, - and then reassembled it, adding many - new - features along the way.

The result of this is Privoxy, whose first - stable version, 3.0, was released August, 2002. -


PrevHome 
Contacting the developers, Bug Reporting and Feature Requests  
\ No newline at end of file + + + + + + + Privoxy Copyright, License and History + + + + + + + + + + + +
+

7. Privoxy + Copyright, License and History

+ +

Copyright © 2001-2011 by Privoxy Developers <ijbswa-developers@lists.sourceforge.net>

+ +

Some source code is based on code Copyright © 1997 by Anonymous + Coders and Junkbusters, Inc. and licensed under the GNU General Public License.

+ +

Portions of this document are "borrowed" + from the original Junkbuster (tm) FAQ, + and modified as appropriate for Privoxy.

+ +
+

7.1. License

+ +

Privoxy is free software; you can + redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by + the Free Software Foundation.

+ +

This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.

+ +

You should have received a copy of the GNU + GPL along with this program; if not, write to the

+ +

 Free Software
+  Foundation, Inc. 51 Franklin + Street, Fifth Floor
+  BostonMA 02110-1301
+  USA 

+
+ +
+

7.2. History

+ +

A long time ago, there was the Internet Junkbuster, by Anonymous Coders and + Junkbusters + Corporation. This saved many users a lot of pain in the early days + of web advertising and user tracking.

+ +

But the web, its protocols and standards, and with it, the + techniques for forcing ads on users, give up autonomy over their + browsing, and for tracking them, keeps evolving. Unfortunately, the + Internet Junkbuster did not. Version + 2.0.2, published in 1998, was (and is) the last official release available from Junkbusters Corporation. Fortunately, it had been + released under the GNU GPL, which allowed further development by others.

+ +

So Stefan Waldherr started maintaining an improved version of the + software, to which eventually a number of people contributed patches. + It could already replace banners with a transparent image, and had a + first version of pop-up killing, but it was still very closely based on + the original, with all its limitations, such as the lack of HTTP/1.1 + support, flexible per-site configuration, or content modification. The + last release from this effort was version 2.0.2-10, published in + 2000.

+ +

Then, some developers picked up the thread, and started turning the + software inside out, upside down, and then reassembled it, adding many + new features along the way.

+ +

The result of this is Privoxy, + whose first stable version, 3.0, was released August, 2002.

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/faq/general.html b/external/privoxy/doc/webserver/faq/general.html index 7043b18b..3fb3b53a 100644 --- a/external/privoxy/doc/webserver/faq/general.html +++ b/external/privoxy/doc/webserver/faq/general.html @@ -1,1076 +1,614 @@ - -General Information
Privoxy Frequently Asked Questions
PrevNext

1. General Information

1.1. Who should give Privoxy a try?

Anyone who is interested in security, privacy, or in - finer-grained control over their web and Internet experience. -

1.2. Is Privoxy the best choice for -me?

Privoxy is certainly a good choice, especially for those who want more - control and security. Those with the willingness to read the documentation - and the ability to fine-tune their installation will benefit the most. -

One of Privoxy's - strengths is that it is highly configurable giving you the ability to - completely personalize your installation. Being familiar with, or at least - having an interest in learning about HTTP and other networking - protocols, HTML, and - "Regular - Expressions" - will be a big plus and will help you get the most out of Privoxy. - A new installation just includes a very basic configuration. The user - should take this as a starting point only, and enhance it as he or she - sees fit. In fact, the user is encouraged, and expected to, fine-tune the - configuration. -

Much of Privoxy's configuration can be done - with a Web browser. - But there are areas where configuration is done using a - text editor - to edit configuration files. Also note that the web-based action editor - doesn't use authentication and should only be enabled in environments - where all clients with access to Privoxy listening port can be trusted. -

1.3. What is a "proxy"? How does -Privoxy work?

A web proxy - is a service, based on a software such as Privoxy, that clients - (i.e. browsers) can use instead of connecting to web servers directly. - The clients then ask the proxy to request objects (web pages, images, movies etc) - on their behalf and to forward the data to the clients. - It is a "go-between". For details, see - Wikipedia's proxy definition. -

There are many reasons to use web proxies, such as security (firewalling), - efficiency (caching) and others, and there are any number of proxies - to accommodate those needs. -

Privoxy is a proxy that is primarily focused on - privacy enhancement, ad and junk elimination and freeing the user from - restrictions placed on his activities. Sitting between your browser(s) and the Internet, - it is in a perfect position to filter outbound personal information that your - browser is leaking, as well as inbound junk. It uses a variety of techniques to do - this, all of which are under your complete control via the various configuration - files and options. Being a proxy also makes it easier to share - configurations among multiple browsers and/or users. -

1.4. Does Privoxy do anything more than ad blocking?

- Yes, ad blocking is but one possible use. There are many, many ways Privoxy - can be used to sanitize and customize web browsing.

1.5. What is this new version of -"Junkbuster"?

A long time ago, there was the - Internet Junkbuster, - by Anonymous Coders and Junkbusters - Corporation. This saved many users a lot of pain in the early days of - web advertising and user tracking.

But the web, its protocols and standards, and with it, the techniques for - forcing ads on users, give up autonomy over their browsing, and - for tracking them, keeps evolving. Unfortunately, the Internet - Junkbuster did not. Version 2.0.2, published in 1998, was - (and is) the last official - release - available from Junkbusters Corporation. - Fortunately, it had been released under the GNU - GPL, - which allowed further development by others.

So Stefan Waldherr started maintaining an improved version of the - software, to which eventually a number of people contributed patches. - It could already replace banners with a transparent image, and had a first - version of pop-up killing, but it was still very closely based on the - original, with all its limitations, such as the lack of HTTP/1.1 support, - flexible per-site configuration, or content modification. The last release - from this effort was version 2.0.2-10, published in 2000.

Then, some - developers - picked up the thread, and started turning the software inside out, upside down, - and then reassembled it, adding many - new - features along the way.

The result of this is Privoxy, whose first - stable version, 3.0, was released August, 2002. -

1.6. Why "Privoxy"? Why change the name from -Junkbuster at all?

Though outdated, Junkbusters Corporation - continues to offer their original version of the Internet - Junkbuster, so publishing our - Junkbuster-derived software under the same name - led to confusion.

There are also potential legal complications from our use of the - Junkbuster name, which is a registered trademark of - Junkbusters Corporation. - There are, however, no objections from Junkbusters Corporation to the - Privoxy project itself, and they, in fact, still - share our ideals and goals.

The developers also believed that there are so many improvements over the original - code, that it was time to make a clean break from the past and make - a name in their own right.

Privoxy is the - "Privacy Enhancing Proxy". Also, its content - modification and junk suppression gives you, the user, more - control, more freedom, and allows you to browse your personal and - "private edition" of the web.

1.7. How does Privoxy differ -from the old Junkbuster?

Privoxy picks up where - Junkbuster left off. - The new Privoxy still blocks ads and banners, - still manages cookies, and still - helps protect your privacy. But, most of these features have been enhanced, - and many new ones have been added, all in the same vein. -

Privoxy's new features include:

  • Can keep outgoing connections alive and reuse them later on. -

  • Supports tagging which allows to change the behaviour - based on client and server headers. -

  • Can be run as an "intercepting" proxy, which obviates the need to - configure browsers individually. -

  • Sophisticated actions and filters for manipulating both server and client - headers. -

  • Can be chained with other proxies. -

  • Integrated browser based configuration and control utility at http://config.privoxy.org/ - (shortcut: http://p.p/). Browser-based - tracing of rule and filter effects. Remote toggling. -

  • Web page filtering (text replacements, removes banners based on size, - invisible "web-bugs", JavaScript and HTML annoyances, - pop-up windows, etc.) -

  • Modularized configuration that allows for standard settings and - user settings to reside in separate files, so that installing updated - actions files won't overwrite individual user settings. -

  • Support for Perl Compatible Regular Expressions in the configuration files, and - a more sophisticated and flexible configuration syntax. -

  • Improved cookie management features (e.g. session based cookies). -

  • GIF de-animation. -

  • Bypass many click-tracking scripts (avoids script redirection). -

  • Multi-threaded (POSIX and native threads). -

  • User-customizable HTML templates for most proxy-generated pages (e.g. "blocked" page). -

  • Auto-detection and re-reading of config file changes. -

  • Improved signal handling, and a true daemon mode (Unix). -

  • Every feature now controllable on a per-site or per-location basis, configuration - more powerful and versatile over-all. -

  • Many smaller new features added, limitations and bugs removed. -

1.8. How does Privoxy know what is -an ad, and what is not?

Privoxy's approach to blocking ads is twofold:

First, there are certain patterns in the locations (URLs) - of banner images. This applies to both the path (you wouldn't guess how many - web sites serve their banners from a directory called "banners"!) - and the host (blocking the big banner hosting services like doublecklick.net - already helps a lot). Privoxy takes advantage of this - fact by using URL - patterns to sort out and block the requests for things that sound - like they would be ads or banners.

Second, banners tend to come in certain sizes. But you - can't tell the size of an image by its URL without downloading it, and if you - do, it's too late to save bandwidth. Therefore, Privoxy - also inspects the HTML sources of web pages while they are loaded, and replaces - references to images with standard banner sizes by dummy references, so that - your browser doesn't request them anymore in the first place.

Both of this involves a certain amount of guesswork and is, of course, freely - and readily configurable.

1.9. Can Privoxy make mistakes? -This does not sound very scientific.

Actually, it's a black art ;-) And yes, it is always possible to have a broad - rule accidentally block or change something by mistake. You will almost surely - run into such situations at some point. It is tricky writing rules to - cover every conceivable possibility, and not occasionally get false positives.

But this should not be a big concern since the - Privoxy configuration is very flexible, and - includes tools to help identify these types of situations so they can be - addressed as needed, allowing you to customize your installation. - (See the Troubleshooting section below.)

1.10. Will I have to configure Privoxy - before I can use it?

That depends on your expectations. - The default installation should give you a good starting - point, and block most ads and unwanted content, - but many of the more advanced features are off by default, and require - you to activate them.

You do have to set up your browser to use - Privoxy (see the Installation section below).

And you will certainly run into situations where there are false positives, - or ads not being blocked that you may not want to see. In these cases, you - would certainly benefit by customizing Privoxy's - configuration to more closely match your individual situation. And we - encourage you to do this. This is where the real power of - Privoxy lies!

1.11. Can Privoxy run as a server on a network?

- Yes, Privoxy runs as a server already, and can easily be configured to - "serve" more than one client. See How can I set up Privoxy to act as a proxy for my LAN below.

1.12. My browser does the same things as -Privoxy. Why should I use Privoxy at all?

Modern browsers do indeed have some of the same - functionality as Privoxy. Maybe this is - adequate for you. But Privoxy is very - versatile and powerful, and can probably do a number of things - your browser just can't. -

In addition, a proxy is good choice if you use multiple browsers, or - have a LAN with multiple computers since Privoxy can run as a server - application. This way all the configuration is in one place, and you don't - have to maintain a similar configuration for possibly many browsers or - users. -

Note, however, that it's recommended to leverage both your browser's - and Privoxy's privacy enhancing features - at the same time. While your browser probably lacks some features - Privoxy offers, it should also be able to do some things more - reliable, for example restricting and suppressing JavaScript. -

1.13. Why should I trust Privoxy?

The most important reason is because you have access to - everything, and you can control everything. You can - check every line of every configuration file yourself. You can check every - last bit of source code should you desire. And even if you can't read code, - there should be some comfort in knowing that other people can, - and do read it. You can build the software from scratch, if you want, - so that you know the executable is clean, and that it is - yours. In fact, we encourage this level of scrutiny. It - is one reason we use Privoxy ourselves. -

1.14. Is there is a license or fee? What about a -warranty? Registration?

Privoxy is free software and licensed under the GNU General Public License (GPL) version 2. - It is free to use, copy, modify or distribute as you wish under the terms of this - license. Please see the Copyright section for more - information on the license and copyright. Or the LICENSE file - that should be included. -

There is no warranty of any kind, expressed, implied or otherwise. - That is something that would cost real money ;-) There is no registration either. -

1.15. Can Privoxy remove spyware? Adware? Viruses?

No, at least not reliably enough to trust it. Privoxy is not designed to be - a malware removal tool and the default configuration doesn't even try to - filter out any malware.

Privoxy could help prevent contact from (known) sites that use such - tactics with appropriate configuration rules, and thus could conceivably - prevent contamination from such sites. However, keeping such a configuration - up to date would require a lot of time and effort that would be better spend - on keeping your software itself up to date so it doesn't have known - vulnerabilities.

1.16. Can I use Privoxy with other ad-blocking software?

Privoxy should work fine with other proxies and other software in general.

But it is probably not necessary to use Privoxy in conjunction with other - ad-blocking products, and this could conceivably cause undesirable results. - It might be better to choose one software or the other and work a little to - tweak its configuration to your liking.

Note that this is an advice specific to ad blocking.

1.17. I would like to help you, what can I do?

1.17.1. Would you like to participate?

Well, we always need help. There is something for - everybody who wants to help us. We welcome new developers, packagers, - testers, documentation writers or really anyone with a desire to help in - any way. You DO NOT need to be a - "programmer". There are many other tasks available. In fact, - the programmers often can't spend as much time programming because of some - of the other, more mundane things that need to be done, like checking the - Tracker feedback sections. -

So first thing, get an account on SourceForge.net - and mail your id to the developers - mailing list. Then, please read the Developer's Manual, at least - the pertinent sections.

You can also start helping out without SourceForge.net account, - simply by showing up on the mailing list, helping out other users, - providing general feedback or reporting problems you noticed. -

1.17.2. Would you like to donate?

Privoxy is developed by unpaid volunteers - and thus our current running costs are pretty low. Nevertheless, we - have plans that will cost money in the future. We would like to get - this money through donations made by our users.

Privoxy has therefore become an associated - project of Software - in the Public Interest (SPI), which allows us to receive tax-deductible - donations in most western countries.

We intend to use the donations to pay for our domain after transfering - it to SPI. Our goal is to make sure there's no single point of failure - and the bill gets paid and the site keeps running even if a some of - the currently active developers were to suddenly disappear for a while.

We would also like to spend some money on more reliable hosting, - on hardware to help make sure Privoxy - keeps running on platforms the developers currently can't test on, - and on technical books to educate our developers about said platforms - or to improve their knowledge in general.

If you enjoy our software and feel like helping out with a donation, - please have a look at - SPI's donation page - to see what the options are.


PrevHomeNext
Privoxy Frequently Asked Questions Installation
\ No newline at end of file + + + + + + + General Information + + + + + + + + + + + + +
+

1. General + Information

+ +
+

1.1. Who should give + Privoxy a try?

+ +

Anyone who is interested in security, privacy, or in finer-grained + control over their web and Internet experience.

+
+ +
+

1.2. Is Privoxy + the best choice for me?

+ +

Privoxy is certainly a good choice, + especially for those who want more control and security. Those with the + willingness to read the documentation and the ability to fine-tune + their installation will benefit the most.

+ +

One of Privoxy's strengths is that + it is highly configurable giving you the ability to completely + personalize your installation. Being familiar with, or at least having + an interest in learning about HTTP and other + networking protocols, HTML, and "Regular Expressions" will be a + big plus and will help you get the most out of Privoxy. A new installation just includes a very + basic configuration. The user should take this as a starting point + only, and enhance it as he or she sees fit. In fact, the user is + encouraged, and expected to, fine-tune the configuration.

+ +

Much of Privoxy's configuration can + be done with a Web browser. But there are areas where configuration + is done using a text editor to edit configuration files. Also note + that the web-based action editor doesn't use authentication and should + only be enabled in environments where all clients with access to + Privoxy listening port can be + trusted.

+
+ +
+

1.3. What is a + "proxy"? How does Privoxy work?

+ +

A web proxy is a service, based on a software such as + Privoxy, that clients (i.e. browsers) + can use instead of connecting to web servers directly. The clients then + ask the proxy to request objects (web pages, images, movies etc) on + their behalf and to forward the data to the clients. It is a + "go-between". For details, see Wikipedia's + proxy definition.

+ +

There are many reasons to use web proxies, such as security + (firewalling), efficiency (caching) and others, and there are any + number of proxies to accommodate those needs.

+ +

Privoxy is a proxy that is + primarily focused on privacy enhancement, ad and junk elimination and + freeing the user from restrictions placed on his activities. Sitting + between your browser(s) and the Internet, it is in a perfect position + to filter outbound personal information that your browser is leaking, + as well as inbound junk. It uses a variety of techniques to do this, + all of which are under your complete control via the various + configuration files and options. Being a proxy also makes it easier to + share configurations among multiple browsers and/or users.

+
+ +
+

1.4. Does + Privoxy do anything more than ad blocking?

+ +

Yes, ad blocking is but one possible use. There are many, many ways + Privoxy can be used to sanitize and + customize web browsing.

+
+ +
+

1.5. What is this new + version of "Junkbuster"?

+ +

A long time ago, there was the Internet Junkbuster, by Anonymous Coders and + Junkbusters + Corporation. This saved many users a lot of pain in the early days + of web advertising and user tracking.

+ +

But the web, its protocols and standards, and with it, the + techniques for forcing ads on users, give up autonomy over their + browsing, and for tracking them, keeps evolving. Unfortunately, the + Internet Junkbuster did not. Version + 2.0.2, published in 1998, was (and is) the last official release available from Junkbusters Corporation. Fortunately, it had been + released under the GNU GPL, which allowed further development by others.

+ +

So Stefan Waldherr started maintaining an improved version of the + software, to which eventually a number of people contributed patches. + It could already replace banners with a transparent image, and had a + first version of pop-up killing, but it was still very closely based on + the original, with all its limitations, such as the lack of HTTP/1.1 + support, flexible per-site configuration, or content modification. The + last release from this effort was version 2.0.2-10, published in + 2000.

+ +

Then, some developers picked up the thread, and started turning the + software inside out, upside down, and then reassembled it, adding many + new features along the way.

+ +

The result of this is Privoxy, + whose first stable version, 3.0, was released August, 2002.

+
+ +
+

1.6. Why "Privoxy"? Why change the name from Junkbuster at + all?

+ +

Though outdated, Junkbusters Corporation continues to offer their original + version of the Internet Junkbuster, so + publishing our Junkbuster-derived + software under the same name led to confusion.

+ +

There are also potential legal complications from our use of the + Junkbuster name, which is a registered + trademark of Junkbusters Corporation. There are, however, no objections + from Junkbusters Corporation to the Privoxy project itself, and they, in fact, still + share our ideals and goals.

+ +

The developers also believed that there are so many improvements + over the original code, that it was time to make a clean break from the + past and make a name in their own right.

+ +

Privoxy is the "Privacy Enhancing + Proxy". Also, its content modification and junk + suppression gives you, the + user, more control, more freedom, and allows you to browse your + personal and "private edition" of the web.

+
+ +
+

1.7. How does Privoxy + differ from the old Junkbuster?

+ +

Privoxy picks up where Junkbuster left off. The new Privoxy still blocks ads and banners, still + manages cookies, and still helps protect your privacy. But, most of + these features have been enhanced, and many new ones have been added, + all in the same vein.

+ +

Privoxy's new features include:

+ +
    +
  • +

    Supports "Connection: keep-alive". Outgoing connections can be + kept alive independently from the client.

    +
  • + +
  • +

    Supports IPv6, provided the operating system does so too, and + the configure script detects it.

    +
  • + +
  • +

    Supports tagging which allows to change the behaviour based on + client and server headers.

    +
  • + +
  • +

    Can be run as an "intercepting" proxy, which obviates the need + to configure browsers individually.

    +
  • + +
  • +

    Sophisticated actions and filters for manipulating both server + and client headers.

    +
  • + +
  • +

    Can be chained with other proxies.

    +
  • + +
  • +

    Integrated browser-based configuration and control utility at + http://config.privoxy.org/ (shortcut: http://p.p/). Browser-based tracing + of rule and filter effects. Remote toggling.

    +
  • + +
  • +

    Web page filtering (text replacements, removes banners based on + size, invisible "web-bugs" and HTML + annoyances, etc.)

    +
  • + +
  • +

    Modularized configuration that allows for standard settings and + user settings to reside in separate files, so that installing + updated actions files won't overwrite individual user settings.

    +
  • + +
  • +

    Support for Perl Compatible Regular Expressions in the + configuration files, and a more sophisticated and flexible + configuration syntax.

    +
  • + +
  • +

    GIF de-animation.

    +
  • + +
  • +

    Bypass many click-tracking scripts (avoids script + redirection).

    +
  • + +
  • +

    User-customizable HTML templates for most proxy-generated pages + (e.g. "blocked" page).

    +
  • + +
  • +

    Auto-detection and re-reading of config file changes.

    +
  • + +
  • +

    Most features are controllable on a per-site or per-location + basis.

    +
  • + +
  • +

    Many smaller new features added, limitations and bugs + removed.

    +
  • +
+
+ +
+

1.8. How does + Privoxy know what is an ad, and what is not?

+ +

Privoxy's approach to blocking ads + is twofold:

+ +

First, there are certain patterns in the locations (URLs) of banner images. This + applies to both the path (you wouldn't guess how many web sites serve + their banners from a directory called "banners"!) and the host (blocking the big banner + hosting services like doublecklick.net already helps a lot). + Privoxy takes advantage of this fact + by using URL patterns to sort out and block the requests for things + that sound like they would be ads or banners.

+ +

Second, banners tend to come in certain sizes. But you can't tell the size of an + image by its URL without downloading it, and if you do, it's too late + to save bandwidth. Therefore, Privoxy + also inspects the HTML sources of web pages while they are loaded, and + replaces references to images with standard banner sizes by dummy + references, so that your browser doesn't request them anymore in the + first place.

+ +

Both of this involves a certain amount of guesswork and is, of + course, freely and readily configurable.

+
+ +
+

1.9. Can Privoxy make + mistakes? This does not sound very scientific.

+ +

Actually, it's a black art ;-) And yes, it is always possible to + have a broad rule accidentally block or change something by mistake. + You will almost surely run into such situations at some point. It is + tricky writing rules to cover every conceivable possibility, and not + occasionally get false positives.

+ +

But this should not be a big concern since the Privoxy configuration is very flexible, and + includes tools to help identify these types of situations so they can + be addressed as needed, allowing you to customize your installation. + (See the Troubleshooting section + below.)

+
+ +
+

1.10. Will I have to + configure Privoxy before I can use it?

+ +

That depends on your expectations. The default installation should + give you a good starting point, and block most ads and unwanted content, but many + of the more advanced features are off by default, and require you to + activate them.

+ +

You do have to set up your browser to use Privoxy (see the Installation section below).

+ +

And you will certainly run into situations where there are false + positives, or ads not being blocked that you may not want to see. In + these cases, you would certainly benefit by customizing Privoxy's configuration to more closely match your + individual situation. And we encourage you to do this. This is where + the real power of Privoxy lies!

+
+ +
+

1.11. Can Privoxy run as a + server on a network?

+ +

Yes, Privoxy runs as a server + already, and can easily be configured to "serve" more than one client. See How can I set up Privoxy to act as a + proxy for my LAN below.

+
+ +
+

1.12. My browser + does the same things as Privoxy. Why should I use Privoxy at + all?

+ +

Modern browsers do indeed have some of the same functionality as + Privoxy. Maybe this is adequate for + you. But Privoxy is very versatile and + powerful, and can probably do a number of things your browser just + can't.

+ +

In addition, a proxy is good choice if you use multiple browsers, or + have a LAN with multiple computers since Privoxy can run as a server application. This way + all the configuration is in one place, and you don't have to maintain a + similar configuration for possibly many browsers or users.

+ +

Note, however, that it's recommended to leverage both your browser's + and Privoxy's privacy enhancing + features at the same time. While your browser probably lacks some + features Privoxy offers, it should + also be able to do some things more reliable, for example restricting + and suppressing JavaScript.

+
+ +
+

1.13. Why should I + trust Privoxy?

+ +

The most important reason is because you have access to everything, and you can control + everything. You can check every line of every configuration file + yourself. You can check every last bit of source code should you + desire. And even if you can't read code, there should be some comfort + in knowing that other people can, and do read it. You can build the + software from scratch, if you want, so that you know the executable is + clean, and that it is yours. + In fact, we encourage this level of scrutiny. It is one reason we use + Privoxy ourselves.

+
+ +
+

1.14. Is there is a + license or fee? What about a warranty? Registration?

+ +

Privoxy is free software and + licensed under the GNU General Public License (GPL) version 2. It is free to + use, copy, modify or distribute as you wish under the terms of this + license. Please see the Copyright section + for more information on the license and copyright. Or the LICENSE file that should be included.

+ +

There is no warranty of + any kind, expressed, implied or otherwise. That is something that would + cost real money ;-) There is no registration either.

+
+ +
+

1.15. Can Privoxy + remove spyware? Adware? Viruses?

+ +

No, at least not reliably enough to trust it. Privoxy is not designed to be a malware removal + tool and the default configuration doesn't even try to filter out any + malware.

+ +

Privoxy could help prevent contact + from (known) sites that use such tactics with appropriate configuration + rules, and thus could conceivably prevent contamination from such + sites. However, keeping such a configuration up to date would require a + lot of time and effort that would be better spend on keeping your + software itself up to date so it doesn't have known + vulnerabilities.

+
+ +
+

1.16. Can I use + Privoxy with other ad-blocking software?

+ +

Privoxy should work fine with other + proxies and other software in general.

+ +

But it is probably not necessary to use Privoxy in conjunction with other ad-blocking + products, and this could conceivably cause undesirable results. It + might be better to choose one software or the other and work a little + to tweak its configuration to your liking.

+ +

Note that this is an advice specific to ad blocking.

+
+ +
+

1.17. I would like to help you, what can I + do?

+ +
+

1.17.1. + Would you like to participate?

+ +

Well, we always need + help. There is something for everybody who wants to help us. We + welcome new developers, packagers, testers, documentation writers or + really anyone with a desire to help in any way. You DO NOT need to be a "programmer". There are many other tasks available. In + fact, the programmers often can't spend as much time programming + because of some of the other, more mundane things that need to be + done, like checking the Tracker feedback sections or responding to + user questions on the mailing lists.

+ +

So first thing, subscribe to the Privoxy Users or the Privoxy Developers mailing list, join the + discussion, help out other users, provide general feedback or report + problems you noticed.

+ +

If you intend to help out with the trackers, you also might want + to get an account on SourceForge.net so we don't confuse you + with the other name-less users.

+ +

We also have a Developer's Manual. While it is partly out of date, it's + still worth reading.

+ +

Our TODO list may be of interest to you as well. Please + let us know if you want to work on one of the items listed.

+
+ +
+

+ +

Privoxy is developed by unpaid + volunteers and thus our current running costs are pretty low. + Nevertheless, we have plans that will cost money in the future. They + include, but aren't limited to spending money on:

+ +
    +
  • +

    Hardware to help make sure Privoxy keeps running on platforms the + developers currently can't test on and can be ported to + others.

    +
  • + +
  • +

    Technical books to educate our developers about said platforms + or to improve their knowledge in general.

    +
  • + +
  • +

    More reliable hosting,

    +
  • +
+ +

We would like to get this money through donations made by our + users.

+ +

Privoxy has therefore become an + associated project of Software + in the Public Interest (SPI), which allows us to receive + donations. In the United States they are tax-deductible, in a few + other western countries they might be tax-deductible in the + future.

+ +

If you read this section before you may notice that paying for the + project domain privoxy.org is no longer on the list. It has been + transferred to SPI is sponsored by Mythic Beasts Ltd.

+ +

If you enjoy our software and feel like helping out with a + donation, please have a look at SPI's donation + page to see what the options are. If you have any questions + regarding donations please mail to either the public user mailing + list or, if it's a private matter, to Fabian Keil (Privoxy's + SPI liason) directly.

+
+
+
+ + + + diff --git a/external/privoxy/doc/webserver/faq/index.html b/external/privoxy/doc/webserver/faq/index.html index cec0d7c5..38813775 100644 --- a/external/privoxy/doc/webserver/faq/index.html +++ b/external/privoxy/doc/webserver/faq/index.html @@ -1,999 +1,558 @@ - -Privoxy Frequently Asked Questions

Privoxy Frequently Asked Questions

Copyright Š 2001-2009 by - Privoxy Developers -

$Id: index.html,v 1.51 2009/03/21 12:59:04 fabiankeil Exp $

This FAQ gives quick answers to frequently asked questions about - Privoxy. - It is not a substitute for the - Privoxy User Manual. - -

What is Privoxy?

Privoxy is a non-caching web proxy with advanced filtering capabilities - for enhancing privacy, modifying web page data and HTTP headers, controlling - access, and removing ads and other obnoxious Internet junk. Privoxy has a - flexible configuration and can be customized to suit individual needs and tastes. - It has application for both stand-alone systems and multi-user networks.

Privoxy is Free Software and licensed under the GPL2.

Privoxy is an associated project of Software in the Public Interest (SPI). - Donations are welcome.

Please note that this document is a work in progress. This copy represents - the state at the release of version 3.0.12. - You can find the latest version of the document at http://www.privoxy.org/faq/. - Please see the Contact section if you want to - contact the developers. -


Table of Contents
1. General Information
1.1. Who should give Privoxy a try?
1.2. Is Privoxy the best choice for -me?
1.3. What is a "proxy"? How does -Privoxy work?
1.4. Does Privoxy do anything more than ad blocking?
1.5. What is this new version of -"Junkbuster"?
1.6. Why "Privoxy"? Why change the name from -Junkbuster at all?
1.7. How does Privoxy differ -from the old Junkbuster?
1.8. How does Privoxy know what is -an ad, and what is not?
1.9. Can Privoxy make mistakes? -This does not sound very scientific.
1.10. Will I have to configure Privoxy - before I can use it?
1.11. Can Privoxy run as a server on a network?
1.12. My browser does the same things as -Privoxy. Why should I use Privoxy at all?
1.13. Why should I trust Privoxy?
1.14. Is there is a license or fee? What about a -warranty? Registration?
1.15. Can Privoxy remove spyware? Adware? Viruses?
1.16. Can I use Privoxy with other ad-blocking software?
1.17. I would like to help you, what can I do?
1.17.1. Would you like to participate?
1.17.2. Would you like to donate?
2. Installation
2.1. Which browsers are supported by Privoxy?
2.2. Which operating systems are supported?
2.3. Can I use Privoxy with my email client?
2.4. I just installed Privoxy. Is there anything -special I have to do now?
2.5. What is the proxy address of Privoxy?
2.6. I just installed Privoxy, and nothing is happening. -All the ads are there. What's wrong?
2.7. I get a "Privoxy is not being used" dummy page although -Privoxy is running and being used.
3. Configuration
3.1. What exactly is an "actions" file?
3.2. The "actions" concept confuses me. Please list -some of these "actions".
3.3. How are actions files configured? What is the easiest -way to do this?
3.4. There are several different "actions" files. What are -the differences?
3.5. Where can I get updated Actions Files?
3.6. Can I use my old config files?
3.7. Why is the configuration so complicated?
3.8. How can I make my Yahoo/Hotmail/Gmail account work?
3.9. What's the difference between the -"Cautious", "Medium" and "Advanced" defaults?
3.10. Why can I change the configuration -with a browser? Does that not raise security issues?
3.11. What is the default.filter file? What is a "filter"?
3.12. How can I set up Privoxy to act as a proxy for my - LAN?
3.13. Instead of ads, now I get a checkerboard pattern. I don't want to see anything.
3.14. Why would anybody want to see a checkerboard pattern?
3.15. I see some images being replaced with text -instead of the checkerboard image. Why and how do I get rid of this?
3.16. Can Privoxy run as a service -on Win2K/NT/XP?
3.17. How can I make Privoxy work with other -proxies like Squid or Tor?
3.18. Can I just set Privoxy to use port 80 -and thus avoid individual browser configuration?
3.19. Can Privoxy run as a "transparent" proxy?
3.20. Can Privoxy run as a "intercepting" proxy?
3.21. How can I configure Privoxy for use with Outlook?
3.22. How can I have separate rules just for HTML mail?
3.23. I sometimes notice cookies sneaking through. How?
3.24. Are all cookies bad? Why?
3.25. How can I allow permanent cookies for my trusted sites?
3.26. Can I have separate configurations for different users?
3.27. Can I set-up Privoxy as a whitelist of -"good" sites?
3.28. How can I turn off ad-blocking?
3.29. How can I have custom template pages, like the -BLOCKED page?
3.30. How can I remove the "Go There Anyway" link from -the BLOCKED page?
4. Miscellaneous
4.1. How much does Privoxy slow my browsing down? This -has to add extra time to browsing.
4.2. I notice considerable -delays in page requests. What's wrong?
4.3. What are "http://config.privoxy.org/" and -"http://p.p/"?
4.4. How can I submit new ads, or report -problems?
4.5. If I do submit missed ads, will -they be included in future updates?
4.6. Why doesn't anyone answer my support -request?
4.7. How can I hide my IP address?
4.8. Can Privoxy guarantee I am anonymous?
4.9. A test site says I am not using a Proxy.
4.10. How do I use Privoxy - together with Tor?
4.11. Might some things break because header information or -content is being altered?
4.12. Can Privoxy act as a "caching" proxy to -speed up web browsing?
4.13. What about as a firewall? Can Privoxy protect me?
4.14. I have large empty spaces / a checkerboard pattern now where -ads used to be. Why?
4.15. How can Privoxy filter Secure (HTTPS) URLs?
4.16. Privoxy runs as a "server". How -secure is it? Do I need to take any special precautions?
4.17. Can I temporarily disable Privoxy?
4.18. When "disabled" is Privoxy totally -out of the picture?
4.19. How can I tell Privoxy to totally ignore certain sites?
4.20. My logs show Privoxy "crunches" -ads, but also its own internal CGI pages. What is a "crunch"?
4.21. Can Privoxy effect files that I download -from a webserver? FTP server?
4.22. I just downloaded a Perl script, and Privoxy -altered it! Yikes, what is wrong!
4.23. Should I continue to use a "HOSTS" file for ad-blocking?
4.24. Where can I find more information about Privoxy -and related issues?
4.25. I've noticed that Privoxy changes "Microsoft" to -"MicroSuck"! Why are you manipulating my browsing?
4.26. Does Privoxy produce "valid" HTML (or XHTML)?
5. Troubleshooting
5.1. I cannot connect to any websites. Or, I am getting -"connection refused" message with every web page. Why?
5.2. Why am I getting a 503 Error (WSAECONNREFUSED) on every page?
5.3. I just added a new rule, but the steenkin ad is -still getting through. How?
5.4. One of my favorite sites does not work with Privoxy. -What can I do?
5.5. After installing Privoxy, I have to log in -every time I start IE. What gives?
5.6. I cannot connect to any FTP sites. Privoxy - is blocking me.
5.7. In Mac OS X, I can't configure Microsoft Internet Explorer to use - Privoxy as the HTTP proxy.
5.8. In Mac OS X, I dragged the Privoxy folder to the trash in order to - uninstall it. Now the finder tells me I don't have sufficient privileges to - empty the trash.
5.9. In Mac OS X Panther (10.3), images often fail to load and/or I - experience random delays in page loading. I'm using - localhost as my browser's proxy setting.
5.10. I get a completely blank page at one site. "View Source" - shows only: <html><body></body></html>. Without - Privoxy the page loads fine.
5.11. My logs show many "Unable to get my own hostname" lines. -Why?
5.12. When I try to launch Privoxy, I get an -error message "port 8118 is already in use" (or similar wording). -Why?
5.13. Pages with UTF-8 fonts are garbled.
5.14. Why are binary files (such as images) corrupted when Privoxy - is used?
5.15. What is the "demoronizer" and why is it there?
5.16. Why do I keep seeing "PrivoxyWindowOpen()" in raw source code?
5.17. I am getting too many DNS errors like "404 No Such Domain". Why - can't Privoxy do this better?
5.18. At one site Privoxy just hangs, and starts taking - all CPU. Why is this?
5.19. I just installed Privoxy, and all my -browsing has slowed to a crawl. What gives?
5.20. Why do my filters work on some sites but not on others?
5.21. On some HTTPS sites my browser warns me about unauthenticated content, - the URL bar doesn't get highlighted and the lock symbol appears to be broken. - What's going on?
5.22. I get selinux error messages. How can I fix this?
5.23. I compiled Privoxy with Gentoo's portage and it appears to be very slow. Why?
6. Contacting the developers, Bug Reporting and Feature Requests
6.1. Get Support
6.2. Reporting Problems
6.2.1. Reporting Ads or Other Configuration Problems
6.2.2. Reporting Bugs
6.3. Request New Features
6.4. Other
7. Privoxy Copyright, License and History
7.1. License
7.2. History

  Next
  General Information
\ No newline at end of file + + + + + + + Privoxy Frequently Asked Questions + + + + + + + + +
+
+

Privoxy Frequently Asked + Questions

+ +

Copyright © + 2001-2011 by Privoxy + Developers

+ +

$Id: faq.sgml,v 2.84 2011/11/13 17:03:54 fabiankeil + Exp $

+ +
+ + +

This FAQ gives quick answers to frequently asked questions about + Privoxy. It is + not a substitute for the Privoxy User + Manual.

+ +

What is Privoxy?

+ +

Privoxy is a non-caching web proxy with advanced filtering + capabilities for enhancing privacy, modifying web page data and HTTP + headers, controlling access, and removing ads and other obnoxious + Internet junk. Privoxy has a flexible configuration and can be + customized to suit individual needs and tastes. It has application + for both stand-alone systems and multi-user networks.

+ +

Privoxy is Free Software and licensed under the GNU GPLv2.

+ +

Privoxy is an associated project of Software in the Public + Interest (SPI).

+ +

Helping hands and donations are welcome:

+ + + +

Please note that this document is a work in progress. This copy + represents the state at the release of version 3.0.19. You can find + the latest version of the document at http://www.privoxy.org/faq/. Please see the Contact section if you want to contact the + developers.

+
+
+
+ +
+
+
Table of Contents
+ +
1. General Information
+ +
+
+
1.1. Who should give + Privoxy a try?
+ +
1.2. Is Privoxy the best + choice for me?
+ +
1.3. What is a "proxy"? How does Privoxy work?
+ +
1.4. Does Privoxy do + anything more than ad blocking?
+ +
1.5. What is this new version of + "Junkbuster"?
+ +
1.6. Why "Privoxy"? Why change the name from Junkbuster at + all?
+ +
1.7. How does Privoxy differ + from the old Junkbuster?
+ +
1.8. How does Privoxy know + what is an ad, and what is not?
+ +
1.9. Can Privoxy make mistakes? + This does not sound very scientific.
+ +
1.10. Will I have to configure + Privoxy before I can use it?
+ +
1.11. Can Privoxy run as a server + on a network?
+ +
1.12. My browser does the + same things as Privoxy. Why should I use Privoxy at all?
+ +
1.13. Why should I trust + Privoxy?
+ +
1.14. Is there is a license or + fee? What about a warranty? Registration?
+ +
1.15. Can Privoxy remove + spyware? Adware? Viruses?
+ +
1.16. Can I use Privoxy with + other ad-blocking software?
+ +
1.17. I would like + to help you, what can I do?
+ +
+
+
1.17.1. Would you like + to participate?
+ +
1.17.2. Would you like to + donate?
+
+
+
+
+ +
2. Installation
+ +
+
+
2.1. Which browsers + are supported by Privoxy?
+ +
2.2. Which operating + systems are supported?
+ +
2.3. Can I use + Privoxy with my email client?
+ +
2.4. I just installed + Privoxy. Is there anything special I have to do now?
+ +
2.5. What is the proxy + address of Privoxy?
+ +
2.6. I just installed + Privoxy, and nothing is happening. All the ads are there. What's + wrong?
+ +
2.7. I get a "Privoxy is not being used" dummy page although + Privoxy is running and being used.
+
+
+ +
3. Configuration
+ +
+
+
3.1. What exactly is an + "actions" file?
+ +
3.2. The "actions" concept confuses me. Please list some of + these "actions".
+ +
3.3. How are actions + files configured? What is the easiest way to do this?
+ +
3.4. There are several + different "actions" files. What are + the differences?
+ +
3.5. Where can I get + updated Actions Files?
+ +
3.6. Can I use my old + config files?
+ +
3.7. Why is the + configuration so complicated?
+ +
3.8. How can I make my + Yahoo/Hotmail/Gmail account work?
+ +
3.9. What's the + difference between the "Cautious", + "Medium" and "Advanced" defaults?
+ +
3.10. Why can I + change the configuration with a browser? Does that not raise + security issues?
+ +
3.11. What is the + default.filter file? What is a + "filter"?
+ +
3.12. How can I set up + Privoxy to act as a proxy for my LAN?
+ +
3.13. Instead of ads, now + I get a checkerboard pattern. I don't want to see + anything.
+ +
3.14. Why would anybody + want to see a checkerboard pattern?
+ +
3.15. I see some images + being replaced with text instead of the checkerboard image. Why + and how do I get rid of this?
+ +
3.16. Can Privoxy run as + a service on Win2K/NT/XP?
+ +
3.17. How can I make + Privoxy work with other proxies?
+ +
3.18. Can I just set + Privoxy to use port 80 and thus avoid individual browser + configuration?
+ +
3.19. Can Privoxy + run as a "transparent" proxy?
+ +
3.20. Can Privoxy + run as a "intercepting" + proxy?
+ +
3.21. How can I + configure Privoxy for use with Outlook?
+ +
3.22. How can I + have separate rules just for HTML mail?
+ +
3.23. I sometimes + notice cookies sneaking through. How?
+ +
3.24. Are all + cookies bad? Why?
+ +
3.25. How can I + allow permanent cookies for my trusted sites?
+ +
3.26. Can I have + separate configurations for different users?
+ +
3.27. Can I set-up + Privoxy as a whitelist of "good" + sites?
+ +
3.28. How can I turn + off ad-blocking?
+ +
3.29. How can I have + custom template pages, like the BLOCKED page?
+ +
3.30. How can I remove + the "Go There Anyway" link from the + BLOCKED page?
+
+
+ +
4. Miscellaneous
+ +
+
+
4.1. How much does Privoxy slow my + browsing down? This has to add extra time to browsing.
+ +
4.2. I notice considerable + delays in page requests. What's wrong?
+ +
4.3. What are + "http://config.privoxy.org/" and "http://p.p/"?
+ +
4.4. How can I submit new ads, or + report problems?
+ +
4.5. If I do submit missed ads, + will they be included in future updates?
+ +
4.6. Why doesn't anyone answer + my support request?
+ +
4.7. How can I hide my IP + address?
+ +
4.8. Can Privoxy guarantee I am + anonymous?
+ +
4.9. A test site says I am not + using a Proxy.
+ +
4.10. How do I use Privoxy together + with Tor?
+ +
4.11. Might some things break + because header information or content is being altered?
+ +
4.12. Can Privoxy act as a + "caching" proxy to speed up web + browsing?
+ +
4.13. What about as a firewall? + Can Privoxy protect me?
+ +
4.14. I have large empty spaces / + a checkerboard pattern now where ads used to be. Why?
+ +
4.15. How can Privoxy filter + Secure (HTTPS) URLs?
+ +
4.16. Privoxy runs as a + "server". How secure is it? Do I need + to take any special precautions?
+ +
4.17. Can I temporarily disable + Privoxy?
+ +
4.18. When "disabled" is Privoxy totally out of the + picture?
+ +
4.19. How can I tell Privoxy to + totally ignore certain sites?
+ +
4.20. My logs show Privoxy + "crunches" ads, but also its own + internal CGI pages. What is a "crunch"?
+ +
4.21. Can Privoxy effect files + that I download from a webserver? FTP server?
+ +
4.22. I just downloaded a Perl + script, and Privoxy altered it! Yikes, what is wrong!
+ +
4.23. Should I continue to use + a "HOSTS" file for + ad-blocking?
+ +
4.24. Where can I find more + information about Privoxy and related issues?
+ +
4.25. I've noticed that Privoxy + changes "Microsoft" to "MicroSuck"! Why are you manipulating my + browsing?
+ +
4.26. Does Privoxy produce + "valid" HTML (or XHTML)?
+ +
4.27. How did you manage + to get Privoxy on my computer without my consent?
+
+
+ +
5. Troubleshooting
+ +
+
+
5.1. I cannot connect to any + websites. Or, I am getting "connection + refused" message with every web page. Why?
+ +
5.2. Why am I getting a 503 + Error (WSAECONNREFUSED) on every page?
+ +
5.3. I just added a new rule, + but the steenkin ad is still getting through. How?
+ +
5.4. One of my favorite sites + does not work with Privoxy. What can I do?
+ +
5.5. After installing Privoxy, I + have to log in every time I start IE. What gives?
+ +
5.6. I cannot connect to any FTP + sites. Privoxy is blocking me.
+ +
5.7. In Mac OS X, I can't + configure Microsoft Internet Explorer to use Privoxy as the HTTP + proxy.
+ +
5.8. In Mac OS X, I + dragged the Privoxy folder to the trash in order to uninstall it. + Now the finder tells me I don't have sufficient privileges to + empty the trash.
+ +
5.9. In Mac OS X Panther + (10.3), images often fail to load and/or I experience random + delays in page loading. I'm using localhost as my browser's proxy setting.
+ +
5.10. I get a completely + blank page at one site. "View Source" + shows only: <html><body></body></html>. + Without Privoxy the page loads fine.
+ +
5.11. My logs show many + "Unable to get my own hostname" lines. + Why?
+ +
5.12. When I try to launch + Privoxy, I get an error message "port 8118 is + already in use" (or similar wording). Why?
+ +
5.13. Pages with UTF-8 + fonts are garbled.
+ +
5.14. Why are binary + files (such as images) corrupted when Privoxy is used?
+ +
5.15. What is the + "demoronizer" and why is it + there?
+ +
5.16. Why do I keep seeing + "PrivoxyWindowOpen()" in raw source + code?
+ +
5.17. I am getting too many + DNS errors like "404 No Such Domain". + Why can't Privoxy do this better?
+ +
5.18. At one site Privoxy just + hangs, and starts taking all CPU. Why is this?
+ +
5.19. I just installed + Privoxy, and all my browsing has slowed to a crawl. What + gives?
+ +
5.20. Why do my filters + work on some sites but not on others?
+ +
5.21. On some HTTPS sites + my browser warns me about unauthenticated content, the URL bar + doesn't get highlighted and the lock symbol appears to be broken. + What's going on?
+ +
5.22. I get selinux error + messages. How can I fix this?
+ +
5.23. I compiled + Privoxy with Gentoo's portage + and it appears to be very slow. Why?
+
+
+ +
6. Contacting the developers, Bug + Reporting and Feature Requests
+ +
+
+
6.1. Get + Support
+ +
6.2. Reporting + Problems
+ +
+
+
6.2.1. Reporting Ads + or Other Configuration Problems
+ +
6.2.2. Reporting + Bugs
+
+
+ +
6.3. Request New + Features
+ +
6.4. Mailing + Lists
+
+
+ +
7. Privoxy Copyright, License and + History
+ +
+
+
7.1. License
+ +
7.2. History
+
+
+
+
+
+ + + + diff --git a/external/privoxy/doc/webserver/faq/installation.html b/external/privoxy/doc/webserver/faq/installation.html index 1e99b309..47ecf734 100644 --- a/external/privoxy/doc/webserver/faq/installation.html +++ b/external/privoxy/doc/webserver/faq/installation.html @@ -1,569 +1,259 @@ - -Installation
Privoxy Frequently Asked Questions
PrevNext

2. Installation

2.1. Which browsers are supported by Privoxy?

Any browser that can be configured to use a proxy, which - should be virtually all browsers, including - Firefox, Internet - Explorer, Opera, and - Safari among others. - Direct browser support is not an absolute requirement since - Privoxy runs as a separate application and talks - to the browser in the standardized HTTP protocol, just like a web server - does.

2.2. Which operating systems are supported?

At present, Privoxy is known to run on - Windows(95, 98, ME, 2000, XP, Vista), GNU/Linux (RedHat, SuSE, Debian, - Fedora, Gentoo, Slackware and others), Mac OSX, OS/2, AmigaOS, FreeBSD, - NetBSD, OpenBSD, Solaris, and various other flavors of Unix.

But any operating system that runs TCP/IP, can conceivably take advantage of - Privoxy in a networked situation where - Privoxy would run as a server on a LAN gateway. - Then only the "gateway" needs to be running one of the above - operating systems.

Source code is freely available, so porting to other operating systems - is always a possibility.

2.3. Can I use Privoxy with my email client?

As long as there is some way to set a HTTP proxy for the client, then yes, - any application can be used, whether it is strictly speaking a - "browser" or not. Though this may not be the best approach for - dealing with some of the common abuses of HTML in email. See How can I configure Privoxy - with Outlook? below for more on - this.

Be aware that HTML email presents a number of unique security and privacy - related issues, that can require advanced skills to overcome. The developers - recommend using email clients that can be configured to convert HTML to plain - text for these reasons.

2.4. I just installed Privoxy. Is there anything -special I have to do now?

All browsers should be told to use Privoxy - as a proxy by specifying the correct proxy address and port number - in the appropriate configuration area for the browser. It's possible - to combine Privoxy with a packet filter to intercept HTTP requests - even if the client isn't explicitly configured to use Privoxy, - but where possible, configuring the client is recommended. See - the User Manual for more - details. You should also flush your browser's memory and disk - cache to get rid of any cached junk items, and remove any stored - cookies.

2.5. What is the proxy address of Privoxy?

If you set up the Privoxy to run on - the computer you browse from (rather than your ISP's server or some - networked computer on a LAN), the proxy will be on 127.0.0.1 - (sometimes referred to as "localhost", - which is the special name used by every computer on the Internet to refer - to itself) and the port will be 8118 (unless you used the listen-address - config option to tell Privoxy to run on - a different port). -

When configuring your browser's proxy settings you typically enter - the word "localhost" or the IP address "127.0.0.1" - in the boxes next to "HTTP" and "Secure" (HTTPS) and - then the number "8118" for "port". - This tells your browser to send all web requests to Privoxy - instead of directly to the Internet. -

Privoxy can also be used to proxy for - a Local Area Network. In this case, your would enter either the IP - address of the LAN host where Privoxy - is running, or the equivalent hostname, e.g. 192.168.1.1. - Port assignment would be same as above. Note that - Privoxy doesn't listen on any LAN interfaces by - default. -

Privoxy does not currently handle - any other protocols such as FTP, SMTP, IM, IRC, ICQ, etc. -

2.6. I just installed Privoxy, and nothing is happening. -All the ads are there. What's wrong?

Did you configure your browser to use Privoxy - as a proxy? It does not sound like it. See above. You might also try flushing - the browser's caches to force a full re-reading of pages. You can verify - that Privoxy is running, and your browser - is correctly configured by entering the special URL: - http://p.p/. - - This should take you to a page titled "This is Privoxy.." with - access to Privoxy's internal configuration. - If you see this, then you are good to go. If you receive a page saying - "Privoxy is not running", then the browser is not set up to use - your Privoxy installation. - If you receive anything else (probably nothing at all), it could either - be that the browser is not set up correctly, or that - Privoxy is not running at all. Check the log file. For instructions - on starting Privoxy and browser configuration, - see the chapter - on starting Privoxy in the - User Manual.

2.7. I get a "Privoxy is not being used" dummy page although -Privoxy is running and being used.

First, make sure that Privoxy is really running and - being used by visiting http://p.p/. You - should see the Privoxy main page. If not, see - the chapter - on starting Privoxy in the - User Manual.

Now if http://p.p/ works for you, but - other parts of Privoxy's web interface show - the dummy page, your browser has cached a redirection it encountered before - Privoxy was being used. You need to clear your - browser's cache. Note that shift-reloading the dummy page won't help, since - that'll only refresh the dummy page, not the redirection that lead you there.

The procedure for clearing the cache varies from browser to browser. For - example, Mozilla/Netscape users would click - Edit --> Preferences --> - Advanced --> Cache and - then click both "Clear Memory Cache" - and "Clear Disk Cache". - In some Firefox versions it's - Tools --> Options --> - Privacy --> Cache and - then click "Clear Cache Now". -


PrevHomeNext
General Information Configuration
\ No newline at end of file + + + + + + + Installation + + + + + + + + + + + + +
+

2. + Installation

+ +
+

2.1. Which + browsers are supported by Privoxy?

+ +

Any browser that can be configured to use a proxy, which should be + virtually all browsers, including Firefox, Internet + Explorer, Opera, and + Safari among others. Direct browser + support is not an absolute requirement since Privoxy runs as a separate application and talks + to the browser in the standardized HTTP protocol, just like a web + server does.

+
+ +
+

2.2. Which operating + systems are supported?

+ +

At present, Privoxy is known to run + on Windows(95, 98, ME, 2000, XP, Vista), GNU/Linux (RedHat, SuSE, + Debian, Fedora, Gentoo, Slackware and others), Mac OSX, OS/2, AmigaOS, + FreeBSD, NetBSD, OpenBSD, Solaris, and various other flavors of + Unix.

+ +

But any operating system that runs TCP/IP, can conceivably take + advantage of Privoxy in a networked + situation where Privoxy would run as a + server on a LAN gateway. Then only the "gateway" needs to be running one of the above operating + systems.

+ +

Source code is freely available, so porting to other operating + systems is always a possibility.

+
+ +
+

2.3. Can I + use Privoxy with my email client?

+ +

As long as there is some way to set a HTTP proxy for the client, + then yes, any application can be used, whether it is strictly speaking + a "browser" or not. Though this may not be + the best approach for dealing with some of the common abuses of HTML in + email. See How can I configure + Privoxy with Outlook? below for more on this.

+ +

Be aware that HTML email presents a number of unique security and + privacy related issues, that can require advanced skills to overcome. + The developers recommend using email clients that can be configured to + convert HTML to plain text for these reasons.

+
+ +
+

2.4. I just + installed Privoxy. Is there anything special I have to do now?

+ +

All browsers should be told to use Privoxy as a proxy by specifying the correct proxy + address and port number in the appropriate configuration area for the + browser. It's possible to combine Privoxy with a packet filter to intercept HTTP + requests even if the client isn't explicitly configured to use + Privoxy, but where possible, + configuring the client is recommended. See the User Manual for more + details. You should also flush your browser's memory and disk cache + to get rid of any cached junk items, and remove any stored cookies.

+
+ +
+

2.5. What is the + proxy address of Privoxy?

+ +

If you set up the Privoxy to run on + the computer you browse from (rather than your ISP's server or some + networked computer on a LAN), the proxy will be on 127.0.0.1 (sometimes referred to as "localhost", which is the special name used by every + computer on the Internet to refer to itself) and the port will be 8118 + (unless you used the listen-address config option to tell Privoxy to run on a different port).

+ +

When configuring your browser's proxy settings you typically enter + the word "localhost" or the IP address + "127.0.0.1" in the boxes next to + "HTTP" and "Secure" (HTTPS) and then the number "8118" for "port". This tells + your browser to send all web requests to Privoxy instead of directly to the Internet.

+ +

Privoxy can also be used to proxy + for a Local Area Network. In this case, your would enter either the IP + address of the LAN host where Privoxy + is running, or the equivalent hostname, e.g. 192.168.1.1. Port assignment would be same as above. + Note that Privoxy doesn't listen on + any LAN interfaces by default.

+ +

Privoxy does not currently handle + any other protocols such as FTP, SMTP, IM, IRC, ICQ, etc.

+
+ +
+

2.6. I just installed + Privoxy, and nothing is happening. All the ads are there. What's + wrong?

+ +

Did you configure your browser to use Privoxy as a proxy? It does not sound like it. See + above. You might also try flushing the browser's caches to force a full + re-reading of pages. You can verify that Privoxy is running, and your browser is correctly + configured by entering the special URL: http://p.p/. This should take you to a page titled + "This is Privoxy.." with access to + Privoxy's internal configuration. If + you see this, then you are good to go. If you receive a page saying + "Privoxy is not running", then the browser + is not set up to use your Privoxy + installation. If you receive anything else (probably nothing at all), + it could either be that the browser is not set up correctly, or that + Privoxy is not running at all. Check + the log + file. For instructions on starting Privoxy and browser configuration, see the + chapter on starting Privoxy + in the User + Manual.

+
+ +
+

2.7. I get a + "Privoxy is not being used" dummy page + although Privoxy is running and being used.

+ +

First, make sure that Privoxy is really running and being used by visiting + http://p.p/. You should see the + Privoxy main page. If not, see the + chapter on starting Privoxy + in the User + Manual.

+ +

Now if http://p.p/ works for + you, but other parts of Privoxy's web + interface show the dummy page, your browser has cached a redirection it + encountered before Privoxy was being + used. You need to clear your browser's cache. Note that shift-reloading + the dummy page won't help, since that'll only refresh the dummy page, + not the redirection that lead you there.

+ +

The procedure for clearing the cache varies from browser to browser. + For example, Mozilla/Netscape users + would click Edit --> Preferences --> Advanced --> Cache + and then click both "Clear + Memory Cache" and "Clear Disk Cache". In some Firefox versions it's Tools --> Options + --> Privacy --> Cache and then click "Clear Cache Now".

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/faq/misc.html b/external/privoxy/doc/webserver/faq/misc.html index 174722e6..b028cf6d 100644 --- a/external/privoxy/doc/webserver/faq/misc.html +++ b/external/privoxy/doc/webserver/faq/misc.html @@ -1,1745 +1,929 @@ - -Miscellaneous
Privoxy Frequently Asked Questions
PrevNext

4. Miscellaneous

4.1. How much does Privoxy slow my browsing down? This -has to add extra time to browsing.

How much of an impact depends on many things, including the CPU of the host - system, how aggressive the configuration is, which specific actions are being triggered, - the size of the page, the bandwidth of the connection, etc.

Overall, it should not slow you down any in real terms, and may actually help - speed things up since ads, banners and other junk are not typically being - retrieved and displayed. The actual processing time required by - Privoxy itself for each page, is relatively small - in the overall scheme of things, and happens very quickly. This is typically - more than offset by time saved not downloading and rendering ad images and - other junk content (if ad blocking is being used).

"Filtering" content via the filter or - deanimate-gifs - actions may cause a perceived slowdown, since the entire document - needs to be buffered before displaying. And on very large documents, - filtering may have some measurable impact. How much depends on the page size, - the actual definition of the filter(s), etc. See below. Most other actions - have little to no impact on speed.

Also, when filtering is enabled but zlib support isn't available, compression - is often disabled (see prevent-compression). - This can have an impact on speed as well, although it's probably smaller than - you might think. Again, the page size, etc. will determine how much of an impact.

4.2. I notice considerable -delays in page requests. What's wrong?

If you use any filter action, - such as filtering banners by size, web-bugs etc, or the deanimate-gifs - action, the entire document must be loaded into memory in order for the filtering - mechanism to work, and nothing is sent to the browser during this time.

The loading time typically does not really change much in real numbers, but - the feeling is different, because most browsers are able to start rendering - incomplete content, giving the user a feeling of "it works". This effect is - more noticeable on slower dialup connections. Extremely large documents - may have some impact on the time to load the page where there is filtering - being done. But overall, the difference should be very minimal. If there is a - big impact, then probably some other situation is contributing (like - anti-virus software). -

Filtering is automatically disabled for inappropriate MIME types. But note - that if the web server mis-reports the MIME type, then content that should - not be filtered, could be. Privoxy only knows how - to differentiate filterable content because of the MIME type as reported by - the server, or because of some configuration setting that enables/disables - filtering.

4.3. What are "http://config.privoxy.org/" and -"http://p.p/"?

http://config.privoxy.org/ is the - address of Privoxy's built-in user interface, and - http://p.p/ is a shortcut for it.

Since Privoxy sits between your web browser and the Internet, - it can simply intercept requests for these addresses and answer them with its built-in - "web server".

This also makes for a good test for your browser configuration: If entering the - URL http://config.privoxy.org/ - takes you to a page saying "This is Privoxy ...", everything is OK. - If you get a page saying "Privoxy is not working" instead, then - your browser didn't use Privoxy for the request, - hence it could not be intercepted, and you have accessed the real - web site at config.privoxy.org.

4.4. How can I submit new ads, or report -problems?

Please see the Contact section for -various ways to interact with the developers.

4.5. If I do submit missed ads, will -they be included in future updates?

Whether such submissions are eventually included in the - default.action configuration file depends on how - significant the issue is. We of course want to address any potential - problem with major, high-profile sites such as Google, - Yahoo, etc. Any site with global or regional reach, - has a good chance of being a candidate. But at the other end of the spectrum - are any number of smaller, low-profile sites such as for local clubs or - schools. Since their reach and impact are much less, they are best handled by - inclusion in the user's user.action, and thus would be - unlikely to be included.

4.6. Why doesn't anyone answer my support -request?

Rest assured that it has been read and considered. Why it is not answered, -could be for various reasons, including no one has a good answer for it, no -one has had time to yet investigate it thoroughly, it has been reported -numerous times already, or because not enough information was provided to help -us help you. Your efforts are not wasted, and we do appreciate them.

4.7. How can I hide my IP address?

If you run both the browser and Privoxy locally, you cannot hide your IP - address with Privoxy or ultimately any other - software alone. The server needs to know your IP address so that it knows - where to send the responses back.

There are many publicly usable "anonymous" proxies out there, which - provide a further level of indirection between you and the web server.

However, these proxies are called "anonymous" because you don't need - to authenticate, not because they would offer any real anonymity. - Most of them will log your IP address and make it available to the - authorities in case you violate the law of the country they run in. In fact - you can't even rule out that some of them only exist to *collect* information - on (those suspicious) people with a more than average preference for privacy.

If you want to hide your IP address from most adversaries, - you should consider chaining Privoxy - with Tor. - The configuration details can be found in - How do I use Privoxy together - with Tor section - just below.

4.8. Can Privoxy guarantee I am anonymous?

No. Your chances of remaining anonymous are improved, but unless you - chain Privoxy with Tor - or a similar proxy and know what you're doing when it comes to configuring - the rest of your system, you should assume that everything you do - on the Web can be traced back to you.

Privoxy can remove various information about you, - and allows you more freedom to decide which sites - you can trust, and what details you want to reveal. But it neither - hides your IP address, nor can it guarantee that the rest of the system - behaves correctly. There are several possibilities how a web sites can find - out who you are, even if you are using a strict Privoxy - configuration and chained it with Tor.

Most of Privoxy's privacy-enhancing features can be easily subverted - by an insecure browser configuration, therefore you should use a browser that can - be configured to only execute code from trusted sites, and be careful which sites you trust. - For example there is no point in having Privoxy - modify the User-Agent header, if websites can get all the information they want - through JavaScript, ActiveX, Flash, Java etc.

A few browsers disclose the user's email address in certain situations, such - as when transferring a file by FTP. Privoxy - does not filter FTP. If you need this feature, or are concerned about the - mail handler of your browser disclosing your email address, you might - consider products such as NSClean.

Browsers available only as binaries could use non-standard headers to give - out any information they can have access to: see the manufacturer's license - agreement. It's impossible to anticipate and prevent every breach of privacy - that might occur. The professionally paranoid prefer browsers available as - source code, because anticipating their behavior is easier. Trust the source, - Luke!

4.9. A test site says I am not using a Proxy.

Good! Actually, they are probably testing for some other kinds of proxies. - Hiding yourself completely would require additional steps.

4.10. How do I use Privoxy - together with Tor?

Before you configure Privoxy to use - Tor, - please follow the User Manual chapters - 2. Installation and - 5. Startup to make sure - Privoxy itself is setup correctly.

- If it is, refer to Tor's - extensive documentation to learn how to install Tor, - and make sure Tor's logfile says that - "Tor has successfully opened a circuit" and it - "looks like client functionality is working".

If either Tor or Privoxy - isn't working, their combination most likely will neither. Testing them on their - own will also help you to direct problem reports to the right audience. - If Privoxy isn't working, don't bother the - Tor developers. If Tor - isn't working, don't send bug reports to the Privoxy Team.

If you verified that Privoxy and Tor - are working, it is time to connect them. As far as Privoxy - is concerned, Tor is just another proxy that can be reached - by socks4 or socks4a. Most likely you are interested in Tor - to increase your anonymity level, therefore you should use socks4a, to make sure DNS requests are - done through Tor and thus invisible to your local network.

Since Privoxy 3.0.5, its - main configuration file - is already prepared for Tor, if you are using a - default Tor configuration and run it on the same - system as Privoxy, you just have to edit the - forwarding section - and uncomment the line:

#        forward-socks4a             /     127.0.0.1:9050 .
- 

This is enough to reach the Internet, but additionally you might want to - uncomment the following forward rules, to make sure your local network is still - reachable through Privoxy:

+ +
#        forward         192.168.*.*/     .
+
+
+
+
+  
+
+  Miscellaneous
+  
+  
+  
+  
+  
+  
+  
+
+
+
+  
+
+  
+

4. Miscellaneous

+ +
+

4.1. How much does + Privoxy slow my browsing down? This has to add extra time to + browsing.

+ +

How much of an impact depends on many things, including the CPU of + the host system, how aggressive the configuration is, which specific + actions are being triggered, the size of the page, the bandwidth of the + connection, etc.

+ +

Overall, it should not slow you down any in real terms, and may + actually help speed things up since ads, banners and other junk are not + typically being retrieved and displayed. The actual processing time + required by Privoxy itself for each + page, is relatively small in the overall scheme of things, and happens + very quickly. This is typically more than offset by time saved not + downloading and rendering ad images and other junk content (if ad + blocking is being used).

+ +

"Filtering" content via the filter or deanimate-gifs actions may cause a perceived slowdown, + since the entire document needs to be buffered before displaying. And + on very large documents, filtering may have some measurable impact. How + much depends on the page size, the actual definition of the filter(s), + etc. See below. Most other actions have little to no impact on + speed.

+ +

Also, when filtering is enabled but zlib support isn't available, + compression is often disabled (see prevent-compression). This can have an impact on speed as + well, although it's probably smaller than you might think. Again, the + page size, etc. will determine how much of an impact.

+
+ +
+

4.2. I + notice considerable delays in page requests. What's wrong?

+ +

If you use any filter + action, such as filtering banners by size, web-bugs etc, or the + deanimate-gifs action, the entire document must be + loaded into memory in order for the filtering mechanism to work, and + nothing is sent to the browser during this time.

+ +

The loading time typically does not really change much in real + numbers, but the feeling is different, because most browsers are able + to start rendering incomplete content, giving the user a feeling of "it + works". This effect is more noticeable on slower dialup connections. + Extremely large documents may have some impact on the time to load the + page where there is filtering being done. But overall, the difference + should be very minimal. If there is a big impact, then probably some + other situation is contributing (like anti-virus software).

+ +

Filtering is automatically disabled for inappropriate MIME types. + But note that if the web server mis-reports the MIME type, then content + that should not be filtered, could be. Privoxy only knows how to differentiate filterable + content because of the MIME type as reported by the server, or because + of some configuration setting that enables/disables filtering.

+
+ +
+

4.3. What are + "http://config.privoxy.org/" and "http://p.p/"?

+ +

http://config.privoxy.org/ is the address of Privoxy's built-in user interface, and http://p.p/ is a shortcut for it.

+ +

Since Privoxy sits between your web + browser and the Internet, it can simply intercept requests for these + addresses and answer them with its built-in "web + server".

+ +

This also makes for a good test for your browser configuration: If + entering the URL http://config.privoxy.org/ takes you to a page saying + "This is Privoxy ...", everything is OK. If + you get a page saying "Privoxy is not + working" instead, then your browser didn't use Privoxy for the request, hence it could not be + intercepted, and you have accessed the real web site at config.privoxy.org.

+
+ +
+

4.4. How can I submit + new ads, or report problems?

+ +

Please see the Contact section for + various ways to interact with the developers.

+
+ +
+

4.5. If I do submit + missed ads, will they be included in future updates?

+ +

Whether such submissions are eventually included in the default.action configuration file depends on how + significant the issue is. We of course want to address any potential + problem with major, high-profile sites such as Google, Yahoo, etc. Any site + with global or regional reach, has a good chance of being a candidate. + But at the other end of the spectrum are any number of smaller, + low-profile sites such as for local clubs or schools. Since their reach + and impact are much less, they are best handled by inclusion in the + user's user.action, and thus would be + unlikely to be included.

+
+ +
+

4.6. Why doesn't + anyone answer my support request?

+ +

Rest assured that it has been read and considered. Why it is not + answered, could be for various reasons, including no one has a good + answer for it, no one has had time to yet investigate it thoroughly, it + has been reported numerous times already, or because not enough + information was provided to help us help you. Your efforts are not + wasted, and we do appreciate them.

+
+ +
+

4.7. How can I hide my IP + address?

+ +

If you run both the browser and Privoxy locally, you cannot hide your IP address + with Privoxy or ultimately any other + software alone. The server needs to know your IP address so that it + knows where to send the responses back.

+ +

There are many publicly usable "anonymous" proxies out there, which + provide a further level of indirection between you and the web + server.

+ +

However, these proxies are called "anonymous" because you don't need + to authenticate, not because they would offer any real anonymity. Most + of them will log your IP address and make it available to the + authorities in case you violate the law of the country they run in. In + fact you can't even rule out that some of them only exist to *collect* + information on (those suspicious) people with a more than average + preference for privacy.

+ +

If you want to hide your IP address from most adversaries, you + should consider chaining Privoxy with + Tor. The + configuration details can be found in How + do I use Privoxy together with + Tor section just below.

+
+ +
+

4.8. Can Privoxy + guarantee I am anonymous?

+ +

No. Your chances of remaining anonymous are improved, but unless you + chain Privoxy with Tor or a similar proxy and know what you're + doing when it comes to configuring the rest of your system, you should + assume that everything you do on the Web can be traced back to you.

+ +

Privoxy can remove various + information about you, and allows you more freedom to decide which sites + you can trust, and what details you want to reveal. But it neither + hides your IP address, nor can it guarantee that the rest of the system + behaves correctly. There are several possibilities how a web sites can + find out who you are, even if you are using a strict Privoxy configuration and chained it with + Tor.

+ +

Most of Privoxy's privacy-enhancing + features can be easily subverted by an insecure browser configuration, + therefore you should use a browser that can be configured to only + execute code from trusted sites, and be careful which sites you trust. + For example there is no point in having Privoxy modify the User-Agent header, if websites + can get all the information they want through JavaScript, ActiveX, + Flash, Java etc.

+ +

A few browsers disclose the user's email address in certain + situations, such as when transferring a file by FTP. Privoxy does not filter FTP. If you need this + feature, or are concerned about the mail handler of your browser + disclosing your email address, you might consider products such as + NSClean.

+ +

Browsers available only as binaries could use non-standard headers + to give out any information they can have access to: see the + manufacturer's license agreement. It's impossible to anticipate and + prevent every breach of privacy that might occur. The professionally + paranoid prefer browsers available as source code, because anticipating + their behavior is easier. Trust the source, Luke!

+
+ +
+

4.9. A test site says I + am not using a Proxy.

+ +

Good! Actually, they are probably testing for some other kinds of + proxies. Hiding yourself completely would require additional steps.

+
+ +
+

4.10. How do I use Privoxy + together with Tor?

+ +

Before you configure Privoxy to use + Tor, please + follow the User Manual chapters 2. Installation + and 5. Startup + to make sure Privoxy itself is setup + correctly.

+ +

If it is, refer to Tor's + extensive documentation to learn how to install Tor, and make sure Tor's logfile says that "Tor + has successfully opened a circuit" and it "looks like client functionality is working".

+ +

If either Tor or Privoxy isn't working, their combination most + likely will neither. Testing them on their own will also help you to + direct problem reports to the right audience. If Privoxy isn't working, don't bother the + Tor developers. If Tor isn't working, don't send bug reports to the + Privoxy Team.

+ +

If you verified that Privoxy and + Tor are working, it is time to connect + them. As far as Privoxy is concerned, + Tor is just another proxy that can be + reached by socks4, socks4a and socks5. Most likely you are interested + in Tor to increase your anonymity + level, therefore you should use socks5, to make sure DNS requests are + done through Tor and thus invisible to + your local network. Using socks4a would work too, but with socks5 you + get more precise error messages.

+ +

Since Privoxy 3.0.5, its main configuration file + is already prepared for Tor, if you + are using a default Tor configuration + and run it on the same system as Privoxy, you just have to edit the forwarding + section and uncomment the line:

+ + + + + +
+
+#        forward-socks5             /     127.0.0.1:9050 .
+
+
+
+ +

This is enough to reach the Internet, but additionally you might + want to uncomment the following forward rules, to make sure your local + network is still reachable through Privoxy:

+ + + +
+
+#        forward         192.168.*.*/     .
 #        forward            10.*.*.*/     .
 #        forward           127.*.*.*/     .
- 

Unencrypted connections to systems in these address ranges will - be as (un)secure as the local network is, but the alternative is - that your browser can't reach the network at all. Then again, - that may actually be desired and if you don't know for sure - that your browser has to be able to reach the local network, - there's no reason to allow it.

If you want your browser to be able to reach servers in your local - network by using their names, you will need additional exceptions - that look like this:

#        forward           localhost/     .
- 

Save the modified configuration file and open - http://config.privoxy.org/show-status/ - in your browser, confirm that Privoxy has reloaded its configuration - and that there are no other forward lines, unless you know that you need them. If everything looks good, - refer to - Tor - Faq 4.2 to learn how to verify that you are really using Tor.

Afterward, please take the time to at least skim through the rest - of Tor's documentation. Make sure you understand - what Tor does, why it is no replacement for - application level security, and why you probably don't want to - use it for unencrypted logins.

4.11. Might some things break because header information or -content is being altered?

Definitely. It is common for sites to use browser type, browser version, - HTTP header content, and various other techniques in order to dynamically - decide what to display and how to display it. What you see, and what I see, - might be very different. There are many, many ways that this can be handled, - so having hard and fast rules, is tricky.

The "User-Agent" is sometimes used in this way to identify - the browser, and adjust content accordingly.

Also, different browsers use different encodings of non-English - characters, certain web servers convert pages on-the-fly according to the - User Agent header. Giving a "User Agent" with the wrong - operating system or browser manufacturer causes some sites in these languages - to be garbled; Surfers to Eastern European sites should change it to - something closer. And then some page access counters work by looking at the - "Referer" header; they may fail or break if unavailable. The - weather maps of Intellicast have been blocked by their server when no - "Referer" or cookie is provided, is another example. (But you - can forge both headers without giving information away). There are - many other ways things can go wrong when trying to fool a web server. The - results of which could inadvertently cause pages to load incorrectly, - partially, or even not at all. And there may be no obvious clues as to just - what went wrong, or why. Nowhere will there be a message that says - "Turn off fast-redirects or else! - "

Similar thoughts apply to modifying JavaScript, and, to a lesser degree, - HTML elements.

If you have problems with a site, you will have to adjust your configuration - accordingly. Cookies are probably the most likely adjustment that may - be required, but by no means the only one.

4.12. Can Privoxy act as a "caching" proxy to -speed up web browsing?

No, it does not have this ability at all. You want something like - Squid or - Polipo for this. - And, yes, before you ask, Privoxy can co-exist - with other kinds of proxies like Squid. - See the forwarding - chapter in the user - manual for details.

4.13. What about as a firewall? Can Privoxy protect me?

Not in the way you mean, or in the way some firewall vendors claim they can. - Privoxy can help protect your privacy, but can't - protect your system from intrusion attempts. It is, of course, perfectly possible - to use both.

4.14. I have large empty spaces / a checkerboard pattern now where -ads used to be. Why?

It is technically possible to eliminate banners and ads in a way that frees - their allocated page space. This could easily be done by blocking with - Privoxy's filters, - and eliminating the entire image references from the - HTML page source.

But, this would consume considerably more CPU resources (IOW, slow things - down), would likely destroy the layout of some web pages which rely on the - banners utilizing a certain amount of page space, and might fail in other - cases, where the screen space is reserved (e.g. by HTML tables for instance). - Also, making ads and banners disappear without any trace complicates - troubleshooting, and would sooner or later be problematic.

The better alternative is to instead let them stay, and block the resulting - requests for the banners themselves as is now the case. This leaves either - empty space, or the familiar checkerboard pattern.

So the developers won't support this in the default configuration, but you - can of course define appropriate filters yourself to achieve this.

4.15. How can Privoxy filter Secure (HTTPS) URLs?

Since secure HTTP connections are encrypted SSL sessions between your browser - and the secure site, and are meant to be reliably secure, - there is little that Privoxy can do but hand the raw - gibberish data though from one end to the other unprocessed.

The only exception to this is blocking by host patterns, as the client needs - to tell Privoxy the name of the remote server, - so that Privoxy can establish the connection. - If that name matches a host-only pattern, the connection will be blocked.

As far as ad blocking is concerned, this is less of a restriction than it may - seem, since ad sources are often identifiable by the host name, and often - the banners to be placed in an encrypted page come unencrypted nonetheless - for efficiency reasons, which exposes them to the full power of - Privoxy's ad blocking.

"Content cookies" (those that are embedded in the actual HTML or - JS page content, see filter{content-cookies}), - in an SSL transaction will be impossible to block under these conditions. - Fortunately, this does not seem to be a very common scenario since most - cookies come by traditional means.

4.16. Privoxy runs as a "server". How -secure is it? Do I need to take any special precautions?

On Unix-like systems, Privoxy can run as a non-privileged - user, which is how we recommend it be run. Also, by default - Privoxy listens to requests from "localhost" - only.

The server aspect of Privoxy is not itself directly - exposed to the Internet in this configuration. If you want to have - Privoxy serve as a LAN proxy, this will have to - be opened up to allow for LAN requests. In this case, we'd recommend - you specify only the LAN gateway address, e.g. 192.168.1.1, in the main - Privoxy configuration file and check all access control and security - options. All LAN hosts can then use this as their proxy address - in the browser proxy configuration, but Privoxy - will not listen on any external interfaces. ACLs can be defined in addition, - and using a firewall is always good too. Better safe than sorry.

4.17. Can I temporarily disable Privoxy?

Privoxy doesn't have a transparent proxy mode, - but you can toggle off blocking and content filtering.

The easiest way to do that is to point your browser - to the remote toggle URL: http://config.privoxy.org/toggle.

See the Bookmarklets section - of the User Manual for an easy way to access this - feature. Note that this is a feature that may need to be enabled in the main - config file.

4.18. When "disabled" is Privoxy totally -out of the picture?

No, this just means all optional filtering and actions are disabled. - Privoxy is still acting as a proxy, but just - doing less of the things that Privoxy would - normally be expected to do. It is still a "middle-man" in - the interaction between your browser and web sites. See below to bypass - the proxy.

4.19. How can I tell Privoxy to totally ignore certain sites?

Bypassing a proxy, or proxying based on arbitrary criteria, is purely a browser - configuration issue, not a Privoxy issue. Modern browsers typically do have - settings for not proxying certain sites. Check your browser's help files.

4.20. My logs show Privoxy "crunches" -ads, but also its own internal CGI pages. What is a "crunch"?

A "crunch" simply means Privoxy intercepted - something, nothing more. Often this is indeed ads or - banners, but Privoxy uses the same mechanism for - trapping requests for its own internal pages. For instance, a request for - Privoxy's configuration page at: http://config.privoxy.org, is - intercepted (i.e. it does not go out to the 'net), and the familiar CGI - configuration is returned to the browser, and the log consequently will show - a "crunch".

Since version 3.0.7, Privoxy will also log the crunch reason. - If you are using an older version you might want to upgrade.

4.21. Can Privoxy effect files that I download -from a webserver? FTP server?

From the webserver's perspective, there is no difference between - viewing a document (i.e. a page), and downloading a file. The same is true of - Privoxy. If there is a match for a block pattern, - it will still be blocked, and of course this is obvious. -

Filtering is potentially more of a concern since the results are not always - so obvious, and the effects of filtering are there whether the file is simply - viewed, or downloaded. And potentially whether the content is some obnoxious - advertisement, or Mr. Jimmy's latest/greatest source code jewel. Of course, - one of these presumably is "bad" content that we don't want, and - the other is "good" content that we do want. - Privoxy is blind to the differences, and can only - distinguish "good from bad" by the configuration parameters - we give it.

Privoxy knows the differences in files according - to the "Content Type" as reported by the webserver. If this is - reported accurately (e.g. "application/zip" for a zip archive), - then Privoxy knows to ignore these where - appropriate. Privoxy potentially can filter HTML - as well as plain text documents, subject to configuration parameters of - course. Also, documents that are of an unknown type (generally assumed to be - "text/plain") can be filtered, as will those that might be - incorrectly reported by the webserver. If such a file is a downloaded file - that is intended to be saved to disk, then any content that might have been - altered by filtering, will be saved too, for these (probably rare) cases.

Note that versions later than 3.0.2 do NOT filter document types reported as - "text/plain". Prior to this, Privoxy - did filter this document type.

In short, filtering is "ON" if a) the content type as reported - by the webserver is appropriate and b) the configuration - allows it (or at least does not disallow it). That's it. There is no magic - cookie anywhere to say this is "good" and this is - "bad". It's the configuration that lets it all happen or not.

If you download text files, you probably do not want these to be filtered, - particularly if the content is source code, or other critical content. Source - code sometimes might be mistaken for Javascript (i.e. the kind that might - open a pop-up window). It is recommended to turn off filtering for download - sites (particularly if the content may be plain text files and you are using - version 3.0.2 or earlier) in your user.action file. And - also, for any site or page where making any changes at - all to the content is to be avoided.

Privoxy does not do FTP at all, only HTTP - and HTTPS (SSL) protocols.

4.23. Should I continue to use a "HOSTS" file for ad-blocking?

One time-tested technique to defeat common ads is to trick the local DNS - system by giving a phony IP address for the ad generator in the local - HOSTS file, typically using 127.0.0.1, aka - localhost. This effectively blocks the ad.

There is no reason to use this technique in conjunction with - Privoxy. Privoxy - does essentially the same thing, much more elegantly and with much more - flexibility. A large HOSTS file, in fact, not only - duplicates effort, but may get in the way and seriously slow down your system. - It is recommended to remove such entries from your HOSTS file. If you think - your hosts list is neglected by Privoxy's - configuration, consider adding your list to your user.action file:

+ +
  { +block }
+
+
+
+ +

Unencrypted connections to systems in these address ranges will be + as (un)secure as the local network is, but the alternative is that your + browser can't reach the network at all. Then again, that may actually + be desired and if you don't know for sure that your browser has to be + able to reach the local network, there's no reason to allow it.

+ +

If you want your browser to be able to reach servers in your local + network by using their names, you will need additional exceptions that + look like this:

+ + + + + +
+
+#        forward           localhost/     .
+
+
+
+ +

Save the modified configuration file and open http://config.privoxy.org/show-status/ in your browser, + confirm that Privoxy has reloaded its + configuration and that there are no other forward lines, unless you + know that you need them. If everything looks good, refer to Tor Faq 4.2 to learn how to verify that you are + really using Tor.

+ +

Afterward, please take the time to at least skim through the rest of + Tor's documentation. Make sure you + understand what Tor does, why it is no + replacement for application level security, and why you probably don't + want to use it for unencrypted logins.

+
+ +
+

4.11. Might some things + break because header information or content is being altered?

+ +

Definitely. It is common for sites to use browser type, browser + version, HTTP header content, and various other techniques in order to + dynamically decide what to display and how to display it. What you see, + and what I see, might be very different. There are many, many ways that + this can be handled, so having hard and fast rules, is tricky.

+ +

The "User-Agent" is sometimes used in + this way to identify the browser, and adjust content accordingly.

+ +

Also, different browsers use different encodings of non-English + characters, certain web servers convert pages on-the-fly according to + the User Agent header. Giving a "User Agent" + with the wrong operating system or browser manufacturer causes some + sites in these languages to be garbled; Surfers to Eastern European + sites should change it to something closer. And then some page access + counters work by looking at the "Referer" + header; they may fail or break if unavailable. The weather maps of + Intellicast have been blocked by their server when no "Referer" or cookie is provided, is another example. + (But you can forge both headers without giving information away). There + are many other ways things can go wrong when trying to fool a web + server. The results of which could inadvertently cause pages to load + incorrectly, partially, or even not at all. And there may be no obvious + clues as to just what went wrong, or why. Nowhere will there be a + message that says "Turn off fast-redirects + or else! "

+ +

Similar thoughts apply to modifying JavaScript, and, to a lesser + degree, HTML elements.

+ +

If you have problems with a site, you will have to adjust your + configuration accordingly. Cookies are probably the most likely + adjustment that may be required, but by no means the only one.

+
+ +
+

4.12. Can Privoxy act as + a "caching" proxy to speed up web + browsing?

+ +

No, it does not have this ability at all. You want something like + Squid or + Polipo for this. And, yes, before you ask, Privoxy can co-exist with other kinds of proxies + like Squid. See the forwarding + chapter in the user manual for details.

+
+ +
+

4.13. What about as a + firewall? Can Privoxy protect me?

+ +

Not in the way you mean, or in the way some firewall vendors claim + they can. Privoxy can help protect + your privacy, but can't protect your system from intrusion attempts. It + is, of course, perfectly possible to use both.

+
+ +
+

4.14. I have large empty + spaces / a checkerboard pattern now where ads used to be. Why?

+ +

It is technically possible to eliminate banners and ads in a way + that frees their allocated page space. This could easily be done by + blocking with Privoxy's filters, and + eliminating the entire image + references from the HTML page source.

+ +

But, this would consume considerably more CPU resources (IOW, slow + things down), would likely destroy the layout of some web pages which + rely on the banners utilizing a certain amount of page space, and might + fail in other cases, where the screen space is reserved (e.g. by HTML + tables for instance). Also, making ads and banners disappear without + any trace complicates troubleshooting, and would sooner or later be + problematic.

+ +

The better alternative is to instead let them stay, and block the + resulting requests for the banners themselves as is now the case. This + leaves either empty space, or the familiar checkerboard pattern.

+ +

So the developers won't support this in the default configuration, + but you can of course define appropriate filters yourself to achieve + this.

+
+ +
+

4.15. How can Privoxy + filter Secure (HTTPS) URLs?

+ +

Since secure HTTP connections are encrypted SSL sessions between + your browser and the secure site, and are meant to be reliably + secure, there is little that + Privoxy can do but hand the raw + gibberish data though from one end to the other unprocessed.

+ +

The only exception to this is blocking by host patterns, as the + client needs to tell Privoxy the name + of the remote server, so that Privoxy + can establish the connection. If that name matches a host-only pattern, + the connection will be blocked.

+ +

As far as ad blocking is concerned, this is less of a restriction + than it may seem, since ad sources are often identifiable by the host + name, and often the banners to be placed in an encrypted page come + unencrypted nonetheless for efficiency reasons, which exposes them to + the full power of Privoxy's ad + blocking.

+ +

"Content cookies" (those that are + embedded in the actual HTML or JS page content, see filter{content-cookies}), in an SSL transaction will be + impossible to block under these conditions. Fortunately, this does not + seem to be a very common scenario since most cookies come by + traditional means.

+
+ +
+

4.16. Privoxy runs as a + "server". How secure is it? Do I need to + take any special precautions?

+ +

On Unix-like systems, Privoxy can + run as a non-privileged user, which is how we recommend it be run. + Also, by default Privoxy listens to + requests from "localhost" only.

+ +

The server aspect of Privoxy is not + itself directly exposed to the Internet in this configuration. If you + want to have Privoxy serve as a LAN + proxy, this will have to be opened up to allow for LAN requests. In + this case, we'd recommend you specify only the LAN gateway address, + e.g. 192.168.1.1, in the main Privoxy + configuration file and check all access + control and security options. All LAN hosts can then use this as + their proxy address in the browser proxy configuration, but + Privoxy will not listen on any + external interfaces. ACLs can be defined in addition, and using a + firewall is always good too. Better safe than sorry.

+
+ +
+

4.17. Can I + temporarily disable Privoxy?

+ +

Privoxy doesn't have a transparent + proxy mode, but you can toggle off blocking and content filtering.

+ +

The easiest way to do that is to point your browser to the remote + toggle URL: http://config.privoxy.org/toggle.

+ +

See the Bookmarklets section of the User + Manual for an easy way to access this feature. Note that this is a + feature that may need to be enabled in the main config file.

+
+ +
+

4.18. When + "disabled" is Privoxy totally out of the + picture?

+ +

No, this just means all optional filtering and actions are disabled. + Privoxy is still acting as a proxy, + but just doing less of the things that Privoxy would normally be expected to do. It is + still a "middle-man" in the interaction + between your browser and web sites. See below to bypass the proxy.

+
+ +
+

4.19. How can I tell + Privoxy to totally ignore certain sites?

+ +

Bypassing a proxy, or proxying based on arbitrary criteria, is + purely a browser configuration issue, not a Privoxy issue. Modern browsers typically do have + settings for not proxying certain sites. Check your browser's help + files.

+
+ +
+

4.20. My logs show + Privoxy "crunches" ads, but also its own + internal CGI pages. What is a "crunch"?

+ +

A "crunch" simply means Privoxy intercepted something, nothing more. Often this is + indeed ads or banners, but Privoxy + uses the same mechanism for trapping requests for its own internal + pages. For instance, a request for Privoxy's configuration page at: http://config.privoxy.org, is intercepted (i.e. it does not + go out to the 'net), and the familiar CGI configuration is returned to + the browser, and the log consequently will show a "crunch".

+ +

Since version 3.0.7, Privoxy will also log the crunch reason. If you + are using an older version you might want to upgrade.

+
+ +
+

4.21. Can Privoxy + effect files that I download from a webserver? FTP server?

+ +

From the webserver's perspective, there is no difference between + viewing a document (i.e. a page), and downloading a file. The same is + true of Privoxy. If there is a match + for a block + pattern, it will still be blocked, and of course this is obvious.

+ +

Filtering is potentially more of a concern since the results are not + always so obvious, and the effects of filtering are there whether the + file is simply viewed, or downloaded. And potentially whether the + content is some obnoxious advertisement, or Mr. Jimmy's latest/greatest + source code jewel. Of course, one of these presumably is "bad" content that we don't want, and the other is + "good" content that we do want. Privoxy is blind to the differences, and can only + distinguish "good from bad" by the + configuration parameters we + give it.

+ +

Privoxy knows the differences in + files according to the "Content Type" as + reported by the webserver. If this is reported accurately (e.g. + "application/zip" for a zip archive), then + Privoxy knows to ignore these where + appropriate. Privoxy potentially can + filter HTML as well as plain text documents, subject to configuration + parameters of course. Also, documents that are of an unknown type + (generally assumed to be "text/plain") can + be filtered, as will those that might be incorrectly reported by the + webserver. If such a file is a downloaded file that is intended to be + saved to disk, then any content that might have been altered by + filtering, will be saved too, for these (probably rare) cases.

+ +

Note that versions later than 3.0.2 do NOT filter document types + reported as "text/plain". Prior to this, + Privoxy did filter this document + type.

+ +

In short, filtering is "ON" if a) the + content type as reported by the webserver is appropriate and b) the configuration allows it (or at + least does not disallow it). That's it. There is no magic cookie + anywhere to say this is "good" and this is + "bad". It's the configuration that lets it + all happen or not.

+ +

If you download text files, you probably do not want these to be + filtered, particularly if the content is source code, or other critical + content. Source code sometimes might be mistaken for Javascript (i.e. + the kind that might open a pop-up window). It is recommended to turn + off filtering for download sites (particularly if the content may be + plain text files and you are using version 3.0.2 or earlier) in your + user.action file. And also, for any site or + page where making any changes + at all to the content is to be avoided.

+ +

Privoxy does not do FTP at all, + only HTTP and HTTPS (SSL) protocols.

+
+ + + +
+

4.23. Should I + continue to use a "HOSTS" file for + ad-blocking?

+ +

One time-tested technique to defeat common ads is to trick the local + DNS system by giving a phony IP address for the ad generator in the + local HOSTS file, typically using 127.0.0.1, aka localhost. This + effectively blocks the ad.

+ +

There is no reason to use this technique in conjunction with + Privoxy. Privoxy does essentially the same thing, much more + elegantly and with much more flexibility. A large HOSTS file, in fact, not only duplicates effort, but + may get in the way and seriously slow down your system. It is + recommended to remove such entries from your HOSTS file. If you think your hosts list is neglected + by Privoxy's configuration, consider + adding your list to your user.action + file:

+ + + +
+
+  { +block }
    www.ad.example1.com
    ad.example2.com
    ads.galore.example.com
-   etc.example.com

4.24. Where can I find more information about Privoxy -and related issues?

Other references and sites of interest to Privoxy - users:

http://www.privoxy.org/, - the Privoxy Home page. -

-

http://www.privoxy.org/faq/, - the Privoxy FAQ. -

-

http://www.privoxy.org/developer-manual/, - the Privoxy developer manual. -

-

https://sourceforge.net/projects/ijbswa/, - the Project Page for Privoxy on - SourceForge. -

-

http://config.privoxy.org/, - the web-based user interface. Privoxy must be - running for this to work. Shortcut: http://p.p/ -

-

https://sourceforge.net/tracker/?group_id=11118&atid=460288, to submit "misses" and other - configuration related suggestions to the developers. -

- - -

http://www.junkbusters.com/ht/en/cookies.html, - an explanation how cookies are used to track web users. -

-

http://www.junkbusters.com/ijb.html, - the original Internet Junkbuster. -

-

http://www.squid-cache.org/, a popular - caching proxy, which is often used together with Privoxy. -

-

http://www.pps.jussieu.fr/~jch/software/polipo/, - Polipo is a caching proxy with advanced features - like pipelining, multiplexing and caching of partial instances. In many setups - it can be used as Squid replacement. -

-

https://www.torproject.org/, - Tor can help anonymize web browsing, - web publishing, instant messaging, IRC, SSH, and other applications. -

-

4.25. I've noticed that Privoxy changes "Microsoft" to -"MicroSuck"! Why are you manipulating my browsing?

We're not. The text substitutions that you are seeing are disabled - in the default configuration as shipped. You have either manually - activated the "fun" filter which - is clearly labeled "Text replacements for subversive browsing - fun!" or you are using an older Privoxy version and have implicitly - activated it by choosing the "Advanced" profile in the - web-based editor. Please upgrade.

4.26. Does Privoxy produce "valid" HTML (or XHTML)?

Privoxy generates HTML in both its own "templates", and possibly - whenever there are text substitutions via a Privoxy filter. While this - should always conform to the HTML 4.01 specifications, it has not been - validated against this or any other standard.


PrevHomeNext
Configuration Troubleshooting
\ No newline at end of file + etc.example.com +
+
+

+ +
+

4.24. Where can I find + more information about Privoxy and related issues?

+ +

Other references and sites of interest to Privoxy users:

+ + + + + + + +
http://www.privoxy.org/, the Privoxy Home page.
+ + + + + + + +
http://www.privoxy.org/faq/, the Privoxy FAQ.
+ + + + + + + +
http://www.privoxy.org/developer-manual/, the + Privoxy developer manual.
+ + + + + + + +
https://sourceforge.net/projects/ijbswa/, the Project + Page for Privoxy on SourceForge.
+ + + + + + + +
http://config.privoxy.org/, the web-based user + interface. Privoxy must be + running for this to work. Shortcut: http://p.p/
+ + + + + + + +
https://sourceforge.net/tracker/?group_id=11118&atid=460288, + to submit "misses" and other + configuration related suggestions to the developers.
+ + + + + + + +
http://www.junkbusters.com/ht/en/cookies.html, + an explanation how cookies are used to track web users.
+ + + + + + + +
http://www.junkbusters.com/ijb.html, the original + Internet Junkbuster.
+ + + + + + + +
http://www.squid-cache.org/, a popular caching proxy, + which is often used together with Privoxy.
+ + + + + + + +
http://www.pps.jussieu.fr/~jch/software/polipo/, + Polipo is a caching proxy with + advanced features like pipelining, multiplexing and caching of + partial instances. In many setups it can be used as Squid replacement.
+ + + + + + + +
https://www.torproject.org/, Tor can help anonymize web browsing, web + publishing, instant messaging, IRC, SSH, and other + applications.
+
+ +
+

4.25. I've noticed + that Privoxy changes "Microsoft" to + "MicroSuck"! Why are you manipulating my + browsing?

+ +

We're not. The text substitutions that you are seeing are disabled + in the default configuration as shipped. You have either manually + activated the "fun" + filter which is clearly labeled "Text replacements + for subversive browsing fun!" or you are using an older Privoxy + version and have implicitly activated it by choosing the "Advanced" profile in the web-based editor. Please + upgrade.

+
+ +
+

4.26. Does Privoxy produce + "valid" HTML (or XHTML)?

+ +

Privoxy generates HTML in both its own "templates", and possibly whenever there are text + substitutions via a Privoxy filter. + While this should always conform to the HTML 4.01 specifications, it + has not been validated against this or any other standard.

+
+ +
+

4.27. How did you manage to get Privoxy on my + computer without my consent?

+ +

We didn't. We make Privoxy available for download, but we don't go + around installing it on other people's systems behind their back. If + you discover Privoxy running on your system and are sure you didn't + install it yourself, somebody else did. You may not even be running the + real Privoxy, but maybe something else that only pretends to be + Privoxy, or maybe something that is based on the real Privoxy, but has + been modified.

+ +

Lately there have been reports of problems with some kind of Privoxy + versions that come preinstalled on some Netbooks. Some of the problems + described are inconsistent with the behaviour of official Privoxy + versions, which suggests that the preinstalled software may contain + vendor modifications that we don't know about and thus can't debug.

+ +

Privoxy's license allows vendor + modifications, but the vendor has to comply with the license, which + involves informing the user about the changes and to make the changes + available under the same license as Privoxy itself.

+ +

If you are having trouble with a modified Privoxy version, please + try to talk to whoever made the modifications before reporting the + problem to us. Please also try to convince whoever made the + modifications to talk to us. If you think somebody gave you a modified + Privoxy version without complying to the license, please let us + know.

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/faq/trouble.html b/external/privoxy/doc/webserver/faq/trouble.html index 8bc5b709..12fc01d7 100644 --- a/external/privoxy/doc/webserver/faq/trouble.html +++ b/external/privoxy/doc/webserver/faq/trouble.html @@ -1,239 +1,157 @@ - -Troubleshooting
Privoxy Frequently Asked Questions
PrevNext

5. Troubleshooting

5.1. I cannot connect to any websites. Or, I am getting -"connection refused" message with every web page. Why?

There are several possibilities:

  • Privoxy is not running. Solution: verify - that Privoxy is installed correctly, has not crashed, and is indeed running. - Turn on Privoxy's logging, and look at the logs to see what they say.

  • Or your browser is configured for a different port than what - Privoxy is using. Solution: verify that Privoxy - and your browser are set to the same port (listen-address).

  • Or if using a forwarding rule, you have a configuration problem or a - problem with a host in the forwarding chain. Solution: temporarily alter your - configuration and take the forwarders out of the equation.

  • Or you have a firewall that is interfering and blocking you. Solution: - try disabling or removing the firewall as a simple test. -

5.2. Why am I getting a 503 Error (WSAECONNREFUSED) on every page?

More than likely this is a problem with your TCP/IP networking. ZoneAlarm has - been reported to cause this symptom -- even if not running! The solution is - to either fight the ZA configuration, or uninstall ZoneAlarm, and then find - something better behaved in its place. Other personal firewall type products - may cause similar type problems if not configured correctly. -

5.3. I just added a new rule, but the steenkin ad is -still getting through. How?

If the ad had been displayed before you added its URL, it will probably be - held in the browser's cache for some time, so it will be displayed without - the need for any request to the server, and Privoxy - will not be involved. Flush the browser's caches, and then try again.

If this doesn't help, you probably have an error in the rule you - applied. Try pasting the full URL of the offending ad into http://config.privoxy.org/show-url-info - and see if it really matches your new rule. Blocking ads is like blocking - spam: a lot of tinkering is required to stay ahead of the game. And - remember you need to block the URL of the ad in question, which may be - entirely different from the site URL itself. Most ads are hosted on different - servers than the main site itself. If you right-click on the ad, you should - be able to get all the relevant information you need. Alternately, you can - find the correct URL by looking at Privoxy's logs - (you may need to enable logging in the main config file if its disabled).

Below is a slightly modified real-life log snippet that originates with one - requested URL: www.example.com (name of site was changed - for this example, the number of requests is real). You can see in this the - complexity of what goes into making up this one "page". There - are eight different domains involved here, with thirty two separate URLs - requested in all, making up all manner of images, Shockwave Flash, - JavaScript, CSS stylesheets, scripts, and other related content. Some of this - content is obviously "good" or "bad", but not all. - Many of the more questionable looking requests, are going to outside domains - that seem to be identifying themselves with suspicious looking names, making - our job a little easier. Privoxy has "crunched" (meaning caught - and BLOCKED) quite a few items in this example, but perhaps missed a few as well.

+ +
Request: www.example.com/
+
+
+
+
+  
+
+  Troubleshooting
+  
+  
+  
+  
+  
+  
+  
+
+
+
+  
+
+  
+

5. + Troubleshooting

+ +
+

5.1. I cannot connect + to any websites. Or, I am getting "connection + refused" message with every web page. Why?

+ +

There are several possibilities:

+ +
    +
  • +

    Privoxy is not running. + Solution: verify that Privoxy is + installed correctly, has not crashed, and is indeed running. Turn + on Privoxy's logging, and look at + the logs to see what they say.

    +
  • + +
  • +

    Or your browser is configured for a different port than what + Privoxy is using. Solution: verify + that Privoxy and your browser are + set to the same port (listen-address).

    +
  • + +
  • +

    Or if using a forwarding rule, you have a configuration problem + or a problem with a host in the forwarding chain. Solution: + temporarily alter your configuration and take the forwarders out of + the equation.

    +
  • + +
  • +

    Or you have a firewall that is interfering and blocking you. + Solution: try disabling or removing the firewall as a simple + test.

    +
  • +
+
+ +
+

5.2. Why am I + getting a 503 Error (WSAECONNREFUSED) on every page?

+ +

More than likely this is a problem with your TCP/IP networking. + ZoneAlarm has been reported to cause this symptom -- even if not + running! The solution is to either fight the ZA configuration, or + uninstall ZoneAlarm, and then find something better behaved in its + place. Other personal firewall type products may cause similar type + problems if not configured correctly.

+
+ +
+

5.3. I just added a + new rule, but the steenkin ad is still getting through. How?

+ +

If the ad had been displayed before you added its URL, it will + probably be held in the browser's cache for some time, so it will be + displayed without the need for any request to the server, and + Privoxy will not be involved. Flush + the browser's caches, and then try again.

+ +

If this doesn't help, you probably have an error in the rule you + applied. Try pasting the full URL of the offending ad into http://config.privoxy.org/show-url-info and see if it really + matches your new rule. Blocking ads is like blocking spam: a lot of + tinkering is required to stay ahead of the game. And remember you need + to block the URL of the ad in question, which may be entirely different + from the site URL itself. Most ads are hosted on different servers than + the main site itself. If you right-click on the ad, you should be able + to get all the relevant information you need. Alternately, you can find + the correct URL by looking at Privoxy's logs (you may need to enable logging in + the main config file if its disabled).

+ +

Below is a slightly modified real-life log snippet that originates + with one requested URL: www.example.com (name + of site was changed for this example, the number of requests is real). + You can see in this the complexity of what goes into making up this one + "page". There are eight different domains + involved here, with thirty two separate URLs requested in all, making + up all manner of images, Shockwave Flash, JavaScript, CSS stylesheets, + scripts, and other related content. Some of this content is obviously + "good" or "bad", + but not all. Many of the more questionable looking requests, are going + to outside domains that seem to be identifying themselves with + suspicious looking names, making our job a little easier. Privoxy has "crunched" + (meaning caught and BLOCKED) quite a few items in this example, but + perhaps missed a few as well.

+ + + +
+
+Request: www.example.com/
 Request: www.example.com/favicon.ico
 Request: img.example.com/main.css
 Request: img.example.com/sr.js
@@ -243,8 +161,8 @@ Request: img.example.com/pb.png
 Request: www.google-analytics.com/urchin.js crunch! (Blocked)
 Request: www.advertising-department.com/ats/switch.ps.php?26856 crunch! (Blocked)
 Request: img.example.com/p.gif
-Request: www.popuptraffic.com/assign.php?l=example&mode=behind crunch! (Blocked)
-Request: www.popuptraffic.com/scripts/popup.php?hid=5c3cf&tmpl=PBa.tmpl crunch! (Blocked)
+Request: www.popuptraffic.com/assign.php?l=example&mode=behind crunch! (Blocked)
+Request: www.popuptraffic.com/scripts/popup.php?hid=5c3cf&tmpl=PBa.tmpl crunch! (Blocked)
 Request: www.popuptraffic.com/assign.php?l=example crunch! (Blocked)
 Request: www.lik-sang.com/Banners/best_sellers/best_sellers.css
 Request: www.adtrak.net/adx.js crunch! (Blocked)
@@ -253,1024 +171,566 @@ Request: img.example.com/example.jpg
 Request: img.example.com/mt.png
 Request: img.example.com/mm.png
 Request: img.example.com/mb.png
-Request: www.popuptraffic.com/scripts/popup.php?hid=a71b91fa5&tmpl=Ua.tmp crunch! (Blocked)
+Request: www.popuptraffic.com/scripts/popup.php?hid=a71b91fa5&tmpl=Ua.tmp crunch! (Blocked)
 Request: www.example.com/tracker.js
 Request: www.lik-sang.com/Banners/best_sellers/lsi_head.gif
-Request: www.adtrak.net/adjs.php?n=020548130&what=zone:61 crunch! (Blocked)
-Request: www.adtrak.net/adjs.php?n=463594413&what=zone:58&source=Ua crunch! (Blocked)
+Request: www.adtrak.net/adjs.php?n=020548130&what=zone:61 crunch! (Blocked)
+Request: www.adtrak.net/adjs.php?n=463594413&what=zone:58&source=Ua crunch! (Blocked)
 Request: www.lik-sang.com/Banners/best_sellers/bottomani.swf
-Request: mmm.elitemediagroup.net/install.php?allowpop=no&popupmincook=0&allowsp2=1 crunch! (Blocked)
-Request: www.example.com/tracker.js?screen=1400x1050&win=962x693
-Request: www.adtrak.net/adlog.php?bannerid=1309&clientid=439&zoneid=61 crunch! (Blocked)
-Request: 66.70.21.80/scripts/click.php?hid=5c3cf599a9efd0320d26&si
+Request: mmm.elitemediagroup.net/install.php?allowpop=no&popupmincook=0&allowsp2=1 crunch! (Blocked)
+Request: www.example.com/tracker.js?screen=1400x1050&win=962x693
+Request: www.adtrak.net/adlog.php?bannerid=1309&clientid=439&zoneid=61 crunch! (Blocked)
+Request: 66.70.21.80/scripts/click.php?hid=5c3cf599a9efd0320d26&si
 Request: 66.70.21.80/img/pixel.gif
-Request: www.adtrak.net/adlog.php?bannerid=1309&clientid=439&zoneid=58&source=Ua&block=86400 crunch! (Blocked)
-Request: 66.70.21.80/scripts/click.php?hid=a71b9f6504b0c5681fa5&si=Ua

Despite 12 out of 32 requests being blocked, the page looked, and seemed to - behave perfectly "normal" (minus some ads, of course).

5.4. One of my favorite sites does not work with Privoxy. -What can I do?

First verify that it is indeed a Privoxy problem, - by toggling off Privoxy through http://config.privoxy.org/toggle - (the toggle feature may need to be enabled in the main - config), - and then shift-reloading the problem page (i.e. holding down the shift key - while clicking reload. Alternatively, flush your browser's disk and memory - caches).

If the problem went away, we know we have a configuration related problem. - Now go to http://config.privoxy.org/show-url-info - and paste the full URL of the page in question into the prompt. See which - actions are being applied to the URL, and which matches in which actions - files are responsible for that. It might be helpful also to look at your logs - for this site too, to see what else might be happening (note: logging may need - to be enabled in the main config file). Many sites are - complex and require a number of related pages to help present their content. - Look at what else might be used by the page in question, and what of that - might be required. - Now, armed with this information, go to - http://config.privoxy.org/show-status - and select the appropriate actions files for editing.

You can now either look for a section which disables the actions that - you suspect to cause the problem and add a pattern for your site there, - or make up a completely new section for your site. In any case, the recommended - way is to disable only the prime suspect, reload the problem page, and only - if the problem persists, disable more and more actions until you have - identified the culprit. You may or may not want to turn the other actions - on again. Remember to flush your browser's caches in between any such changes!

Alternately, if you are comfortable with a text editor, you can accomplish - the same thing by editing the appropriate actions file. Probably the easiest - way to deal with such problems when editing by hand is to add your - site to a { fragile } section in user.action, - which is an alias that turns off most "dangerous" - actions, but is also likely to turn off more actions then needed, and thus lower - your privacy and protection more than necessary,

Troubleshooting actions is discussed in more detail in the User Manual appendix, - Troubleshooting: the Anatomy of an Action. - There is also an actions tutorial - with general configuration information and examples.

As a last resort, you can always see if your browser has a setting that will - bypass the proxy setting for selective sites. Modern browsers can do this.

5.5. After installing Privoxy, I have to log in -every time I start IE. What gives?

This is a quirk that effects the installation of - Privoxy, in conjunction with Internet Explorer and - Internet Connection Sharing on Windows 2000 and Windows XP. The symptoms may - appear to be corrupted or invalid DUN settings, or passwords.

When setting up an NT based Windows system with - Privoxy you may find that things do not seem to be - doing what you expect. When you set your system up you will probably have set - up Internet Connection Sharing (ICS) with Dial up Networking (DUN) when - logged in with administrator privileges. You will probably have made this DUN - connection available to other accounts that you may have set-up on your - system. E.g. Mum or Dad sets up the system and makes accounts suitably - configured for the kids.

When setting up Privoxy in this environment you - will have to alter the proxy set-up of Internet Explorer (IE) for the - specific DUN connection on which you wish to use - Privoxy. When you do this the ICS DUN set-up - becomes user specific. In this instance you will see no difference if you - change the DUN connection under the account used to set-up the connection. - However when you do this from another user you will notice that the DUN - connection changes to make available to "Me only". You will also find that - you have to store the password under each different user!

The reason for this is that each user's set-up for IE is user specific. Each - set-up DUN connection and each LAN connection in IE store the settings for - each user individually. As such this enforces individual configurations - rather than common ones. Hence the first time you use a DUN connection after - re-booting your system it may not perform as you expect, and prompt you for - the password. Just set and save the password again and all should be OK.

[Thanks to Ray Griffith for this submission.]

5.6. I cannot connect to any FTP sites. Privoxy - is blocking me.

Privoxy cannot act as a proxy for FTP traffic, - so do not configure your browser to use Privoxy - as an FTP proxy. The same is true for any protocol other than HTTP - or HTTPS (SSL). -

Most browsers understand FTP as well as HTTP. If you connect to a site, with - a URL like ftp://ftp.example.com, your browser is making - an FTP connection, and not a HTTP connection. So while your browser may - speak FTP, Privoxy does not, and cannot proxy - such traffic. -

To complicate matters, some systems may have a generic "proxy" - setting, which will enable various protocols, including - both HTTP and FTP proxying! So it is possible to - accidentally enable FTP proxying in these cases. And of course, if this - happens, Privoxy will indeed cause problems since - it does not know FTP. Newer version will give a sane error - message if a FTP connection is attempted. Just disable the FTP setting - and all will be well again. -

Will Privoxy ever proxy FTP traffic? Unlikely. - There just is not much reason, and the work to make this happen is more than - it may seem. -

5.7. In Mac OS X, I can't configure Microsoft Internet Explorer to use - Privoxy as the HTTP proxy.

Microsoft Internet Explorer (in versions like 5.1) respects system-wide - network settings. In order to change the HTTP proxy, open System - Preferences, and click on the Network icon. In the settings pane that - comes up, click on the Proxies tab. Ensure the "Web Proxy (HTTP)" checkbox - is checked and enter 127.0.0.1 in the entry field. - Enter 8118 in the Port field. The next time you start - IE, it should reflect these values. -

5.8. In Mac OS X, I dragged the Privoxy folder to the trash in order to - uninstall it. Now the finder tells me I don't have sufficient privileges to - empty the trash.

Note: This ONLY applies to privoxy 3.0.6 and earlier. -

Just dragging the Privoxy folder to the trash is - not enough to delete it. Privoxy supplies an - uninstall.command file that takes care of - these details. Open the trash, drag the uninstall.command - file out of the trash and double-click on it. You will be prompted for - confirmation and the administration password. -

The trash may still appear full after this command; emptying the trash - from the desktop should make it appear empty again. -

5.9. In Mac OS X Panther (10.3), images often fail to load and/or I - experience random delays in page loading. I'm using - localhost as my browser's proxy setting.

We believe this is due to an IPv6-related bug in Mac OS X, but don't fully - understand the issue yet. In any case, changing the proxy setting to - 127.0.0.1 instead of localhost - works around the problem. -

5.10. I get a completely blank page at one site. "View Source" - shows only: <html><body></body></html>. Without - Privoxy the page loads fine.

Chances are that the site suffers from a bug in - PHP, - which results in empty pages being sent if the client explicitly requests - an uncompressed page, like Privoxy does. - This bug has been fixed in PHP 4.2.3. -

To find out if this is in fact the source of the problem, try adding - the site to a -prevent-compression section in - user.action: -

   # Make exceptions for ill-behaved sites:                                     
-   #                                                                    
-   {-prevent-compression}                                               
-    .example.com

If that works, you may also want to report the problem to the - site's webmasters, telling them to use zlib.output_compression - instead of ob_gzhandler in their PHP applications (workaround) - or upgrade to PHP 4.2.3 or later (fix). -

5.11. My logs show many "Unable to get my own hostname" lines. -Why?

Privoxy tries to get the hostname of the system - its running on from the IP address of the system interface it is bound to - (from the config file - listen-address setting). If the system cannot supply - this information, Privoxy logs this condition.

Typically, this would be considered a minor system configuration error. It is - not a fatal error to Privoxy however, but may - result in a much slower response from Privoxy on - some platforms due to DNS timeouts.

This can be caused by a problem with the local hosts - file. If this file has been changed from the original, try reverting it to - see if that helps. Make sure whatever name(s) are used for the local system, - that they resolve both ways.

You should also be able to work around the problem with the - hostname option.

5.12. When I try to launch Privoxy, I get an -error message "port 8118 is already in use" (or similar wording). -Why?

Port 8118 is Privoxy's default TCP - "listening" port. Typically this message would mean that there - is already one instance of Privoxy running, and - your system is actually trying to start a second - Privoxy on the same port, which will not work. - (You can have multiple instances but they must be assigned different ports.) - How and why this might happen varies from platform to platform, but you need - to check your installation and start-up procedures.

5.13. Pages with UTF-8 fonts are garbled.

This is caused by the "demoronizer" filter. You should either - upgrade Privoxy, or at least upgrade to the most - recent default.action file available from SourceForge. - Or you can simply disable the demoronizer filter.

5.14. Why are binary files (such as images) corrupted when Privoxy - is used?

This may also be caused by the "demoronizer" filter, - in conjunction with a web server that is misreporting the content type. Binary - files are exempted from Privoxy's filtering - (unless the web server by mistake says the file is something else). Either - upgrade Privoxy, or go to the most recent - default.action file available from SourceForge.

5.15. What is the "demoronizer" and why is it there?

The original demoronizer was a Perl script that cleaned up HTML pages which - were created with certain Microsoft products. MS has used proprietary extensions - to standardized font encodings (ISO 8859-1), which has caused problems for pages - that are viewed with non-Microsoft products (and are expecting to see a - standard set of fonts). The demoronizer corrected these errors so the pages - displayed correctly. Privoxy borrowed from this - script, introducing a filter based on the original demoronizer, which in turn could - correct these errors on the fly.

But this is only needed in some situations, and will cause serious problems in some - other situations.

If you are using Microsoft products, you do not need it. If you need to view - pages with UTF-8 characters (such as Cyrillic or Chinese), then it will - cause corruption of the fonts, and thus should not be on.

On the other hand, if you use non-Microsoft products, and you occasionally - notice weird characters on pages, you might want to try it.

5.16. Why do I keep seeing "PrivoxyWindowOpen()" in raw source code?

Privoxy is attempting to disable malicious - Javascript - in this case, with the unsolicited-popups - filter. Privoxy cannot tell very well - "good" code snippets from "bad" code snippets.

If you see this in HTML source, and the page displays without problems, then - this is good, and likely some pop-up window was disabled. If you see this - where it is causing a problem, such as a downloaded program source code file, - then you should set an exception for this site or page such that the - integrity of the page stays in tact by disabling all filtering.

5.17. I am getting too many DNS errors like "404 No Such Domain". Why - can't Privoxy do this better?

There are potentially several factors here. First of all, the DNS resolution - is done by the underlying operating system -- not - Privoxy itself. Privoxy - merely initiates the process and hands it off, and then later reports - whatever the outcome was and tries to give a coherent message if there seems - to be a problem. In some cases, this might otherwise be mitigated by the - browser itself which might try some work-arounds and alternate approaches (e.g - adding "www." to the URL).

In other cases, if Privoxy is being chained - with another proxy, this could complicate the issue, and cause undue - delays and timeouts. In the case of a "socks4a" proxy, the socks - server handles all the DNS. Privoxy would just be - the "messenger" which is reporting whatever problem occurred - downstream, and not the root cause of the error.

In any case, versions newer than 3.0.3 include various improvements to help - Privoxy better handle these cases.

5.18. At one site Privoxy just hangs, and starts taking - all CPU. Why is this?

This is probably a manifestation of the "100% cpu" problem that - occurs on pages containing many (thousands upon thousands) of blank lines. The blank lines - are in the raw HTML source of the page, and the browser just ignores them. But the - pattern matching in Privoxy's page filtering - mechanism is trying to match against absurdly long strings and this becomes - very CPU-intensive, taking a long, long time to complete.

Until a better solution comes along, disable filtering on these pages, - particularly the js-annoyances and - unsolicited-popups filters. If you run into this problem - with a recent Privoxy version, please send a problem report.

5.19. I just installed Privoxy, and all my -browsing has slowed to a crawl. What gives?

This should not happen, and for the overwhelming number of users world-wide, - it does not happen. I would suspect some inadvertent interaction of software - components such as anti-virus software, spyware protectors, personal - firewalls or similar components. Try disabling (or uninstalling) these one - at a time and see if that helps. Either way, if you are using a - recent Privoxy version, please report the problem.

5.20. Why do my filters work on some sites but not on others?

It's probably due to compression. It is a common practice for web servers to - send their content "compressed" in order to speed things up, and - then let the browser "uncompress" them. When compiled with zlib support - Privoxy can decompress content before filtering, otherwise you may want to enable -prevent-compression.

As of Privoxy 3.0.9, zlib support is enabled in the default builds.

5.21. On some HTTPS sites my browser warns me about unauthenticated content, - the URL bar doesn't get highlighted and the lock symbol appears to be broken. - What's going on?

Probably the browser is requesting ads through HTTPS and Privoxy - is blocking the requests. Privoxy's error messages are delivered - unencrypted and while it's obvious for the browser that the HTTPS - request is already blocked by the proxy, some warn about unauthenticated - content anyway.

To work around the problem you can redirect those requests to an invalid - local address instead of blocking them. While the redirects aren't - encrypted either, many browsers don't care. They simply follow the - redirect, fail to reach a server and display an error message instead - of the ad.

To do that, enable logging to figure out which requests get blocked by - Privoxy and add the hosts (no path patterns) to a section like this:

{+redirect{http://127.0.0.1:0/} -block -limit-connect}
-.ivwbox.de:443/

Additionally you have to configure your browser to contact - "127.0.0.1:0" directly (instead of through Privoxy).

To add a proxy exception in Mozilla Firefox - open the "Preferences", click the "Settings" - button located on the "Network" tab in the "Advanced" - section, and add "127.0.0.1:0" in the "No Proxy for:" - field.

5.22. I get selinux error messages. How can I fix this?

Please report the problem to the creator of your selinux policies.

The problem is that some selinux policy writers aren't familiar - with the application they are trying to "secure" and - thus create policies that make no sense.

In Privoxy's case the problem usually - is that the policy only allows outgoing connections for certain - destination ports (e.g. 80 and 443). While this may cover the - standard ports, websites occasionally use other ports as well. - This isn't a security problem and therefore Privoxy's - default configuration doesn't block these requests.

If you really want to block these ports (and don't be able - to load websites that don't use standard ports), you should - configure Privoxy to block these ports as well, so it doesn't - trigger the selinux warnings.

5.23. I compiled Privoxy with Gentoo's portage and it appears to be very slow. Why?

Probably you unintentionally compiled Privoxy without threading support - in which case requests have to be serialized and only one can be served - at the same time.

Check your "USE" flags and make sure they include - "threads". If they don't, add the flag and rebuild Privoxy.

If you compiled Privoxy with threading support (on POSIX-based systems), - the "Conditional #defines" section on http://config.privoxy.org/show-status - will list "FEATURE_PTHREAD" as "enabled".


PrevHomeNext
Miscellaneous Contacting the developers, Bug Reporting and Feature Requests
\ No newline at end of file +Request: www.adtrak.net/adlog.php?bannerid=1309&clientid=439&zoneid=58&source=Ua&block=86400 crunch! (Blocked) +Request: 66.70.21.80/scripts/click.php?hid=a71b9f6504b0c5681fa5&si=Ua +
+
+ +

Despite 12 out of 32 requests being blocked, the page looked, and + seemed to behave perfectly "normal" (minus + some ads, of course).

+
+ +
+

5.4. One of my + favorite sites does not work with Privoxy. What can I do?

+ +

First verify that it is indeed a Privoxy problem, by toggling off Privoxy through http://config.privoxy.org/toggle (the toggle feature may + need to be enabled in the main config), and + then shift-reloading the problem page (i.e. holding down the shift key + while clicking reload. Alternatively, flush your browser's disk and + memory caches).

+ +

If the problem went away, we know we have a configuration related + problem. Now go to http://config.privoxy.org/show-url-info and paste the + full URL of the page in question into the prompt. See which actions are + being applied to the URL, and which matches in which actions files are + responsible for that. It might be helpful also to look at your logs for + this site too, to see what else might be happening (note: logging may + need to be enabled in the main config file). Many sites are complex and + require a number of related pages to help present their content. Look + at what else might be used by the page in question, and what of that + might be required. Now, armed + with this information, go to http://config.privoxy.org/show-status and select the + appropriate actions files for editing.

+ +

You can now either look for a section which disables the actions + that you suspect to cause the problem and add a pattern for your site + there, or make up a completely new section for your site. In any case, + the recommended way is to disable only the prime suspect, reload the + problem page, and only if the problem persists, disable more and more + actions until you have identified the culprit. You may or may not want + to turn the other actions on again. Remember to flush your browser's + caches in between any such changes!

+ +

Alternately, if you are comfortable with a text editor, you can + accomplish the same thing by editing the appropriate actions file. + Probably the easiest way to deal with such problems when editing by + hand is to add your site to a { fragile } + section in user.action, which is an alias + that turns off most "dangerous" actions, but + is also likely to turn off more actions then needed, and thus lower + your privacy and protection more than necessary,

+ +

Troubleshooting actions is discussed in more detail in the User Manual + appendix, Troubleshooting: the Anatomy of an Action. There is also + an actions tutorial with general configuration information and + examples.

+ +

As a last resort, you can always see if your browser has a setting + that will bypass the proxy setting for selective sites. Modern browsers + can do this.

+
+ +
+

5.5. After installing Privoxy, + I have to log in every time I start IE. What gives?

+ +

This is a quirk that effects the installation of Privoxy, in conjunction with Internet Explorer and + Internet Connection Sharing on Windows 2000 and Windows XP. The + symptoms may appear to be corrupted or invalid DUN settings, or + passwords.

+ +

When setting up an NT based Windows system with Privoxy you may find that things do not seem to be + doing what you expect. When you set your system up you will probably + have set up Internet Connection Sharing (ICS) with Dial up Networking + (DUN) when logged in with administrator privileges. You will probably + have made this DUN connection available to other accounts that you may + have set-up on your system. E.g. Mum or Dad sets up the system and + makes accounts suitably configured for the kids.

+ +

When setting up Privoxy in this + environment you will have to alter the proxy set-up of Internet + Explorer (IE) for the specific DUN connection on which you wish to use + Privoxy. When you do this the ICS DUN + set-up becomes user specific. In this instance you will see no + difference if you change the DUN connection under the account used to + set-up the connection. However when you do this from another user you + will notice that the DUN connection changes to make available to "Me + only". You will also find that you have to store the password under + each different user!

+ +

The reason for this is that each user's set-up for IE is user + specific. Each set-up DUN connection and each LAN connection in IE + store the settings for each user individually. As such this enforces + individual configurations rather than common ones. Hence the first time + you use a DUN connection after re-booting your system it may not + perform as you expect, and prompt you for the password. Just set and + save the password again and all should be OK.

+ +

[Thanks to Ray Griffith for this submission.]

+
+ +
+

5.6. I cannot connect to any + FTP sites. Privoxy is blocking me.

+ +

Privoxy cannot act as a proxy for + FTP traffic, so do not configure your browser to use Privoxy as an FTP proxy. The same is true for + any protocol other than HTTP or + HTTPS (SSL).

+ +

Most browsers understand FTP as well as HTTP. If you connect to a + site, with a URL like ftp://ftp.example.com, + your browser is making an FTP connection, and not a HTTP connection. So + while your browser may speak FTP, Privoxy does not, and cannot proxy such + traffic.

+ +

To complicate matters, some systems may have a generic "proxy" setting, which will enable various protocols, + including both HTTP and FTP + proxying! So it is possible to accidentally enable FTP proxying in + these cases. And of course, if this happens, Privoxy will indeed cause problems since it does + not know FTP. Newer version will give a sane error message if a FTP + connection is attempted. Just disable the FTP setting and all will be + well again.

+ +

Will Privoxy ever proxy FTP + traffic? Unlikely. There just is not much reason, and the work to make + this happen is more than it may seem.

+
+ +
+

5.7. In Mac OS X, I + can't configure Microsoft Internet Explorer to use Privoxy as the HTTP + proxy.

+ +

Microsoft Internet Explorer (in versions like 5.1) respects + system-wide network settings. In order to change the HTTP proxy, open + System Preferences, and click on the Network icon. In the settings pane + that comes up, click on the Proxies tab. Ensure the "Web Proxy (HTTP)" + checkbox is checked and enter 127.0.0.1 in the + entry field. Enter 8118 in the Port field. The + next time you start IE, it should reflect these values.

+
+ +
+

5.8. + In Mac OS X, I dragged the Privoxy folder to the trash in order to + uninstall it. Now the finder tells me I don't have sufficient + privileges to empty the trash.

+ +

Note: This ONLY applies to privoxy 3.0.6 and earlier.

+ +

Just dragging the Privoxy folder to + the trash is not enough to delete it. Privoxy supplies an uninstall.command file that takes care of these + details. Open the trash, drag the uninstall.command file out of the trash and + double-click on it. You will be prompted for confirmation and the + administration password.

+ +

The trash may still appear full after this command; emptying the + trash from the desktop should make it appear empty again.

+
+ +
+

5.9. In Mac + OS X Panther (10.3), images often fail to load and/or I experience + random delays in page loading. I'm using localhost as my browser's proxy setting.

+ +

We believe this is due to an IPv6-related bug in Mac OS X, but don't + fully understand the issue yet. In any case, changing the proxy setting + to 127.0.0.1 instead of localhost works around the problem.

+
+ +
+

5.10. I get a + completely blank page at one site. "View + Source" shows only: <html><body></body></html>. + Without Privoxy the page loads fine.

+ +

Chances are that the site suffers from a bug in PHP, which results in empty pages being sent + if the client explicitly requests an uncompressed page, like + Privoxy does. This bug has been fixed + in PHP 4.2.3.

+ +

To find out if this is in fact the source of the problem, try adding + the site to a -prevent-compression section in + user.action:

+ + + + + +
+
+   # Make exceptions for ill-behaved sites:
+   #
+   {-prevent-compression}
+    .example.com
+
+
+ +

If that works, you may also want to report the problem to the site's + webmasters, telling them to use zlib.output_compression instead of + ob_gzhandler in their PHP applications (workaround) or upgrade to PHP + 4.2.3 or later (fix).

+
+ +
+

5.11. My logs + show many "Unable to get my own hostname" + lines. Why?

+ +

Privoxy tries to get the hostname + of the system its running on from the IP address of the system + interface it is bound to (from the config + file listen-address setting). + If the system cannot supply this information, Privoxy logs this condition.

+ +

Typically, this would be considered a minor system configuration + error. It is not a fatal error to Privoxy however, but may result in a much slower + response from Privoxy on some + platforms due to DNS timeouts.

+ +

This can be caused by a problem with the local hosts file. If this file has been changed from the + original, try reverting it to see if that helps. Make sure whatever + name(s) are used for the local system, that they resolve both ways.

+ +

You should also be able to work around the problem with the hostname + option.

+
+ +
+

5.12. When I try to launch + Privoxy, I get an error message "port 8118 is + already in use" (or similar wording). Why?

+ +

Port 8118 is Privoxy's default TCP + "listening" port. Typically this message + would mean that there is already one instance of Privoxy running, and your system is actually + trying to start a second Privoxy on + the same port, which will not work. (You can have multiple instances + but they must be assigned different ports.) How and why this might + happen varies from platform to platform, but you need to check your + installation and start-up procedures.

+
+ +
+

5.13. Pages + with UTF-8 fonts are garbled.

+ +

This is caused by the "demoronizer" + filter. You should either upgrade Privoxy, or at least upgrade to the most recent + default.action file available from SourceForge. Or you can simply disable the demoronizer + filter.

+
+ +
+

5.14. Why + are binary files (such as images) corrupted when Privoxy is + used?

+ +

This may also be caused by the "demoronizer" filter, in conjunction with a web server + that is misreporting the content type. Binary files are exempted from + Privoxy's filtering (unless the web + server by mistake says the file is something else). Either upgrade + Privoxy, or go to the most recent + default.action file available from SourceForge.

+
+ +
+

5.15. What + is the "demoronizer" and why is it + there?

+ +

The original demoronizer was a Perl script that cleaned up HTML + pages which were created with certain Microsoft products. MS has used + proprietary extensions to standardized font encodings (ISO 8859-1), + which has caused problems for pages that are viewed with non-Microsoft + products (and are expecting to see a standard set of fonts). The + demoronizer corrected these errors so the pages displayed correctly. + Privoxy borrowed from this script, + introducing a filter based on the original demoronizer, which in turn + could correct these errors on the fly.

+ +

But this is only needed in some situations, and will cause serious + problems in some other situations.

+ +

If you are using Microsoft products, you do not need it. If you need + to view pages with UTF-8 characters (such as Cyrillic or Chinese), then + it will cause corruption of the fonts, and thus should not be on.

+ +

On the other hand, if you use non-Microsoft products, and you + occasionally notice weird characters on pages, you might want to try + it.

+
+ +
+

5.16. Why do I + keep seeing "PrivoxyWindowOpen()" in raw + source code?

+ +

Privoxy is attempting to disable + malicious Javascript in this case, with the unsolicited-popups filter. Privoxy cannot tell very well "good" code snippets from "bad" code snippets.

+ +

If you see this in HTML source, and the page displays without + problems, then this is good, and likely some pop-up window was + disabled. If you see this where it is causing a problem, such as a + downloaded program source code file, then you should set an exception + for this site or page such that the integrity of the page stays in tact + by disabling all filtering.

+
+ +
+

5.17. I am getting + too many DNS errors like "404 No Such + Domain". Why can't Privoxy do this better?

+ +

There are potentially several factors here. First of all, the DNS + resolution is done by the underlying operating system -- not + Privoxy itself. Privoxy merely initiates the process and hands it + off, and then later reports whatever the outcome was and tries to give + a coherent message if there seems to be a problem. In some cases, this + might otherwise be mitigated by the browser itself which might try some + work-arounds and alternate approaches (e.g adding "www." to the URL).

+ +

In other cases, if Privoxy is being + chained with another proxy, this could complicate the issue, and cause + undue delays and timeouts. In the case of a "socks4a" proxy, the socks server handles all the DNS. + Privoxy would just be the "messenger" which is reporting whatever problem occurred + downstream, and not the root cause of the error.

+ +

In any case, versions newer than 3.0.3 include various improvements + to help Privoxy better handle these + cases.

+
+ +
+

5.18. At one site + Privoxy just hangs, and starts taking all CPU. Why is this?

+ +

This is probably a manifestation of the "100% + cpu" problem that occurs on pages containing many (thousands + upon thousands) of blank lines. The blank lines are in the raw HTML + source of the page, and the browser just ignores them. But the pattern + matching in Privoxy's page filtering + mechanism is trying to match against absurdly long strings and this + becomes very CPU-intensive, taking a long, long time to complete.

+ +

Until a better solution comes along, disable filtering on these + pages, particularly the js-annoyances and + unsolicited-popups filters. If you run into + this problem with a recent Privoxy + version, please send a problem report.

+
+ +
+

5.19. I just + installed Privoxy, and all my browsing has slowed to a crawl. What + gives?

+ +

This should not happen, and for the overwhelming number of users + world-wide, it does not happen. I would suspect some inadvertent + interaction of software components such as anti-virus software, spyware + protectors, personal firewalls or similar components. Try disabling (or + uninstalling) these one at a time and see if that helps. Either way, if + you are using a recent Privoxy + version, please report the problem.

+
+ +
+

5.20. Why do + my filters work on some sites but not on others?

+ +

It's probably due to compression. It is a common practice for web + servers to send their content "compressed" + in order to speed things up, and then let the browser "uncompress" them. When compiled with zlib support + Privoxy can decompress content before + filtering, otherwise you may want to enable prevent-compression.

+ +

As of Privoxy 3.0.9, zlib support + is enabled in the default builds.

+
+ +
+

5.21. On + some HTTPS sites my browser warns me about unauthenticated content, the + URL bar doesn't get highlighted and the lock symbol appears to be + broken. What's going on?

+ +

Probably the browser is requesting ads through HTTPS and + Privoxy is blocking the requests. + Privoxy's error messages are delivered unencrypted and while it's + obvious for the browser that the HTTPS request is already blocked by + the proxy, some warn about unauthenticated content anyway.

+ +

To work around the problem you can redirect those requests to an + invalid local address instead of blocking them. While the redirects + aren't encrypted either, many browsers don't care. They simply follow + the redirect, fail to reach a server and display an error message + instead of the ad.

+ +

To do that, enable logging to figure out which requests get blocked + by Privoxy and add the hosts (no path + patterns) to a section like this:

+ + + + + +
+
+{+redirect{http://127.0.0.1:0/} -block -limit-connect}
+.ivwbox.de:443/
+
+
+ +

Additionally you have to configure your browser to contact + "127.0.0.1:0" directly (instead of through + Privoxy).

+ +

To add a proxy exception in Mozilla + Firefox open the "Preferences", click + the "Settings" button located on the + "Network" tab in the "Advanced" section, and add "127.0.0.1:0" in the "No Proxy + for:" field.

+
+ +
+

5.22. I get selinux + error messages. How can I fix this?

+ +

Please report the problem to the creator of your selinux + policies.

+ +

The problem is that some selinux policy writers aren't familiar with + the application they are trying to "secure" + and thus create policies that make no sense.

+ +

In Privoxy's case the problem + usually is that the policy only allows outgoing connections for certain + destination ports (e.g. 80 and 443). While this may cover the standard + ports, websites occasionally use other ports as well. This isn't a + security problem and therefore Privoxy's default configuration doesn't block + these requests.

+ +

If you really want to block these ports (and don't be able to load + websites that don't use standard ports), you should configure Privoxy + to block these ports as well, so it doesn't trigger the selinux + warnings.

+
+ +
+

5.23. I + compiled Privoxy with Gentoo's portage + and it appears to be very slow. Why?

+ +

Probably you unintentionally compiled Privoxy without threading support in which case + requests have to be serialized and only one can be served at the same + time.

+ +

Check your "USE" flags and make sure they + include "threads". If they don't, add the + flag and rebuild Privoxy.

+ +

If you compiled Privoxy with + threading support (on POSIX-based systems), the "Conditional #defines" section on http://config.privoxy.org/show-status will list "FEATURE_PTHREAD" as "enabled".

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/index.html b/external/privoxy/doc/webserver/index.html index 3afc2d95..f52958ff 100644 --- a/external/privoxy/doc/webserver/index.html +++ b/external/privoxy/doc/webserver/index.html @@ -1,328 +1,207 @@ - -Privoxy - Home Page - -

Privoxy - Home Page

Privoxy is a non-caching web proxy with advanced filtering capabilities - for enhancing privacy, modifying web page data and HTTP headers, controlling - access, and removing ads and other obnoxious Internet junk. Privoxy has a - flexible configuration and can be customized to suit individual needs and tastes. - It has application for both stand-alone systems and multi-user networks.

Privoxy is Free Software and licensed under the GPL2.

Privoxy is an associated project of Software in the Public Interest (SPI). - Donations are welcome.

The most recent release is 3.0.12 (stable). -



Privoxy is developed on:
- -

Copyright © 2001-2009 by Privoxy Developers -

\ No newline at end of file + + + + + + + Privoxy - Home Page + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

Privoxy - Home Page

+ +
+ + +

Privoxy is a non-caching web proxy with advanced filtering + capabilities for enhancing privacy, modifying web page data and HTTP + headers, controlling access, and removing ads and other obnoxious + Internet junk. Privoxy has a flexible configuration and can be + customized to suit individual needs and tastes. It has application + for both stand-alone systems and multi-user networks.

+ +

Privoxy is Free Software and licensed under the GNU GPLv2.

+ +

Privoxy is an associated project of Software in the Public + Interest (SPI).

+ +

Helping hands and donations are welcome:

+ + + +

The most recent release is 3.0.19 (stable).

+
+
+
+ + + + + + + +
+
+ +

+ +
+ + + + + + + + + + + + + + +
Privoxy is developed on:
+
+ +

Copyright © 2001-2010 by Privoxy Developers

+
+
+ + diff --git a/external/privoxy/doc/webserver/man-page/privoxy-man-page.html b/external/privoxy/doc/webserver/man-page/privoxy-man-page.html index 91f045db..58e137d3 100644 --- a/external/privoxy/doc/webserver/man-page/privoxy-man-page.html +++ b/external/privoxy/doc/webserver/man-page/privoxy-man-page.html @@ -1,294 +1,213 @@ + - -Man page of PRIVOXY - -

PRIVOXY

-Section: (1)
Updated: 21 March 2009
Index -
+ + + -  -

NAME

+ Privoxy Man page + + -privoxy - Privacy Enhancing Proxy -  -

SYNOPSIS

+ +

NAME

+
+
 
-

-privoxy [--help ] [--version ] [--no-daemon ] [--pidfile pidfile ] [--user user[.group] ] [--chroot ] [--pre-chroot-nslookup hostname ] [configfile ] -

-  -

OPTIONS

+
-

+

SYNOPSIS

+
+       privoxy   [--help   ]  [--version   ]  [--no-daemon  ] [--pidfile pidfile ]
+       [--user user[.group] ] [--chroot    ]  [--pre-chroot-nslookup  hostname  ]
+       [configfile ]
 
-Privoxy may be invoked with the following command line
-options:
-
-
--help
-Print brief usage info and exit. -
--version
-Print version info and exit. -
--no-daemon
-Don't become a daemon, i.e. don't fork and become process group -leader, don't detach from controlling tty, and do all logging there. -
--pidfile pidfile
-On startup, write the process ID to pidfile. -Delete the pidfile on exit. -Failure to create or delete the pidfile -is non-fatal. If no --pidfile option is given, no PID file will be used. -
--user user[.group]
-After (optionally) writing the PID file, assume the user ID of -user and the GID of -group, or, if the optional -group was not given, the default group of -user. Exit if the privileges are not -sufficient to do so. -
--chroot
-Before changing to the user ID given in the --user option, chroot to -that user's home directory, i.e. make the kernel pretend to the -Privoxy process that the directory tree starts -there. If set up carefully, this can limit the impact of possible -vulnerabilities in Privoxy to the files contained in -that hierarchy. -
--pre-chroot-nslookup hostname
-Initialize the resolver library using hostname -before chroot'ing. On some systems this reduces the number of files -that must be copied into the chroot tree. -
-

-If the configfile is not specified on the command line, -Privoxy will look for a file named -config in the current directory. If no -configfile is found, Privoxy will -fail to start. -  -

DESCRIPTION

-

+

-Privoxy is a non-caching web proxy with advanced filtering capabilities -for enhancing privacy, modifying web page data and HTTP headers, controlling -access, and removing ads and other obnoxious Internet junk. Privoxy has a -flexible configuration and can be customized to suit individual needs and tastes. -It has application for both stand-alone systems and multi-user networks. -

+

OPTIONS

+
+       Privoxy may be invoked with the following command line options:
 
-Privoxy is Free Software and licensed under the GPL2.
- 
-

INSTALLATION AND USAGE

+ --help Print brief usage info and exit. -

+ --version + Print version info and exit. -Browsers can either be individually configured to use -Privoxy as a HTTP proxy (recommended), -or Privoxy can be combined with a packet -filter to build an intercepting proxy -(see config). The default setting is for -localhost, on port 8118 (configurable in the main config file). To set the -HTTP proxy in Firefox, go through: Tools; -Options; General; -Connection Settings; -Manual Proxy Configuration. -

+ --no-daemon + Don't become a daemon, i.e. don't fork and become process + group leader, don't detach from controlling tty, and do all log- + ging there. -For Internet Explorer, go through: Tools; -Internet Properties; Connections; -LAN Settings. -

+ --pidfile pidfile + On startup, write the process ID to pidfile. Delete the pidfile + on exit. Failure to create or delete the pidfile is non-fatal. + If no --pidfile option is given, no PID file will be used. -The Secure (SSL) Proxy should also be set to the same values, otherwise -https: URLs will not be proxied. Note: Privoxy can only -proxy HTTP and HTTPS traffic. Do not try it with FTP or other protocols. -HTTPS presents some limitations, and not all features will work with HTTPS -connections. -

+ --user user[.group] + After (optionally) writing the PID file, assume the user ID of + user and the GID of group, or, if the optional group was not + given, the default group of user. Exit if the privileges are not + sufficient to do so. -For other browsers, check the documentation. -  -

CONFIGURATION

+ --chroot + Before changing to the user ID given in the --user option, + chroot to that user's home directory, i.e. make the kernel pre- + tend to the Privoxy process that the directory tree starts + there. If set up carefully, this can limit the impact of possi- + ble vulnerabilities in Privoxy to the files contained in that + hierarchy. -

+ --pre-chroot-nslookup hostname + Initialize the resolver library using hostname before + chroot'ing. On some systems this reduces the number of files + that must be copied into the chroot tree. -Privoxy can be configured with the various configuration -files. The default configuration files are: config, -default.filter, default.action and -default.action. user.action should -be used for locally defined exceptions to the default rules in -match-all.action and default.action, -and user.filter for locally defined filters. These are -well commented. On Unix and Unix-like systems, these are located in -/etc/privoxy/ by default. -

+ If the configfile is not specified on the command line, Privoxy + will look for a file named config in the current directory. If no con- + figfile is found, Privoxy will fail to start. -Privoxy uses the concept of actions -in order to manipulate the data stream between the browser and remote sites. -There are various actions available with specific functions for such things -as blocking web sites, managing cookies, etc. These actions can be invoked -individually or combined, and used against individual URLs, or groups of URLs -that can be defined using wildcards and regular expressions. The result is -that the user has greatly enhanced control and freedom. -

-The actions list (ad blocks, etc) can also be configured with your -web browser at http://config.privoxy.org/ -(assuming the configuration allows it). -Privoxy's configuration parameters can also be viewed at -the same page. In addition, Privoxy can be toggled on/off. -This is an internal page, and does not require Internet access. -

+

-See the User Manual for a detailed -explanation of installation, general usage, all configuration options, new -features and notes on upgrading. -  -

FILES

+

DESCRIPTION

+
+       Privoxy is a non-caching web proxy with advanced filtering capabilities
+       for enhancing privacy, modifying web page data and HTTP  headers,  con-
+       trolling  access,  and  removing ads and other obnoxious Internet junk.
+       Privoxy has a flexible configuration and  can  be  customized  to  suit
 
-

-

- 
- /usr/sbin/privoxy
- /etc/privoxy/config
- /etc/privoxy/match-all.action
- /etc/privoxy/default.action
- /etc/privoxy/user.action
- /etc/privoxy/default.filter
- /etc/privoxy/user.filter
- /etc/privoxy/trust
- /etc/privoxy/templates/*
- /var/log/privoxy/logfile
-
-

+

-Various other files should be included, but may vary depending on platform -and build configuration. Additional documentation should be included in the local -documentation directory. -  -

SIGNALS

+

INSTALLATION AND USAGE

+
+       Browsers can either be individually configured to use Privoxy as  a HTTP
+       proxy (recommended), or Privoxy can be combined with a packet filter to
+       build  an intercepting proxy (see config).  The default setting is  for
+       localhost,  on port  8118 (configurable in the main config  file).   To
+       set  the  HTTP  proxy  in Firefox, go through: Tools; Options; General;
+       Connection Settings; Manual Proxy Configuration.
 
-

+ For Internet Explorer, go through: Tools; Internet Properties; Connec- + tions; LAN Settings. -Privoxy terminates on the SIGINT, -SIGTERM and SIGABRT signals. Log -rotation scripts may cause a re-opening of the logfile by sending a -SIGHUP to Privoxy. Note that unlike -other daemons, Privoxy does not need to be made aware of -config file changes by SIGHUP -- it will detect them -automatically. -  -

NOTES

+ The Secure (SSL) Proxy should also be set to the same values, otherwise + https: URLs will not be proxied. Note: Privoxy can only proxy HTTP and + HTTPS traffic. Do not try it with FTP or other protocols. HTTPS + presents some limitations, and not all features will work with HTTPS + connections. -

+ For other browsers, check the documentation. -Please see the User Manual on how to contact the -developers, for feature requests, reporting problems, and other questions. -  -

SEE ALSO

-

+

-Other references and sites of interest to Privoxy -users: -

+

CONFIGURATION

+
+       Privoxy   can  be  configured  with the various configuration files. The
+       default configuration files are: config,  default.filter,  default.action
+       and  default.action.  user.action  should  be  used for locally defined
+       exceptions to the default rules in match-all.action and default.action,
+       and  user.filter  for locally defined filters. These are well commented.
+       On Unix and Unix-like systems, these are located  in  /etc/privoxy/  by
+       default.
 
-

-http://www.privoxy.org/, -the Privoxy Home page. -

-http://www.privoxy.org/faq/, -the Privoxy FAQ. -

-http://www.privoxy.org/developer-manual/, -the Privoxy developer manual. -

-https://sourceforge.net/projects/ijbswa/, -the Project Page for Privoxy on -SourceForge. -

-http://config.privoxy.org/, -the web-based user interface. Privoxy must be -running for this to work. Shortcut: http://p.p/ -

-https://sourceforge.net/tracker/?group_id=11118&atid=460288, to submit ``misses'' and other -configuration related suggestions to the developers. -  -

DEVELOPMENT TEAM

+ Privoxy uses the concept of actions in order to manipulate the data + stream between the browser and remote sites. There are various actions + available with specific functions for such things as blocking web + sites, managing cookies, etc. These actions can be invoked individually + or combined, and used against individual URLs, or groups of URLs that + can be defined using wildcards and regular expressions. The result is + that the user has greatly enhanced control and freedom. -

-

- Fabian Keil, lead developer
- David Schmidt, developer
+       The  actions list (ad blocks, etc) can also be configured with your web
+       browser  at  http://config.privoxy.org/  (assuming  the   configuration
+       allows it).  Privoxy's configuration parameters   can also  be viewed at
+       the same page. In addition, Privoxy can be toggled on/off.  This  is  an
+       internal page, and does not require Internet access.
 
- Hal Burgiss
- Mark Miller
- Gerry Murphy
- Lee Rian
- Roland Rosenfeld
- Jörg Strohmayer
-
+ See the User Manual for a detailed explanation of installation, general + usage, all configuration options, new features and notes on upgrading. -  -

COPYRIGHT AND LICENSE

-  -

COPYRIGHT

+
-

+

FILES

+
+    /usr/sbin/privoxy
+    /etc/privoxy/config
+    /etc/privoxy/match-all.action
+    /etc/privoxy/default.action
+    /etc/privoxy/user.action
+    /etc/privoxy/default.filter
+       detect them automatically.
 
-Copyright (C) 2001-2009 by Privoxy Developers <ijbswa-developers@lists.sourceforge.net>
-

-Some source code is based on code Copyright (C) 1997 by Anonymous Coders -and Junkbusters, Inc. and licensed under the GNU General Public -License. -  -

LICENSE

+
-

+

NOTES

+
+       This  is  a  UNRELEASED  version  of Privoxy. Not all features are well
+       tested.
 
-Privoxy is free software; you can
-redistribute it and/or modify it under the terms of the 
-GNU General Public License, version 2,
-as published by the Free Software Foundation.
-

+ Please see the User Manual on how to contact the developers, for fea- + ture requests, reporting problems, and other questions. -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. -

-You should have received a copy of the GNU GPL -along with this program; if not, write to the Free Software -Foundation, Inc. 51 Franklin Street, Fifth Floor -Boston, MA 02110-1301 -USA -

+

-
- 

Index

-
-
NAME
-
SYNOPSIS
-
OPTIONS
-
DESCRIPTION
-
INSTALLATION AND USAGE
-
CONFIGURATION
-
FILES
-
SIGNALS
-
NOTES
-
SEE ALSO
-
DEVELOPMENT TEAM
-
COPYRIGHT AND LICENSE
-
-
COPYRIGHT
-
LICENSE
-
-
-
-This document was created by -man2html, -using the manual pages.
-Time: 11:32:52 GMT, March 21, 2009 - - +

SEE ALSO

+
+       Other references and sites of interest to Privoxy users:
+
+
+       http://www.privoxy.org/, the Privoxy Home page.
+
+       http://www.privoxy.org/faq/, the Privoxy  FAQ.
+
+       http://www.privoxy.org/developer-manual/, the Privoxy developer manual.
+
+       https://sourceforge.net/projects/ijbswa/, the Project Page for  Privoxy
+       on SourceForge.
+
+       http://config.privoxy.org/,  the web-based user interface. Privoxy must
+       be running for this to work. Shortcut: http://p.p/
+
+       https://sourceforge.net/tracker/?group_id=11118&atid=460288, to  submit
+       ``misses''  and other configuration related suggestions to the develop-
+       ers.
+
+
+
+ +

DEVELOPMENT TEAM

+
+    Fabian Keil, lead developer
+    David Schmidt, developer
+
+    Hal Burgiss
+    Lee Rian
+    Roland Rosenfeld
+
+
+
+ +

COPYRIGHT AND LICENSE

+
+   COPYRIGHT
+       Copyright  (C)  2001-2011  by   Privoxy   Developers   <ijbswa-develop-
+       ers@lists.sourceforge.net>
+
+       Some  source  code  is  based  on  code Copyright (C) 1997 by Anonymous
+       Coders and Junkbusters, Inc. and licensed under the GNU General    Public
+       License.
+
+   LICENSE
+       Privoxy   is  free  software;  you  can redistribute it and/or modify it
+       under the terms of the GNU General Public License, version 2,  as  pub-
+       lished by the Free Software Foundation.
+
+ + diff --git a/external/privoxy/doc/webserver/privoxy-index.html b/external/privoxy/doc/webserver/privoxy-index.html index 22cec35b..4bde44a2 100644 --- a/external/privoxy/doc/webserver/privoxy-index.html +++ b/external/privoxy/doc/webserver/privoxy-index.html @@ -1,283 +1,185 @@ - -Privoxy - The Privacy Enhancing Proxy - -

Privoxy - The Privacy Enhancing Proxy

Project Index Page v3.0.12

Privoxy is a non-caching web proxy with advanced filtering capabilities - for enhancing privacy, modifying web page data and HTTP headers, controlling - access, and removing ads and other obnoxious Internet junk. Privoxy has a - flexible configuration and can be customized to suit individual needs and tastes. - It has application for both stand-alone systems and multi-user networks.

Privoxy is Free Software and licensed under the GPL2.

Privoxy is an associated project of Software in the Public Interest (SPI). - Donations are welcome.



Copyright © 2001-2009 by Privoxy Developers -

\ No newline at end of file + + + + + + + Privoxy - The Privacy Enhancing Proxy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

Privoxy - The Privacy + Enhancing Proxy

+ +

Project Index Page v3.0.19

+ +
+ + +

Privoxy is a non-caching web proxy with advanced filtering + capabilities for enhancing privacy, modifying web page data and HTTP + headers, controlling access, and removing ads and other obnoxious + Internet junk. Privoxy has a flexible configuration and can be + customized to suit individual needs and tastes. It has application + for both stand-alone systems and multi-user networks.

+ +

Privoxy is Free Software and licensed under the GNU GPLv2.

+ +

Privoxy is an associated project of Software in the Public + Interest (SPI).

+ +

Helping hands and donations are welcome:

+ + +
+
+
+ + + + + + + +
+
+ +

+ +

Copyright © 2001-2010 by Privoxy Developers

+
+
+ + diff --git a/external/privoxy/doc/webserver/team/index.html b/external/privoxy/doc/webserver/team/index.html index 2903bcf5..168c9637 100644 --- a/external/privoxy/doc/webserver/team/index.html +++ b/external/privoxy/doc/webserver/team/index.html @@ -1,26 +1,52 @@ + + - - + + + + Privoxy - Team Photos - - -

Privoxy - Team Photos

+ + + + +

Privoxy - Team Photos


+

In our day jobs, we're all models ;-)

+ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + +
- + diff --git a/external/privoxy/doc/webserver/user-manual/actions-file.html b/external/privoxy/doc/webserver/user-manual/actions-file.html index be87aa77..45461131 100644 --- a/external/privoxy/doc/webserver/user-manual/actions-file.html +++ b/external/privoxy/doc/webserver/user-manual/actions-file.html @@ -1,2238 +1,1301 @@ - -Actions Files - -
Privoxy 3.0.12 User Manual
PrevNext

8. Actions Files

The actions files are used to define what actions - Privoxy takes for which URLs, and thus determines - how ad images, cookies and various other aspects of HTTP content and - transactions are handled, and on which sites (or even parts thereof). - There are a number of such actions, with a wide range of functionality. - Each action does something a little different. - These actions give us a veritable arsenal of tools with which to exert - our control, preferences and independence. Actions can be combined so that - their effects are aggregated when applied against a given set of URLs.

There - are three action files included with Privoxy with - differing purposes:

  • match-all.action - is used to define which - "actions" relating to banner-blocking, images, pop-ups, - content modification, cookie handling etc should be applied by default. - It should be the first actions file loaded -

  • default.action - defines many exceptions (both - positive and negative) from the default set of actions that's configured - in match-all.action. It is a set of rules that should - work reasonably well as-is for most users. This file is only supposed to - be edited by the developers. It should be the second actions file loaded. -

  • user.action - is intended to be for local site - preferences and exceptions. As an example, if your ISP or your bank - has specific requirements, and need special handling, this kind of - thing should go here. This file will not be upgraded. -

  • Edit Set to Cautious Set to Medium Set to Advanced -

    These have increasing levels of aggressiveness and have no - influence on your browsing unless you select them explicitly in the - editor. A default installation should be pre-set to - Cautious. New users should try this for a while before - adjusting the settings to more aggressive levels. The more aggressive - the settings, then the more likelihood there is of problems such as sites - not working as they should. -

    The Edit button allows you to turn each - action on/off individually for fine-tuning. The Cautious - button changes the actions list to low/safe settings which will activate - ad blocking and a minimal set of Privoxy's features, and subsequently - there will be less of a chance for accidental problems. The - Medium button sets the list to a medium level of - other features and a low level set of privacy features. The - Advanced button sets the list to a high level of - ad blocking and medium level of privacy. See the chart below. The latter - three buttons over-ride any changes via with the - Edit button. More fine-tuning can be done in the - lower sections of this internal page. -

    While the actions file editor allows to enable these settings in all - actions files, they are only supposed to be enabled in the first one - to make sure you don't unintentionally overrule earlier rules. -

    The default profiles, and their associated actions, as pre-defined in - default.action are: -

    Table 1. Default Configurations

    FeatureCautiousMediumAdvanced
    Ad-blocking Aggressivenessmediumhighhigh
    Ad-filtering by sizenoyesyes
    Ad-filtering by linknonoyes
    Pop-up killingblocks onlyblocks onlyblocks only
    Privacy Featureslowmediummedium/high
    Cookie handlingnonesession-onlykill
    Referer forgingnoyesyes
    GIF de-animationnoyesyes
    Fast redirectsnonoyes
    HTML tamingnonoyes
    JavaScript tamingnonoyes
    Web-bug killingnoyesyes
    Image tag reorderingnoyesyes
    -

The list of actions files to be used are defined in the main configuration - file, and are processed in the order they are defined (e.g. - default.action is typically processed before - user.action). The content of these can all be viewed and - edited from http://config.privoxy.org/show-status. - The over-riding principle when applying actions, is that the last action that - matches a given URL wins. The broadest, most general rules go first - (defined in default.action), - followed by any exceptions (typically also in - default.action), which are then followed lastly by any - local preferences (typically in user.action). - Generally, user.action has the last word. -

An actions file typically has multiple sections. If you want to use - "aliases" in an actions file, you have to place the (optional) - alias section at the top of that file. - Then comes the default set of rules which will apply universally to all - sites and pages (be very careful with using such a - universal set in user.action or any other actions file after - default.action, because it will override the result - from consulting any previous file). And then below that, - exceptions to the defined universal policies. You can regard - user.action as an appendix to default.action, - with the advantage that it is a separate file, which makes preserving your - personal settings across Privoxy upgrades easier.

- Actions can be used to block anything you want, including ads, banners, or - just some obnoxious URL whose content you would rather not see. Cookies can be accepted - or rejected, or accepted only during the current browser session (i.e. not - written to disk), content can be modified, some JavaScripts tamed, user-tracking - fooled, and much more. See below for a complete list - of actions.

8.1. Finding the Right Mix

Note that some actions, like cookie suppression - or script disabling, may render some sites unusable that rely on these - techniques to work properly. Finding the right mix of actions is not always easy and - certainly a matter of personal taste. And, things can always change, requiring - refinements in the configuration. In general, it can be said that the more - "aggressive" your default settings (in the top section of the - actions file) are, the more exceptions for "trusted" sites you - will have to make later. If, for example, you want to crunch all cookies per - default, you'll have to make exceptions from that rule for sites that you - regularly use and that require cookies for actually useful purposes, like maybe - your bank, favorite shop, or newspaper.

We have tried to provide you with reasonable rules to start from in the - distribution actions files. But there is no general rule of thumb on these - things. There just are too many variables, and sites are constantly changing. - Sooner or later you will want to change the rules (and read this chapter again :).

8.2. How to Edit

The easiest way to edit the actions files is with a browser by - using our browser-based editor, which can be reached from http://config.privoxy.org/show-status. - Note: the config file option enable-edit-actions must be enabled for - this to work. The editor allows both fine-grained control over every single - feature on a per-URL basis, and easy choosing from wholesale sets of defaults - like "Cautious", "Medium" or - "Advanced". Warning: the "Advanced" setting is more - aggressive, and will be more likely to cause problems for some sites. - Experienced users only! -

If you prefer plain text editing to GUIs, you can of course also directly edit the - the actions files with your favorite text editor. Look at - default.action which is richly commented with many - good examples.

8.3. How Actions are Applied to Requests

Actions files are divided into sections. There are special sections, - like the "alias" sections which will - be discussed later. For now let's concentrate on regular sections: They have a - heading line (often split up to multiple lines for readability) which consist - of a list of actions, separated by whitespace and enclosed in curly braces. - Below that, there is a list of URL and tag patterns, each on a separate line.

To determine which actions apply to a request, the URL of the request is - compared to all URL patterns in each "action file". - Every time it matches, the list of applicable actions for the request is - incrementally updated, using the heading of the section in which the - pattern is located. The same is done again for tags and tag patterns later on.

If multiple applying sections set the same action differently, - the last match wins. If not, the effects are aggregated. - E.g. a URL might match a regular section with a heading line of { - +handle-as-image }, - then later another one with just { - +block }, resulting - in both actions to apply. And there may well be - cases where you will want to combine actions together. Such a section then - might look like:

+ +
  { +handle-as-image  +block{Banner ads.} }
+
+
+
+
+  
+
+  Actions Files
+  
+  
+  
+  
+  
+  
+  
+  
+
+
+
+  
+
+  
+

8. Actions + Files

+ +

The actions files are used to define what actions Privoxy takes for which URLs, and thus determines + how ad images, cookies and various other aspects of HTTP content and + transactions are handled, and on which sites (or even parts thereof). + There are a number of such actions, with a wide range of functionality. + Each action does something a little different. These actions give us a + veritable arsenal of tools with which to exert our control, preferences + and independence. Actions can be combined so that their effects are + aggregated when applied against a given set of URLs.

+ +

There are three action files included with Privoxy with differing purposes:

+ +
    +
  • +

    match-all.action - is used to define + which "actions" relating to + banner-blocking, images, pop-ups, content modification, cookie + handling etc should be applied by default. It should be the first + actions file loaded

    +
  • + +
  • +

    default.action - defines many exceptions + (both positive and negative) from the default set of actions that's + configured in match-all.action. It is a set + of rules that should work reasonably well as-is for most users. This + file is only supposed to be edited by the developers. It should be + the second actions file loaded.

    +
  • + +
  • +

    user.action - is intended to be for + local site preferences and exceptions. As an example, if your ISP or + your bank has specific requirements, and need special handling, this + kind of thing should go here. This file will not be upgraded.

    +
  • + +
  • +

    Edit Set to + Cautious Set to Medium + Set to Advanced

    + +

    These have increasing levels of aggressiveness and have no influence on your browsing unless + you select them explicitly in the editor. A default + installation should be pre-set to Cautious. + New users should try this for a while before adjusting the settings + to more aggressive levels. The more aggressive the settings, then the + more likelihood there is of problems such as sites not working as + they should.

    + +

    The Edit button allows you to turn + each action on/off individually for fine-tuning. The Cautious button changes the actions list to + low/safe settings which will activate ad blocking and a minimal set + of Privoxy's features, and + subsequently there will be less of a chance for accidental problems. + The Medium button sets the list to a + medium level of other features and a low level set of privacy + features. The Advanced button sets the + list to a high level of ad blocking and medium level of privacy. See + the chart below. The latter three buttons over-ride any changes via + with the Edit button. More fine-tuning + can be done in the lower sections of this internal page.

    + +

    While the actions file editor allows to enable these settings in + all actions files, they are only supposed to be enabled in the first + one to make sure you don't unintentionally overrule earlier + rules.

    + +

    The default profiles, and their associated actions, as pre-defined + in default.action are:

    + +
    + + +

    Table 1. Default Configurations

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FeatureCautiousMediumAdvanced
    Ad-blocking Aggressivenessmediumhighhigh
    Ad-filtering by sizenoyesyes
    Ad-filtering by linknonoyes
    Pop-up killingblocks onlyblocks onlyblocks only
    Privacy Featureslowmediummedium/high
    Cookie handlingnonesession-onlykill
    Referer forgingnoyesyes
    GIF de-animationnoyesyes
    Fast redirectsnonoyes
    HTML tamingnonoyes
    JavaScript tamingnonoyes
    Web-bug killingnoyesyes
    Image tag reorderingnoyesyes
    +
    +
  • +
+ +

The list of actions files to be used are defined in the main + configuration file, and are processed in the order they are defined (e.g. + default.action is typically processed before + user.action). The content of these can all be + viewed and edited from http://config.privoxy.org/show-status. The over-riding + principle when applying actions, is that the last action that matches a + given URL wins. The broadest, most general rules go first (defined in + default.action), followed by any exceptions + (typically also in default.action), which are + then followed lastly by any local preferences (typically in user.action). + Generally, user.action has the last word.

+ +

An actions file typically has multiple sections. If you want to use + "aliases" in an actions file, you have to + place the (optional) alias + section at the top of that file. Then comes the default set of rules + which will apply universally to all sites and pages (be very careful with using such a universal + set in user.action or any other actions file + after default.action, because it will override + the result from consulting any previous file). And then below that, + exceptions to the defined universal policies. You can regard user.action as an appendix to default.action, with the advantage that it is a separate + file, which makes preserving your personal settings across Privoxy upgrades easier.

+ +

Actions can be used to block anything you want, including ads, + banners, or just some obnoxious URL whose content you would rather not + see. Cookies can be accepted or rejected, or accepted only during the + current browser session (i.e. not written to disk), content can be + modified, some JavaScripts tamed, user-tracking fooled, and much more. + See below for a complete list of + actions.

+ +
+

8.1. Finding the Right + Mix

+ +

Note that some actions, like + cookie suppression or script disabling, may render some sites unusable + that rely on these techniques to work properly. Finding the right mix + of actions is not always easy and certainly a matter of personal taste. + And, things can always change, requiring refinements in the + configuration. In general, it can be said that the more "aggressive" your default settings (in the top section + of the actions file) are, the more exceptions for "trusted" sites you will have to make later. If, for + example, you want to crunch all cookies per default, you'll have to + make exceptions from that rule for sites that you regularly use and + that require cookies for actually useful purposes, like maybe your + bank, favorite shop, or newspaper.

+ +

We have tried to provide you with reasonable rules to start from in + the distribution actions files. But there is no general rule of thumb + on these things. There just are too many variables, and sites are + constantly changing. Sooner or later you will want to change the rules + (and read this chapter again :).

+
+ +
+

8.2. How to + Edit

+ +

The easiest way to edit the actions files is with a browser by using + our browser-based editor, which can be reached from http://config.privoxy.org/show-status. Note: the config file + option enable-edit-actions must be + enabled for this to work. The editor allows both fine-grained control + over every single feature on a per-URL basis, and easy choosing from + wholesale sets of defaults like "Cautious", + "Medium" or "Advanced". Warning: the "Advanced" setting is more aggressive, and will be more + likely to cause problems for some sites. Experienced users only!

+ +

If you prefer plain text editing to GUIs, you can of course also + directly edit the the actions files with your favorite text editor. + Look at default.action which is richly + commented with many good examples.

+
+ +
+

8.3. How + Actions are Applied to Requests

+ +

Actions files are divided into sections. There are special sections, + like the "alias" sections which will be + discussed later. For now let's concentrate on regular sections: They + have a heading line (often split up to multiple lines for readability) + which consist of a list of actions, separated by whitespace and + enclosed in curly braces. Below that, there is a list of URL and tag + patterns, each on a separate line.

+ +

To determine which actions apply to a request, the URL of the + request is compared to all URL patterns in each "action file". Every time it matches, the list of + applicable actions for the request is incrementally updated, using the + heading of the section in which the pattern is located. The same is + done again for tags and tag patterns later on.

+ +

If multiple applying sections set the same action differently, the + last match wins. If not, the effects are aggregated. E.g. a URL might + match a regular section with a heading line of { + +handle-as-image + }, then later another one with just { + +block }, resulting in + both actions to apply. And + there may well be cases where you will want to combine actions + together. Such a section then might look like:

+ + + +
+
+  { +handle-as-image  +block{Banner ads.} }
   # Block these as if they were images. Send no block page.
    banners.example.com
    media.example.com/.*banners
-   .example.com/images/ads/
-

You can trace this process for URL patterns and any given URL by visiting http://config.privoxy.org/show-url-info.

Examples and more detail on this is provided in the Appendix, Troubleshooting: Anatomy of an Action section.

8.4. Patterns

- As mentioned, Privoxy uses "patterns" - to determine what actions might apply to which sites and - pages your browser attempts to access. These "patterns" use wild - card type pattern matching to achieve a high degree of - flexibility. This allows one expression to be expanded and potentially match - against many similar patterns.

Generally, an URL pattern has the form - <domain>/<path>, where both the - <domain> and <path> are - optional. (This is why the special / pattern matches all - URLs). Note that the protocol portion of the URL pattern (e.g. - http://) should not be included in - the pattern. This is assumed already!

The pattern matching syntax is different for the domain and path parts of - the URL. The domain part uses a simple globbing type matching technique, - while the path part uses more flexible - "Regular - Expressions" (POSIX 1003.2).

www.example.com/

is a domain-only pattern and will match any request to www.example.com, - regardless of which document on that server is requested. So ALL pages in - this domain would be covered by the scope of this action. Note that a - simple example.com is different and would NOT match. -

www.example.com

means exactly the same. For domain-only patterns, the trailing / may - be omitted. -

www.example.com/index.html

matches all the documents on www.example.com - whose name starts with /index.html. -

www.example.com/index.html$

matches only the single document /index.html - on www.example.com. -

/index.html$

matches the document /index.html, regardless of the domain, - i.e. on any web server anywhere. -

index.html

matches nothing, since it would be interpreted as a domain name and - there is no top-level domain called .html. So its - a mistake. -

8.4.1. The Domain Pattern

The matching of the domain part offers some flexible options: if the - domain starts or ends with a dot, it becomes unanchored at that end. - For example:

.example.com

matches any domain with first-level domain com - and second-level domain example. - For example www.example.com, - example.com and foo.bar.baz.example.com. - Note that it wouldn't match if the second-level domain was another-example. -

www.

matches any domain that STARTS with - www. (It also matches the domain - www but most of the time that doesn't matter.) -

.example.

matches any domain that CONTAINS .example.. - And, by the way, also included would be any files or documents that exist - within that domain since no path limitations are specified. (Correctly - speaking: It matches any FQDN that contains example as - a domain.) This might be www.example.com, - news.example.de, or - www.example.net/cgi/testing.pl for instance. All these - cases are matched. -

Additionally, there are wild-cards that you can use in the domain names - themselves. These work similarly to shell globbing type wild-cards: - "*" represents zero or more arbitrary characters (this is - equivalent to the - "Regular - Expression" based syntax of ".*"), - "?" represents any single character (this is equivalent to the - regular expression syntax of a simple "."), and you can define - "character classes" in square brackets which is similar to - the same regular expression technique. All of this can be freely mixed:

ad*.example.com

matches "adserver.example.com", - "ads.example.com", etc but not "sfads.example.com" -

*ad*.example.com

matches all of the above, and then some. -

.?pix.com

matches www.ipix.com, - pictures.epix.com, a.b.c.d.e.upix.com etc. -

www[1-9a-ez].example.c*

matches www1.example.com, - www4.example.cc, wwwd.example.cy, - wwwz.example.com etc., but not - wwww.example.com. -

While flexible, this is not the sophistication of full regular expression based syntax.

8.4.2. The Path Pattern

Privoxy uses "modern" POSIX 1003.2 - "Regular - Expressions" for matching the path portion (after the slash), - and is thus more flexible.

There is an Appendix with a brief quick-start into regular - expressions, you also might want to have a look at your operating system's documentation - on regular expressions (try man re_format).

Note that the path pattern is automatically left-anchored at the "/", - i.e. it matches as if it would start with a "^" (regular expression speak - for the beginning of a line).

Please also note that matching in the path is CASE INSENSITIVE - by default, but you can switch to case sensitive at any point in the pattern by using the - "(?-i)" switch: www.example.com/(?-i)PaTtErN.* will match - only documents whose path starts with PaTtErN in - exactly this capitalization.

.example.com/.*

Is equivalent to just ".example.com", since any documents - within that domain are matched with or without the ".*" - regular expression. This is redundant -

.example.com/.*/index.html$

Will match any page in the domain of "example.com" that is - named "index.html", and that is part of some path. For - example, it matches "www.example.com/testing/index.html" but - NOT "www.example.com/index.html" because the regular - expression called for at least two "/'s", thus the path - requirement. It also would match - "www.example.com/testing/index_html", because of the - special meta-character ".". -

.example.com/(.*/)?index\.html$

This regular expression is conditional so it will match any page - named "index.html" regardless of path which in this case can - have one or more "/'s". And this one must contain exactly - ".html" (but does not have to end with that!). -

.example.com/(.*/)(ads|banners?|junk)

This regular expression will match any path of "example.com" - that contains any of the words "ads", "banner", - "banners" (because of the "?") or "junk". - The path does not have to end in these words, just contain them. -

.example.com/(.*/)(ads|banners?|junk)/.*\.(jpe?g|gif|png)$

This is very much the same as above, except now it must end in either - ".jpg", ".jpeg", ".gif" or ".png". So this - one is limited to common image formats. -

There are many, many good examples to be found in default.action, - and more tutorials below in Appendix on regular expressions.

8.4.3. The Tag Pattern

Tag patterns are used to change the applying actions based on the - request's tags. Tags can be created with either the - client-header-tagger - or the server-header-tagger action.

Tag patterns have to start with "TAG:", so Privoxy - can tell them apart from URL patterns. Everything after the colon - including white space, is interpreted as a regular expression with - path pattern syntax, except that tag patterns aren't left-anchored - automatically (Privoxy doesn't silently add a "^", - you have to do it yourself if you need it).

To match all requests that are tagged with "foo" - your pattern line should be "TAG:^foo$", - "TAG:foo" would work as well, but it would also - match requests whose tags contain "foo" somewhere. - "TAG: foo" wouldn't work as it requires white space.

Sections can contain URL and tag patterns at the same time, - but tag patterns are checked after the URL patterns and thus - always overrule them, even if they are located before the URL patterns.

Once a new tag is added, Privoxy checks right away if it's matched by one - of the tag patterns and updates the action settings accordingly. As a result - tags can be used to activate other tagger actions, as long as these other - taggers look for headers that haven't already be parsed.

For example you could tag client requests which use the - POST method, - then use this tag to activate another tagger that adds a tag if cookies - are sent, and then use a block action based on the cookie tag. This allows - the outcome of one action, to be input into a subsequent action. However if - you'd reverse the position of the described taggers, and activated the - method tagger based on the cookie tagger, no method tags would be created. - The method tagger would look for the request line, but at the time - the cookie tag is created, the request line has already been parsed.

While this is a limitation you should be aware of, this kind of - indirection is seldom needed anyway and even the example doesn't - make too much sense.

8.5. Actions

All actions are disabled by default, until they are explicitly enabled - somewhere in an actions file. Actions are turned on if preceded with a - "+", and turned off if preceded with a "-". So a - +action means "do that action", e.g. - +block means "please block URLs that match the - following patterns", and -block means "don't - block URLs that match the following patterns, even if +block - previously applied."

- Again, actions are invoked by placing them on a line, enclosed in curly braces and - separated by whitespace, like in - {+some-action -some-other-action{some-parameter}}, - followed by a list of URL patterns, one per line, to which they apply. - Together, the actions line and the following pattern lines make up a section - of the actions file.

- Actions fall into three categories:

  • - Boolean, i.e the action can only be "enabled" or - "disabled". Syntax: -

      +name        # enable action name
    -  -name        # disable action name
    -

    - Example: +handle-as-image -

  • - Parameterized, where some value is required in order to enable this type of action. - Syntax: -

    + +
      +name{param}  # enable action and set parameter to param,
    +   .example.com/images/ads/
    +
    +
    + +

    You can trace this process for URL patterns and any given URL by + visiting http://config.privoxy.org/show-url-info.

    + +

    Examples and more detail on this is provided in the Appendix, + Troubleshooting: Anatomy of an + Action section.

    +
+ +
+

8.4. + Patterns

+ +

As mentioned, Privoxy uses + "patterns" to determine what actions might apply to which sites and + pages your browser attempts to access. These "patterns" use wild card type pattern matching to achieve a high degree + of flexibility. This allows one expression to be expanded and + potentially match against many similar patterns.

+ +

Generally, an URL pattern has the form <domain><port>/<path>, where the + <domain>, the <port> and the <path> are optional. (This is why the special + / pattern matches all URLs). Note that the + protocol portion of the URL pattern (e.g. http://) should not be included in the pattern. This is + assumed already!

+ +

The pattern matching syntax is different for the domain and path + parts of the URL. The domain part uses a simple globbing type matching + technique, while the path part uses more flexible "Regular Expressions" (POSIX + 1003.2).

+ +

The port part of a pattern is a decimal port number preceded by a + colon (:). If the domain part contains a + numerical IPv6 address, it has to be put into angle brackets + (<, >).

+ +
+
+
www.example.com/
+ +
+

is a domain-only pattern and will match any request to + www.example.com, regardless of which + document on that server is requested. So ALL pages in this domain + would be covered by the scope of this action. Note that a simple + example.com is different and would NOT + match.

+
+ +
www.example.com
+ +
+

means exactly the same. For domain-only patterns, the trailing + / may be omitted.

+
+ +
www.example.com/index.html
+ +
+

matches all the documents on www.example.com whose name starts with /index.html.

+
+ +
www.example.com/index.html$
+ +
+

matches only the single document /index.html on www.example.com.

+
+ +
/index.html$
+ +
+

matches the document /index.html, + regardless of the domain, i.e. on any web server anywhere.

+
+ +
/
+ +
+

Matches any URL because there's no requirement for either the + domain or the path to match anything.

+
+ +
:8000/
+ +
+

Matches any URL pointing to TCP port 8000.

+
+ +
<2001:db8::1>/
+ +
+

Matches any URL with the host address 2001:db8::1. (Note that the real URL uses plain + brackets, not angle brackets.)

+
+ +
index.html
+ +
+

matches nothing, since it would be interpreted as a domain + name and there is no top-level domain called .html. So its a mistake.

+
+
+
+ +
+

8.4.1. The Domain + Pattern

+ +

The matching of the domain part offers some flexible options: if + the domain starts or ends with a dot, it becomes unanchored at that + end. For example:

+ +
+
+
.example.com
+ +
+

matches any domain with first-level domain com and second-level domain example. For example www.example.com, example.com and foo.bar.baz.example.com. Note that it wouldn't + match if the second-level domain was another-example.

+
+ +
www.
+ +
+

matches any domain that STARTS with www. (It also matches the domain www but most of the time that doesn't + matter.)

+
+ +
.example.
+ +
+

matches any domain that CONTAINS .example.. And, by the way, also included would + be any files or documents that exist within that domain since + no path limitations are specified. (Correctly speaking: It + matches any FQDN that contains example + as a domain.) This might be www.example.com, news.example.de, or www.example.net/cgi/testing.pl for instance. All + these cases are matched.

+
+
+
+ +

Additionally, there are wild-cards that you can use in the domain + names themselves. These work similarly to shell globbing type + wild-cards: "*" represents zero or more + arbitrary characters (this is equivalent to the "Regular Expression" based + syntax of ".*"), "?" represents any single character (this is + equivalent to the regular expression syntax of a simple "."), and you can define "character classes" in square brackets which is + similar to the same regular expression technique. All of this can be + freely mixed:

+ +
+
+
ad*.example.com
+ +
+

matches "adserver.example.com", + "ads.example.com", etc but not + "sfads.example.com"

+
+ +
*ad*.example.com
+ +
+

matches all of the above, and then some.

+
+ +
.?pix.com
+ +
+

matches www.ipix.com, pictures.epix.com, a.b.c.d.e.upix.com etc.

+
+ +
www[1-9a-ez].example.c*
+ +
+

matches www1.example.com, + www4.example.cc, wwwd.example.cy, wwwz.example.com etc., but not wwww.example.com.

+
+
+
+ +

While flexible, this is not the sophistication of full regular + expression based syntax.

+
+ +
+

8.4.2. The Path + Pattern

+ +

Privoxy uses "modern" POSIX 1003.2 "Regular Expressions" for + matching the path portion (after the slash), and is thus more + flexible.

+ +

There is an Appendix with a + brief quick-start into regular expressions, you also might want to + have a look at your operating system's documentation on regular + expressions (try man re_format).

+ +

Note that the path pattern is automatically left-anchored at the + "/", i.e. it matches as if it would start + with a "^" (regular expression speak for + the beginning of a line).

+ +

Please also note that matching in the path is CASE INSENSITIVE by default, but you + can switch to case sensitive at any point in the pattern by using the + "(?-i)" switch: www.example.com/(?-i)PaTtErN.* will match only + documents whose path starts with PaTtErN in + exactly this + capitalization.

+ +
+
+
.example.com/.*
+ +
+

Is equivalent to just ".example.com", since any documents within that + domain are matched with or without the ".*" regular expression. This is redundant

+
+ +
.example.com/.*/index.html$
+ +
+

Will match any page in the domain of "example.com" that is named "index.html", and that is part of some path. For + example, it matches "www.example.com/testing/index.html" but NOT + "www.example.com/index.html" because + the regular expression called for at least two "/'s", thus the path requirement. It also would + match "www.example.com/testing/index_html", because of + the special meta-character ".".

+
+ +
.example.com/(.*/)?index\.html$
+ +
+

This regular expression is conditional so it will match any + page named "index.html" regardless + of path which in this case can have one or more "/'s". And this one must contain exactly + ".html" (but does not have to end + with that!).

+
+ +
.example.com/(.*/)(ads|banners?|junk)
+ +
+

This regular expression will match any path of "example.com" that contains any of the words + "ads", "banner", "banners" + (because of the "?") or "junk". The path does not have to end in these + words, just contain them.

+
+ +
.example.com/(.*/)(ads|banners?|junk)/.*\.(jpe?g|gif|png)$
+ +
+

This is very much the same as above, except now it must end + in either ".jpg", ".jpeg", ".gif" or + ".png". So this one is limited to + common image formats.

+
+
+
+ +

There are many, many good examples to be found in default.action, and more tutorials below in Appendix on regular expressions.

+
+ +
+

8.4.3. The + Tag Pattern

+ +

Tag patterns are used to change the applying actions based on the + request's tags. Tags can be created with either the client-header-tagger or + the server-header-tagger + action.

+ +

Tag patterns have to start with "TAG:", + so Privoxy can tell them apart from + URL patterns. Everything after the colon including white space, is + interpreted as a regular expression with path pattern syntax, except + that tag patterns aren't left-anchored automatically (Privoxy doesn't silently add a "^", you have to do it yourself if you need it).

+ +

To match all requests that are tagged with "foo" your pattern line should be "TAG:^foo$", "TAG:foo" + would work as well, but it would also match requests whose tags + contain "foo" somewhere. "TAG: foo" wouldn't work as it requires white + space.

+ +

Sections can contain URL and tag patterns at the same time, but + tag patterns are checked after the URL patterns and thus always + overrule them, even if they are located before the URL patterns.

+ +

Once a new tag is added, Privoxy checks right away if it's matched + by one of the tag patterns and updates the action settings + accordingly. As a result tags can be used to activate other tagger + actions, as long as these other taggers look for headers that haven't + already be parsed.

+ +

For example you could tag client requests which use the POST method, then use this tag to activate another + tagger that adds a tag if cookies are sent, and then use a block + action based on the cookie tag. This allows the outcome of one + action, to be input into a subsequent action. However if you'd + reverse the position of the described taggers, and activated the + method tagger based on the cookie tagger, no method tags would be + created. The method tagger would look for the request line, but at + the time the cookie tag is created, the request line has already been + parsed.

+ +

While this is a limitation you should be aware of, this kind of + indirection is seldom needed anyway and even the example doesn't make + too much sense.

+
+
+ +
+

8.5. Actions

+ +

All actions are disabled by default, until they are explicitly + enabled somewhere in an actions file. Actions are turned on if preceded + with a "+", and turned off if preceded with + a "-". So a +action + means "do that action", e.g. +block means "please block URLs that + match the following patterns", and -block means "don't block URLs that + match the following patterns, even if +block + previously applied."

+ +

Again, actions are invoked by placing them on a line, enclosed in + curly braces and separated by whitespace, like in {+some-action -some-other-action{some-parameter}}, + followed by a list of URL patterns, one per line, to which they apply. + Together, the actions line and the following pattern lines make up a + section of the actions file.

+ +

Actions fall into three categories:

+ +
    +
  • +

    Boolean, i.e the action can only be "enabled" or "disabled". + Syntax:

    + + + + + +
    +
    +  +name        # enable action name
    +  -name        # disable action name
    +
    +
    + +

    Example: +handle-as-image

    +
  • + +
  • +

    Parameterized, where some value is required in order to enable + this type of action. Syntax:

    + + + +
    +
    +  +name{param}  # enable action and set parameter to param,
                    # overwriting parameter from previous match if necessary
    -  -name         # disable action. The parameter can be omitted
    -

    Note that if the URL matches multiple positive forms of a parameterized action, - the last match wins, i.e. the params from earlier matches are simply ignored. -

    - Example: +hide-user-agent{Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.4) Gecko/20070602 Firefox/2.0.0.4} -

  • - Multi-value. These look exactly like parameterized actions, - but they behave differently: If the action applies multiple times to the - same URL, but with different parameters, all the parameters - from all matches are remembered. This is used for actions - that can be executed for the same request repeatedly, like adding multiple - headers, or filtering through multiple filters. Syntax: -

    + +
      +name{param}   # enable action and add param to the list of parameters
    -  -name{param}   # remove the parameter param from the list of parameters
    +  -name         # disable action. The parameter can be omitted
    +
    +
    + +

    Note that if the URL matches multiple positive forms of a + parameterized action, the last match wins, i.e. the params from + earlier matches are simply ignored.

    + +

    Example: +hide-user-agent{Mozilla/5.0 (X11; + U; FreeBSD i386; en-US; rv:1.8.1.4) Gecko/20070602 + Firefox/2.0.0.4}

    +
  • + +
  • +

    Multi-value. These look exactly like parameterized actions, but + they behave differently: If the action applies multiple times to + the same URL, but with different parameters, all the parameters from all matches are remembered. This is + used for actions that can be executed for the same request + repeatedly, like adding multiple headers, or filtering through + multiple filters. Syntax:

    + + + +
    +
    +  +name{param}   # enable action and add param to the list of parameters
    +  -name{param}   # remove the parameter param from the list of parameters
                     # If it was the last one left, disable the action.
    -  -name          # disable this action completely and remove all parameters from the list
    -

    - Examples: +add-header{X-Fun-Header: Some text} and - +filter{html-annoyances} -

If nothing is specified in any actions file, no "actions" are - taken. So in this case Privoxy would just be a - normal, non-blocking, non-filtering proxy. You must specifically enable the - privacy and blocking features you need (although the provided default actions - files will give a good starting point).

Later defined action sections always over-ride earlier ones of the same type. - So exceptions to any rules you make, should come in the latter part of the file (or - in a file that is processed later when using multiple actions files such - as user.action). For multi-valued actions, the actions - are applied in the order they are specified. Actions files are processed in - the order they are defined in config (the default - installation has three actions files). It also quite possible for any given - URL to match more than one "pattern" (because of wildcards and - regular expressions), and thus to trigger more than one set of actions! Last - match wins.

The list of valid Privoxy actions are:

8.5.1. add-header

Typical use:

Confuse log analysis, custom applications

Effect:

Sends a user defined HTTP header to the web server. -

Type:

Multi-value.

Parameter:

Any string value is possible. Validity of the defined HTTP headers is not checked. - It is recommended that you use the "X-" prefix - for custom headers. -

Notes:

This action may be specified multiple times, in order to define multiple - headers. This is rarely needed for the typical user. If you don't know what - "HTTP headers" are, you definitely don't need to worry about this - one. -

Example usage:

+add-header{X-User-Tracking: sucks}
-

8.5.2. block

Typical use:

Block ads or other unwanted content

Effect:

Requests for URLs to which this action applies are blocked, i.e. the - requests are trapped by Privoxy and the requested URL is never retrieved, - but is answered locally with a substitute page or image, as determined by - the handle-as-image, - set-image-blocker, and - handle-as-empty-document actions. - -

Type:

Parameterized.

Parameter:

A block reason that should be given to the user.

Notes:

Privoxy sends a special "BLOCKED" page - for requests to blocked pages. This page contains the block reason given as - parameter, a link to find out why the block action applies, and a click-through - to the blocked content (the latter only if the force feature is available and - enabled). -

- A very important exception occurs if both - block and handle-as-image, - apply to the same request: it will then be replaced by an image. If - set-image-blocker - (see below) also applies, the type of image will be determined by its parameter, - if not, the standard checkerboard pattern is sent. -

It is important to understand this process, in order - to understand how Privoxy deals with - ads and other unwanted content. Blocking is a core feature, and one - upon which various other features depend. -

The filter - action can perform a very similar task, by "blocking" - banner images and other content through rewriting the relevant URLs in the - document's HTML source, so they don't get requested in the first place. - Note that this is a totally different technique, and it's easy to confuse the two. -

Example usage (section):

+ +
{+block{No nasty stuff for you.}}
+  -name          # disable this action completely and remove all parameters from the list
+
+
+ +

Examples: +add-header{X-Fun-Header: Some + text} and +filter{html-annoyances}

+ + + +

If nothing is specified in any actions file, no "actions" are taken. So in this case Privoxy would just be a normal, non-blocking, + non-filtering proxy. You must specifically enable the privacy and + blocking features you need (although the provided default actions files + will give a good starting point).

+ +

Later defined action sections always over-ride earlier ones of the + same type. So exceptions to any rules you make, should come in the + latter part of the file (or in a file that is processed later when + using multiple actions files such as user.action). For multi-valued actions, the actions are + applied in the order they are specified. Actions files are processed in + the order they are defined in config (the + default installation has three actions files). It also quite possible + for any given URL to match more than one "pattern" (because of wildcards and regular + expressions), and thus to trigger more than one set of actions! Last + match wins.

+ +

The list of valid Privoxy actions + are:

+ +
+

8.5.1. + add-header

+ +
+
+
Typical use:
+ +
+

Confuse log analysis, custom applications

+
+ +
Effect:
+ +
+

Sends a user defined HTTP header to the web server.

+
+ +
Type:
+ +
+

Multi-value.

+
+ +
Parameter:
+ +
+

Any string value is possible. Validity of the defined HTTP + headers is not checked. It is recommended that you use the + "X-" prefix + for custom headers.

+
+ +
Notes:
+ +
+

This action may be specified multiple times, in order to + define multiple headers. This is rarely needed for the typical + user. If you don't know what "HTTP + headers" are, you definitely don't need to worry about + this one.

+ +

Headers added by this action are not modified by other + actions.

+
+ +
Example usage:
+ +
+ + + + +
+
++add-header{X-User-Tracking: sucks}
+
+
+
+
+
+
+ +
+

8.5.2. block

+ +
+
+
Typical use:
+ +
+

Block ads or other unwanted content

+
+ +
Effect:
+ +
+

Requests for URLs to which this action applies are blocked, + i.e. the requests are trapped by Privoxy and the requested URL is never + retrieved, but is answered locally with a substitute page or + image, as determined by the handle-as-image, + set-image-blocker, + and handle-as-empty-document + actions.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

A block reason that should be given to the user.

+
+ +
Notes:
+ +
+

Privoxy sends a special + "BLOCKED" page for requests to + blocked pages. This page contains the block reason given as + parameter, a link to find out why the block action applies, and + a click-through to the blocked content (the latter only if the + force feature is available and enabled).

+ +

A very important exception occurs if both block and handle-as-image, + apply to the same request: it will then be replaced by an + image. If set-image-blocker + (see below) also applies, the type of image will be determined + by its parameter, if not, the standard checkerboard pattern is + sent.

+ +

It is important to understand this process, in order to + understand how Privoxy deals + with ads and other unwanted content. Blocking is a core + feature, and one upon which various other features depend.

+ +

The filter action can perform a + very similar task, by "blocking" + banner images and other content through rewriting the relevant + URLs in the document's HTML source, so they don't get requested + in the first place. Note that this is a totally different + technique, and it's easy to confuse the two.

+
+ +
Example usage (section):
+ +
+ + +
+
+{+block{No nasty stuff for you.}}
 # Block and replace with "blocked" page
  .nasty-stuff.example.com
 
-{+block{Doubleclick banners.} +handle-as-image} 
+{+block{Doubleclick banners.} +handle-as-image}
 # Block and replace with image
  .ad.doubleclick.net
  .ads.r.us/banners/
 
-{+block{Layered ads.} +handle-as-empty-document} 
+{+block{Layered ads.} +handle-as-empty-document}
 # Block and then ignore
- adserver.example.net/.*\.js$
-

8.5.3. change-x-forwarded-for

Typical use:

Improve privacy by not forwarding the source of the request in the HTTP headers.

Effect:

Deletes the "X-Forwarded-For:" HTTP header from the client request, - or adds a new one. -

Type:

Parameterized.

Parameter:

  • "block" to delete the header.

  • "add" to create the header (or append - the client's IP address to an already existing one). -

Notes:

It is safe and recommended to use block. -

Forwarding the source address of the request may make - sense in some multi-user setups but is also a privacy risk. -

Example usage:

+change-x-forwarded-for{block}
-

8.5.4. client-header-filter

Typical use:

Rewrite or remove single client headers. -

Effect:

All client headers to which this action applies are filtered on-the-fly through - the specified regular expression based substitutions. -

Type:

Parameterized.

Parameter:

The name of a client-header filter, as defined in one of the - filter files. -

Notes:

Client-header filters are applied to each header on its own, not to - all at once. This makes it easier to diagnose problems, but on the downside - you can't write filters that only change header x if header y's value is z. - You can do that by using tags though. -

Client-header filters are executed after the other header actions have finished - and use their output as input. -

If the request URL gets changed, Privoxy will detect that and use the new - one. This can be used to rewrite the request destination behind the client's - back, for example to specify a Tor exit relay for certain requests. -

Please refer to the filter file chapter - to learn which client-header filters are available by default, and how to - create your own. -

Example usage (section):

+ +
# Hide Tor exit notation in Host and Referer Headers
+ adserver.example.net/.*\.js$
+
+
+

+
+
+
+ +
+

8.5.3. change-x-forwarded-for

+ +
+
+
Typical use:
+ +
+

Improve privacy by not forwarding the source of the request + in the HTTP headers.

+
+ +
Effect:
+ +
+

Deletes the "X-Forwarded-For:" + HTTP header from the client request, or adds a new one.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+
    +
  • +

    "block" to delete the + header.

    +
  • + +
  • +

    "add" to create the header + (or append the client's IP address to an already existing + one).

    +
  • +
+
+ +
Notes:
+ +
+

It is safe and recommended to use block.

+ +

Forwarding the source address of the request may make sense + in some multi-user setups but is also a privacy risk.

+
+ +
Example usage:
+ +
+ + + + +
+
++change-x-forwarded-for{block}
+
+
+
+
+
+
+ +
+

8.5.4. client-header-filter

+ +
+
+
Typical use:
+ +
+

Rewrite or remove single client headers.

+
+ +
Effect:
+ +
+

All client headers to which this action applies are filtered + on-the-fly through the specified regular expression based + substitutions.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

The name of a client-header filter, as defined in one of the + filter files.

+
+ +
Notes:
+ +
+

Client-header filters are applied to each header on its own, + not to all at once. This makes it easier to diagnose problems, + but on the downside you can't write filters that only change + header x if header y's value is z. You can do that by using + tags though.

+ +

Client-header filters are executed after the other header + actions have finished and use their output as input.

+ +

If the request URL gets changed, Privoxy will detect that and use the new + one. This can be used to rewrite the request destination behind + the client's back, for example to specify a Tor exit relay for + certain requests.

+ +

Please refer to the filter file + chapter to learn which client-header filters are available + by default, and how to create your own.

+
+ +
Example usage (section):
+ +
+ + +
+
+# Hide Tor exit notation in Host and Referer Headers
 {+client-header-filter{hide-tor-exit-notation}}
 /
-    
-

8.5.5. client-header-tagger

Typical use:

Block requests based on their headers. -

Effect:

Client headers to which this action applies are filtered on-the-fly through - the specified regular expression based substitutions, the result is used as - tag. -

Type:

Parameterized.

Parameter:

The name of a client-header tagger, as defined in one of the - filter files. -

Notes:

Client-header taggers are applied to each header on its own, - and as the header isn't modified, each tagger "sees" - the original. -

Client-header taggers are the first actions that are executed - and their tags can be used to control every other action. -

Example usage (section):

+ +
# Tag every request with the User-Agent header
+
+
+
+

+
+
+
+ +
+

8.5.5. client-header-tagger

+ +
+
+
Typical use:
+ +
+

Block requests based on their headers.

+
+ +
Effect:
+ +
+

Client headers to which this action applies are filtered + on-the-fly through the specified regular expression based + substitutions, the result is used as tag.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

The name of a client-header tagger, as defined in one of the + filter files.

+
+ +
Notes:
+ +
+

Client-header taggers are applied to each header on its own, + and as the header isn't modified, each tagger "sees" the original.

+ +

Client-header taggers are the first actions that are + executed and their tags can be used to control every other + action.

+
+ +
Example usage (section):
+ +
+ + +
+
+# Tag every request with the User-Agent header
 {+client-header-tagger{user-agent}}
 /
 
@@ -2254,2179 +1317,1430 @@ TAG:^User-Agent: RPM APT-HTTP/
 TAG:^User-Agent: fetch libfetch/
 TAG:^User-Agent: Ubuntu APT-HTTP/
 TAG:^User-Agent: MPlayer/
-    
-

8.5.6. content-type-overwrite

Typical use:

Stop useless download menus from popping up, or change the browser's rendering mode

Effect:

Replaces the "Content-Type:" HTTP server header. -

Type:

Parameterized.

Parameter:

Any string. -

Notes:

The "Content-Type:" HTTP server header is used by the - browser to decide what to do with the document. The value of this - header can cause the browser to open a download menu instead of - displaying the document by itself, even if the document's format is - supported by the browser. -

The declared content type can also affect which rendering mode - the browser chooses. If XHTML is delivered as "text/html", - many browsers treat it as yet another broken HTML document. - If it is send as "application/xml", browsers with - XHTML support will only display it, if the syntax is correct. -

If you see a web site that proudly uses XHTML buttons, but sets - "Content-Type: text/html", you can use Privoxy - to overwrite it with "application/xml" and validate - the web master's claim inside your XHTML-supporting browser. - If the syntax is incorrect, the browser will complain loudly. -

You can also go the opposite direction: if your browser prints - error messages instead of rendering a document falsely declared - as XHTML, you can overwrite the content type with - "text/html" and have it rendered as broken HTML document. -

By default content-type-overwrite only replaces - "Content-Type:" headers that look like some kind of text. - If you want to overwrite it unconditionally, you have to combine it with - force-text-mode. - This limitation exists for a reason, think twice before circumventing it. -

Most of the time it's easier to replace this action with a custom - server-header filter. - It allows you to activate it for every document of a certain site and it will still - only replace the content types you aimed at. -

Of course you can apply content-type-overwrite - to a whole site and then make URL based exceptions, but it's a lot - more work to get the same precision. -

Example usage (sections):

+ +
# Check if www.example.net/ really uses valid XHTML
+
+
+
+

+
+
+
+ +
+

8.5.6. content-type-overwrite

+ +
+
+
Typical use:
+ +
+

Stop useless download menus from popping up, or change the + browser's rendering mode

+
+ +
Effect:
+ +
+

Replaces the "Content-Type:" HTTP + server header.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

Any string.

+
+ +
Notes:
+ +
+

The "Content-Type:" HTTP server + header is used by the browser to decide what to do with the + document. The value of this header can cause the browser to + open a download menu instead of displaying the document by + itself, even if the document's format is supported by the + browser.

+ +

The declared content type can also affect which rendering + mode the browser chooses. If XHTML is delivered as "text/html", many browsers treat it as yet + another broken HTML document. If it is send as "application/xml", browsers with XHTML support + will only display it, if the syntax is correct.

+ +

If you see a web site that proudly uses XHTML buttons, but + sets "Content-Type: text/html", you + can use Privoxy to overwrite + it with "application/xml" and + validate the web master's claim inside your XHTML-supporting + browser. If the syntax is incorrect, the browser will complain + loudly.

+ +

You can also go the opposite direction: if your browser + prints error messages instead of rendering a document falsely + declared as XHTML, you can overwrite the content type with + "text/html" and have it rendered as + broken HTML document.

+ +

By default content-type-overwrite + only replaces "Content-Type:" + headers that look like some kind of text. If you want to + overwrite it unconditionally, you have to combine it with + force-text-mode. + This limitation exists for a reason, think twice before + circumventing it.

+ +

Most of the time it's easier to replace this action with a + custom server-header + filter. It allows you to activate it for every + document of a certain site and it will still only replace the + content types you aimed at.

+ +

Of course you can apply content-type-overwrite to a whole site and then + make URL based exceptions, but it's a lot more work to get the + same precision.

+
+ +
Example usage (sections):
+ +
+ + +
+
+# Check if www.example.net/ really uses valid XHTML
 { +content-type-overwrite{application/xml} }
 www.example.net/
 
 # but leave the content type unmodified if the URL looks like a style sheet
 {-content-type-overwrite}
 www.example.net/.*\.css$
-www.example.net/.*style
-

8.5.7. crunch-client-header

Typical use:

Remove a client header Privoxy has no dedicated action for.

Effect:

Deletes every header sent by the client that contains the string the user supplied as parameter. -

Type:

Parameterized.

Parameter:

Any string. -

Notes:

This action allows you to block client headers for which no dedicated - Privoxy action exists. - Privoxy will remove every client header that - contains the string you supplied as parameter. -

Regular expressions are not supported and you can't - use this action to block different headers in the same request, unless - they contain the same string. -

crunch-client-header is only meant for quick tests. - If you have to block several different headers, or only want to modify - parts of them, you should use a - client-header filter. -

Warning

Don't block any header without understanding the consequences. -

Example usage (section):

+ +
# Block the non-existent "Privacy-Violation:" client header 
+www.example.net/.*style
+
+
+

+
+
+
+ +
+

8.5.7. crunch-client-header

+ +
+
+
Typical use:
+ +
+

Remove a client header Privoxy has no dedicated action for.

+
+ +
Effect:
+ +
+

Deletes every header sent by the client that contains the + string the user supplied as parameter.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

Any string.

+
+ +
Notes:
+ +
+

This action allows you to block client headers for which no + dedicated Privoxy action + exists. Privoxy will remove + every client header that contains the string you supplied as + parameter.

+ +

Regular expressions are not supported and you can't use + this action to block different headers in the same request, + unless they contain the same string.

+ +

crunch-client-header is only meant + for quick tests. If you have to block several different + headers, or only want to modify parts of them, you should use a + client-header + filter.

+ +
+ + + + + + + + +
Warning
+

Don't block any header without understanding the + consequences.

+
+
+
+ +
Example usage (section):
+ +
+ + +
+
+# Block the non-existent "Privacy-Violation:" client header
 { +crunch-client-header{Privacy-Violation:} }
 /
-    
-

8.5.8. crunch-if-none-match

Typical use:

Prevent yet another way to track the user's steps between sessions.

Effect:

Deletes the "If-None-Match:" HTTP client header. -

Type:

Boolean.

Parameter:

N/A -

Notes:

Removing the "If-None-Match:" HTTP client header - is useful for filter testing, where you want to force a real - reload instead of getting status code "304" which - would cause the browser to use a cached copy of the page. -

It is also useful to make sure the header isn't used as a cookie - replacement (unlikely but possible). -

Blocking the "If-None-Match:" header shouldn't cause any - caching problems, as long as the "If-Modified-Since:" header - isn't blocked or missing as well. -

It is recommended to use this action together with - hide-if-modified-since - and - overwrite-last-modified. -

Example usage (section):

+ +
# Let the browser revalidate cached documents but don't
+
+
+
+

+
+
+
+ +
+

8.5.8. crunch-if-none-match

+ +
+
+
Typical use:
+ +
+

Prevent yet another way to track the user's steps between + sessions.

+
+ +
Effect:
+ +
+

Deletes the "If-None-Match:" HTTP + client header.

+
+ +
Type:
+ +
+

Boolean.

+
+ +
Parameter:
+ +
+

N/A

+
+ +
Notes:
+ +
+

Removing the "If-None-Match:" + HTTP client header is useful for filter testing, where you want + to force a real reload instead of getting status code + "304" which would cause the browser + to use a cached copy of the page.

+ +

It is also useful to make sure the header isn't used as a + cookie replacement (unlikely but possible).

+ +

Blocking the "If-None-Match:" + header shouldn't cause any caching problems, as long as the + "If-Modified-Since:" header isn't + blocked or missing as well.

+ +

It is recommended to use this action together with + hide-if-modified-since + and overwrite-last-modified.

+
+ +
Example usage (section):
+ +
+ + +
+
+# Let the browser revalidate cached documents but don't
 # allow the server to use the revalidation headers for user tracking.
 {+hide-if-modified-since{-60} \
  +overwrite-last-modified{randomize} \
  +crunch-if-none-match}
-/   
-

8.5.9. crunch-incoming-cookies

Typical use:

Prevent the web server from setting HTTP cookies on your system -

Effect:

Deletes any "Set-Cookie:" HTTP headers from server replies. -

Type:

Boolean.

Parameter:

N/A -

Notes:

This action is only concerned with incoming HTTP cookies. For - outgoing HTTP cookies, use - crunch-outgoing-cookies. - Use both to disable HTTP cookies completely. -

It makes no sense at all to use this action in conjunction - with the session-cookies-only action, - since it would prevent the session cookies from being set. See also - filter-content-cookies. -

Example usage:

+crunch-incoming-cookies
-

8.5.10. crunch-server-header

Typical use:

Remove a server header Privoxy has no dedicated action for.

Effect:

Deletes every header sent by the server that contains the string the user supplied as parameter. -

Type:

Parameterized.

Parameter:

Any string. -

Notes:

This action allows you to block server headers for which no dedicated - Privoxy action exists. Privoxy - will remove every server header that contains the string you supplied as parameter. -

Regular expressions are not supported and you can't - use this action to block different headers in the same request, unless - they contain the same string. -

crunch-server-header is only meant for quick tests. - If you have to block several different headers, or only want to modify - parts of them, you should use a custom - server-header filter. -

Warning

Don't block any header without understanding the consequences. -

Example usage (section):

+ +
# Crunch server headers that try to prevent caching
+/
+
+
+

+
+
+
+ +
+

8.5.9. crunch-incoming-cookies

+ +
+
+
Typical use:
+ +
+

Prevent the web server from setting HTTP cookies on your + system

+
+ +
Effect:
+ +
+

Deletes any "Set-Cookie:" HTTP + headers from server replies.

+
+ +
Type:
+ +
+

Boolean.

+
+ +
Parameter:
+ +
+

N/A

+
+ +
Notes:
+ +
+

This action is only concerned with incoming HTTP cookies. For + outgoing HTTP + cookies, use crunch-outgoing-cookies. + Use both to disable + HTTP cookies completely.

+ +

It makes no sense at + all to use this action in conjunction with the + session-cookies-only + action, since it would prevent the session cookies from being + set. See also filter-content-cookies.

+
+ +
Example usage:
+ +
+ + + + +
+
++crunch-incoming-cookies
+
+
+
+
+
+
+ +
+

8.5.10. crunch-server-header

+ +
+
+
Typical use:
+ +
+

Remove a server header Privoxy has no dedicated action for.

+
+ +
Effect:
+ +
+

Deletes every header sent by the server that contains the + string the user supplied as parameter.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

Any string.

+
+ +
Notes:
+ +
+

This action allows you to block server headers for which no + dedicated Privoxy action + exists. Privoxy will remove + every server header that contains the string you supplied as + parameter.

+ +

Regular expressions are not supported and you can't use + this action to block different headers in the same request, + unless they contain the same string.

+ +

crunch-server-header is only meant + for quick tests. If you have to block several different + headers, or only want to modify parts of them, you should use a + custom server-header + filter.

+ +
+ + + + + + + + +
Warning
+

Don't block any header without understanding the + consequences.

+
+
+
+ +
Example usage (section):
+ +
+ + +
+
+# Crunch server headers that try to prevent caching
 { +crunch-server-header{no-cache} }
-/   
-

8.5.11. crunch-outgoing-cookies

Typical use:

Prevent the web server from reading any HTTP cookies from your system -

Effect:

Deletes any "Cookie:" HTTP headers from client requests. -

Type:

Boolean.

Parameter:

N/A -

Notes:

This action is only concerned with outgoing HTTP cookies. For - incoming HTTP cookies, use - crunch-incoming-cookies. - Use both to disable HTTP cookies completely. -

It makes no sense at all to use this action in conjunction - with the session-cookies-only action, - since it would prevent the session cookies from being read. -

Example usage:

+crunch-outgoing-cookies
-

8.5.12. deanimate-gifs

Typical use:

Stop those annoying, distracting animated GIF images.

Effect:

De-animate GIF animations, i.e. reduce them to their first or last image. -

Type:

Parameterized.

Parameter:

"last" or "first" -

Notes:

This will also shrink the images considerably (in bytes, not pixels!). If - the option "first" is given, the first frame of the animation - is used as the replacement. If "last" is given, the last - frame of the animation is used instead, which probably makes more sense for - most banner animations, but also has the risk of not showing the entire - last frame (if it is only a delta to an earlier frame). -

You can safely use this action with patterns that will also match non-GIF - objects, because no attempt will be made at anything that doesn't look like - a GIF. -

Example usage:

+deanimate-gifs{last}
-

8.5.13. downgrade-http-version

Typical use:

Work around (very rare) problems with HTTP/1.1

Effect:

Downgrades HTTP/1.1 client requests and server replies to HTTP/1.0. -

Type:

Boolean.

Parameter:

N/A -

Notes:

This is a left-over from the time when Privoxy - didn't support important HTTP/1.1 features well. It is left here for the - unlikely case that you experience HTTP/1.1 related problems with some server - out there. Not all HTTP/1.1 features and requirements are supported yet, - so there is a chance you might need this action. -

Example usage (section):

{+downgrade-http-version}
-problem-host.example.com
-

8.5.14. fast-redirects

Typical use:

Fool some click-tracking scripts and speed up indirect links.

Effect:

Detects redirection URLs and redirects the browser without contacting - the redirection server first. -

Type:

Parameterized.

Parameter:

  • "simple-check" to just search for the string "http://" - to detect redirection URLs. -

  • "check-decoded-url" to decode URLs (if necessary) before searching - for redirection URLs. -

Notes:

- Many sites, like yahoo.com, don't just link to other sites. Instead, they - will link to some script on their own servers, giving the destination as a - parameter, which will then redirect you to the final target. URLs - resulting from this scheme typically look like: - "http://www.example.org/click-tracker.cgi?target=http%3a//www.example.net/". -

Sometimes, there are even multiple consecutive redirects encoded in the - URL. These redirections via scripts make your web browsing more traceable, - since the server from which you follow such a link can see where you go - to. Apart from that, valuable bandwidth and time is wasted, while your - browser asks the server for one redirect after the other. Plus, it feeds - the advertisers. -

This feature is currently not very smart and is scheduled for improvement. - If it is enabled by default, you will have to create some exceptions to - this action. It can lead to failures in several ways: -

Not every URLs with other URLs as parameters is evil. - Some sites offer a real service that requires this information to work. - For example a validation service needs to know, which document to validate. - fast-redirects assumes that every URL parameter that - looks like another URL is a redirection target, and will always redirect to - the last one. Most of the time the assumption is correct, but if it isn't, - the user gets redirected anyway. -

Another failure occurs if the URL contains other parameters after the URL parameter. - The URL: - "http://www.example.org/?redirect=http%3a//www.example.net/&foo=bar". - contains the redirection URL "http://www.example.net/", - followed by another parameter. fast-redirects doesn't know that - and will cause a redirect to "http://www.example.net/&foo=bar". - Depending on the target server configuration, the parameter will be silently ignored - or lead to a "page not found" error. You can prevent this problem by - first using the redirect action - to remove the last part of the URL, but it requires a little effort. -

To detect a redirection URL, fast-redirects only - looks for the string "http://", either in plain text - (invalid but often used) or encoded as "http%3a//". - Some sites use their own URL encoding scheme, encrypt the address - of the target server or replace it with a database id. In theses cases - fast-redirects is fooled and the request reaches the - redirection server where it probably gets logged. -

Example usage:

+ +
 { +fast-redirects{simple-check} }
-   one.example.com 
+/
+
+
+

+
+
+
+ +
+

8.5.11. crunch-outgoing-cookies

+ +
+
+
Typical use:
+ +
+

Prevent the web server from reading any HTTP cookies from + your system

+
+ +
Effect:
+ +
+

Deletes any "Cookie:" HTTP + headers from client requests.

+
+ +
Type:
+ +
+

Boolean.

+
+ +
Parameter:
+ +
+

N/A

+
+ +
Notes:
+ +
+

This action is only concerned with outgoing HTTP cookies. For + incoming HTTP + cookies, use crunch-incoming-cookies. + Use both to disable + HTTP cookies completely.

+ +

It makes no sense at + all to use this action in conjunction with the + session-cookies-only + action, since it would prevent the session cookies from being + read.

+
+ +
Example usage:
+ +
+ + + + +
+
++crunch-outgoing-cookies
+
+
+
+
+
+
+ +
+

8.5.12. deanimate-gifs

+ +
+
+
Typical use:
+ +
+

Stop those annoying, distracting animated GIF images.

+
+ +
Effect:
+ +
+

De-animate GIF animations, i.e. reduce them to their first + or last image.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

"last" or "first"

+
+ +
Notes:
+ +
+

This will also shrink the images considerably (in bytes, not + pixels!). If the option "first" is + given, the first frame of the animation is used as the + replacement. If "last" is given, the + last frame of the animation is used instead, which probably + makes more sense for most banner animations, but also has the + risk of not showing the entire last frame (if it is only a + delta to an earlier frame).

+ +

You can safely use this action with patterns that will also + match non-GIF objects, because no attempt will be made at + anything that doesn't look like a GIF.

+
+ +
Example usage:
+ +
+ + + + +
+
++deanimate-gifs{last}
+
+
+
+
+
+
+ +
+

8.5.13. downgrade-http-version

+ +
+
+
Typical use:
+ +
+

Work around (very rare) problems with HTTP/1.1

+
+ +
Effect:
+ +
+

Downgrades HTTP/1.1 client requests and server replies to + HTTP/1.0.

+
+ +
Type:
+ +
+

Boolean.

+
+ +
Parameter:
+ +
+

N/A

+
+ +
Notes:
+ +
+

This is a left-over from the time when Privoxy didn't support important HTTP/1.1 + features well. It is left here for the unlikely case that you + experience HTTP/1.1-related problems with some server out + there.

+ +

Note that enabling this action is only a workaround. It + should not be enabled for sites that work without it. While it + shouldn't break any pages, it has an (usually negative) + performance impact.

+ +

If you come across a site where enabling this action helps, + please report it, so the cause of the problem can be analyzed. + If the problem turns out to be caused by a bug in Privoxy it should be fixed so the + following release works without the work around.

+
+ +
Example usage (section):
+ +
+ + + + +
+
+{+downgrade-http-version}
+problem-host.example.com
+
+
+
+
+
+
+ +
+

8.5.14. fast-redirects

+ +
+
+
Typical use:
+ +
+

Fool some click-tracking scripts and speed up indirect + links.

+
+ +
Effect:
+ +
+

Detects redirection URLs and redirects the browser without + contacting the redirection server first.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+
    +
  • +

    "simple-check" to just search + for the string "http://" to + detect redirection URLs.

    +
  • + +
  • +

    "check-decoded-url" to decode + URLs (if necessary) before searching for redirection + URLs.

    +
  • +
+
+ +
Notes:
+ +
+

Many sites, like yahoo.com, don't just link to other sites. + Instead, they will link to some script on their own servers, + giving the destination as a parameter, which will then redirect + you to the final target. URLs resulting from this scheme + typically look like: "http://www.example.org/click-tracker.cgi?target=http%3a//www.example.net/".

+ +

Sometimes, there are even multiple consecutive redirects + encoded in the URL. These redirections via scripts make your + web browsing more traceable, since the server from which you + follow such a link can see where you go to. Apart from that, + valuable bandwidth and time is wasted, while your browser asks + the server for one redirect after the other. Plus, it feeds the + advertisers.

+ +

This feature is currently not very smart and is scheduled + for improvement. If it is enabled by default, you will have to + create some exceptions to this action. It can lead to failures + in several ways:

+ +

Not every URLs with other URLs as parameters is evil. Some + sites offer a real service that requires this information to + work. For example a validation service needs to know, which + document to validate. fast-redirects + assumes that every URL parameter that looks like another URL is + a redirection target, and will always redirect to the last one. + Most of the time the assumption is correct, but if it isn't, + the user gets redirected anyway.

+ +

Another failure occurs if the URL contains other parameters + after the URL parameter. The URL: "http://www.example.org/?redirect=http%3a//www.example.net/&foo=bar". + contains the redirection URL "http://www.example.net/", followed by another + parameter. fast-redirects doesn't know + that and will cause a redirect to "http://www.example.net/&foo=bar". Depending + on the target server configuration, the parameter will be + silently ignored or lead to a "page not + found" error. You can prevent this problem by first + using the redirect action to remove + the last part of the URL, but it requires a little effort.

+ +

To detect a redirection URL, fast-redirects only looks for the string + "http://", either in plain text + (invalid but often used) or encoded as "http%3a//". Some sites use their own URL + encoding scheme, encrypt the address of the target server or + replace it with a database id. In theses cases fast-redirects is fooled and the request reaches + the redirection server where it probably gets logged.

+
+ +
Example usage:
+ +
+ + +
+
+ { +fast-redirects{simple-check} }
+   one.example.com
 
  { +fast-redirects{check-decoded-url} }
-   another.example.com/testing
-

8.5.15. filter

Typical use:

Get rid of HTML and JavaScript annoyances, banner advertisements (by size), - do fun text replacements, add personalized effects, etc.

Effect:

All instances of text-based type, most notably HTML and JavaScript, to which - this action applies, can be filtered on-the-fly through the specified regular - expression based substitutions. (Note: as of version 3.0.3 plain text documents - are exempted from filtering, because web servers often use the - text/plain MIME type for all files whose type they don't know.) -

Type:

Parameterized.

Parameter:

The name of a content filter, as defined in the filter file. - Filters can be defined in one or more files as defined by the - filterfile - option in the config file. - default.filter is the collection of filters - supplied by the developers. Locally defined filters should go - in their own file, such as user.filter. -

When used in its negative form, - and without parameters, all filtering is completely disabled. -

Notes:

For your convenience, there are a number of pre-defined filters available - in the distribution filter file that you can use. See the examples below for - a list. -

Filtering requires buffering the page content, which may appear to - slow down page rendering since nothing is displayed until all content has - passed the filters. (It does not really take longer, but seems that way - since the page is not incrementally displayed.) This effect will be more - noticeable on slower connections. -

"Rolling your own" - filters requires a knowledge of - "Regular - Expressions" and - "HTML". - This is very powerful feature, and potentially very intrusive. - Filters should be used with caution, and where an equivalent - "action" is not available. -

The amount of data that can be filtered is limited to the - buffer-limit - option in the main config file. The - default is 4096 KB (4 Megs). Once this limit is exceeded, the buffered - data, and all pending data, is passed through unfiltered. -

Inappropriate MIME types, such as zipped files, are not filtered at all. - (Again, only text-based types except plain text). Encrypted SSL data - (from HTTPS servers) cannot be filtered either, since this would violate - the integrity of the secure transaction. In some situations it might - be necessary to protect certain text, like source code, from filtering - by defining appropriate -filter exceptions. -

Compressed content can't be filtered either, unless Privoxy - is compiled with zlib support (requires at least Privoxy 3.0.7), - in which case Privoxy will decompress the content before filtering - it. -

If you use a Privoxy version without zlib support, but want filtering to work on - as much documents as possible, even those that would normally be sent compressed, - you must use the prevent-compression - action in conjunction with filter. -

Content filtering can achieve some of the same effects as the - block - action, i.e. it can be used to block ads and banners. But the mechanism - works quite differently. One effective use, is to block ad banners - based on their size (see below), since many of these seem to be somewhat - standardized. -

Feedback with suggestions for new or - improved filters is particularly welcome! -

The below list has only the names and a one-line description of each - predefined filter. There are more - verbose explanations of what these filters do in the filter file chapter. -

Example usage (with filters from the distribution default.filter file). - See the Predefined Filters section for - more explanation on each:

-
+filter{js-annoyances}       # Get rid of particularly annoying JavaScript abuse.
-

-
+filter{js-events}           # Kill all JS event bindings and timers (Radically destructive! Only for extra nasty sites).
-

-
+filter{html-annoyances}     # Get rid of particularly annoying HTML abuse.
-

-
+filter{content-cookies}     # Kill cookies that come in the HTML or JS content.
-

-
+filter{refresh-tags}        # Kill automatic refresh tags (for dial-on-demand setups).
-

-
+filter{unsolicited-popups}  # Disable only unsolicited pop-up windows. Useful if your browser lacks this ability.
-

-
+filter{all-popups}          # Kill all popups in JavaScript and HTML. Useful if your browser lacks this ability.
-

-
+filter{img-reorder}         # Reorder attributes in <img> tags to make the banners-by-* filters more effective.
-

-
+filter{banners-by-size}     # Kill banners by size.
-

-
+filter{banners-by-link}     # Kill banners by their links to known clicktrackers.
-

-
+filter{webbugs}             # Squish WebBugs (1x1 invisible GIFs used for user tracking).
-

-
+filter{tiny-textforms}      # Extend those tiny textareas up to 40x80 and kill the hard wrap.
-

-
+filter{jumping-windows}     # Prevent windows from resizing and moving themselves.
-

-
+filter{frameset-borders}    # Give frames a border and make them resizable.
-

-
+filter{demoronizer}         # Fix MS's non-standard use of standard charsets.
-

-
+filter{shockwave-flash}     # Kill embedded Shockwave Flash objects.
-

-
+filter{quicktime-kioskmode} # Make Quicktime movies saveable.
-

-
+filter{fun}                 # Text replacements for subversive browsing fun!
-

-
+filter{crude-parental}      # Crude parental filtering. Note that this filter doesn't work reliably.
-

-
+filter{ie-exploits}         # Disable some known Internet Explorer bug exploits.
-

-
+filter{site-specifics}      # Cure for site-specific problems. Don't apply generally!
-

-
+filter{no-ping}             # Removes non-standard ping attributes in <a> and <area> tags.
-

-
+filter{google}              # CSS-based block for Google text ads. Also removes a width limitation and the toolbar advertisement.
-

-
+filter{yahoo}               # CSS-based block for Yahoo text ads. Also removes a width limitation.
-

-
+filter{msn}                 # CSS-based block for MSN text ads. Also removes tracking URLs and a width limitation.
-

-
+filter{blogspot}            # Cleans up some Blogspot blogs. Read the fine print before using this.
-

8.5.16. force-text-mode

Typical use:

Force Privoxy to treat a document as if it was in some kind of text format.

Effect:

Declares a document as text, even if the "Content-Type:" isn't detected as such. -

Type:

Boolean.

Parameter:

N/A -

Notes:

As explained above, - Privoxy tries to only filter files that are - in some kind of text format. The same restrictions apply to - content-type-overwrite. - force-text-mode declares a document as text, - without looking at the "Content-Type:" first. -

Warning

Think twice before activating this action. Filtering binary data - with regular expressions can cause file damage. -

Example usage:

+force-text-mode
-     
-

8.5.17. forward-override

Typical use:

Change the forwarding settings based on User-Agent or request origin

Effect:

Overrules the forward directives in the configuration file. -

Type:

Multi-value.

Parameter:

  • "forward ." to use a direct connection without any additional proxies.

  • "forward 127.0.0.1:8123" to use the HTTP proxy listening at 127.0.0.1 port 8123. -

  • "forward-socks4a 127.0.0.1:9050 ." to use the socks4a proxy listening at - 127.0.0.1 port 9050. Replace "forward-socks4a" with "forward-socks4" - to use a socks4 connection (with local DNS resolution) instead, use "forward-socks5" - for socks5 connections (with remote DNS resolution). -

  • "forward-socks4a 127.0.0.1:9050 proxy.example.org:8000" to use the socks4a proxy - listening at 127.0.0.1 port 9050 to reach the HTTP proxy listening at proxy.example.org port 8000. - Replace "forward-socks4a" with "forward-socks4" to use a socks4 connection - (with local DNS resolution) instead, use "forward-socks5" - for socks5 connections (with remote DNS resolution). -

Notes:

This action takes parameters similar to the - forward directives in the configuration - file, but without the URL pattern. It can be used as replacement, but normally it's only - used in cases where matching based on the request URL isn't sufficient. -

Warning

Please read the description for the forward directives before - using this action. Forwarding to the wrong people will reduce your privacy and increase the - chances of man-in-the-middle attacks. -

If the ports are missing or invalid, default values will be used. This might change - in the future and you shouldn't rely on it. Otherwise incorrect syntax causes Privoxy - to exit. -

Use the show-url-info CGI page - to verify that your forward settings do what you thought the do. -

Example usage:

+ +
# Always use direct connections for requests previously tagged as
-# "User-Agent: fetch libfetch/2.0" and make sure
+   another.example.com/testing
+
+
+

+
+
+
+ +
+

8.5.15. + filter

+ +
+
+
Typical use:
+ +
+

Get rid of HTML and JavaScript annoyances, banner + advertisements (by size), do fun text replacements, add + personalized effects, etc.

+
+ +
Effect:
+ +
+

All instances of text-based type, most notably HTML and + JavaScript, to which this action applies, can be filtered + on-the-fly through the specified regular expression based + substitutions. (Note: as of version 3.0.3 plain text documents + are exempted from filtering, because web servers often use the + text/plain MIME type for all files + whose type they don't know.)

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

The name of a content filter, as defined in the filter file. Filters can be defined in + one or more files as defined by the filterfile + option in the config file. default.filter is the collection of filters + supplied by the developers. Locally defined filters should go + in their own file, such as user.filter.

+ +

When used in its negative form, and without parameters, + all filtering is + completely disabled.

+
+ +
Notes:
+ +
+

For your convenience, there are a number of pre-defined + filters available in the distribution filter file that you can + use. See the examples below for a list.

+ +

Filtering requires buffering the page content, which may + appear to slow down page rendering since nothing is displayed + until all content has passed the filters. (The total time until + the page is completely rendered doesn't change much, but it may + be perceived as slower since the page is not incrementally + displayed.) This effect will be more noticeable on slower + connections.

+ +

"Rolling your own" filters + requires a knowledge of "Regular Expressions" and + "HTML". This is very + powerful feature, and potentially very intrusive. Filters + should be used with caution, and where an equivalent + "action" is not available.

+ +

The amount of data that can be filtered is limited to the + buffer-limit option in the + main config file. The default is 4096 + KB (4 Megs). Once this limit is exceeded, the buffered data, + and all pending data, is passed through unfiltered.

+ +

Inappropriate MIME types, such as zipped files, are not + filtered at all. (Again, only text-based types except plain + text). Encrypted SSL data (from HTTPS servers) cannot be + filtered either, since this would violate the integrity of the + secure transaction. In some situations it might be necessary to + protect certain text, like source code, from filtering by + defining appropriate -filter + exceptions.

+ +

Compressed content can't be filtered either, but if + Privoxy is compiled with zlib + support and a supported compression algorithm is used (gzip or + deflate), Privoxy can first + decompress the content and then filter it.

+ +

If you use a Privoxy + version without zlib support, but want filtering to work on as + much documents as possible, even those that would normally be + sent compressed, you must use the prevent-compression + action in conjunction with filter.

+ +

Content filtering can achieve some of the same effects as + the block action, i.e. it can be + used to block ads and banners. But the mechanism works quite + differently. One effective use, is to block ad banners based on + their size (see below), since many of these seem to be somewhat + standardized.

+ +

Feedback with suggestions for new + or improved filters is particularly welcome!

+ +

The below list has only the names and a one-line description + of each predefined filter. There are more verbose + explanations of what these filters do in the filter file chapter.

+
+ +
Example usage (with filters from the distribution default.filter file). See the Predefined Filters + section for more explanation on each:
+ +
+

+ + + + + +
+
++filter{js-annoyances}       # Get rid of particularly annoying JavaScript abuse.
+
+
+ +

+ + + + + +
+
++filter{js-events}           # Kill all JS event bindings and timers (Radically destructive! Only for extra nasty sites).
+
+
+ +

+ + + + + +
+
++filter{html-annoyances}     # Get rid of particularly annoying HTML abuse.
+
+
+ +

+ + + + + +
+
++filter{content-cookies}     # Kill cookies that come in the HTML or JS content.
+
+
+ +

+ + + + + +
+
++filter{refresh-tags}        # Kill automatic refresh tags (for dial-on-demand setups).
+
+
+ +

+ + + + + +
+
++filter{unsolicited-popups}  # Disable only unsolicited pop-up windows. Useful if your browser lacks this ability.
+
+
+ +

+ + + + + +
+
++filter{all-popups}          # Kill all popups in JavaScript and HTML. Useful if your browser lacks this ability.
+
+
+ +

+ + + + + +
+
++filter{img-reorder}         # Reorder attributes in <img> tags to make the banners-by-* filters more effective.
+
+
+ +

+ + + + + +
+
++filter{banners-by-size}     # Kill banners by size.
+
+
+ +

+ + + + + +
+
++filter{banners-by-link}     # Kill banners by their links to known clicktrackers.
+
+
+ +

+ + + + + +
+
++filter{webbugs}             # Squish WebBugs (1x1 invisible GIFs used for user tracking).
+
+
+ +

+ + + + + +
+
++filter{tiny-textforms}      # Extend those tiny textareas up to 40x80 and kill the hard wrap.
+
+
+ +

+ + + + + +
+
++filter{jumping-windows}     # Prevent windows from resizing and moving themselves.
+
+
+ +

+ + + + + +
+
++filter{frameset-borders}    # Give frames a border and make them resizable.
+
+
+ +

+ + + + + +
+
++filter{demoronizer}         # Fix MS's non-standard use of standard charsets.
+
+
+ +

+ + + + + +
+
++filter{shockwave-flash}     # Kill embedded Shockwave Flash objects.
+
+
+ +

+ + + + + +
+
++filter{quicktime-kioskmode} # Make Quicktime movies saveable.
+
+
+ +

+ + + + + +
+
++filter{fun}                 # Text replacements for subversive browsing fun!
+
+
+ +

+ + + + + +
+
++filter{crude-parental}      # Crude parental filtering. Note that this filter doesn't work reliably.
+
+
+ +

+ + + + + +
+
++filter{ie-exploits}         # Disable some known Internet Explorer bug exploits.
+
+
+ +

+ + + + + +
+
++filter{site-specifics}      # Cure for site-specific problems. Don't apply generally!
+
+
+ +

+ + + + + +
+
++filter{no-ping}             # Removes non-standard ping attributes in <a> and <area> tags.
+
+
+ +

+ + + + + +
+
++filter{google}              # CSS-based block for Google text ads. Also removes a width limitation and the toolbar advertisement.
+
+
+ +

+ + + + + +
+
++filter{yahoo}               # CSS-based block for Yahoo text ads. Also removes a width limitation.
+
+
+ +

+ + + + + +
+
++filter{msn}                 # CSS-based block for MSN text ads. Also removes tracking URLs and a width limitation.
+
+
+ +

+ + + + + +
+
++filter{blogspot}            # Cleans up some Blogspot blogs. Read the fine print before using this.
+
+
+
+
+
+
+ +
+

8.5.16. force-text-mode

+ +
+
+
Typical use:
+ +
+

Force Privoxy to treat a + document as if it was in some kind of text format.

+
+ +
Effect:
+ +
+

Declares a document as text, even if the "Content-Type:" isn't detected as such.

+
+ +
Type:
+ +
+

Boolean.

+
+ +
Parameter:
+ +
+

N/A

+
+ +
Notes:
+ +
+

As explained above, Privoxy tries to only filter files that + are in some kind of text format. The same restrictions apply to + content-type-overwrite. + force-text-mode declares a document as + text, without looking at the "Content-Type:" first.

+ +
+ + + + + + + + +
Warning
+

Think twice before activating this action. Filtering + binary data with regular expressions can cause file + damage.

+
+
+
+ +
Example usage:
+ +
+ + + + +
+
++force-text-mode
+
+
+
+
+
+
+
+ +
+

8.5.17. forward-override

+ +
+
+
Typical use:
+ +
+

Change the forwarding settings based on User-Agent or + request origin

+
+ +
Effect:
+ +
+

Overrules the forward directives in the configuration + file.

+
+ +
Type:
+ +
+

Multi-value.

+
+ +
Parameter:
+ +
+
    +
  • +

    "forward ." to use a direct + connection without any additional proxies.

    +
  • + +
  • +

    "forward 127.0.0.1:8123" to + use the HTTP proxy listening at 127.0.0.1 port 8123.

    +
  • + +
  • +

    "forward-socks4a 127.0.0.1:9050 + ." to use the socks4a proxy listening at 127.0.0.1 + port 9050. Replace "forward-socks4a" with "forward-socks4" to use a socks4 connection + (with local DNS resolution) instead, use "forward-socks5" for socks5 connections + (with remote DNS resolution).

    +
  • + +
  • +

    "forward-socks4a 127.0.0.1:9050 + proxy.example.org:8000" to use the socks4a proxy + listening at 127.0.0.1 port 9050 to reach the HTTP proxy + listening at proxy.example.org port 8000. Replace + "forward-socks4a" with + "forward-socks4" to use a socks4 + connection (with local DNS resolution) instead, use + "forward-socks5" for socks5 + connections (with remote DNS resolution).

    +
  • +
+
+ +
Notes:
+ +
+

This action takes parameters similar to the forward directives in the + configuration file, but without the URL pattern. It can be used + as replacement, but normally it's only used in cases where + matching based on the request URL isn't sufficient.

+ +
+ + + + + + + + +
Warning
+

Please read the description for the forward directives before + using this action. Forwarding to the wrong people will + reduce your privacy and increase the chances of + man-in-the-middle attacks.

+ +

If the ports are missing or invalid, default values + will be used. This might change in the future and you + shouldn't rely on it. Otherwise incorrect syntax causes + Privoxy to exit.

+ +

Use the show-url-info CGI page to verify that your + forward settings do what you thought the do.

+
+
+
+ +
Example usage:
+ +
+ + +
+
+# Always use direct connections for requests previously tagged as
+# "User-Agent: fetch libfetch/2.0" and make sure
 # resuming downloads continues to work.
 # This way you can continue to use Tor for your normal browsing,
 # without overloading the Tor network with your FreeBSD ports updates
@@ -4438,255 +2752,164 @@ CLASS="QUOTE"
  -overwrite-last-modified     \
 }
 TAG:^User-Agent: fetch libfetch/2\.0$
-     
-

8.5.18. handle-as-empty-document

Typical use:

Mark URLs that should be replaced by empty documents if they get blocked

Effect:

This action alone doesn't do anything noticeable. It just marks URLs. - If the block action also applies, - the presence or absence of this mark decides whether an HTML "BLOCKED" - page, or an empty document will be sent to the client as a substitute for the blocked content. - The empty document isn't literally empty, but actually contains a single space. -

Type:

Boolean.

Parameter:

N/A -

Notes:

Some browsers complain about syntax errors if JavaScript documents - are blocked with Privoxy's - default HTML page; this option can be used to silence them. - And of course this action can also be used to eliminate the Privoxy - BLOCKED message in frames. -

The content type for the empty document can be specified with - content-type-overwrite{}, - but usually this isn't necessary. -

Example usage:

+ +
# Block all documents on example.org that end with ".js",
-# but send an empty document instead of the usual HTML message. 
+
+
+
+

+
+
+
+ +
+

8.5.18. handle-as-empty-document

+ +
+
+
Typical use:
+ +
+

Mark URLs that should be replaced by empty documents + if they get + blocked

+
+ +
Effect:
+ +
+

This action alone doesn't do anything noticeable. It just + marks URLs. If the block action also applies, the presence or + absence of this mark decides whether an HTML "BLOCKED" page, or an empty document will be + sent to the client as a substitute for the blocked content. The + empty document isn't + literally empty, but actually contains a single space.

+
+ +
Type:
+ +
+

Boolean.

+
+ +
Parameter:
+ +
+

N/A

+
+ +
Notes:
+ +
+

Some browsers complain about syntax errors if JavaScript + documents are blocked with Privoxy's default HTML page; this option + can be used to silence them. And of course this action can also + be used to eliminate the Privoxy BLOCKED message in frames.

+ +

The content type for the empty document can be specified + with content-type-overwrite{}, + but usually this isn't necessary.

+
+ +
Example usage:
+ +
+ + +
+
+# Block all documents on example.org that end with ".js",
+# but send an empty document instead of the usual HTML message.
 {+block{Blocked JavaScript} +handle-as-empty-document}
 example.org/.*\.js$
-     
-

8.5.19. handle-as-image

Typical use:

Mark URLs as belonging to images (so they'll be replaced by images if they do get blocked, rather than HTML pages)

Effect:

This action alone doesn't do anything noticeable. It just marks URLs as images. - If the block action also applies, - the presence or absence of this mark decides whether an HTML "blocked" - page, or a replacement image (as determined by the set-image-blocker action) will be sent to the - client as a substitute for the blocked content. -

Type:

Boolean.

Parameter:

N/A -

Notes:

The below generic example section is actually part of default.action. - It marks all URLs with well-known image file name extensions as images and should - be left intact. -

Users will probably only want to use the handle-as-image action in conjunction with - block, to block sources of banners, whose URLs don't - reflect the file type, like in the second example section. -

Note that you cannot treat HTML pages as images in most cases. For instance, (in-line) ad - frames require an HTML page to be sent, or they won't display properly. - Forcing handle-as-image in this situation will not replace the - ad frame with an image, but lead to error messages. -

Example usage (sections):

+ +
# Generic image extensions:
+
+
+
+

+
+
+
+ +
+

8.5.19. handle-as-image

+ +
+
+
Typical use:
+ +
+

Mark URLs as belonging to images (so they'll be replaced by + images if they do get + blocked, rather than HTML pages)

+
+ +
Effect:
+ +
+

This action alone doesn't do anything noticeable. It just + marks URLs as images. If the block action also applies, the presence or + absence of this mark decides whether an HTML "blocked" page, or a replacement image (as + determined by the set-image-blocker + action) will be sent to the client as a substitute for the + blocked content.

+
+ +
Type:
+ +
+

Boolean.

+
+ +
Parameter:
+ +
+

N/A

+
+ +
Notes:
+ +
+

The below generic example section is actually part of + default.action. It marks all URLs + with well-known image file name extensions as images and should + be left intact.

+ +

Users will probably only want to use the handle-as-image + action in conjunction with block, to block sources of + banners, whose URLs don't reflect the file type, like in the + second example section.

+ +

Note that you cannot treat HTML pages as images in most + cases. For instance, (in-line) ad frames require an HTML page + to be sent, or they won't display properly. Forcing handle-as-image in this situation will not + replace the ad frame with an image, but lead to error + messages.

+
+ +
Example usage (sections):
+ +
+ + +
+
+# Generic image extensions:
 #
 {+handle-as-image}
 /.*\.(gif|jpg|jpeg|png|bmp|ico)$
@@ -4695,1037 +2918,713 @@ CLASS="SCREEN"
 # blocked as images:
 #
 {+block{Nasty banners.} +handle-as-image}
-nasty-banner-server.example.com/junk.cgi\?output=trash
-

8.5.20. hide-accept-language

Typical use:

Pretend to use different language settings.

Effect:

Deletes or replaces the "Accept-Language:" HTTP header in client requests. -

Type:

Parameterized.

Parameter:

Keyword: "block", or any user defined value. -

Notes:

Faking the browser's language settings can be useful to make a - foreign User-Agent set with - hide-user-agent - more believable. -

However some sites with content in different languages check the - "Accept-Language:" to decide which one to take by default. - Sometimes it isn't possible to later switch to another language without - changing the "Accept-Language:" header first. -

Therefore it's a good idea to either only change the - "Accept-Language:" header to languages you understand, - or to languages that aren't wide spread. -

Before setting the "Accept-Language:" header - to a rare language, you should consider that it helps to - make your requests unique and thus easier to trace. - If you don't plan to change this header frequently, - you should stick to a common language. -

Example usage (section):

+ +
# Pretend to use Canadian language settings.
+nasty-banner-server.example.com/junk.cgi\?output=trash
+
+
+

+
+
+
+ +
+

8.5.20. hide-accept-language

+ +
+
+
Typical use:
+ +
+

Pretend to use different language settings.

+
+ +
Effect:
+ +
+

Deletes or replaces the "Accept-Language:" HTTP header in client + requests.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

Keyword: "block", or any user + defined value.

+
+ +
Notes:
+ +
+

Faking the browser's language settings can be useful to make + a foreign User-Agent set with hide-user-agent + more believable.

+ +

However some sites with content in different languages check + the "Accept-Language:" to decide + which one to take by default. Sometimes it isn't possible to + later switch to another language without changing the + "Accept-Language:" header first.

+ +

Therefore it's a good idea to either only change the + "Accept-Language:" header to + languages you understand, or to languages that aren't wide + spread.

+ +

Before setting the "Accept-Language:" header to a rare language, + you should consider that it helps to make your requests unique + and thus easier to trace. If you don't plan to change this + header frequently, you should stick to a common language.

+
+ +
Example usage (section):
+ +
+ + +
+
+# Pretend to use Canadian language settings.
 {+hide-accept-language{en-ca} \
 +hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \
 }
-/   
-

8.5.21. hide-content-disposition

Typical use:

Prevent download menus for content you prefer to view inside the browser.

Effect:

Deletes or replaces the "Content-Disposition:" HTTP header set by some servers. -

Type:

Parameterized.

Parameter:

Keyword: "block", or any user defined value. -

Notes:

Some servers set the "Content-Disposition:" HTTP header for - documents they assume you want to save locally before viewing them. - The "Content-Disposition:" header contains the file name - the browser is supposed to use by default. -

In most browsers that understand this header, it makes it impossible to - just view the document, without downloading it first, - even if it's just a simple text file or an image. -

Removing the "Content-Disposition:" header helps - to prevent this annoyance, but some browsers additionally check the - "Content-Type:" header, before they decide if they can - display a document without saving it first. In these cases, you have - to change this header as well, before the browser stops displaying - download menus. -

It is also possible to change the server's file name suggestion - to another one, but in most cases it isn't worth the time to set - it up. -

This action will probably be removed in the future, - use server-header filters instead. -

Example usage:

+ +
# Disarm the download link in Sourceforge's patch tracker
+/
+
+
+

+
+
+
+ +
+

8.5.21. hide-content-disposition

+ +
+
+
Typical use:
+ +
+

Prevent download menus for content you prefer to view inside + the browser.

+
+ +
Effect:
+ +
+

Deletes or replaces the "Content-Disposition:" HTTP header set by some + servers.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

Keyword: "block", or any user + defined value.

+
+ +
Notes:
+ +
+

Some servers set the "Content-Disposition:" HTTP header for documents + they assume you want to save locally before viewing them. The + "Content-Disposition:" header + contains the file name the browser is supposed to use by + default.

+ +

In most browsers that understand this header, it makes it + impossible to just + view the document, without downloading it first, even if + it's just a simple text file or an image.

+ +

Removing the "Content-Disposition:" header helps to prevent + this annoyance, but some browsers additionally check the + "Content-Type:" header, before they + decide if they can display a document without saving it first. + In these cases, you have to change this header as well, before + the browser stops displaying download menus.

+ +

It is also possible to change the server's file name + suggestion to another one, but in most cases it isn't worth the + time to set it up.

+ +

This action will probably be removed in the future, use + server-header filters instead.

+
+ +
Example usage:
+ +
+ + +
+
+# Disarm the download link in Sourceforge's patch tracker
 { -filter \
  +content-type-overwrite{text/plain}\
  +hide-content-disposition{block} }
- .sourceforge.net/tracker/download\.php
-

8.5.22. hide-if-modified-since

Typical use:

Prevent yet another way to track the user's steps between sessions.

Effect:

Deletes the "If-Modified-Since:" HTTP client header or modifies its value. -

Type:

Parameterized.

Parameter:

Keyword: "block", or a user defined value that specifies a range of hours. -

Notes:

Removing this header is useful for filter testing, where you want to force a real - reload instead of getting status code "304", which would cause the - browser to use a cached copy of the page. -

Instead of removing the header, hide-if-modified-since can - also add or subtract a random amount of time to/from the header's value. - You specify a range of minutes where the random factor should be chosen from and - Privoxy does the rest. A negative value means - subtracting, a positive value adding. -

Randomizing the value of the "If-Modified-Since:" makes - it less likely that the server can use the time as a cookie replacement, - but you will run into caching problems if the random range is too high. -

It is a good idea to only use a small negative value and let - overwrite-last-modified - handle the greater changes. -

It is also recommended to use this action together with - crunch-if-none-match, - otherwise it's more or less pointless. -

Example usage (section):

+ +
# Let the browser revalidate but make tracking based on the time less likely.
+ .sourceforge.net/tracker/download\.php
+
+
+

+
+
+
+ +
+

8.5.22. hide-if-modified-since

+ +
+
+
Typical use:
+ +
+

Prevent yet another way to track the user's steps between + sessions.

+
+ +
Effect:
+ +
+

Deletes the "If-Modified-Since:" + HTTP client header or modifies its value.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

Keyword: "block", or a user + defined value that specifies a range of hours.

+
+ +
Notes:
+ +
+

Removing this header is useful for filter testing, where you + want to force a real reload instead of getting status code + "304", which would cause the browser + to use a cached copy of the page.

+ +

Instead of removing the header, hide-if-modified-since can also add or subtract + a random amount of time to/from the header's value. You specify + a range of minutes where the random factor should be chosen + from and Privoxy does the + rest. A negative value means subtracting, a positive value + adding.

+ +

Randomizing the value of the "If-Modified-Since:" makes it less likely that + the server can use the time as a cookie replacement, but you + will run into caching problems if the random range is too + high.

+ +

It is a good idea to only use a small negative value and let + overwrite-last-modified + handle the greater changes.

+ +

It is also recommended to use this action together with + crunch-if-none-match, + otherwise it's more or less pointless.

+
+ +
Example usage (section):
+ +
+ + +
+
+# Let the browser revalidate but make tracking based on the time less likely.
 {+hide-if-modified-since{-60} \
  +overwrite-last-modified{randomize} \
  +crunch-if-none-match}
-/
-

8.5.23. hide-from-header

Typical use:

Keep your (old and ill) browser from telling web servers your email address

Effect:

Deletes any existing "From:" HTTP header, or replaces it with the - specified string. -

Type:

Parameterized.

Parameter:

Keyword: "block", or any user defined value. -

Notes:

The keyword "block" will completely remove the header - (not to be confused with the block - action). -

Alternately, you can specify any value you prefer to be sent to the web - server. If you do, it is a matter of fairness not to use any address that - is actually used by a real person. -

This action is rarely needed, as modern web browsers don't send - "From:" headers anymore. -

Example usage:

+hide-from-header{block}
or -
+hide-from-header{spam-me-senseless@sittingduck.example.com}
-

8.5.24. hide-referrer

Typical use:

Conceal which link you followed to get to a particular site

Effect:

Deletes the "Referer:" (sic) HTTP header from the client request, - or replaces it with a forged one. -

Type:

Parameterized.

Parameter:

  • "conditional-block" to delete the header completely if the host has changed.

  • "conditional-forge" to forge the header if the host has changed.

  • "block" to delete the header unconditionally.

  • "forge" to pretend to be coming from the homepage of the server we are talking to.

  • Any other string to set a user defined referrer.

Notes:

conditional-block is the only parameter, - that isn't easily detected in the server's log file. If it blocks the - referrer, the request will look like the visitor used a bookmark or - typed in the address directly. -

Leaving the referrer unmodified for requests on the same host - allows the server owner to see the visitor's "click path", - but in most cases she could also get that information by comparing - other parts of the log file: for example the User-Agent if it isn't - a very common one, or the user's IP address if it doesn't change between - different requests. -

Always blocking the referrer, or using a custom one, can lead to - failures on servers that check the referrer before they answer any - requests, in an attempt to prevent their content from being - embedded or linked to elsewhere. -

Both conditional-block and forge - will work with referrer checks, as long as content and valid referring page - are on the same host. Most of the time that's the case. -

- hide-referer is an alternate spelling of - hide-referrer and the two can be can be freely - substituted with each other. ("referrer" is the - correct English spelling, however the HTTP specification has a bug - it - requires it to be spelled as "referer".) -

Example usage:

+hide-referrer{forge}
or -
+hide-referrer{http://www.yahoo.com/}
-

8.5.25. hide-user-agent

Typical use:

Try to conceal your type of browser and client operating system

Effect:

Replaces the value of the "User-Agent:" HTTP header - in client requests with the specified value. -

Type:

Parameterized.

Parameter:

Any user-defined string. -

Notes:

Warning

This can lead to problems on web sites that depend on looking at this header in - order to customize their content for different browsers (which, by the - way, is NOT the right thing to do: good web sites - work browser-independently). -

Using this action in multi-user setups or wherever different types of - browsers will access the same Privoxy is - not recommended. In single-user, single-browser - setups, you might use it to delete your OS version information from - the headers, because it is an invitation to exploit known bugs for your - OS. It is also occasionally useful to forge this in order to access - sites that won't let you in otherwise (though there may be a good - reason in some cases). Example of this: some MSN sites will not - let Mozilla enter, yet forging to a - Netscape 6.1 user-agent works just fine. - (Must be just a silly MS goof, I'm sure :-). -

More information on known user-agent strings can be found at - http://www.user-agents.org/ - and - http://en.wikipedia.org/wiki/User_agent. -

Example usage:

+hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}
-

8.5.26. limit-connect

Typical use:

Prevent abuse of Privoxy as a TCP proxy relay or disable SSL for untrusted sites

Effect:

Specifies to which ports HTTP CONNECT requests are allowable. -

Type:

Parameterized.

Parameter:

A comma-separated list of ports or port ranges (the latter using dashes, with the minimum - defaulting to 0 and the maximum to 65K). -

Notes:

By default, i.e. if no limit-connect action applies, - Privoxy allows HTTP CONNECT requests to all - ports. Use limit-connect if fine-grained control - is desired for some or all destinations. -

The CONNECT methods exists in HTTP to allow access to secure websites - ("https://" URLs) through proxies. It works very simply: - the proxy connects to the server on the specified port, and then - short-circuits its connections to the client and to the remote server. - This means CONNECT-enabled proxies can be used as TCP relays very easily. -

Privoxy relays HTTPS traffic without seeing - the decoded content. Websites can leverage this limitation to circumvent Privoxy's - filters. By specifying an invalid port range you can disable HTTPS entirely. -

Example usages:

+ +
+limit-connect{443}                   # Port 443 is OK.
+/
+
+
+

+
+
+
+ +
+

8.5.23. hide-from-header

+ +
+
+
Typical use:
+ +
+

Keep your (old and ill) browser from telling web servers + your email address

+
+ +
Effect:
+ +
+

Deletes any existing "From:" HTTP + header, or replaces it with the specified string.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

Keyword: "block", or any user + defined value.

+
+ +
Notes:
+ +
+

The keyword "block" will + completely remove the header (not to be confused with the + block action).

+ +

Alternately, you can specify any value you prefer to be sent + to the web server. If you do, it is a matter of fairness not to + use any address that is actually used by a real person.

+ +

This action is rarely needed, as modern web browsers don't + send "From:" headers anymore.

+
+ +
Example usage:
+ +
+ + + + +
+
++hide-from-header{block}
+
+
or + + + + + +
+
++hide-from-header{spam-me-senseless@sittingduck.example.com}
+
+
+
+
+
+
+ +
+

8.5.24. + hide-referrer

+ +
+
+
Typical use:
+ +
+

Conceal which link you followed to get to a particular + site

+
+ +
Effect:
+ +
+

Deletes the "Referer:" (sic) HTTP + header from the client request, or replaces it with a forged + one.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+
    +
  • +

    "conditional-block" to delete + the header completely if the host has changed.

    +
  • + +
  • +

    "conditional-forge" to forge + the header if the host has changed.

    +
  • + +
  • +

    "block" to delete the header + unconditionally.

    +
  • + +
  • +

    "forge" to pretend to be + coming from the homepage of the server we are talking + to.

    +
  • + +
  • +

    Any other string to set a user defined referrer.

    +
  • +
+
+ +
Notes:
+ +
+

conditional-block is the only + parameter, that isn't easily detected in the server's log file. + If it blocks the referrer, the request will look like the + visitor used a bookmark or typed in the address directly.

+ +

Leaving the referrer unmodified for requests on the same + host allows the server owner to see the visitor's "click path", but in most cases she could also + get that information by comparing other parts of the log file: + for example the User-Agent if it isn't a very common one, or + the user's IP address if it doesn't change between different + requests.

+ +

Always blocking the referrer, or using a custom one, can + lead to failures on servers that check the referrer before they + answer any requests, in an attempt to prevent their content + from being embedded or linked to elsewhere.

+ +

Both conditional-block and + forge will work with referrer checks, + as long as content and valid referring page are on the same + host. Most of the time that's the case.

+ +

hide-referer is an alternate + spelling of hide-referrer and the two + can be can be freely substituted with each other. ("referrer" is the correct English spelling, + however the HTTP specification has a bug - it requires it to be + spelled as "referer".)

+
+ +
Example usage:
+ +
+ + + + +
+
++hide-referrer{forge}
+
+
or + + + + + +
+
++hide-referrer{http://www.yahoo.com/}
+
+
+
+
+
+
+ +
+

8.5.25. hide-user-agent

+ +
+
+
Typical use:
+ +
+

Try to conceal your type of browser and client operating + system

+
+ +
Effect:
+ +
+

Replaces the value of the "User-Agent:" HTTP header in client requests + with the specified value.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

Any user-defined string.

+
+ +
Notes:
+ +
+
+ + + + + + + + +
Warning
+

This can lead to problems on web sites that depend + on looking at this header in order to customize their + content for different browsers (which, by the way, is + NOT the right + thing to do: good web sites work + browser-independently).

+
+
+ +

Using this action in multi-user setups or wherever different + types of browsers will access the same Privoxy is not recommended. In single-user, + single-browser setups, you might use it to delete your OS + version information from the headers, because it is an + invitation to exploit known bugs for your OS. It is also + occasionally useful to forge this in order to access sites that + won't let you in otherwise (though there may be a good reason + in some cases).

+ +

More information on known user-agent strings can be found at + http://www.user-agents.org/ and http://en.wikipedia.org/wiki/User_agent.

+
+ +
Example usage:
+ +
+ + + + +
+
++hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}
+
+
+
+
+
+
+ +
+

8.5.26. + limit-connect

+ +
+
+
Typical use:
+ +
+

Prevent abuse of Privoxy as + a TCP proxy relay or disable SSL for untrusted sites

+
+ +
Effect:
+ +
+

Specifies to which ports HTTP CONNECT requests are + allowable.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

A comma-separated list of ports or port ranges (the latter + using dashes, with the minimum defaulting to 0 and the maximum + to 65K).

+
+ +
Notes:
+ +
+

By default, i.e. if no limit-connect action applies, Privoxy allows HTTP CONNECT requests to + all ports. Use limit-connect if + fine-grained control is desired for some or all + destinations.

+ +

The CONNECT methods exists in HTTP to allow access to secure + websites ("https://" URLs) through + proxies. It works very simply: the proxy connects to the server + on the specified port, and then short-circuits its connections + to the client and to the remote server. This means + CONNECT-enabled proxies can be used as TCP relays very + easily.

+ +

Privoxy relays HTTPS + traffic without seeing the decoded content. Websites can + leverage this limitation to circumvent Privoxy's filters. By specifying an + invalid port range you can disable HTTPS entirely.

+
+ +
Example usages:
+ +
+ + +
+
++limit-connect{443}                   # Port 443 is OK.
 +limit-connect{80,443}                # Ports 80 and 443 are OK.
 +limit-connect{-3, 7, 20-100, 500-}   # Ports less than 3, 7, 20 to 100 and above 500 are OK.
 +limit-connect{-}                     # All ports are OK
-+limit-connect{,}                     # No HTTPS/SSL traffic is allowed
-

8.5.27. prevent-compression

Typical use:

Ensure that servers send the content uncompressed, so it can be - passed through filters. -

Effect:

Removes the Accept-Encoding header which can be used to ask for compressed transfer. -

Type:

Boolean.

Parameter:

N/A -

Notes:

More and more websites send their content compressed by default, which - is generally a good idea and saves bandwidth. But the filter and - deanimate-gifs - actions need access to the uncompressed data. -

When compiled with zlib support (available since Privoxy 3.0.7), content that should be - filtered is decompressed on-the-fly and you don't have to worry about this action. - If you are using an older Privoxy version, or one that hasn't been compiled with zlib - support, this action can be used to convince the server to send the content uncompressed. -

Most text-based instances compress very well, the size is seldom decreased by less than 50%, - for markup-heavy instances like news feeds saving more than 90% of the original size isn't - unusual. -

Not using compression will therefore slow down the transfer, and you should only - enable this action if you really need it. As of Privoxy 3.0.7 it's disabled in all - predefined action settings. -

Note that some (rare) ill-configured sites don't handle requests for uncompressed - documents correctly. Broken PHP applications tend to send an empty document body, - some IIS versions only send the beginning of the content. If you enable - prevent-compression per default, you might want to add - exceptions for those sites. See the example for how to do that. -

Example usage (sections):

+ +
# Selectively turn off compression, and enable a filter
++limit-connect{,}                     # No HTTPS/SSL traffic is allowed
+
+
+

+
+
+
+ +
+

8.5.27. prevent-compression

+ +
+
+
Typical use:
+ +
+

Ensure that servers send the content uncompressed, so it can + be passed through filters.

+
+ +
Effect:
+ +
+

Removes the Accept-Encoding header which can be used to ask + for compressed transfer.

+
+ +
Type:
+ +
+

Boolean.

+
+ +
Parameter:
+ +
+

N/A

+
+ +
Notes:
+ +
+

More and more websites send their content compressed by + default, which is generally a good idea and saves bandwidth. + But the filter and deanimate-gifs + actions need access to the uncompressed data.

+ +

When compiled with zlib support (available since + Privoxy 3.0.7), content that + should be filtered is decompressed on-the-fly and you don't + have to worry about this action. If you are using an older + Privoxy version, or one that + hasn't been compiled with zlib support, this action can be used + to convince the server to send the content uncompressed.

+ +

Most text-based instances compress very well, the size is + seldom decreased by less than 50%, for markup-heavy instances + like news feeds saving more than 90% of the original size isn't + unusual.

+ +

Not using compression will therefore slow down the transfer, + and you should only enable this action if you really need it. + As of Privoxy 3.0.7 it's + disabled in all predefined action settings.

+ +

Note that some (rare) ill-configured sites don't handle + requests for uncompressed documents correctly. Broken PHP + applications tend to send an empty document body, some IIS + versions only send the beginning of the content. If you enable + prevent-compression per default, you + might want to add exceptions for those sites. See the example + for how to do that.

+
+ +
Example usage (sections):
+ +
+ + +
+
+# Selectively turn off compression, and enable a filter
 #
 { +filter{tiny-textforms} +prevent-compression }
 # Match only these sites
@@ -5741,1076 +3640,653 @@ CLASS="SCREEN"
 # Then maybe make exceptions for broken sites:
 #
 { -prevent-compression }
-.compusa.com/
-

8.5.28. overwrite-last-modified

Typical use:

Prevent yet another way to track the user's steps between sessions.

Effect:

Deletes the "Last-Modified:" HTTP server header or modifies its value. -

Type:

Parameterized.

Parameter:

One of the keywords: "block", "reset-to-request-time" - and "randomize" -

Notes:

Removing the "Last-Modified:" header is useful for filter - testing, where you want to force a real reload instead of getting status - code "304", which would cause the browser to reuse the old - version of the page. -

The "randomize" option overwrites the value of the - "Last-Modified:" header with a randomly chosen time - between the original value and the current time. In theory the server - could send each document with a different "Last-Modified:" - header to track visits without using cookies. "Randomize" - makes it impossible and the browser can still revalidate cached documents. -

"reset-to-request-time" overwrites the value of the - "Last-Modified:" header with the current time. You could use - this option together with - hide-if-modified-since - to further customize your random range. -

The preferred parameter here is "randomize". It is safe - to use, as long as the time settings are more or less correct. - If the server sets the "Last-Modified:" header to the time - of the request, the random range becomes zero and the value stays the same. - Therefore you should later randomize it a second time with - hided-if-modified-since, - just to be sure. -

It is also recommended to use this action together with - crunch-if-none-match. -

Example usage:

+ +
# Let the browser revalidate without being tracked across sessions
+.compusa.com/
+
+
+

+
+
+
+ +
+

8.5.28. overwrite-last-modified

+ +
+
+
Typical use:
+ +
+

Prevent yet another way to track the user's steps between + sessions.

+
+ +
Effect:
+ +
+

Deletes the "Last-Modified:" HTTP + server header or modifies its value.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

One of the keywords: "block", + "reset-to-request-time" and + "randomize"

+
+ +
Notes:
+ +
+

Removing the "Last-Modified:" + header is useful for filter testing, where you want to force a + real reload instead of getting status code "304", which would cause the browser to reuse + the old version of the page.

+ +

The "randomize" option overwrites + the value of the "Last-Modified:" + header with a randomly chosen time between the original value + and the current time. In theory the server could send each + document with a different "Last-Modified:" header to track visits without + using cookies. "Randomize" makes it + impossible and the browser can still revalidate cached + documents.

+ +

"reset-to-request-time" + overwrites the value of the "Last-Modified:" header with the current time. + You could use this option together with hide-if-modified-since + to further customize your random range.

+ +

The preferred parameter here is "randomize". It is safe to use, as long as the + time settings are more or less correct. If the server sets the + "Last-Modified:" header to the time + of the request, the random range becomes zero and the value + stays the same. Therefore you should later randomize it a + second time with hided-if-modified-since, + just to be sure.

+ +

It is also recommended to use this action together with + crunch-if-none-match.

+
+ +
Example usage:
+ +
+ + +
+
+# Let the browser revalidate without being tracked across sessions
 { +hide-if-modified-since{-60} \
  +overwrite-last-modified{randomize} \
  +crunch-if-none-match}
-/
-

8.5.29. redirect

Typical use:

Redirect requests to other sites. -

Effect:

Convinces the browser that the requested document has been moved - to another location and the browser should get it from there. -

Type:

Parameterized

Parameter:

An absolute URL or a single pcrs command. -

Notes:

Requests to which this action applies are answered with a - HTTP redirect to URLs of your choosing. The new URL is - either provided as parameter, or derived by applying a - single pcrs command to the original URL. -

This action will be ignored if you use it together with - block. - It can be combined with - fast-redirects{check-decoded-url} - to redirect to a decoded version of a rewritten URL. -

Use this action carefully, make sure not to create redirection loops - and be aware that using your own redirects might make it - possible to fingerprint your requests. -

In case of problems with your redirects, or simply to watch - them working, enable debug 128. -

Example usages:

+ +
# Replace example.com's style sheet with another one
+/
+
+
+

+
+
+
+ +
+

8.5.29. + redirect

+ +
+
+
Typical use:
+ +
+

Redirect requests to other sites.

+
+ +
Effect:
+ +
+

Convinces the browser that the requested document has been + moved to another location and the browser should get it from + there.

+
+ +
Type:
+ +
+

Parameterized

+
+ +
Parameter:
+ +
+

An absolute URL or a single pcrs command.

+
+ +
Notes:
+ +
+

Requests to which this action applies are answered with a + HTTP redirect to URLs of your choosing. The new URL is either + provided as parameter, or derived by applying a single pcrs + command to the original URL.

+ +

This action will be ignored if you use it together with + block. It can be combined + with fast-redirects{check-decoded-url} + to redirect to a decoded version of a rewritten URL.

+ +

Use this action carefully, make sure not to create + redirection loops and be aware that using your own redirects + might make it possible to fingerprint your requests.

+ +

In case of problems with your redirects, or simply to watch + them working, enable debug + 128.

+
+ +
Example usages:
+ +
+ + +
+
+# Replace example.com's style sheet with another one
 { +redirect{http://localhost/css-replacements/example.com.css} }
  example.com/stylesheet\.css
 
 # Create a short, easy to remember nickname for a favorite site
-# (relies on the browser accept and forward invalid URLs to Privoxy)
+# (relies on the browser accept and forward invalid URLs to Privoxy)
 { +redirect{http://www.privoxy.org/user-manual/actions-file.html} }
  a
 
 # Always use the expanded view for Undeadly.org articles
 # (Note the $ at the end of the URL pattern to make sure
 # the request for the rewritten URL isn't redirected as well)
-{+redirect{s@$@&mode=expanded@}}
-undeadly.org/cgi\?action=article&sid=\d*$
+{+redirect{s@$@&mode=expanded@}}
+undeadly.org/cgi\?action=article&sid=\d*$
 
 # Redirect Google search requests to MSN
-{+redirect{s@^http://[^/]*/search\?q=([^&]*).*@http://search.msn.com/results.aspx?q=$1@}}
+{+redirect{s@^http://[^/]*/search\?q=([^&]*).*@http://search.msn.com/results.aspx?q=$1@}}
 .google.com/search
 
 # Redirect MSN search requests to Yahoo
-{+redirect{s@^http://[^/]*/results\.aspx\?q=([^&]*).*@http://search.yahoo.com/search?p=$1@}}
+{+redirect{s@^http://[^/]*/results\.aspx\?q=([^&]*).*@http://search.yahoo.com/search?p=$1@}}
 search.msn.com//results\.aspx\?q=
 
 # Redirect remote requests for this manual
 # to the local version delivered by Privoxy
 {+redirect{s@^http://www@http://config@}}
-www.privoxy.org/user-manual/
-

8.5.30. server-header-filter

Typical use:

Rewrite or remove single server headers. -

Effect:

All server headers to which this action applies are filtered on-the-fly - through the specified regular expression based substitutions. -

Type:

Parameterized.

Parameter:

The name of a server-header filter, as defined in one of the - filter files. -

Notes:

Server-header filters are applied to each header on its own, not to - all at once. This makes it easier to diagnose problems, but on the downside - you can't write filters that only change header x if header y's value is z. - You can do that by using tags though. -

Server-header filters are executed after the other header actions have finished - and use their output as input. -

Please refer to the filter file chapter - to learn which server-header filters are available by default, and how to - create your own. -

Example usage (section):

+ +
{+server-header-filter{html-to-xml}}
+www.privoxy.org/user-manual/
+
+
+

+
+
+
+ +
+

8.5.30. server-header-filter

+ +
+
+
Typical use:
+ +
+

Rewrite or remove single server headers.

+
+ +
Effect:
+ +
+

All server headers to which this action applies are filtered + on-the-fly through the specified regular expression based + substitutions.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

The name of a server-header filter, as defined in one of the + filter files.

+
+ +
Notes:
+ +
+

Server-header filters are applied to each header on its own, + not to all at once. This makes it easier to diagnose problems, + but on the downside you can't write filters that only change + header x if header y's value is z. You can do that by using + tags though.

+ +

Server-header filters are executed after the other header + actions have finished and use their output as input.

+ +

Please refer to the filter file + chapter to learn which server-header filters are available + by default, and how to create your own.

+
+ +
Example usage (section):
+ +
+ + +
+
+{+server-header-filter{html-to-xml}}
 example.org/xml-instance-that-is-delivered-as-html
 
 {+server-header-filter{xml-to-html}}
 example.org/instance-that-is-delivered-as-xml-but-is-not
-    
-

8.5.31. server-header-tagger

Typical use:

Enable or disable filters based on the Content-Type header. -

Effect:

Server headers to which this action applies are filtered on-the-fly through - the specified regular expression based substitutions, the result is used as - tag. -

Type:

Parameterized.

Parameter:

The name of a server-header tagger, as defined in one of the - filter files. -

Notes:

Server-header taggers are applied to each header on its own, - and as the header isn't modified, each tagger "sees" - the original. -

Server-header taggers are executed before all other header actions - that modify server headers. Their tags can be used to control - all of the other server-header actions, the content filters - and the crunch actions (redirect - and block). -

Obviously crunching based on tags created by server-header taggers - doesn't prevent the request from showing up in the server's log file. -

Example usage (section):

+ +
# Tag every request with the content type declared by the server
+
+
+
+

+
+
+
+ +
+

8.5.31. server-header-tagger

+ +
+
+
Typical use:
+ +
+

Enable or disable filters based on the Content-Type + header.

+
+ +
Effect:
+ +
+

Server headers to which this action applies are filtered + on-the-fly through the specified regular expression based + substitutions, the result is used as tag.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

The name of a server-header tagger, as defined in one of the + filter files.

+
+ +
Notes:
+ +
+

Server-header taggers are applied to each header on its own, + and as the header isn't modified, each tagger "sees" the original.

+ +

Server-header taggers are executed before all other header + actions that modify server headers. Their tags can be used to + control all of the other server-header actions, the content + filters and the crunch actions (redirect and block).

+ +

Obviously crunching based on tags created by server-header + taggers doesn't prevent the request from showing up in the + server's log file.

+
+ +
Example usage (section):
+ +
+ + +
+
+# Tag every request with the content type declared by the server
 {+server-header-tagger{content-type}}
 /
-    
-

8.5.32. session-cookies-only

Typical use:

Allow only temporary "session" cookies (for the current - browser session only). -

Effect:

Deletes the "expires" field from "Set-Cookie:" - server headers. Most browsers will not store such cookies permanently and - forget them in between sessions. -

Type:

Boolean.

Parameter:

N/A -

Notes:

This is less strict than crunch-incoming-cookies / - crunch-outgoing-cookies and allows you to browse - websites that insist or rely on setting cookies, without compromising your privacy too badly. -

Most browsers will not permanently store cookies that have been processed by - session-cookies-only and will forget about them between sessions. - This makes profiling cookies useless, but won't break sites which require cookies so - that you can log in for transactions. This is generally turned on for all - sites, and is the recommended setting. -

It makes no sense at all to use session-cookies-only - together with crunch-incoming-cookies or - crunch-outgoing-cookies. If you do, cookies - will be plainly killed. -

Note that it is up to the browser how it handles such cookies without an "expires" - field. If you use an exotic browser, you might want to try it out to be sure. -

This setting also has no effect on cookies that may have been stored - previously by the browser before starting Privoxy. - These would have to be removed manually. -

Privoxy also uses - the content-cookies filter - to block some types of cookies. Content cookies are not effected by - session-cookies-only. -

Example usage:

+session-cookies-only
-

8.5.33. set-image-blocker

Typical use:

Choose the replacement for blocked images

Effect:

This action alone doesn't do anything noticeable. If both - block and handle-as-image also - apply, i.e. if the request is to be blocked as an image, - then the parameter of this action decides what will be - sent as a replacement. -

Type:

Parameterized.

Parameter:

  • "pattern" to send a built-in checkerboard pattern image. The image is visually - decent, scales very well, and makes it obvious where banners were busted. -

  • "blank" to send a built-in transparent image. This makes banners disappear - completely, but makes it hard to detect where Privoxy has blocked - images on a given page and complicates troubleshooting if Privoxy - has blocked innocent images, like navigation icons. -

  • "target-url" to - send a redirect to target-url. You can redirect - to any image anywhere, even in your local filesystem via "file:///" URL. - (But note that not all browsers support redirecting to a local file system). -

    A good application of redirects is to use special Privoxy-built-in - URLs, which send the built-in images, as target-url. - This has the same visual effect as specifying "blank" or "pattern" in - the first place, but enables your browser to cache the replacement image, instead of requesting - it over and over again. -

Notes:

The URLs for the built-in images are "http://config.privoxy.org/send-banner?type=type", where type is - either "blank" or "pattern". -

There is a third (advanced) type, called "auto". It is NOT to be - used in set-image-blocker, but meant for use from filters. - Auto will select the type of image that would have applied to the referring page, had it been an image. -

Example usage:

Built-in pattern: -

+set-image-blocker{pattern}
-

Redirect to the BSD daemon: -

+set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}
-

Redirect to the built-in pattern for better caching: -

+set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}
-

8.5.34. Summary

Note that many of these actions have the potential to cause a page to - misbehave, possibly even not to display at all. There are many ways - a site designer may choose to design his site, and what HTTP header - content, and other criteria, he may depend on. There is no way to have hard - and fast rules for all sites. See the Appendix for a brief example on troubleshooting - actions.

8.6. Aliases

Custom "actions", known to Privoxy - as "aliases", can be defined by combining other actions. - These can in turn be invoked just like the built-in actions. - Currently, an alias name can contain any character except space, tab, - "=", - "{" and "}", but we strongly - recommend that you only use "a" to "z", - "0" to "9", "+", and "-". - Alias names are not case sensitive, and are not required to start with a - "+" or "-" sign, since they are merely textually - expanded.

Aliases can be used throughout the actions file, but they must be - defined in a special section at the top of the file! - And there can only be one such section per actions file. Each actions file may - have its own alias section, and the aliases defined in it are only visible - within that file.

There are two main reasons to use aliases: One is to save typing for frequently - used combinations of actions, the other one is a gain in flexibility: If you - decide once how you want to handle shops by defining an alias called - "shop", you can later change your policy on shops in - one place, and your changes will take effect everywhere - in the actions file where the "shop" alias is used. Calling aliases - by their purpose also makes your actions files more readable.

Currently, there is one big drawback to using aliases, though: - Privoxy's built-in web-based action file - editor honors aliases when reading the actions files, but it expands - them before writing. So the effects of your aliases are of course preserved, - but the aliases themselves are lost when you edit sections that use aliases - with it.

Now let's define some aliases...

+ +
 # Useful custom aliases we can use later.
+
+
+
+ + +

+
+ +
+

8.5.32. session-cookies-only

+ +
+
+
Typical use:
+ +
+

Allow only temporary "session" + cookies (for the current browser session only).

+
+ +
Effect:
+ +
+

Deletes the "expires" field from + "Set-Cookie:" server headers. Most + browsers will not store such cookies permanently and forget + them in between sessions.

+
+ +
Type:
+ +
+

Boolean.

+
+ +
Parameter:
+ +
+

N/A

+
+ +
Notes:
+ +
+

This is less strict than crunch-incoming-cookies + / crunch-outgoing-cookies + and allows you to browse websites that insist or rely on + setting cookies, without compromising your privacy too + badly.

+ +

Most browsers will not permanently store cookies that have + been processed by session-cookies-only + and will forget about them between sessions. This makes + profiling cookies useless, but won't break sites which require + cookies so that you can log in for transactions. This is + generally turned on for all sites, and is the recommended + setting.

+ +

It makes no sense at + all to use session-cookies-only + together with crunch-incoming-cookies + or crunch-outgoing-cookies. + If you do, cookies will be plainly killed.

+ +

Note that it is up to the browser how it handles such + cookies without an "expires" field. + If you use an exotic browser, you might want to try it out to + be sure.

+ +

This setting also has no effect on cookies that may have + been stored previously by the browser before starting + Privoxy. These would have to + be removed manually.

+ +

Privoxy also uses the + content-cookies + filter to block some types of cookies. Content cookies are + not effected by session-cookies-only.

+
+ +
Example usage:
+ +
+ + + + +
+
++session-cookies-only
+
+
+
+
+
+
+ +
+

8.5.33. set-image-blocker

+ +
+
+
Typical use:
+ +
+

Choose the replacement for blocked images

+
+ +
Effect:
+ +
+

This action alone doesn't do anything noticeable. If + both block + and handle-as-image + also apply, i.e. if + the request is to be blocked as an image, then the parameter of this action + decides what will be sent as a replacement.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+
    +
  • +

    "pattern" to send a built-in + checkerboard pattern image. The image is visually decent, + scales very well, and makes it obvious where banners were + busted.

    +
  • + +
  • +

    "blank" to send a built-in + transparent image. This makes banners disappear completely, + but makes it hard to detect where Privoxy has blocked images on a given + page and complicates troubleshooting if Privoxy has blocked innocent images, + like navigation icons.

    +
  • + +
  • +

    "target-url" to send a redirect + to target-url. You can + redirect to any image anywhere, even in your local + filesystem via "file:///" URL. + (But note that not all browsers support redirecting to a + local file system).

    + +

    A good application of redirects is to use special + Privoxy-built-in URLs, + which send the built-in images, as target-url. This has the same visual + effect as specifying "blank" or + "pattern" in the first place, + but enables your browser to cache the replacement image, + instead of requesting it over and over again.

    +
  • +
+
+ +
Notes:
+ +
+

The URLs for the built-in images are "http://config.privoxy.org/send-banner?type=type", where type is either "blank" or "pattern".

+ +

There is a third (advanced) type, called "auto". It is NOT to be used in set-image-blocker, but meant for use from + filters. Auto will select the + type of image that would have applied to the referring page, + had it been an image.

+
+ +
Example usage:
+ +
+

Built-in pattern:

+ + + + + +
+
++set-image-blocker{pattern}
+
+
+ +

Redirect to the BSD daemon:

+ + + + + +
+
++set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}
+
+
+ +

Redirect to the built-in pattern for better caching:

+ + + + + +
+
++set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}
+
+
+
+
+
+
+ +
+

8.5.34. + Summary

+ +

Note that many of these actions have the potential to cause a page + to misbehave, possibly even not to display at all. There are many + ways a site designer may choose to design his site, and what HTTP + header content, and other criteria, he may depend on. There is no way + to have hard and fast rules for all sites. See the Appendix for a brief example on + troubleshooting actions.

+
+
+ +
+

8.6. Aliases

+ +

Custom "actions", known to Privoxy as "aliases", + can be defined by combining other actions. These can in turn be invoked + just like the built-in actions. Currently, an alias name can contain + any character except space, tab, "=", + "{" and "}", but + we strongly recommend that + you only use "a" to "z", "0" to "9", "+", and "-". Alias names are not case sensitive, and are not + required to start with a "+" or "-" sign, since they are merely textually expanded.

+ +

Aliases can be used throughout the actions file, but they + must be defined in a special section + at the top of the file! And there can only be one such section + per actions file. Each actions file may have its own alias section, and + the aliases defined in it are only visible within that file.

+ +

There are two main reasons to use aliases: One is to save typing for + frequently used combinations of actions, the other one is a gain in + flexibility: If you decide once how you want to handle shops by + defining an alias called "shop", you can + later change your policy on shops in one place, and your changes will take + effect everywhere in the actions file where the "shop" alias is used. Calling aliases by their purpose + also makes your actions files more readable.

+ +

Currently, there is one big drawback to using aliases, though: + Privoxy's built-in web-based action + file editor honors aliases when reading the actions files, but it + expands them before writing. So the effects of your aliases are of + course preserved, but the aliases themselves are lost when you edit + sections that use aliases with it.

+ +

Now let's define some aliases...

+ + + +
+
+ # Useful custom aliases we can use later.
  #
  # Note the (required!) section header line and that this section
  # must be at the top of the actions file!
@@ -6820,79 +4296,46 @@ CLASS="SCREEN"
  # These aliases just save typing later:
  # (Note that some already use other aliases!)
  #
- +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
- -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
+ +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
+ -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
  +block-as-image      = +block{Blocked image.} +handle-as-image
- allow-all-cookies   = -crunch-all-cookies -session-cookies-only -filter{content-cookies}
+ allow-all-cookies   = -crunch-all-cookies -session-cookies-only -filter{content-cookies}
 
  # These aliases define combinations of actions
  # that are useful for certain types of sites:
  #
- fragile     = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer -prevent-compression
+ fragile     = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer -prevent-compression
 
- shop        = -crunch-all-cookies -filter{all-popups}
+ shop        = -crunch-all-cookies -filter{all-popups}
 
  # Short names for other aliases, for really lazy people ;-)
  #
  c0 = +crunch-all-cookies
- c1 = -crunch-all-cookies

...and put them to use. These sections would appear in the lower part of an - actions file and define exceptions to the default actions (as specified further - up for the "/" pattern):

+ +
 # These sites are either very complex or very keen on
+ c1 = -crunch-all-cookies
+
+
+ +

...and put them to use. These sections would appear in the lower + part of an actions file and define exceptions to the default actions + (as specified further up for the "/" + pattern):

+ + + +
+
+ # These sites are either very complex or very keen on
  # user data and require minimal interference to work:
  #
  {fragile}
@@ -6903,7 +4346,7 @@ CLASS="SCREEN"
 
  # Shopping sites:
  # Allow cookies (for setting and retrieving your customer data)
- #           
+ #
  {shop}
  .quietpc.com
  .worldpay.com   # for quietpc.com
@@ -6913,234 +4356,123 @@ CLASS="SCREEN"
  #
  {-filter{all-popups} -filter{unsolicited-popups}}
   .dabs.com
-  .overclockers.co.uk

Aliases like "shop" and "fragile" are typically used for - "problem" sites that require more than one action to be disabled - in order to function properly.

8.7. Actions Files Tutorial

The above chapters have shown which actions files - there are and how they are organized, how actions are specified and applied - to URLs, how patterns work, and how to - define and use aliases. Now, let's look at an - example match-all.action, default.action - and user.action file and see how all these pieces come together:

8.7.1. match-all.action

Remember all actions are disabled when matching starts, - so we have to explicitly enable the ones we want.

While the match-all.action file only contains a - single section, it is probably the most important one. It has only one - pattern, "/", but this pattern - matches all URLs. Therefore, the set of - actions used in this "default" section will - be applied to all requests as a start. It can be partly or - wholly overridden by other actions files like default.action - and user.action, but it will still be largely responsible - for your overall browsing experience.

Again, at the start of matching, all actions are disabled, so there is - no need to disable any actions here. (Remember: a "+" - preceding the action name enables the action, a "-" disables!). - Also note how this long line has been made more readable by splitting it into - multiple lines with line continuation.

+ +
{ \
- +change-x-forwarded-for{block} \
- +hide-from-header{block} \
- +set-image-blocker{pattern} \
+  .overclockers.co.uk
+
+
+ +

Aliases like "shop" and "fragile" are typically used for "problem" sites that require more than one action to be + disabled in order to function properly.

+
+ +
+

8.7. Actions + Files Tutorial

+ +

The above chapters have shown which + actions files there are and how they are organized, how actions are + specified and applied to URLs, how patterns work, and how to define + and use aliases. Now, let's + look at an example match-all.action, + default.action and user.action file and see how all these pieces come + together:

+ +
+

8.7.1. + match-all.action

+ +

Remember all actions are + disabled when matching starts, so we have to explicitly enable + the ones we want.

+ +

While the match-all.action file only + contains a single section, it is probably the most important one. It + has only one pattern, "/", but this pattern matches all URLs. Therefore, the + set of actions used in this "default" + section will be applied to all + requests as a start. It can be partly or wholly overridden by + other actions files like default.action and + user.action, but it will still be largely + responsible for your overall browsing experience.

+ +

Again, at the start of matching, all actions are disabled, so + there is no need to disable any actions here. (Remember: a + "+" preceding the action name enables the + action, a "-" disables!). Also note how + this long line has been made more readable by splitting it into + multiple lines with line continuation.

+ + + +
+
+{ \
+ +change-x-forwarded-for{block} \
+ +hide-from-header{block} \
+ +set-image-blocker{pattern} \
 }
 / # Match all URLs
- 

The default behavior is now set.

8.7.2. default.action

If you aren't a developer, there's no need for you to edit the - default.action file. It is maintained by - the Privoxy developers and if you disagree with some of the - sections, you should overrule them in your user.action.

Understanding the default.action file can - help you with your user.action, though.

The first section in this file is a special section for internal use - that prevents older Privoxy versions from reading the file:

+ +
##########################################################################
+
+
+
+ +

The default behavior is now set.

+
+ +
+

8.7.2. + default.action

+ +

If you aren't a developer, there's no need for you to edit the + default.action file. It is maintained by + the Privoxy developers and if you + disagree with some of the sections, you should overrule them in your + user.action.

+ +

Understanding the default.action file + can help you with your user.action, + though.

+ +

The first section in this file is a special section for internal + use that prevents older Privoxy + versions from reading the file:

+ + + +
+
+##########################################################################
 # Settings -- Don't change! For internal Privoxy use ONLY.
 ##########################################################################
 {{settings}}
-for-privoxy-version=3.0.11

After that comes the (optional) alias section. We'll use the example - section from the above chapter on aliases, - that also explains why and how aliases are used:

+ +
##########################################################################
+for-privoxy-version=3.0.11
+
+
+ +

After that comes the (optional) alias section. We'll use the + example section from the above chapter on aliases, that also + explains why and how aliases are used:

+ + + +
+
+##########################################################################
 # Aliases
 ##########################################################################
 {{alias}}
@@ -7148,76 +4480,42 @@ CLASS="SCREEN"
  # These aliases just save typing later:
  # (Note that some already use other aliases!)
  #
- +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
- -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
+ +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
+ -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
  +block-as-image      = +block{Blocked image.} +handle-as-image
- mercy-for-cookies   = -crunch-all-cookies -session-cookies-only -filter{content-cookies}
+ mercy-for-cookies   = -crunch-all-cookies -session-cookies-only -filter{content-cookies}
 
  # These aliases define combinations of actions
  # that are useful for certain types of sites:
  #
- fragile     = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer
- shop        = -crunch-all-cookies -filter{all-popups}

The first of our specialized sections is concerned with "fragile" - sites, i.e. sites that require minimum interference, because they are either - very complex or very keen on tracking you (and have mechanisms in place that - make them unusable for people who avoid being tracked). We will simply use - our pre-defined fragile alias instead of stating the list - of actions explicitly:

+ +
##########################################################################
+ fragile     = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer
+ shop        = -crunch-all-cookies -filter{all-popups}
+
+
+ +

The first of our specialized sections is concerned with + "fragile" sites, i.e. sites that require + minimum interference, because they are either very complex or very + keen on tracking you (and have mechanisms in place that make them + unusable for people who avoid being tracked). We will simply use our + pre-defined fragile alias instead of stating + the list of actions explicitly:

+ + + +
+
+##########################################################################
 # Exceptions for sites that'll break under the default action set:
 ##########################################################################
 
@@ -7226,239 +4524,148 @@ CLASS="SCREEN"
 { fragile }
 .office.microsoft.com           # surprise, surprise!
 .windowsupdate.microsoft.com
-mail.google.com

Shopping sites are not as fragile, but they typically - require cookies to log in, and pop-up windows for shopping - carts or item details. Again, we'll use a pre-defined alias:

+ +
# Shopping sites:
+mail.google.com
+
+
+ +

Shopping sites are not as fragile, but they typically require + cookies to log in, and pop-up windows for shopping carts or item + details. Again, we'll use a pre-defined alias:

+ + + +
+
+# Shopping sites:
 #
 { shop }
-.quietpc.com 
+.quietpc.com
 .worldpay.com   # for quietpc.com
 .jungle.com
-.scan.co.uk

The fast-redirects - action, which may have been enabled in match-all.action, - breaks some sites. So disable it for popular sites where we know it misbehaves:

+ +
{ -fast-redirects }
+.scan.co.uk
+
+
+ +

The fast-redirects action, + which may have been enabled in match-all.action, breaks some sites. So disable it + for popular sites where we know it misbehaves:

+ + + +
+
+{ -fast-redirects }
 login.yahoo.com
 edit.*.yahoo.com
 .google.com
 .altavista.com/.*(like|url|link):http
 .altavista.com/trans.*urltext=http
-.nytimes.com

It is important that Privoxy knows which - URLs belong to images, so that if they are to - be blocked, a substitute image can be sent, rather than an HTML page. - Contacting the remote site to find out is not an option, since it - would destroy the loading time advantage of banner blocking, and it - would feed the advertisers information about you. We can mark any - URL as an image with the handle-as-image action, - and marking all URLs that end in a known image file extension is a - good start:

+ +
##########################################################################
+.nytimes.com
+
+
+ +

It is important that Privoxy + knows which URLs belong to images, so that if they are to be blocked, a substitute + image can be sent, rather than an HTML page. Contacting the remote + site to find out is not an option, since it would destroy the loading + time advantage of banner blocking, and it would feed the advertisers + information about you. We can mark any URL as an image with the + handle-as-image action, + and marking all URLs that end in a known image file extension is a + good start:

+ + + +
+
+##########################################################################
 # Images:
 ##########################################################################
 
 # Define which file types will be treated as images, in case they get
 # blocked further down this file:
 #
-{ +handle-as-image }
-/.*\.(gif|jpe?g|png|bmp|ico)$

And then there are known banner sources. They often use scripts to - generate the banners, so it won't be visible from the URL that the - request is for an image. Hence we block them and - mark them as images in one go, with the help of our - +block-as-image alias defined above. (We could of - course just as well use +block - +handle-as-image here.) - Remember that the type of the replacement image is chosen by the - set-image-blocker - action. Since all URLs have matched the default section with its - +set-image-blocker{pattern} - action before, it still applies and needn't be repeated:

+ +
# Known ad generators:
+{ +handle-as-image }
+/.*\.(gif|jpe?g|png|bmp|ico)$
+
+
+ +

And then there are known banner sources. They often use scripts to + generate the banners, so it won't be visible from the URL that the + request is for an image. Hence we block them and mark them as images in one go, with + the help of our +block-as-image alias + defined above. (We could of course just as well use +block +handle-as-image here.) + Remember that the type of the replacement image is chosen by the + set-image-blocker + action. Since all URLs have matched the default section with its + +set-image-blocker{pattern} + action before, it still applies and needn't be repeated:

+ + + +
+
+# Known ad generators:
 #
 { +block-as-image }
-ar.atwola.com 
+ar.atwola.com
 .ad.doubleclick.net
 .ad.*.doubleclick.net
 .a.yimg.com/(?:(?!/i/).)*$
 .a[0-9].yimg.com/(?:(?!/i/).)*$
 bs*.gsanet.com
-.qkimg.net

One of the most important jobs of Privoxy - is to block banners. Many of these can be "blocked" - by the filter{banners-by-size} - action, which we enabled above, and which deletes the references to banner - images from the pages while they are loaded, so the browser doesn't request - them anymore, and hence they don't need to be blocked here. But this naturally - doesn't catch all banners, and some people choose not to use filters, so we - need a comprehensive list of patterns for banner URLs here, and apply the - block action to them.

First comes many generic patterns, which do most of the work, by - matching typical domain and path name components of banners. Then comes - a list of individual patterns for specific sites, which is omitted here - to keep the example short:

+ +
##########################################################################
+.qkimg.net
+
+
+ +

One of the most important jobs of Privoxy is to block banners. Many of these can + be "blocked" by the filter{banners-by-size} action, + which we enabled above, and which deletes the references to banner + images from the pages while they are loaded, so the browser doesn't + request them anymore, and hence they don't need to be blocked here. + But this naturally doesn't catch all banners, and some people choose + not to use filters, so we need a comprehensive list of patterns for + banner URLs here, and apply the block action to them.

+ +

First comes many generic patterns, which do most of the work, by + matching typical domain and path name components of banners. Then + comes a list of individual patterns for specific sites, which is + omitted here to keep the example short:

+ + + +
+
+##########################################################################
 # Block these fine banners:
 ##########################################################################
-{ +block{Banner ads.} }
+{ +block{Banner ads.} }
 
 # Generic patterns:
-# 
+#
 ad*.
 .*ads.
 banner?.
@@ -7468,137 +4675,56 @@ count*.
 
 # Site-specific patterns (abbreviated):
 #
-.hitbox.com

It's quite remarkable how many advertisers actually call their banner - servers ads.company.com, or call the directory - in which the banners are stored simply "banners". So the above - generic patterns are surprisingly effective.

But being very generic, they necessarily also catch URLs that we don't want - to block. The pattern .*ads. e.g. catches - "nasty-ads.nasty-corp.com" as intended, - but also "downloads.sourcefroge.net" or - "adsl.some-provider.net." So here come some - well-known exceptions to the +block - section above.

Note that these are exceptions to exceptions from the default! Consider the URL - "downloads.sourcefroge.net": Initially, all actions are deactivated, - so it wouldn't get blocked. Then comes the defaults section, which matches the - URL, but just deactivates the block - action once again. Then it matches .*ads., an exception to the - general non-blocking policy, and suddenly - +block applies. And now, it'll match - .*loads., where -block - applies, so (unless it matches again further down) it ends up - with no block action applying.

+ +
##########################################################################
+.hitbox.com
+
+
+ +

It's quite remarkable how many advertisers actually call their + banner servers ads.company.com, or + call the directory in which the banners are stored simply + "banners". So the above generic patterns + are surprisingly effective.

+ +

But being very generic, they necessarily also catch URLs that we + don't want to block. The pattern .*ads. e.g. + catches "nasty-ads.nasty-corp.com" as intended, + but also "downloads.sourcefroge.net" or + "adsl.some-provider.net." So here + come some well-known exceptions to the +block section above.

+ +

Note that these are exceptions to exceptions from the default! + Consider the URL "downloads.sourcefroge.net": Initially, all actions + are deactivated, so it wouldn't get blocked. Then comes the defaults + section, which matches the URL, but just deactivates the block action + once again. Then it matches .*ads., an + exception to the general non-blocking policy, and suddenly +block applies. + And now, it'll match .*loads., where + -block + applies, so (unless it matches again further down) it ends up with no + block + action applying.

+ + + +
+
+##########################################################################
 # Save some innocent victims of the above generic block patterns:
 ##########################################################################
 
 # By domain:
-# 
-{ -block }
+#
+{ -block }
 adv[io]*.  # (for advogato.org and advice.*)
 adsl.      # (has nothing to do with ads)
 adobe.     # (has nothing to do with ads either)
@@ -7613,147 +4739,87 @@ ad[ud]*.   # (adult.* and add.*)
 # Site-specific:
 #
 www.globalintersec.com/adv # (adv = advanced)
-www.ugu.com/sui/ugu/adv

Filtering source code can have nasty side effects, - so make an exception for our friends at sourceforge.net, - and all paths with "cvs" in them. Note that - -filter - disables all filters in one fell swoop!

+ +
# Don't filter code!
+www.ugu.com/sui/ugu/adv
+
+
+ +

Filtering source code can have nasty side effects, so make an + exception for our friends at sourceforge.net, and all paths with + "cvs" in them. Note that -filter + disables all filters in one + fell swoop!

+ + + +
+
+# Don't filter code!
 #
-{ -filter }
+{ -filter }
 /(.*/)?cvs
 bugzilla.
 developer.
 wiki.
-.sourceforge.net

The actual default.action is of course much more - comprehensive, but we hope this example made clear how it works.

8.7.3. user.action

So far we are painting with a broad brush by setting general policies, - which would be a reasonable starting point for many people. Now, - you might want to be more specific and have customized rules that - are more suitable to your personal habits and preferences. These would - be for narrowly defined situations like your ISP or your bank, and should - be placed in user.action, which is parsed after all other - actions files and hence has the last word, over-riding any previously - defined actions. user.action is also a - safe place for your personal settings, since - default.action is actively maintained by the - Privoxy developers and you'll probably want - to install updated versions from time to time.

So let's look at a few examples of things that one might typically do in - user.action:

# My user.action file. <fred@example.com>

As aliases are local to the actions - file that they are defined in, you can't use the ones from - default.action, unless you repeat them here:

+ +
# Aliases are local to the file they are defined in.
+.sourceforge.net
+
+
+ +

The actual default.action is of course + much more comprehensive, but we hope this example made clear how it + works.

+
+ +
+

8.7.3. + user.action

+ +

So far we are painting with a broad brush by setting general + policies, which would be a reasonable starting point for many people. + Now, you might want to be more specific and have customized rules + that are more suitable to your personal habits and preferences. These + would be for narrowly defined situations like your ISP or your bank, + and should be placed in user.action, which + is parsed after all other actions files and hence has the last word, + over-riding any previously defined actions. user.action is also a safe place for your personal settings, + since default.action is actively maintained + by the Privoxy developers and you'll + probably want to install updated versions from time to time.

+ +

So let's look at a few examples of things that one might typically + do in user.action:

+ + + + + +
+
+# My user.action file. <fred@example.com>
+
+
+ +

As aliases are local to + the actions file that they are defined in, you can't use the ones + from default.action, unless you repeat them + here:

+ + + +
+
+# Aliases are local to the file they are defined in.
 # (Re-)define aliases for this file:
 #
 {{alias}}
-# 
-# These aliases just save typing later, and the alias names should 
+#
+# These aliases just save typing later, and the alias names should
 # be self explanatory.
 #
 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
@@ -7775,83 +4841,56 @@ allow-ads   = -block -filter{banners-by-size} -filter{banners-by-link}
 
 # Alias for specific file types that are text, but might have conflicting
 # MIME types. We want the browser to force these to be text documents.
-handle-as-text = -filter +-content-type-overwrite{text/plain} +-force-text-mode -hide-content-disposition

Say you have accounts on some sites that you visit regularly, and - you don't want to have to log in manually each time. So you'd like - to allow persistent cookies for these sites. The - allow-all-cookies alias defined above does exactly - that, i.e. it disables crunching of cookies in any direction, and the - processing of cookies to make them only temporary.

+ +
{ allow-all-cookies }
+handle-as-text = -filter +-content-type-overwrite{text/plain} +-force-text-mode -hide-content-disposition
+
+
+ +

Say you have accounts on some sites that you visit regularly, and + you don't want to have to log in manually each time. So you'd like to + allow persistent cookies for these sites. The allow-all-cookies alias defined above does exactly + that, i.e. it disables crunching of cookies in any direction, and the + processing of cookies to make them only temporary.

+ + + +
+
+{ allow-all-cookies }
  sourceforge.net
  .yahoo.com
  .msdn.microsoft.com
- .redhat.com

Your bank is allergic to some filter, but you don't know which, so you disable them all:

{ -filter }
- .your-home-banking-site.com

Some file types you may not want to filter for various reasons:

+ +
# Technical documentation is likely to contain strings that might
+ .redhat.com
+
+
+ +

Your bank is allergic to some filter, but you don't know which, so + you disable them all:

+ + + + + +
+
+{ -filter }
+ .your-home-banking-site.com
+
+
+ +

Some file types you may not want to filter for various + reasons:

+ + + +
+
+# Technical documentation is likely to contain strings that might
 # erroneously get altered by the JavaScript-oriented filters:
 #
 .tldp.org
@@ -7860,355 +4899,198 @@ CLASS="SCREEN"
 # And this stupid host sends streaming video with a wrong MIME type,
 # so that Privoxy thinks it is getting HTML and starts filtering:
 #
-stupid-server.example.com/

Example of a simple block action. Say you've - seen an ad on your favourite page on example.com that you want to get rid of. - You have right-clicked the image, selected "copy image location" - and pasted the URL below while removing the leading http://, into a - { +block{} } section. Note that { +handle-as-image - } need not be specified, since all URLs ending in - .gif will be tagged as images by the general rules as set - in default.action anyway:

+ +
{ +block{Nasty ads.} }
+stupid-server.example.com/
+
+
+ +

Example of a simple block + action. Say you've seen an ad on your favourite page on example.com + that you want to get rid of. You have right-clicked the image, + selected "copy image location" and pasted + the URL below while removing the leading http://, into a { +block{} } section. Note that { + +handle-as-image } need not be specified, since all URLs ending + in .gif will be tagged as images by the + general rules as set in default.action anyway:

+ + + +
+
+{ +block{Nasty ads.} }
  www.example.com/nasty-ads/sponsor\.gif
- another.example.net/more/junk/here/

The URLs of dynamically generated banners, especially from large banner - farms, often don't use the well-known image file name extensions, which - makes it impossible for Privoxy to guess - the file type just by looking at the URL. - You can use the +block-as-image alias defined above for - these cases. - Note that objects which match this rule but then turn out NOT to be an - image are typically rendered as a "broken image" icon by the - browser. Use cautiously.

+ +
{ +block-as-image }
+ another.example.net/more/junk/here/
+
+
+ +

The URLs of dynamically generated banners, especially from large + banner farms, often don't use the well-known image file name + extensions, which makes it impossible for Privoxy to guess the file type just by looking + at the URL. You can use the +block-as-image + alias defined above for these cases. Note that objects which match + this rule but then turn out NOT to be an image are typically rendered + as a "broken image" icon by the browser. + Use cautiously.

+ + + +
+
+{ +block-as-image }
  .doubleclick.net
  .fastclick.net
  /Realmedia/ads/
- ar.atwola.com/

Now you noticed that the default configuration breaks Forbes Magazine, - but you were too lazy to find out which action is the culprit, and you - were again too lazy to give feedback, so - you just used the fragile alias on the site, and - -- whoa! -- it worked. The fragile - aliases disables those actions that are most likely to break a site. Also, - good for testing purposes to see if it is Privoxy - that is causing the problem or not. We later find other regular sites - that misbehave, and add those to our personalized list of troublemakers:

+ +
{ fragile }
+ ar.atwola.com/
+
+
+ +

Now you noticed that the default configuration breaks Forbes + Magazine, but you were too lazy to find out which action is the + culprit, and you were again too lazy to give feedback, so you just used the fragile alias on the site, and -- whoa! -- it worked. The fragile aliases disables those actions that are most + likely to break a site. Also, good for testing purposes to see if it + is Privoxy that is causing the + problem or not. We later find other regular sites that misbehave, and + add those to our personalized list of troublemakers:

+ + + +
+
+{ fragile }
  .forbes.com
  webmail.example.com
- .mybank.com

You like the "fun" text replacements in default.filter, - but it is disabled in the distributed actions file. - So you'd like to turn it on in your private, - update-safe config, once and for all:

{ +filter{fun} }
- / # For ALL sites!

Note that the above is not really a good idea: There are exceptions - to the filters in default.action for things that - really shouldn't be filtered, like code on CVS->Web interfaces. Since - user.action has the last word, these exceptions - won't be valid for the "fun" filtering specified here.

You might also worry about how your favourite free websites are - funded, and find that they rely on displaying banner advertisements - to survive. So you might want to specifically allow banners for those - sites that you feel provide value to you:

+ +
{ allow-ads }
+ .mybank.com
+
+
+ +

You like the "fun" text replacements in + default.filter, but it is disabled in the + distributed actions file. So you'd like to turn it on in your + private, update-safe config, once and for all:

+ + + + + +
+
+{ +filter{fun} }
+ / # For ALL sites!
+
+
+ +

Note that the above is not really a good idea: There are + exceptions to the filters in default.action + for things that really shouldn't be filtered, like code on + CVS->Web interfaces. Since user.action + has the last word, these exceptions won't be valid for the + "fun" filtering specified here.

+ +

You might also worry about how your favourite free websites are + funded, and find that they rely on displaying banner advertisements + to survive. So you might want to specifically allow banners for those + sites that you feel provide value to you:

+ + + +
+
+{ allow-ads }
  .sourceforge.net
  .slashdot.org
- .osdn.net

Note that allow-ads has been aliased to - -block, - -filter{banners-by-size}, and - -filter{banners-by-link} above.

Invoke another alias here to force an over-ride of the MIME type application/x-sh which typically would open a download type - dialog. In my case, I want to look at the shell script, and then I can save - it should I choose to.

{ handle-as-text }
- /.*\.sh$

user.action is generally the best place to define - exceptions and additions to the default policies of - default.action. Some actions are safe to have their - default policies set here though. So let's set a default policy to have a - "blank" image as opposed to the checkerboard pattern for - ALL sites. "/" of course matches all URL - paths and patterns:

{ +set-image-blocker{blank} }
-/ # ALL sites


PrevHomeNext
The Main Configuration File Filter Files
\ No newline at end of file + .osdn.net +
+
+ +

Note that allow-ads has been aliased to + -block, -filter{banners-by-size}, + and -filter{banners-by-link} + above.

+ +

Invoke another alias here to force an over-ride of the MIME type + application/x-sh which typically would open + a download type dialog. In my case, I want to look at the shell + script, and then I can save it should I choose to.

+ + + + + +
+
+{ handle-as-text }
+ /.*\.sh$
+
+
+ +

user.action is generally the best place + to define exceptions and additions to the default policies of + default.action. Some actions are safe to + have their default policies set here though. So let's set a default + policy to have a "blank" image as opposed + to the checkerboard pattern for ALL sites. "/" of course matches all URL paths and patterns:

+ + + + + +
+
+{ +set-image-blocker{blank} }
+/ # ALL sites
+
+
+
+
+
+ + + + diff --git a/external/privoxy/doc/webserver/user-manual/appendix.html b/external/privoxy/doc/webserver/user-manual/appendix.html index 4df57a49..1091844d 100644 --- a/external/privoxy/doc/webserver/user-manual/appendix.html +++ b/external/privoxy/doc/webserver/user-manual/appendix.html @@ -1,1454 +1,665 @@ - -Appendix - -
Privoxy 3.0.12 User Manual
Prev 

14. Appendix

14.1. Regular Expressions

Privoxy uses Perl-style "regular - expressions" in its actions - files and filter file, - through the PCRE and - PCRS libraries.

If you are reading this, you probably don't understand what "regular - expressions" are, or what they can do. So this will be a very brief - introduction only. A full explanation would require a book ;-)

Regular expressions provide a language to describe patterns that can be - run against strings of characters (letter, numbers, etc), to see if they - match the string or not. The patterns are themselves (sometimes complex) - strings of literal characters, combined with wild-cards, and other special - characters, called meta-characters. The "meta-characters" have - special meanings and are used to build complex patterns to be matched against. - Perl Compatible Regular Expressions are an especially convenient - "dialect" of the regular expression language.

To make a simple analogy, we do something similar when we use wild-card - characters when listing files with the dir command in DOS. - *.* matches all filenames. The "special" - character here is the asterisk which matches any and all characters. We can be - more specific and use ? to match just individual - characters. So "dir file?.text" would match - "file1.txt", "file2.txt", etc. We are pattern - matching, using a similar technique to "regular expressions"!

Regular expressions do essentially the same thing, but are much, much more - powerful. There are many more "special characters" and ways of - building complex patterns however. Let's look at a few of the common ones, - and then some examples:

. - Matches any single character, e.g. "a", - "A", "4", ":", or "@". -

? - The preceding character or expression is matched ZERO or ONE - times. Either/or. -

+ - The preceding character or expression is matched ONE or MORE - times. -

* - The preceding character or expression is matched ZERO or MORE - times. -

\ - The "escape" character denotes that - the following character should be taken literally. This is used where one of the - special characters (e.g. ".") needs to be taken literally and - not as a special meta-character. Example: "example\.com", makes - sure the period is recognized only as a period (and not expanded to its - meta-character meaning of any single character). -

[ ] - Characters enclosed in brackets will be matched if - any of the enclosed characters are encountered. For instance, "[0-9]" - matches any numeric digit (zero through nine). As an example, we can combine - this with "+" to match any digit one of more times: "[0-9]+". -

( ) - parentheses are used to group a sub-expression, - or multiple sub-expressions. -

| - The "bar" character works like an - "or" conditional statement. A match is successful if the - sub-expression on either side of "|" matches. As an example: - "/(this|that) example/" uses grouping and the bar character - and would match either "this example" or "that - example", and nothing else. -

These are just some of the ones you are likely to use when matching URLs with - Privoxy, and is a long way from a definitive - list. This is enough to get us started with a few simple examples which may - be more illuminating:

/.*/banners/.* - A simple example - that uses the common combination of "." and "*" to - denote any character, zero or more times. In other words, any string at all. - So we start with a literal forward slash, then our regular expression pattern - (".*") another literal forward slash, the string - "banners", another forward slash, and lastly another - ".*". We are building - a directory path here. This will match any file with the path that has a - directory named "banners" in it. The ".*" matches - any characters, and this could conceivably be more forward slashes, so it - might expand into a much longer looking path. For example, this could match: - "/eye/hate/spammers/banners/annoy_me_please.gif", or just - "/banners/annoying.html", or almost an infinite number of other - possible combinations, just so it has "banners" in the path - somewhere.

And now something a little more complex:

/.*/adv((er)?ts?|ertis(ing|ements?))?/ - - We have several literal forward slashes again ("/"), so we are - building another expression that is a file path statement. We have another - ".*", so we are matching against any conceivable sub-path, just so - it matches our expression. The only true literal that must - match our pattern is adv, together with - the forward slashes. What comes after the "adv" string is the - interesting part.

Remember the "?" means the preceding expression (either a - literal character or anything grouped with "(...)" in this case) - can exist or not, since this means either zero or one match. So - "((er)?ts?|ertis(ing|ements?))" is optional, as are the - individual sub-expressions: "(er)", - "(ing|ements?)", and the "s". The "|" - means "or". We have two of those. For instance, - "(ing|ements?)", can expand to match either "ing" - OR "ements?". What is being done here, is an - attempt at matching as many variations of "advertisement", and - similar, as possible. So this would expand to match just "adv", - or "advert", or "adverts", or - "advertising", or "advertisement", or - "advertisements". You get the idea. But it would not match - "advertizements" (with a "z"). We could fix that by - changing our regular expression to: - "/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/", which would then match - either spelling.

/.*/advert[0-9]+\.(gif|jpe?g) - Again - another path statement with forward slashes. Anything in the square brackets - "[ ]" can be matched. This is using "0-9" as a - shorthand expression to mean any digit one through nine. It is the same as - saying "0123456789". So any digit matches. The "+" - means one or more of the preceding expression must be included. The preceding - expression here is what is in the square brackets -- in this case, any digit - one through nine. Then, at the end, we have a grouping: "(gif|jpe?g)". - This includes a "|", so this needs to match the expression on - either side of that bar character also. A simple "gif" on one side, and the other - side will in turn match either "jpeg" or "jpg", - since the "?" means the letter "e" is optional and - can be matched once or not at all. So we are building an expression here to - match image GIF or JPEG type image file. It must include the literal - string "advert", then one or more digits, and a "." - (which is now a literal, and not a special character, since it is escaped - with "\"), and lastly either "gif", or - "jpeg", or "jpg". Some possible matches would - include: "//advert1.jpg", - "/nasty/ads/advert1234.gif", - "/banners/from/hell/advert99.jpg". It would not match - "advert1.gif" (no leading slash), or - "/adverts232.jpg" (the expression does not include an - "s"), or "/advert1.jsp" ("jsp" is not - in the expression anywhere).

We are barely scratching the surface of regular expressions here so that you - can understand the default Privoxy - configuration files, and maybe use this knowledge to customize your own - installation. There is much, much more that can be done with regular - expressions. Now that you know enough to get started, you can learn more on - your own :/

More reading on Perl Compatible Regular expressions: - http://perldoc.perl.org/perlre.html

For information on regular expression based substitutions and their applications - in filters, please see the filter file tutorial - in this manual.

14.2. Privoxy's Internal Pages

Since Privoxy proxies each requested - web page, it is easy for Privoxy to - trap certain special URLs. In this way, we can talk directly to - Privoxy, and see how it is - configured, see how our rules are being applied, change these - rules and other configuration options, and even turn - Privoxy's filtering off, all with - a web browser.

The URLs listed below are the special ones that allow direct access - to Privoxy. Of course, - Privoxy must be running to access these. If - not, you will get a friendly error message. Internet access is not - necessary either.

These may be bookmarked for quick reference. See next.

14.2.1. Bookmarklets

Below are some "bookmarklets" to allow you to easily access a - "mini" version of some of Privoxy's - special pages. They are designed for MS Internet Explorer, but should work - equally well in Netscape, Mozilla, and other browsers which support - JavaScript. They are designed to run directly from your bookmarks - not by - clicking the links below (although that should work for testing).

To save them, right-click the link and choose "Add to Favorites" - (IE) or "Add Bookmark" (Netscape). You will get a warning that - the bookmark "may not be safe" - just click OK. Then you can run the - Bookmarklet directly from your favorites/bookmarks. For even faster access, - you can put them on the "Links" bar (IE) or the "Personal - Toolbar" (Netscape), and run them with a single click.

Credit: The site which gave us the general idea for these bookmarklets is - www.bookmarklets.com. They - have more information about bookmarklets.

14.3. Chain of Events

Let's take a quick look at how some of Privoxy's - core features are triggered, and the ensuing sequence of events when a web - page is requested by your browser:

  • First, your web browser requests a web page. The browser knows to send - the request to Privoxy, which will in turn, - relay the request to the remote web server after passing the following - tests: -

  • Privoxy traps any request for its own internal CGI - pages (e.g http://p.p/) and sends the CGI page back to the browser. -

  • Next, Privoxy checks to see if the URL - matches any "+block" patterns. If - so, the URL is then blocked, and the remote web server will not be contacted. - "+handle-as-image" - and - "+handle-as-empty-document" - are then checked, and if there is no match, an - HTML "BLOCKED" page is sent back to the browser. Otherwise, if - it does match, an image is returned for the former, and an empty text - document for the latter. The type of image would depend on the setting of - "+set-image-blocker" - (blank, checkerboard pattern, or an HTTP redirect to an image elsewhere). -

  • Untrusted URLs are blocked. If URLs are being added to the - trust file, then that is done. -

  • If the URL pattern matches the "+fast-redirects" action, - it is then processed. Unwanted parts of the requested URL are stripped. -

  • Now the rest of the client browser's request headers are processed. If any - of these match any of the relevant actions (e.g. "+hide-user-agent", - etc.), headers are suppressed or forged as determined by these actions and - their parameters. -

  • Now the web server starts sending its response back (i.e. typically a web - page). -

  • First, the server headers are read and processed to determine, among other - things, the MIME type (document type) and encoding. The headers are then - filtered as determined by the - "+crunch-incoming-cookies", - "+session-cookies-only", - and "+downgrade-http-version" - actions. -

  • If any "+filter" action - or "+deanimate-gifs" - action applies (and the document type fits the action), the rest of the page is - read into memory (up to a configurable limit). Then the filter rules (from - default.filter and any other filter files) are - processed against the buffered content. Filters are applied in the order - they are specified in one of the filter files. Animated GIFs, if present, - are reduced to either the first or last frame, depending on the action - setting.The entire page, which is now filtered, is then sent by - Privoxy back to your browser. -

    If neither a "+filter" action - or "+deanimate-gifs" - matches, then Privoxy passes the raw data through - to the client browser as it becomes available. -

  • As the browser receives the now (possibly filtered) page content, it - reads and then requests any URLs that may be embedded within the page - source, e.g. ad images, stylesheets, JavaScript, other HTML documents (e.g. - frames), sounds, etc. For each of these objects, the browser issues a - separate request (this is easily viewable in Privoxy's - logs). And each such request is in turn processed just as above. Note that a - complex web page will have many, many such embedded URLs. If these - secondary requests are to a different server, then quite possibly a very - differing set of actions is triggered. -

NOTE: This is somewhat of a simplistic overview of what happens with each URL - request. For the sake of brevity and simplicity, we have focused on - Privoxy's core features only.

14.4. Troubleshooting: Anatomy of an Action

The way Privoxy applies - actions and filters - to any given URL can be complex, and not always so - easy to understand what is happening. And sometimes we need to be able to - see just what Privoxy is - doing. Especially, if something Privoxy is doing - is causing us a problem inadvertently. It can be a little daunting to look at - the actions and filters files themselves, since they tend to be filled with - regular expressions whose consequences are not - always so obvious.

One quick test to see if Privoxy is causing a problem - or not, is to disable it temporarily. This should be the first troubleshooting - step. See the Bookmarklets section on a quick - and easy way to do this (be sure to flush caches afterward!). Looking at the - logs is a good idea too. (Note that both the toggle feature and logging are - enabled via config file settings, and may need to be - turned "on".)

Another easy troubleshooting step to try is if you have done any - customization of your installation, revert back to the installed - defaults and see if that helps. There are times the developers get complaints - about one thing or another, and the problem is more related to a customized - configuration issue.

Privoxy also provides the - http://config.privoxy.org/show-url-info - page that can show us very specifically how actions - are being applied to any given URL. This is a big help for troubleshooting.

First, enter one URL (or partial URL) at the prompt, and then - Privoxy will tell us - how the current configuration will handle it. This will not - help with filtering effects (i.e. the "+filter" action) from - one of the filter files since this is handled very - differently and not so easy to trap! It also will not tell you about any other - URLs that may be embedded within the URL you are testing. For instance, images - such as ads are expressed as URLs within the raw page source of HTML pages. So - you will only get info for the actual URL that is pasted into the prompt area - -- not any sub-URLs. If you want to know about embedded URLs like ads, you - will have to dig those out of the HTML source. Use your browser's "View - Page Source" option for this. Or right click on the ad, and grab the - URL.

Let's try an example, google.com, - and look at it one section at a time in a sample configuration (your real - configuration may vary):

+ +
 Matches for http://www.google.com:
+
 
- In file: default.action [ View ] [ Edit ]
+
+
+  
+
+  Appendix
+  
+  
+  
+  
+  
+  
+  
+
+
+
+  
+
+  
+

14. Appendix

+ +
+

14.1. Regular + Expressions

+ +

Privoxy uses Perl-style + "regular expressions" in its actions files and filter file, through the PCRE and PCRS libraries.

+ +

If you are reading this, you probably don't understand what + "regular expressions" are, or what they can + do. So this will be a very brief introduction only. A full explanation + would require a book ;-)

+ +

Regular expressions provide a language to describe patterns that can + be run against strings of characters (letter, numbers, etc), to see if + they match the string or not. The patterns are themselves (sometimes + complex) strings of literal characters, combined with wild-cards, and + other special characters, called meta-characters. The "meta-characters" have special meanings and are used to + build complex patterns to be matched against. Perl Compatible Regular + Expressions are an especially convenient "dialect" of the regular expression language.

+ +

To make a simple analogy, we do something similar when we use + wild-card characters when listing files with the dir command in DOS. *.* matches + all filenames. The "special" character here + is the asterisk which matches any and all characters. We can be more + specific and use ? to match just individual + characters. So "dir file?.text" would match + "file1.txt", "file2.txt", etc. We are pattern matching, using a + similar technique to "regular + expressions"!

+ +

Regular expressions do essentially the same thing, but are much, + much more powerful. There are many more "special + characters" and ways of building complex patterns however. Let's + look at a few of the common ones, and then some examples:

+ + + + + + + +
. - Matches any + single character, e.g. "a", + "A", "4", + ":", or "@".
+ + + + + + + +
? - The preceding + character or expression is matched ZERO or ONE times. + Either/or.
+ + + + + + + +
+ - The preceding + character or expression is matched ONE or MORE times.
+ + + + + + + +
* - The preceding + character or expression is matched ZERO or MORE times.
+ + + + + + + +
\ - The + "escape" character denotes that the + following character should be taken literally. This is used where + one of the special characters (e.g. ".") needs to be taken literally and not as a + special meta-character. Example: "example\.com", makes sure the period is + recognized only as a period (and not expanded to its + meta-character meaning of any single character).
+ + + + + + + +
[ ] - Characters + enclosed in brackets will be matched if any of the enclosed + characters are encountered. For instance, "[0-9]" matches any numeric digit (zero through + nine). As an example, we can combine this with "+" to match any digit one of more times: + "[0-9]+".
+ + + + + + + +
( ) - parentheses + are used to group a sub-expression, or multiple + sub-expressions.
+ + + + + + + +
| - The + "bar" character works like an + "or" conditional statement. A match is + successful if the sub-expression on either side of "|" matches. As an example: "/(this|that) example/" uses grouping and the bar + character and would match either "this + example" or "that example", and + nothing else.
+ +

These are just some of the ones you are likely to use when matching + URLs with Privoxy, and is a long way + from a definitive list. This is enough to get us started with a few + simple examples which may be more illuminating:

+ +

/.*/banners/.* - A simple example that uses the + common combination of "." and "*" to denote any character, zero or more times. In + other words, any string at all. So we start with a literal forward + slash, then our regular expression pattern (".*") another literal forward slash, the string + "banners", another forward slash, and lastly + another ".*". We are building a directory + path here. This will match any file with the path that has a directory + named "banners" in it. The ".*" matches any characters, and this could conceivably + be more forward slashes, so it might expand into a much longer looking + path. For example, this could match: "/eye/hate/spammers/banners/annoy_me_please.gif", or + just "/banners/annoying.html", or almost an + infinite number of other possible combinations, just so it has + "banners" in the path somewhere.

+ +

And now something a little more complex:

+ +

/.*/adv((er)?ts?|ertis(ing|ements?))?/ - We have + several literal forward slashes again ("/"), + so we are building another expression that is a file path statement. We + have another ".*", so we are matching + against any conceivable sub-path, just so it matches our expression. + The only true literal that must + match our pattern is adv, + together with the forward slashes. What comes after the "adv" string is the interesting part.

+ +

Remember the "?" means the preceding + expression (either a literal character or anything grouped with + "(...)" in this case) can exist or not, + since this means either zero or one match. So "((er)?ts?|ertis(ing|ements?))" is optional, as are the + individual sub-expressions: "(er)", + "(ing|ements?)", and the "s". The "|" means + "or". We have two of those. For instance, + "(ing|ements?)", can expand to match either + "ing" OR "ements?". + What is being done here, is an attempt at matching as many variations + of "advertisement", and similar, as + possible. So this would expand to match just "adv", or "advert", or + "adverts", or "advertising", or "advertisement", or "advertisements". You get the idea. But it would not + match "advertizements" (with a "z"). We could fix that by changing our regular + expression to: "/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/", which + would then match either spelling.

+ +

/.*/advert[0-9]+\.(gif|jpe?g) - Again another + path statement with forward slashes. Anything in the square brackets + "[ ]" can be matched. This is using + "0-9" as a shorthand expression to mean any + digit one through nine. It is the same as saying "0123456789". So any digit matches. The "+" means one or more of the preceding expression must + be included. The preceding expression here is what is in the square + brackets -- in this case, any digit one through nine. Then, at the end, + we have a grouping: "(gif|jpe?g)". This + includes a "|", so this needs to match the + expression on either side of that bar character also. A simple + "gif" on one side, and the other side will + in turn match either "jpeg" or "jpg", since the "?" means + the letter "e" is optional and can be + matched once or not at all. So we are building an expression here to + match image GIF or JPEG type image file. It must include the literal + string "advert", then one or more digits, + and a "." (which is now a literal, and not a + special character, since it is escaped with "\"), and lastly either "gif", or "jpeg", or + "jpg". Some possible matches would include: + "//advert1.jpg", "/nasty/ads/advert1234.gif", "/banners/from/hell/advert99.jpg". It would not match + "advert1.gif" (no leading slash), or + "/adverts232.jpg" (the expression does not + include an "s"), or "/advert1.jsp" ("jsp" is not + in the expression anywhere).

+ +

We are barely scratching the surface of regular expressions here so + that you can understand the default Privoxy configuration files, and maybe use this + knowledge to customize your own installation. There is much, much more + that can be done with regular expressions. Now that you know enough to + get started, you can learn more on your own :/

+ +

More reading on Perl Compatible Regular expressions: http://perldoc.perl.org/perlre.html

+ +

For information on regular expression based substitutions and their + applications in filters, please see the filter file tutorial in this manual.

+
+ +
+

14.2. Privoxy's + Internal Pages

+ +

Since Privoxy proxies each + requested web page, it is easy for Privoxy to trap certain special URLs. In this way, + we can talk directly to Privoxy, and + see how it is configured, see how our rules are being applied, change + these rules and other configuration options, and even turn Privoxy's filtering off, all with a web + browser.

+ +

The URLs listed below are the special ones that allow direct access + to Privoxy. Of course, Privoxy must be running to access these. If not, + you will get a friendly error message. Internet access is not necessary + either.

+ + + +

These may be bookmarked for quick reference. See next.

+ +
+

14.2.1. + Bookmarklets

+ +

Below are some "bookmarklets" to allow + you to easily access a "mini" version of + some of Privoxy's special pages. + They are designed for MS Internet Explorer, but should work equally + well in Netscape, Mozilla, and other browsers which support + JavaScript. They are designed to run directly from your bookmarks - + not by clicking the links below (although that should work for + testing).

+ +

To save them, right-click the link and choose "Add to Favorites" (IE) or "Add + Bookmark" (Netscape). You will get a warning that the bookmark + "may not be safe" - just click OK. Then + you can run the Bookmarklet directly from your favorites/bookmarks. + For even faster access, you can put them on the "Links" bar (IE) or the "Personal + Toolbar" (Netscape), and run them with a single click.

+ + + +

Credit: The site which gave us the general idea for these + bookmarklets is www.bookmarklets.com. They have more information about + bookmarklets.

+
+
+ +
+

14.3. Chain of + Events

+ +

Let's take a quick look at how some of Privoxy's core features are triggered, and the + ensuing sequence of events when a web page is requested by your + browser:

+ +
    +
  • +

    First, your web browser requests a web page. The browser knows + to send the request to Privoxy, + which will in turn, relay the request to the remote web server + after passing the following tests:

    +
  • + +
  • +

    Privoxy traps any request for + its own internal CGI pages (e.g http://p.p/) and sends the CGI page back to the + browser.

    +
  • + +
  • +

    Next, Privoxy checks to see if + the URL matches any "+block" patterns. If so, the URL is then + blocked, and the remote web server will not be contacted. "+handle-as-image" and "+handle-as-empty-document" are then checked, + and if there is no match, an HTML "BLOCKED" page is sent back to the browser. + Otherwise, if it does match, an image is returned for the former, + and an empty text document for the latter. The type of image would + depend on the setting of "+set-image-blocker" (blank, checkerboard + pattern, or an HTTP redirect to an image elsewhere).

    +
  • + +
  • +

    Untrusted URLs are blocked. If URLs are being added to the + trust file, then that is done.

    +
  • + +
  • +

    If the URL pattern matches the "+fast-redirects" action, it is then processed. + Unwanted parts of the requested URL are stripped.

    +
  • + +
  • +

    Now the rest of the client browser's request headers are + processed. If any of these match any of the relevant actions (e.g. + "+hide-user-agent", etc.), headers are + suppressed or forged as determined by these actions and their + parameters.

    +
  • + +
  • +

    Now the web server starts sending its response back (i.e. + typically a web page).

    +
  • + +
  • +

    First, the server headers are read and processed to determine, + among other things, the MIME type (document type) and encoding. The + headers are then filtered as determined by the "+crunch-incoming-cookies", "+session-cookies-only", and "+downgrade-http-version" actions.

    +
  • + +
  • +

    If any "+filter" action or "+deanimate-gifs" action applies (and the + document type fits the action), the rest of the page is read into + memory (up to a configurable limit). Then the filter rules (from + default.filter and any other filter + files) are processed against the buffered content. Filters are + applied in the order they are specified in one of the filter files. + Animated GIFs, if present, are reduced to either the first or last + frame, depending on the action setting.The entire page, which is + now filtered, is then sent by Privoxy back to your browser.

    + +

    If neither a "+filter" action or "+deanimate-gifs" matches, then Privoxy passes the raw data through to the + client browser as it becomes available.

    +
  • + +
  • +

    As the browser receives the now (possibly filtered) page + content, it reads and then requests any URLs that may be embedded + within the page source, e.g. ad images, stylesheets, JavaScript, + other HTML documents (e.g. frames), sounds, etc. For each of these + objects, the browser issues a separate request (this is easily + viewable in Privoxy's logs). And + each such request is in turn processed just as above. Note that a + complex web page will have many, many such embedded URLs. If these + secondary requests are to a different server, then quite possibly a + very differing set of actions is triggered.

    +
  • +
+ +

NOTE: This is somewhat of a simplistic overview of what happens with + each URL request. For the sake of brevity and simplicity, we have + focused on Privoxy's core features + only.

+
+ +
+

14.4. + Troubleshooting: Anatomy of an Action

+ +

The way Privoxy applies actions and filters to any given URL can be complex, + and not always so easy to understand what is happening. And sometimes + we need to be able to see + just what Privoxy is doing. + Especially, if something Privoxy is + doing is causing us a problem inadvertently. It can be a little + daunting to look at the actions and filters files themselves, since + they tend to be filled with regular + expressions whose consequences are not always so obvious.

+ +

One quick test to see if Privoxy is + causing a problem or not, is to disable it temporarily. This should be + the first troubleshooting step. See the Bookmarklets section on a quick + and easy way to do this (be sure to flush caches afterward!). Looking + at the logs is a good idea too. (Note that both the toggle feature and + logging are enabled via config file settings, + and may need to be turned "on".)

+ +

Another easy troubleshooting step to try is if you have done any + customization of your installation, revert back to the installed + defaults and see if that helps. There are times the developers get + complaints about one thing or another, and the problem is more related + to a customized configuration issue.

+ +

Privoxy also provides the http://config.privoxy.org/show-url-info page that can show + us very specifically how actions are + being applied to any given URL. This is a big help for + troubleshooting.

+ +

First, enter one URL (or partial URL) at the prompt, and then + Privoxy will tell us how the current + configuration will handle it. This will not help with filtering effects + (i.e. the "+filter" action) from one of the filter files since + this is handled very differently and not so easy to trap! It also will + not tell you about any other URLs that may be embedded within the URL + you are testing. For instance, images such as ads are expressed as URLs + within the raw page source of HTML pages. So you will only get info for + the actual URL that is pasted into the prompt area -- not any sub-URLs. + If you want to know about embedded URLs like ads, you will have to dig + those out of the HTML source. Use your browser's "View Page Source" option for this. Or right click on + the ad, and grab the URL.

+ +

Let's try an example, google.com, and look at it one section at a time in a sample + configuration (your real configuration may vary):

+ + + +
+
+ Matches for http://www.google.com:
+
+ In file: default.action [ View ] [ Edit ]
 
  {+change-x-forwarded-for{block}
  +deanimate-gifs {last}
@@ -1464,180 +675,86 @@ CLASS="GUIBUTTON"
  +session-cookies-only
  +set-image-blocker {pattern}
 /
- 
+
  { -session-cookies-only }
  .google.com
 
  { -fast-redirects }
  .google.com
 
-In file: user.action [ View ] [ Edit ]
-(no matches in this file)  

This is telling us how we have defined our - "actions", and - which ones match for our test case, "google.com". - Displayed is all the actions that are available to us. Remember, - the + sign denotes "on". - - denotes "off". So some are "on" here, but many - are "off". Each example we try may provide a slightly different - end result, depending on our configuration directives.

The first listing - is for our default.action file. The large, multi-line - listing, is how the actions are set to match for all URLs, i.e. our default - settings. If you look at your "actions" file, this would be the - section just below the "aliases" section near the top. This - will apply to all URLs as signified by the single forward slash at the end - of the listing -- " / ".

But we have defined additional actions that would be exceptions to these general - rules, and then we list specific URLs (or patterns) that these exceptions - would apply to. Last match wins. Just below this then are two explicit - matches for ".google.com". The first is negating our previous - cookie setting, which was for "+session-cookies-only" - (i.e. not persistent). So we will allow persistent cookies for google, at - least that is how it is in this example. The second turns - off any "+fast-redirects" - action, allowing this to take place unmolested. Note that there is a leading - dot here -- ".google.com". This will match any hosts and - sub-domains, in the google.com domain also, such as - "www.google.com" or "mail.google.com". But it would not - match "www.google.de"! So, apparently, we have these two actions - defined as exceptions to the general rules at the top somewhere in the lower - part of our default.action file, and - "google.com" is referenced somewhere in these latter sections.

Then, for our user.action file, we again have no hits. - So there is nothing google-specific that we might have added to our own, local - configuration. If there was, those actions would over-rule any actions from - previously processed files, such as default.action. - user.action typically has the last word. This is the - best place to put hard and fast exceptions,

And finally we pull it all together in the bottom section and summarize how - Privoxy is applying all its "actions" - to "google.com":

+ +

 Final results:
- 
+In file: user.action [ View ] [ Edit ]
+(no matches in this file)
+
+
+ +

This is telling us how we have defined our "actions", + and which ones match for our test case, "google.com". Displayed is all the actions that are + available to us. Remember, the + sign denotes + "on". - denotes + "off". So some are "on" here, but many are "off". Each example we try may provide a slightly + different end result, depending on our configuration directives.

+ +

The first listing is for our default.action file. The large, multi-line listing, is + how the actions are set to match for all URLs, i.e. our default + settings. If you look at your "actions" + file, this would be the section just below the "aliases" section near the top. This will apply to all + URLs as signified by the single forward slash at the end of the listing + -- " / ".

+ +

But we have defined additional actions that would be exceptions to + these general rules, and then we list specific URLs (or patterns) that + these exceptions would apply to. Last match wins. Just below this then + are two explicit matches for ".google.com". + The first is negating our previous cookie setting, which was for + "+session-cookies-only" (i.e. not persistent). So we + will allow persistent cookies for google, at least that is how it is in + this example. The second turns off any "+fast-redirects" action, allowing this to take + place unmolested. Note that there is a leading dot here -- ".google.com". This will match any hosts and + sub-domains, in the google.com domain also, such as "www.google.com" or "mail.google.com". But it would not match "www.google.de"! So, apparently, we have these two + actions defined as exceptions to the general rules at the top somewhere + in the lower part of our default.action file, + and "google.com" is referenced somewhere in + these latter sections.

+ +

Then, for our user.action file, we again + have no hits. So there is nothing google-specific that we might have + added to our own, local configuration. If there was, those actions + would over-rule any actions from previously processed files, such as + default.action. user.action typically has the last word. This is the + best place to put hard and fast exceptions,

+ +

And finally we pull it all together in the bottom section and + summarize how Privoxy is applying all + its "actions" to "google.com":

+ + + +
+
+
 Final results:
+
  -add-header
  -block
- +change-x-forwarded-for{block} 
+ +change-x-forwarded-for{block}
  -client-header-filter{hide-tor-exit-notation}
  -content-type-overwrite
  -crunch-client-header
@@ -1688,142 +805,79 @@ CLASS="SCREEN"
  -prevent-compression
  -redirect
  -server-header-filter{xml-to-html}
- -server-header-filter{html-to-xml} 
+ -server-header-filter{html-to-xml}
  -session-cookies-only
- +set-image-blocker {pattern} 

Notice the only difference here to the previous listing, is to - "fast-redirects" and "session-cookies-only", - which are activated specifically for this site in our configuration, - and thus show in the "Final Results".

Now another example, "ad.doubleclick.net":

+ +

 { +block{Domains starts with "ad"} }
+ +set-image-blocker {pattern}
+
+
+ +

Notice the only difference here to the previous listing, is to + "fast-redirects" and "session-cookies-only", which are activated specifically + for this site in our configuration, and thus show in the "Final Results".

+ +

Now another example, "ad.doubleclick.net":

+ + + +
+
+
 { +block{Domains starts with "ad"} }
   ad*.
 
  { +block{Domain contains "ad"} }
   .ad.
 
  { +block{Doubleclick banner server} +handle-as-image }
-  .[a-vx-z]*.doubleclick.net

We'll just show the interesting part here - the explicit matches. It is - matched three different times. Two "+block{}" sections, - and a "+block{} +handle-as-image", - which is the expanded form of one of our aliases that had been defined as: - "+block-as-image". ("Aliases" are defined in - the first section of the actions file and typically used to combine more - than one action.)

Any one of these would have done the trick and blocked this as an unwanted - image. This is unnecessarily redundant since the last case effectively - would also cover the first. No point in taking chances with these guys - though ;-) Note that if you want an ad or obnoxious - URL to be invisible, it should be defined as "ad.doubleclick.net" - is done here -- as both a "+block{}" - and an - "+handle-as-image". - The custom alias "+block-as-image" just - simplifies the process and make it more readable.

One last example. Let's try "http://www.example.net/adsl/HOWTO/". - This one is giving us problems. We are getting a blank page. Hmmm ...

+ +

 Matches for http://www.example.net/adsl/HOWTO/:
+  .[a-vx-z]*.doubleclick.net
+
+
- In file: default.action [ View ] [ Edit ] +

We'll just show the interesting part here - the explicit matches. It + is matched three different times. Two "+block{}" sections, and a "+block{} + +handle-as-image", which is the expanded form of one of our + aliases that had been defined as: "+block-as-image". ("Aliases" + are defined in the first section of the actions file and typically used + to combine more than one action.)

- {-add-header +

Any one of these would have done the trick and blocked this as an + unwanted image. This is unnecessarily redundant since the last case + effectively would also cover the first. No point in taking chances with + these guys though ;-) Note that if you want an ad or obnoxious URL to + be invisible, it should be defined as "ad.doubleclick.net" is done here -- as both a "+block{}" + and an "+handle-as-image". The custom alias "+block-as-image" just + simplifies the process and make it more readable.

+ +

One last example. Let's try "http://www.example.net/adsl/HOWTO/". This one is giving + us problems. We are getting a blank page. Hmmm ...

+ + + +
+
+
 Matches for http://www.example.net/adsl/HOWTO/:
+
+ In file: default.action [ View ] [ Edit ]
+
+ {-add-header
   -block
-  +change-x-forwarded-for{block} 
+  +change-x-forwarded-for{block}
   -client-header-filter{hide-tor-exit-notation}
   -content-type-overwrite
   -crunch-client-header
@@ -1831,8 +885,8 @@ CLASS="GUIBUTTON"
   -crunch-incoming-cookies
   -crunch-outgoing-cookies
   -crunch-server-header
-  +deanimate-gifs 
-  -downgrade-http-version 
+  +deanimate-gifs
+  -downgrade-http-version
   +fast-redirects {check-decoded-url}
   -filter {js-events}
   -filter {content-cookies}
@@ -1862,326 +916,186 @@ CLASS="GUIBUTTON"
   -filter {no-ping}
   -force-text-mode
   -handle-as-empty-document
-  -handle-as-image 
+  -handle-as-image
   -hide-accept-language
-  -hide-content-disposition  
-  +hide-from-header{block} 
-  +hide-referer{forge} 
-  -hide-user-agent 
+  -hide-content-disposition
+  +hide-from-header{block}
+  +hide-referer{forge}
+  -hide-user-agent
   -overwrite-last-modified
-  +prevent-compression 
+  +prevent-compression
   -redirect
   -server-header-filter{xml-to-html}
-  -server-header-filter{html-to-xml} 
-  +session-cookies-only 
+  -server-header-filter{html-to-xml}
+  +session-cookies-only
   +set-image-blocker{blank} }
    /
 
  { +block{Path contains "ads".} +handle-as-image }
-  /ads

Ooops, the "/adsl/" is matching "/ads" in our - configuration! But we did not want this at all! Now we see why we get the - blank page. It is actually triggering two different actions here, and - the effects are aggregated so that the URL is blocked, and Privoxy is told - to treat the block as if it were an image. But this is, of course, all wrong. - We could now add a new action below this (or better in our own - user.action file) that explicitly - un blocks ( - "{-block}") paths with - "adsl" in them (remember, last match in the configuration - wins). There are various ways to handle such exceptions. Example:


 { -block }
-  /adsl

Now the page displays ;-) - Remember to flush your browser's caches when making these kinds of changes to - your configuration to insure that you get a freshly delivered page! Or, try - using Shift+Reload.

But now what about a situation where we get no explicit matches like - we did with:


 { +block{Path starts with "ads".} +handle-as-image }
- /ads

That actually was very helpful and pointed us quickly to where the problem - was. If you don't get this kind of match, then it means one of the default - rules in the first section of default.action is causing - the problem. This would require some guesswork, and maybe a little trial and - error to isolate the offending rule. One likely cause would be one of the - "+filter" actions. - These tend to be harder to troubleshoot. - Try adding the URL for the site to one of aliases that turn off - "+filter":

+ +

 { shop }
+  /ads
+
+
+ +

Ooops, the "/adsl/" is matching + "/ads" in our configuration! But we did not + want this at all! Now we see why we get the blank page. It is actually + triggering two different actions here, and the effects are aggregated + so that the URL is blocked, and Privoxy is told to treat the block as if it were + an image. But this is, of course, all wrong. We could now add a new + action below this (or better in our own user.action file) that explicitly un blocks ( "{-block}") + paths with "adsl" in them (remember, last + match in the configuration wins). There are various ways to handle such + exceptions. Example:

+ + + + + +
+
+
 { -block }
+  /adsl
+
+
+ +

Now the page displays ;-) Remember to flush your browser's caches + when making these kinds of changes to your configuration to insure that + you get a freshly delivered page! Or, try using Shift+Reload.

+ +

But now what about a situation where we get no explicit matches like + we did with:

+ + + + + +
+
+
 { +block{Path starts with "ads".} +handle-as-image }
+ /ads
+
+
+ +

That actually was very helpful and pointed us quickly to where the + problem was. If you don't get this kind of match, then it means one of + the default rules in the first section of default.action is causing the problem. This would + require some guesswork, and maybe a little trial and error to isolate + the offending rule. One likely cause would be one of the "+filter" + actions. These tend to be harder to troubleshoot. Try adding the URL + for the site to one of aliases that turn off "+filter":

+ + + +
+
+
 { shop }
  .quietpc.com
  .worldpay.com   # for quietpc.com
  .jungle.com
  .scan.co.uk
- .forbes.com

"{ shop }" is an "alias" that expands to - "{ -filter -session-cookies-only }". - Or you could do your own exception to negate filtering:

+ +

 { -filter }
+ .forbes.com
+
+
+ +

"{ shop }" is an + "alias" that expands to "{ -filter -session-cookies-only + }". Or you could do your own exception to negate + filtering:

+ + + +
+
+
 { -filter }
  # Disable ALL filter actions for sites in this section
  .forbes.com
  developer.ibm.com
- localhost

This would turn off all filtering for these sites. This is best - put in user.action, for local site - exceptions. Note that when a simple domain pattern is used by itself (without - the subsequent path portion), all sub-pages within that domain are included - automatically in the scope of the action.

Images that are inexplicably being blocked, may well be hitting the -"+filter{banners-by-size}" - rule, which assumes - that images of certain sizes are ad banners (works well - most of the time since these tend to be standardized).

"{ fragile }" is an alias that disables most - actions that are the most likely to cause trouble. This can be used as a - last resort for problem sites.

+ +

 { fragile }
+ localhost
+
+
+ +

This would turn off all filtering for these sites. This is best put + in user.action, for local site exceptions. + Note that when a simple domain pattern is used by itself (without the + subsequent path portion), all sub-pages within that domain are included + automatically in the scope of the action.

+ +

Images that are inexplicably being blocked, may well be hitting the + "+filter{banners-by-size}" rule, which assumes that + images of certain sizes are ad banners (works well most of the time since these tend to be + standardized).

+ +

"{ fragile }" is + an alias that disables most actions that are the most likely to cause + trouble. This can be used as a last resort for problem sites.

+ + + +
+
+
 { fragile }
  # Handle with care: easy to break
  mail.google.
- mybank.example.com

Remember to flush caches! Note that the - mail.google reference lacks the TLD portion (e.g. - ".com"). This will effectively match any TLD with - google in it, such as mail.google.de., - just as an example.

- If this still does not work, you will have to go through the remaining - actions one by one to find which one(s) is causing the problem.


PrevHome 
See Also  
\ No newline at end of file + mybank.example.com +
+
+ +

Remember to flush caches! + Note that the mail.google reference lacks the + TLD portion (e.g. ".com"). This will + effectively match any TLD with google in it, + such as mail.google.de., just as an + example.

+ +

If this still does not work, you will have to go through the + remaining actions one by one to find which one(s) is causing the + problem.

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/user-manual/config.html b/external/privoxy/doc/webserver/user-manual/config.html index 05e19b30..6626e003 100644 --- a/external/privoxy/doc/webserver/user-manual/config.html +++ b/external/privoxy/doc/webserver/user-manual/config.html @@ -1,4121 +1,3051 @@ - -The Main Configuration File - -
Privoxy 3.0.12 User Manual
PrevNext

7. The Main Configuration File

Again, the main configuration file is named config on - Linux/Unix/BSD and OS/2, and config.txt on Windows. - Configuration lines consist of an initial keyword followed by a list of - values, all separated by whitespace (any number of spaces or tabs). For - example:

  confdir /etc/privoxy

-

Assigns the value /etc/privoxy to the option - confdir and thus indicates that the configuration - directory is named "/etc/privoxy/".

All options in the config file except for confdir and - logdir are optional. Watch out in the below description - for what happens if you leave them unset.

The main config file controls all aspects of Privoxy's - operation that are not location dependent (i.e. they apply universally, no matter - where you may be surfing).

7.1. Local Set-up Documentation

If you intend to operate Privoxy for more users - than just yourself, it might be a good idea to let them know how to reach - you, what you block and why you do that, your policies, etc. -

7.1.1. user-manual

Specifies:

Location of the Privoxy User Manual. -

Type of value:

A fully qualified URI

Default value:

Unset

Effect if unset:

http://www.privoxy.org/version/user-manual/ - will be used, where version is the Privoxy version. -

Notes:

The User Manual URI is the single best source of information on - Privoxy, and is used for help links from some - of the internal CGI pages. The manual itself is normally packaged with the - binary distributions, so you probably want to set this to a locally - installed copy. -

Examples: -

The best all purpose solution is simply to put the full local - PATH to where the User Manual is - located: -

  user-manual  /usr/share/doc/privoxy/user-manual
-

The User Manual is then available to anyone with access to - Privoxy, by following the built-in URL: - http://config.privoxy.org/user-manual/ - (or the shortcut: http://p.p/user-manual/). -

If the documentation is not on the local system, it can be accessed - from a remote server, as: -

  user-manual  http://example.com/privoxy/user-manual/
-

Warning

If set, this option should be the first option in the config - file, because it is used while the config file is being read - on start-up. -

7.1.2. trust-info-url

Specifies:

A URL to be displayed in the error page that users will see if access to an untrusted page is denied. -

Type of value:

URL

Default value:

Unset

Effect if unset:

No links are displayed on the "untrusted" error page. -

Notes:

The value of this option only matters if the experimental trust mechanism has been - activated. (See trustfile below.) -

If you use the trust mechanism, it is a good idea to write up some on-line - documentation about your trust policy and to specify the URL(s) here. - Use multiple times for multiple URLs. -

The URL(s) should be added to the trustfile as well, so users don't end up - locked out from the information on why they were locked out in the first place! -

7.1.3. admin-address

Specifies:

An email address to reach the Privoxy administrator. -

Type of value:

Email address

Default value:

Unset

Effect if unset:

No email address is displayed on error pages and the CGI user interface. -

Notes:

If both admin-address and proxy-info-url - are unset, the whole "Local Privoxy Support" box on all generated pages will - not be shown. -

7.1.4. proxy-info-url

Specifies:

A URL to documentation about the local Privoxy setup, - configuration or policies. -

Type of value:

URL

Default value:

Unset

Effect if unset:

No link to local documentation is displayed on error pages and the CGI user interface. -

Notes:

If both admin-address and proxy-info-url - are unset, the whole "Local Privoxy Support" box on all generated pages will - not be shown. -

This URL shouldn't be blocked ;-) -

7.2. Configuration and Log File Locations

Privoxy can (and normally does) use a number of - other files for additional configuration, help and logging. - This section of the configuration file tells Privoxy - where to find those other files.

The user running Privoxy, must have read - permission for all configuration files, and write permission to any files - that would be modified, such as log files and actions files.

7.2.1. confdir

Specifies:

The directory where the other configuration files are located.

Type of value:

Path name

Default value:

/etc/privoxy (Unix) or Privoxy installation dir (Windows)

Effect if unset:

Mandatory

Notes:

No trailing "/", please. -

7.2.2. templdir

Specifies:

An alternative directory where the templates are loaded from.

Type of value:

Path name

Default value:

unset

Effect if unset:

The templates are assumed to be located in confdir/template.

Notes:

Privoxy's original templates are usually - overwritten with each update. Use this option to relocate customized - templates that should be kept. As template variables might change - between updates, you shouldn't expect templates to work with - Privoxy releases other than the one - they were part of, though. -

7.2.3. logdir

Specifies:

The directory where all logging takes place - (i.e. where the logfile is located). -

Type of value:

Path name

Default value:

/var/log/privoxy (Unix) or Privoxy installation dir (Windows)

Effect if unset:

Mandatory

Notes:

No trailing "/", please. -

7.2.4. actionsfile

Specifies:

The actions file(s) to use -

Type of value:

Complete file name, relative to confdir

Default values:

  match-all.action # Actions that are applied to all sites and maybe overruled later on.

-

  default.action   # Main actions file

-

  user.action      # User customizations

-

Effect if unset:

No actions are taken at all. More or less neutral proxying. -

Notes:

Multiple actionsfile lines are permitted, and are in fact recommended! -

- The default values are default.action, which is the - "main" actions file maintained by the developers, and - user.action, where you can make your personal additions. -

- Actions files contain all the per site and per URL configuration for - ad blocking, cookie management, privacy considerations, etc. - There is no point in using Privoxy without at - least one actions file. -

Note that since Privoxy 3.0.7, the complete filename, including the ".action" - extension has to be specified. The syntax change was necessary to be consistent - with the other file options and to allow previously forbidden characters. -

7.2.5. filterfile

Specifies:

The filter file(s) to use -

Type of value:

File name, relative to confdir

Default value:

default.filter (Unix) or default.filter.txt (Windows)

Effect if unset:

No textual content filtering takes place, i.e. all - +filter{name} - actions in the actions files are turned neutral. -

Notes:

Multiple filterfile lines are permitted. -

The filter files contain content modification - rules that use regular expressions. These rules permit - powerful changes on the content of Web pages, and optionally the headers - as well, e.g., you could try to disable your favorite JavaScript annoyances, - re-write the actual displayed text, or just have some fun - playing buzzword bingo with web pages. -

The - +filter{name} - actions rely on the relevant filter (name) - to be defined in a filter file! -

A pre-defined filter file called default.filter that contains - a number of useful filters for common problems is included in the distribution. - See the section on the filter - action for a list. -

It is recommended to place any locally adapted filters into a separate - file, such as user.filter. -

7.2.6. logfile

Specifies:

The log file to use -

Type of value:

File name, relative to logdir

Default value:

Unset (commented out). When activated: logfile (Unix) or privoxy.log (Windows).

Effect if unset:

No logfile is written. -

Notes:

The logfile is where all logging and error messages are written. The level - of detail and number of messages are set with the debug - option (see below). The logfile can be useful for tracking down a problem with - Privoxy (e.g., it's not blocking an ad you - think it should block) and it can help you to monitor what your browser - is doing. -

Depending on the debug options below, the logfile may be a privacy risk - if third parties can get access to it. As most users will never look - at it, Privoxy 3.0.7 and later only log fatal - errors by default. -

For most troubleshooting purposes, you will have to change that, - please refer to the debugging section for details. -

Your logfile will grow indefinitely, and you will probably want to - periodically remove it. On Unix systems, you can do this with a cron job - (see "man cron"). For Red Hat based Linux distributions, a - logrotate script has been included. -

Any log files must be writable by whatever user Privoxy - is being run as (on Unix, default user id is "privoxy"). -

7.2.7. trustfile

Specifies:

The name of the trust file to use -

Type of value:

File name, relative to confdir

Default value:

Unset (commented out). When activated: trust (Unix) or trust.txt (Windows)

Effect if unset:

The entire trust mechanism is disabled. -

Notes:

The trust mechanism is an experimental feature for building white-lists and should - be used with care. It is NOT recommended for the casual user. -

If you specify a trust file, Privoxy will only allow - access to sites that are specified in the trustfile. Sites can be listed - in one of two ways: -

Prepending a ~ character limits access to this site - only (and any sub-paths within this site), e.g. - ~www.example.com allows access to - ~www.example.com/features/news.html, etc. -

Or, you can designate sites as trusted referrers, by - prepending the name with a + character. The effect is that - access to untrusted sites will be granted -- but only if a link from this - trusted referrer was used to get there. The link target will then be added - to the "trustfile" so that future, direct accesses will be - granted. Sites added via this mechanism do not become trusted referrers - themselves (i.e. they are added with a ~ designation). - There is a limit of 512 such entries, after which new entries will not be - made. -

If you use the + operator in the trust file, it may grow - considerably over time. -

It is recommended that Privoxy be compiled with - the --disable-force, --disable-toggle and - --disable-editor options, if this feature is to be - used. -

Possible applications include limiting Internet access for children. -

7.3. Debugging

These options are mainly useful when tracing a problem. - Note that you might also want to invoke - Privoxy with the --no-daemon - command line option when debugging. -

7.3.1. debug

Specifies:

Key values that determine what information gets logged. -

Type of value:

Integer values

Default value:

0 (i.e.: only fatal errors (that cause Privoxy to exit) are logged)

Effect if unset:

Default value is used (see above). -

Notes:

The available debug levels are: -

+ +
  debug     1 # Log the destination for each request Privoxy let through. See also debug 1024.
+
+
+
+
+  
+
+  The Main Configuration File
+  
+  
+  
+  
+  
+  
+  
+  
+
+
+
+  
+
+  
+

7. The Main Configuration + File

+ +

By default, the main configuration file is named config, with the exception of Windows, where it is named + config.txt. Configuration lines consist of an + initial keyword followed by a list of values, all separated by whitespace + (any number of spaces or tabs). For example:

+ +

  confdir /etc/privoxy

+ +

Assigns the value /etc/privoxy to the option + confdir and thus indicates that the + configuration directory is named "/etc/privoxy/".

+ +

All options in the config file except for confdir and logdir are optional. + Watch out in the below description for what happens if you leave them + unset.

+ +

The main config file controls all aspects of Privoxy's operation that are not location dependent + (i.e. they apply universally, no matter where you may be surfing). Like + the filter and action files, the config file is a plain text file and can + be modified with a text editor like emacs, vim or notepad.exe.

+ +
+

7.1. Local + Set-up Documentation

+ +

If you intend to operate Privoxy + for more users than just yourself, it might be a good idea to let them + know how to reach you, what you block and why you do that, your + policies, etc.

+ +
+

7.1.1. + user-manual

+ +
+
+
Specifies:
+ +
+

Location of the Privoxy + User Manual.

+
+ +
Type of value:
+ +
+

A fully qualified URI

+
+ +
Default value:
+ +
+

Unset

+
+ +
Effect if unset:
+ +
+

http://www.privoxy.org/version/user-manual/ will be used, + where version is the + Privoxy version.

+
+ +
Notes:
+ +
+

The User Manual URI is the single best source of information + on Privoxy, and is used for + help links from some of the internal CGI pages. The manual + itself is normally packaged with the binary distributions, so + you probably want to set this to a locally installed copy.

+ +

Examples:

+ +

The best all purpose solution is simply to put the full + local PATH to where the User Manual is located:

+ + + + + +
+
+  user-manual  /usr/share/doc/privoxy/user-manual
+
+
+ +

The User Manual is then available to anyone with access to + Privoxy, by following the + built-in URL: http://config.privoxy.org/user-manual/ (or the + shortcut: http://p.p/user-manual/).

+ +

If the documentation is not on the local system, it can be + accessed from a remote server, as:

+ + + + + +
+
+  user-manual  http://example.com/privoxy/user-manual/
+
+
+ +
+ + + + + + + + +
Warning
+

If set, this option should be the first option in the config + file, because it is used while the config file + is being read on start-up.

+
+
+
+
+
+
+ +
+

7.1.2. + trust-info-url

+ +
+
+
Specifies:
+ +
+

A URL to be displayed in the error page that users will see + if access to an untrusted page is denied.

+
+ +
Type of value:
+ +
+

URL

+
+ +
Default value:
+ +
+

Unset

+
+ +
Effect if unset:
+ +
+

No links are displayed on the "untrusted" error page.

+
+ +
Notes:
+ +
+

The value of this option only matters if the experimental + trust mechanism has been activated. (See trustfile below.)

+ +

If you use the trust mechanism, it is a good idea to write + up some on-line documentation about your trust policy and to + specify the URL(s) here. Use multiple times for multiple + URLs.

+ +

The URL(s) should be added to the trustfile as well, so + users don't end up locked out from the information on why they + were locked out in the first place!

+
+
+
+
+ +
+

7.1.3. + admin-address

+ +
+
+
Specifies:
+ +
+

An email address to reach the Privoxy administrator.

+
+ +
Type of value:
+ +
+

Email address

+
+ +
Default value:
+ +
+

Unset

+
+ +
Effect if unset:
+ +
+

No email address is displayed on error pages and the CGI + user interface.

+
+ +
Notes:
+ +
+

If both admin-address and + proxy-info-url are unset, the whole + "Local Privoxy Support" box on all generated pages will not be + shown.

+
+
+
+
+ +
+

7.1.4. + proxy-info-url

+ +
+
+
Specifies:
+ +
+

A URL to documentation about the local Privoxy setup, configuration or + policies.

+
+ +
Type of value:
+ +
+

URL

+
+ +
Default value:
+ +
+

Unset

+
+ +
Effect if unset:
+ +
+

No link to local documentation is displayed on error pages + and the CGI user interface.

+
+ +
Notes:
+ +
+

If both admin-address and + proxy-info-url are unset, the whole + "Local Privoxy Support" box on all generated pages will not be + shown.

+ +

This URL shouldn't be blocked ;-)

+
+
+
+
+
+ +
+

7.2. + Configuration and Log File Locations

+ +

Privoxy can (and normally does) use + a number of other files for additional configuration, help and logging. + This section of the configuration file tells Privoxy where to find those other files.

+ +

The user running Privoxy, must have + read permission for all configuration files, and write permission to + any files that would be modified, such as log files and actions + files.

+ +
+

7.2.1. + confdir

+ +
+
+
Specifies:
+ +
+

The directory where the other configuration files are + located.

+
+ +
Type of value:
+ +
+

Path name

+
+ +
Default value:
+ +
+

/etc/privoxy (Unix) or Privoxy installation dir (Windows)

+
+ +
Effect if unset:
+ +
+

Mandatory

+
+ +
Notes:
+ +
+

No trailing "/", please.

+
+
+
+
+ +
+

7.2.2. + templdir

+ +
+
+
Specifies:
+ +
+

An alternative directory where the templates are loaded + from.

+
+ +
Type of value:
+ +
+

Path name

+
+ +
Default value:
+ +
+

unset

+
+ +
Effect if unset:
+ +
+

The templates are assumed to be located in + confdir/template.

+
+ +
Notes:
+ +
+

Privoxy's original + templates are usually overwritten with each update. Use this + option to relocate customized templates that should be kept. As + template variables might change between updates, you shouldn't + expect templates to work with Privoxy releases other than the one they + were part of, though.

+
+
+
+
+ +
+

7.2.3. logdir

+ +
+
+
Specifies:
+ +
+

The directory where all logging takes place (i.e. where the + logfile is located).

+
+ +
Type of value:
+ +
+

Path name

+
+ +
Default value:
+ +
+

/var/log/privoxy (Unix) or Privoxy installation dir (Windows)

+
+ +
Effect if unset:
+ +
+

Mandatory

+
+ +
Notes:
+ +
+

No trailing "/", please.

+
+
+
+
+ +
+

7.2.4. + actionsfile

+ +
+
+
Specifies:
+ +
+

The actions file(s) to + use

+
+ +
Type of value:
+ +
+

Complete file name, relative to confdir

+
+ +
Default values:
+ +
+ + + + + + + + + + + + + + +
+

+   match-all.action # Actions that are applied to all sites and maybe overruled later on.

+
+

+   default.action   # Main actions file

+
+

+   user.action      # User customizations

+
+
+ +
Effect if unset:
+ +
+

No actions are taken at all. More or less neutral + proxying.

+
+ +
Notes:
+ +
+

Multiple actionsfile lines are + permitted, and are in fact recommended!

+ +

The default values are default.action, which is the "main" actions file maintained by the + developers, and user.action, where + you can make your personal additions.

+ +

Actions files contain all the per site and per URL + configuration for ad blocking, cookie management, privacy + considerations, etc. There is no point in using Privoxy without at least one actions + file.

+ +

Note that since Privoxy 3.0.7, the complete filename, + including the ".action" extension + has to be specified. The syntax change was necessary to be + consistent with the other file options and to allow previously + forbidden characters.

+
+
+
+
+ +
+

7.2.5. + filterfile

+ +
+
+
Specifies:
+ +
+

The filter file(s) to use

+
+ +
Type of value:
+ +
+

File name, relative to confdir

+
+ +
Default value:
+ +
+

default.filter (Unix) or default.filter.txt + (Windows)

+
+ +
Effect if unset:
+ +
+

No textual content filtering takes place, i.e. all + +filter{name} actions in the actions files + are turned neutral.

+
+ +
Notes:
+ +
+

Multiple filterfile lines are + permitted.

+ +

The filter files contain + content modification rules that use regular expressions. These rules + permit powerful changes on the content of Web pages, and + optionally the headers as well, e.g., you could try to disable + your favorite JavaScript annoyances, re-write the actual + displayed text, or just have some fun playing buzzword bingo + with web pages.

+ +

The +filter{name} actions rely on the relevant + filter (name) to be defined in + a filter file!

+ +

A pre-defined filter file called default.filter that contains a number of useful + filters for common problems is included in the distribution. + See the section on the filter action for a + list.

+ +

It is recommended to place any locally adapted filters into + a separate file, such as user.filter.

+
+
+
+
+ +
+

7.2.6. + logfile

+ +
+
+
Specifies:
+ +
+

The log file to use

+
+ +
Type of value:
+ +
+

File name, relative to logdir

+
+ +
Default value:
+ +
+

Unset (commented + out). When activated: logfile (Unix) or privoxy.log (Windows).

+
+ +
Effect if unset:
+ +
+

No logfile is written.

+
+ +
Notes:
+ +
+

The logfile is where all logging and error messages are + written. The level of detail and number of messages are set + with the debug option (see below). The + logfile can be useful for tracking down a problem with + Privoxy (e.g., it's not + blocking an ad you think it should block) and it can help you + to monitor what your browser is doing.

+ +

Depending on the debug options below, the logfile may be a + privacy risk if third parties can get access to it. As most + users will never look at it, Privoxy 3.0.7 and later only log fatal + errors by default.

+ +

For most troubleshooting purposes, you will have to change + that, please refer to the debugging section for details.

+ +

Your logfile will grow indefinitely, and you will probably + want to periodically remove it. On Unix systems, you can do + this with a cron job (see "man + cron"). For Red Hat based Linux distributions, a + logrotate script has been included.

+ +

Any log files must be writable by whatever user Privoxy is being run as (on Unix, default + user id is "privoxy").

+
+
+
+
+ +
+

7.2.7. + trustfile

+ +
+
+
Specifies:
+ +
+

The name of the trust file to use

+
+ +
Type of value:
+ +
+

File name, relative to confdir

+
+ +
Default value:
+ +
+

Unset (commented + out). When activated: trust (Unix) or trust.txt (Windows)

+
+ +
Effect if unset:
+ +
+

The entire trust mechanism is disabled.

+
+ +
Notes:
+ +
+

The trust mechanism is an experimental feature for building + white-lists and should be used with care. It is NOT recommended for the casual + user.

+ +

If you specify a trust file, Privoxy will only allow access to sites + that are specified in the trustfile. Sites can be listed in one + of two ways:

+ +

Prepending a ~ character limits + access to this site only (and any sub-paths within this site), + e.g. ~www.example.com allows access to + ~www.example.com/features/news.html, + etc.

+ +

Or, you can designate sites as trusted referrers, by prepending + the name with a + character. The + effect is that access to untrusted sites will be granted -- but + only if a link from this trusted referrer was used to get + there. The link target will then be added to the "trustfile" so that future, direct accesses will + be granted. Sites added via this mechanism do not become + trusted referrers themselves (i.e. they are added with a + ~ designation). There is a limit of + 512 such entries, after which new entries will not be made.

+ +

If you use the + operator in the + trust file, it may grow considerably over time.

+ +

It is recommended that Privoxy be compiled with the --disable-force, --disable-toggle and --disable-editor options, if this feature is to + be used.

+ +

Possible applications include limiting Internet access for + children.

+
+
+
+
+
+ +
+

7.3. + Debugging

+ +

These options are mainly useful when tracing a problem. Note that + you might also want to invoke Privoxy + with the --no-daemon command line option when + debugging.

+ +
+

7.3.1. debug

+ +
+
+
Specifies:
+ +
+

Key values that determine what information gets logged.

+
+ +
Type of value:
+ +
+

Integer values

+
+ +
Default value:
+ +
+

0 (i.e.: only fatal errors (that cause Privoxy to exit) are + logged)

+
+ +
Effect if unset:
+ +
+

Default value is used (see above).

+
+ +
Notes:
+ +
+

The available debug levels are:

+ + + +
+
+  debug     1 # Log the destination for each request Privoxy let through. See also debug 1024.
   debug     2 # show each connection status
   debug     4 # show I/O status
   debug     8 # show header parsing
-  debug    16 # log all data written to the network into the logfile
+  debug    16 # log all data written to the network
   debug    32 # debug force feature
   debug    64 # debug regular expression filters
   debug   128 # debug redirects
   debug   256 # debug GIF de-animation
   debug   512 # Common Log Format
-  debug  1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
+  debug  1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
   debug  2048 # CGI user interface
   debug  4096 # Startup banner and warnings.
-  debug  8192 # Non-fatal errors
-

To select multiple debug levels, you can either add them or use - multiple debug lines. -

A debug level of 1 is informative because it will show you each request - as it happens. 1, 4096 and 8192 are recommended - so that you will notice when things go wrong. The other levels are - probably only of interest if you are hunting down a specific problem. - They can produce a hell of an output (especially 16). - -

Privoxy used to ship with the debug levels recommended above enabled by - default, but due to privacy concerns 3.0.7 and later are configured to - only log fatal errors. -

If you are used to the more verbose settings, simply enable the debug lines - below again. -

If you want to use pure CLF (Common Log Format), you should set "debug - 512" ONLY and not enable anything else. -

Privoxy has a hard-coded limit for the - length of log messages. If it's reached, messages are logged truncated - and marked with "... [too long, truncated]". -

Please don't file any support requests without trying to reproduce - the problem with increased debug level first. Once you read the log - messages, you may even be able to solve the problem on your own. -

7.3.2. single-threaded

Specifies:

Whether to run only one server thread. -

Type of value:

None

Default value:

Unset

Effect if unset:

Multi-threaded (or, where unavailable: forked) operation, i.e. the ability to - serve multiple requests simultaneously. -

Notes:

This option is only there for debugging purposes. - It will drastically reduce performance. -

7.3.3. hostname

Specifies:

The hostname shown on the CGI pages. -

Type of value:

Text

Default value:

Unset

Effect if unset:

The hostname provided by the operating system is used. -

Notes:

On some misconfigured systems resolving the hostname fails or - takes too much time and slows Privoxy down. Setting a fixed hostname - works around the problem. -

In other circumstances it might be desirable to show a hostname - other than the one returned by the operating system. For example - if the system has several different hostnames and you don't want - to use the first one. -

Note that Privoxy does not validate the specified hostname value. -

7.4. Access Control and Security

This section of the config file controls the security-relevant aspects - of Privoxy's configuration. -

7.4.1. listen-address

Specifies:

The IP address and TCP port on which Privoxy will - listen for client requests. -

Type of value:

[IP-Address]:Port

Default value:

127.0.0.1:8118

Effect if unset:

Bind to 127.0.0.1 (localhost), port 8118. This is suitable and recommended for - home users who run Privoxy on the same machine as - their browser. -

Notes:

You will need to configure your browser(s) to this proxy address and port. -

If you already have another service running on port 8118, or if you want to - serve requests from other machines (e.g. on your local network) as well, you - will need to override the default. -

If you leave out the IP address, Privoxy will - bind to all interfaces (addresses) on your machine and may become reachable - from the Internet. In that case, consider using access control lists (ACL's, see below), and/or - a firewall. -

If you open Privoxy to untrusted users, you will - also want to make sure that the following actions are disabled: enable-edit-actions and - enable-remote-toggle -

Example:

Suppose you are running Privoxy on - a machine which has the address 192.168.0.1 on your local private network - (192.168.0.0) and has another outside connection with a different address. - You want it to serve requests from inside only: -

  listen-address  192.168.0.1:8118
-

7.4.2. toggle

Specifies:

Initial state of "toggle" status -

Type of value:

1 or 0

Default value:

1

Effect if unset:

Act as if toggled on -

Notes:

If set to 0, Privoxy will start in - "toggled off" mode, i.e. mostly behave like a normal, - content-neutral proxy with both ad blocking and content filtering - disabled. See enable-remote-toggle below. -

The windows version will only display the toggle icon in the system tray - if this option is present. -

7.4.3. enable-remote-toggle

Specifies:

Whether or not the web-based toggle - feature may be used -

Type of value:

0 or 1

Default value:

0

Effect if unset:

The web-based toggle feature is disabled. -

Notes:

When toggled off, Privoxy mostly acts like a normal, - content-neutral proxy, i.e. doesn't block ads or filter content. -

Access to the toggle feature can not be - controlled separately by "ACLs" or HTTP authentication, - so that everybody who can access Privoxy (see - "ACLs" and listen-address above) can - toggle it for all users. So this option is not recommended - for multi-user environments with untrusted users. -

Note that malicious client side code (e.g Java) is also - capable of using this option. -

As a lot of Privoxy users don't read - documentation, this feature is disabled by default. -

Note that you must have compiled Privoxy with - support for this feature, otherwise this option has no effect. -

7.4.4. enable-remote-http-toggle

Specifies:

Whether or not Privoxy recognizes special HTTP headers to change its behaviour. -

Type of value:

0 or 1

Default value:

0

Effect if unset:

Privoxy ignores special HTTP headers. -

Notes:

When toggled on, the client can change Privoxy's - behaviour by setting special HTTP headers. Currently the only supported - special header is "X-Filter: No", to disable filtering for - the ongoing request, even if it is enabled in one of the action files. -

This feature is disabled by default. If you are using - Privoxy in a environment with trusted clients, - you may enable this feature at your discretion. Note that malicious client - side code (e.g Java) is also capable of using this feature. -

This option will be removed in future releases as it has been obsoleted - by the more general header taggers. -

7.4.5. enable-edit-actions

Specifies:

Whether or not the web-based actions - file editor may be used -

Type of value:

0 or 1

Default value:

0

Effect if unset:

The web-based actions file editor is disabled. -

Notes:

Access to the editor can not be - controlled separately by "ACLs" or HTTP authentication, - so that everybody who can access Privoxy (see - "ACLs" and listen-address above) can - modify its configuration for all users. -

This option is not recommended for environments - with untrusted users and as a lot of Privoxy - users don't read documentation, this feature is disabled by default. -

Note that malicious client side code (e.g Java) is also - capable of using the actions editor and you shouldn't enable - this options unless you understand the consequences and are - sure your browser is configured correctly. -

Note that you must have compiled Privoxy with - support for this feature, otherwise this option has no effect. -

7.4.6. enforce-blocks

Specifies:

Whether the user is allowed to ignore blocks and can "go there anyway". -

Type of value:

0 or 1 -

Default value:

0

Effect if unset:

Blocks are not enforced. -

Notes:

Privoxy is mainly used to block and filter - requests as a service to the user, for example to block ads and other - junk that clogs the pipes. Privoxy's configuration - isn't perfect and sometimes innocent pages are blocked. In this situation it - makes sense to allow the user to enforce the request and have - Privoxy ignore the block. -

In the default configuration Privoxy's - "Blocked" page contains a "go there anyway" - link to adds a special string (the force prefix) to the request URL. - If that link is used, Privoxy will - detect the force prefix, remove it again and let the request pass. -

Of course Privoxy can also be used to enforce - a network policy. In that case the user obviously should not be able to - bypass any blocks, and that's what the "enforce-blocks" - option is for. If it's enabled, Privoxy hides - the "go there anyway" link. If the user adds the force - prefix by hand, it will not be accepted and the circumvention attempt - is logged. -

Examples:

enforce-blocks 1 -

7.4.7. ACLs: permit-access and deny-access

Specifies:

Who can access what. -

Type of value:

src_addr[/src_masklen] - [dst_addr[/dst_masklen]] -

Where src_addr and - dst_addr are IP addresses in dotted decimal notation or valid - DNS names, and src_masklen and - dst_masklen are subnet masks in CIDR notation, i.e. integer - values from 2 to 30 representing the length (in bits) of the network address. The masks and the whole - destination part are optional. -

Default value:

Unset

Effect if unset:

Don't restrict access further than implied by listen-address -

Notes:

Access controls are included at the request of ISPs and systems - administrators, and are not usually needed by individual users. - For a typical home user, it will normally suffice to ensure that - Privoxy only listens on the localhost - (127.0.0.1) or internal (home) network address by means of the - listen-address - option. -

Please see the warnings in the FAQ that Privoxy - is not intended to be a substitute for a firewall or to encourage anyone - to defer addressing basic security weaknesses. -

Multiple ACL lines are OK. - If any ACLs are specified, Privoxy only talks - to IP addresses that match at least one permit-access line - and don't match any subsequent deny-access line. In other words, the - last match wins, with the default being deny-access. -

If Privoxy is using a forwarder (see forward below) - for a particular destination URL, the dst_addr - that is examined is the address of the forwarder and NOT the address - of the ultimate target. This is necessary because it may be impossible for the local - Privoxy to determine the IP address of the - ultimate target (that's often what gateways are used for). -

You should prefer using IP addresses over DNS names, because the address lookups take - time. All DNS names must resolve! You can not use domain patterns - like "*.org" or partial domain names. If a DNS name resolves to multiple - IP addresses, only the first one is used. -

Denying access to particular sites by ACL may have undesired side effects - if the site in question is hosted on a machine which also hosts other sites - (most sites are). -

Examples:

Explicitly define the default behavior if no ACL and - listen-address are set: "localhost" - is OK. The absence of a dst_addr implies that - all destination addresses are OK: -

  permit-access  localhost
-

Allow any host on the same class C subnet as www.privoxy.org access to - nothing but www.example.com (or other domains hosted on the same system): -

  permit-access  www.privoxy.org/24 www.example.com/32
-

Allow access from any host on the 26-bit subnet 192.168.45.64 to anywhere, - with the exception that 192.168.45.73 may not access the IP address behind - www.dirty-stuff.example.com: -

  permit-access  192.168.45.64/26
-  deny-access    192.168.45.73    www.dirty-stuff.example.com
-

7.4.8. buffer-limit

Specifies:

Maximum size of the buffer for content filtering. -

Type of value:

Size in Kbytes

Default value:

4096

Effect if unset:

Use a 4MB (4096 KB) limit. -

Notes:

For content filtering, i.e. the +filter and - +deanimate-gif actions, it is necessary that - Privoxy buffers the entire document body. - This can be potentially dangerous, since a server could just keep sending - data indefinitely and wait for your RAM to exhaust -- with nasty consequences. - Hence this option. -

When a document buffer size reaches the buffer-limit, it is - flushed to the client unfiltered and no further attempt to - filter the rest of the document is made. Remember that there may be multiple threads - running, which might require up to buffer-limit Kbytes - each, unless you have enabled "single-threaded" - above. -

7.5. Forwarding

This feature allows routing of HTTP requests through a chain of - multiple proxies.

Forwarding can be used to chain Privoxy with a caching proxy to speed - up browsing. Using a parent proxy may also be necessary if the machine - that Privoxy runs on has no direct Internet access.

Note that parent proxies can severely decrease your privacy level. - For example a parent proxy could add your IP address to the request - headers and if it's a caching proxy it may add the "Etag" - header to revalidation requests again, even though you configured Privoxy - to remove it. It may also ignore Privoxy's header time randomization and use the - original values which could be used by the server as cookie replacement - to track your steps between visits.

Also specified here are SOCKS proxies. Privoxy - supports the SOCKS 4 and SOCKS 4A protocols.

7.5.1. forward

Specifies:

To which parent HTTP proxy specific requests should be routed. -

Type of value:

target_pattern - http_parent[:port] -

where target_pattern is a URL pattern - that specifies to which requests (i.e. URLs) this forward rule shall apply. Use / to - denote "all URLs". - http_parent[:port] - is the DNS name or IP address of the parent HTTP proxy through which the requests should be forwarded, - optionally followed by its listening port (default: 8080). - Use a single dot (.) to denote "no forwarding". -

Default value:

Unset

Effect if unset:

Don't use parent HTTP proxies. -

Notes:

If http_parent is ".", then requests are not - forwarded to another HTTP proxy but are made directly to the web servers. -

Multiple lines are OK, they are checked in sequence, and the last match wins. -

Examples:

Everything goes to an example parent proxy, except SSL on port 443 (which it doesn't handle): -

  forward   /      parent-proxy.example.org:8080
-  forward   :443   .
-

Everything goes to our example ISP's caching proxy, except for requests - to that ISP's sites: -

  forward   /                  caching-proxy.isp.example.net:8000
-  forward   .isp.example.net   .
-

7.5.2. forward-socks4, forward-socks4a and forward-socks5

Specifies:

Through which SOCKS proxy (and optionally to which parent HTTP proxy) specific requests should be routed. -

Type of value:

target_pattern - socks_proxy[:port] - http_parent[:port] -

where target_pattern is a - URL pattern that specifies to which - requests (i.e. URLs) this forward rule shall apply. Use / to - denote "all URLs". http_parent - and socks_proxy - are IP addresses in dotted decimal notation or valid DNS names - (http_parent - may be "." to denote "no HTTP forwarding"), and the optional - port parameters are TCP ports, - i.e. integer values from 1 to 65535 -

Default value:

Unset

Effect if unset:

Don't use SOCKS proxies. -

Notes:

Multiple lines are OK, they are checked in sequence, and the last match wins. -

The difference between forward-socks4 and forward-socks4a - is that in the SOCKS 4A protocol, the DNS resolution of the target hostname happens on the SOCKS - server, while in SOCKS 4 it happens locally. -

With forward-socks5 the DNS resolution will happen on the remote server as well. -

If http_parent is ".", then requests are not - forwarded to another HTTP proxy but are made (HTTP-wise) directly to the web servers, albeit through - a SOCKS proxy. -

Examples:

From the company example.com, direct connections are made to all - "internal" domains, but everything outbound goes through - their ISP's proxy by way of example.com's corporate SOCKS 4A gateway to - the Internet. -

  forward-socks4a   /              socks-gw.example.com:1080  www-cache.isp.example.net:8080
-  forward           .example.com   .
-

A rule that uses a SOCKS 4 gateway for all destinations but no HTTP parent looks like this: -

  forward-socks4   /               socks-gw.example.com:1080  .
-

To chain Privoxy and Tor, both running on the same system, you would use - something like: -

  forward-socks4a   /               127.0.0.1:9050 .
-

The public Tor network can't be used to - reach your local network, if you need to access local servers you - therefore might want to make some exceptions: -

  forward         192.168.*.*/     .
-  forward            10.*.*.*/     .
-  forward           127.*.*.*/     .
-

Unencrypted connections to systems in these address ranges will - be as (un)secure as the local network is, but the alternative is that you - can't reach the local network through Privoxy - at all. Of course this may actually be desired and there is no reason - to make these exceptions if you aren't sure you need them. -

If you also want to be able to reach servers in your local network by - using their names, you will need additional exceptions that look like - this: -

 forward           localhost/     .
-

7.5.3. Advanced Forwarding Examples

If you have links to multiple ISPs that provide various special content - only to their subscribers, you can configure multiple Privoxies - which have connections to the respective ISPs to act as forwarders to each other, so that - your users can see the internal content of all ISPs.

Assume that host-a has a PPP connection to isp-a.example.net. And host-b has a PPP connection to - isp-b.example.org. Both run Privoxy. Their forwarding - configuration can look like this:

host-a:

  forward    /           .
-  forward    .isp-b.example.net  host-b:8118

host-b:

  forward    /           .
-  forward    .isp-a.example.org  host-a:8118

Now, your users can set their browser's proxy to use either - host-a or host-b and be able to browse the internal content - of both isp-a and isp-b.

If you intend to chain Privoxy and - squid locally, then chaining as - browser -> squid -> privoxy is the recommended way.

Assuming that Privoxy and squid - run on the same box, your squid configuration could then look like this:

+ +
  # Define Privoxy as parent proxy (without ICP) 
-  cache_peer 127.0.0.1 parent 8118 7 no-query 
+  debug  8192 # Non-fatal errors
+  debug 32768 # log all data read from the network
+
+
- # Define ACL for protocol FTP - acl ftp proto FTP +

To select multiple debug levels, you can either add them or + use multiple debug lines.

+ +

A debug level of 1 is informative because it will show you + each request as it happens. 1, 1024, 4096 and 8192 are + recommended so that you will notice when things go + wrong. The other levels are probably only of interest if you + are hunting down a specific problem. They can produce a hell of + an output (especially 16).

+ +

Privoxy used to ship with + the debug levels recommended above enabled by default, but due + to privacy concerns 3.0.7 and later are configured to only log + fatal errors.

+ +

If you are used to the more verbose settings, simply enable + the debug lines below again.

+ +

If you want to use pure CLF (Common Log Format), you should + set "debug 512" ONLY and not enable anything + else.

+ +

Privoxy has a hard-coded + limit for the length of log messages. If it's reached, messages + are logged truncated and marked with "... + [too long, truncated]".

+ +

Please don't file any support requests without trying to + reproduce the problem with increased debug level first. Once + you read the log messages, you may even be able to solve the + problem on your own.

+ + +
+
+ +
+

7.3.2. single-threaded

+ +
+
+
Specifies:
+ +
+

Whether to run only one server thread.

+
+ +
Type of value:
+ +
+

None

+
+ +
Default value:
+ +
+

Unset

+
+ +
Effect if unset:
+ +
+

Multi-threaded (or, where unavailable: forked) operation, + i.e. the ability to serve multiple requests simultaneously.

+
+ +
Notes:
+ +
+

This option is only there for debugging purposes. + It will drastically reduce + performance.

+
+
+
+
+ +
+

7.3.3. + hostname

+ +
+
+
Specifies:
+ +
+

The hostname shown on the CGI pages.

+
+ +
Type of value:
+ +
+

Text

+
+ +
Default value:
+ +
+

Unset

+
+ +
Effect if unset:
+ +
+

The hostname provided by the operating system is used.

+
+ +
Notes:
+ +
+

On some misconfigured systems resolving the hostname fails + or takes too much time and slows Privoxy down. Setting a fixed + hostname works around the problem.

+ +

In other circumstances it might be desirable to show a + hostname other than the one returned by the operating system. + For example if the system has several different hostnames and + you don't want to use the first one.

+ +

Note that Privoxy does not validate the specified hostname + value.

+
+
+
+
+
+ +
+

7.4. + Access Control and Security

+ +

This section of the config file controls the security-relevant + aspects of Privoxy's + configuration.

+ +
+

7.4.1. + listen-address

+ +
+
+
Specifies:
+ +
+

The address and TCP port on which Privoxy will listen for client + requests.

+
+ +
Type of value:
+ +
+

[IP-Address]:Port

+ +

[Hostname]:Port

+
+ +
Default value:
+ +
+

127.0.0.1:8118

+
+ +
Effect if unset:
+ +
+

Bind to 127.0.0.1 (IPv4 localhost), port 8118. This is + suitable and recommended for home users who run Privoxy on the same machine as their + browser.

+
+ +
Notes:
+ +
+

You will need to configure your browser(s) to this proxy + address and port.

+ +

If you already have another service running on port 8118, or + if you want to serve requests from other machines (e.g. on your + local network) as well, you will need to override the + default.

+ +

You can use this statement multiple times to make + Privoxy listen on more ports + or more IP addresses. Suitable if + your operating system does not support sharing IPv6 and IPv4 + protocols on the same socket.

+ +

If a hostname is used instead of an IP address, Privoxy will try to resolve it to an IP + address and if there are multiple, use the first one + returned.

+ +

If the address for the hostname isn't already known on the + system (for example because it's in /etc/hostname), this may + result in DNS traffic.

+ +

If the specified address isn't available on the system, or + if the hostname can't be resolved, Privoxy will fail to start.

+ +

IPv6 addresses containing colons have to be quoted by + brackets. They can only be used if Privoxy has been compiled with IPv6 + support. If you aren't sure if your version supports it, have a + look at http://config.privoxy.org/show-status.

+ +

Some operating systems will prefer IPv6 to IPv4 addresses + even if the system has no IPv6 connectivity which is usually + not expected by the user. Some even rely on DNS to resolve + localhost which mean the "localhost" address used may not + actually be local.

+ +

It is therefore recommended to explicitly configure the + intended IP address instead of relying on the operating system, + unless there's a strong reason not to.

+ +

If you leave out the address, Privoxy will bind to all IPv4 interfaces + (addresses) on your machine and may become reachable from the + Internet and/or the local network. Be aware that some GNU/Linux + distributions modify that behaviour without updating the + documentation. Check for non-standard patches if your + Privoxyversion behaves + differently.

+ +

If you configure Privoxyto + be reachable from the network, consider using access control lists (ACL's, see below), + and/or a firewall.

+ +

If you open Privoxy to + untrusted users, you will also want to make sure that the + following actions are disabled: enable-edit-actions + and enable-remote-toggle

+ +

With the exception noted above, listening on multiple + addresses is currently not supported by Privoxy directly. It can be done on most + operating systems by letting a packet filter redirect request + for certain addresses to Privoxy, though.

+
+ +
Example:
+ +
+

Suppose you are running Privoxy on a machine which has the address + 192.168.0.1 on your local private network (192.168.0.0) and has + another outside connection with a different address. You want + it to serve requests from inside only:

+ + + + + +
+
+  listen-address  192.168.0.1:8118
+
+
+ +

Suppose you are running Privoxy on an IPv6-capable machine and you + want it to listen on the IPv6 address of the loopback + device:

+ + + + + +
+
+  listen-address [::1]:8118
+
+
+
+
+
+
+ +
+

7.4.2. toggle

+ +
+
+
Specifies:
+ +
+

Initial state of "toggle" status

+
+ +
Type of value:
+ +
+

1 or 0

+
+ +
Default value:
+ +
+

1

+
+ +
Effect if unset:
+ +
+

Act as if toggled on

+
+ +
Notes:
+ +
+

If set to 0, Privoxy will + start in "toggled off" mode, i.e. + mostly behave like a normal, content-neutral proxy with both ad + blocking and content filtering disabled. See enable-remote-toggle below.

+ +

The windows version will only display the toggle icon in the + system tray if this option is present.

+
+
+
+
+ +
+

7.4.3. enable-remote-toggle

+ +
+
+
Specifies:
+ +
+

Whether or not the web-based + toggle feature may be used

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

The web-based toggle feature is disabled.

+
+ +
Notes:
+ +
+

When toggled off, Privoxy + mostly acts like a normal, content-neutral proxy, i.e. doesn't + block ads or filter content.

+ +

Access to the toggle feature can not be controlled separately by + "ACLs" or HTTP authentication, so + that everybody who can access Privoxy (see "ACLs" and listen-address above) can toggle it for all + users. So this option is not + recommended for multi-user environments with untrusted + users.

+ +

Note that malicious client side code (e.g Java) is also + capable of using this option.

+ +

As a lot of Privoxy users + don't read documentation, this feature is disabled by + default.

+ +

Note that you must have compiled Privoxy with support for this feature, + otherwise this option has no effect.

+
+
+
+
+ +
+

7.4.4. enable-remote-http-toggle

+ +
+
+
Specifies:
+ +
+

Whether or not Privoxy recognizes special HTTP headers to + change its behaviour.

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

Privoxy ignores special HTTP headers.

+
+ +
Notes:
+ +
+

When toggled on, the client can change Privoxy's behaviour by setting special + HTTP headers. Currently the only supported special header is + "X-Filter: No", to disable filtering + for the ongoing request, even if it is enabled in one of the + action files.

+ +

This feature is disabled by default. If you are using + Privoxy in a environment with + trusted clients, you may enable this feature at your + discretion. Note that malicious client side code (e.g Java) is + also capable of using this feature.

+ +

This option will be removed in future releases as it has + been obsoleted by the more general header taggers.

+
+
+
+
+ +
+

7.4.5. enable-edit-actions

+ +
+
+
Specifies:
+ +
+

Whether or not the web-based + actions file editor may be used

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

The web-based actions file editor is disabled.

+
+ +
Notes:
+ +
+

Access to the editor can not be controlled separately by + "ACLs" or HTTP authentication, so + that everybody who can access Privoxy (see "ACLs" and listen-address above) can modify its + configuration for all users.

+ +

This option is not + recommended for environments with untrusted users and as + a lot of Privoxy users don't + read documentation, this feature is disabled by default.

+ +

Note that malicious client side code (e.g Java) is also + capable of using the actions editor and you shouldn't enable + this options unless you understand the consequences and are + sure your browser is configured correctly.

+ +

Note that you must have compiled Privoxy with support for this feature, + otherwise this option has no effect.

+
+
+
+
+ +
+

7.4.6. + enforce-blocks

+ +
+
+
Specifies:
+ +
+

Whether the user is allowed to ignore blocks and can + "go there anyway".

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

Blocks are not enforced.

+
+ +
Notes:
+ +
+

Privoxy is mainly used to + block and filter requests as a service to the user, for example + to block ads and other junk that clogs the pipes. Privoxy's configuration isn't perfect and + sometimes innocent pages are blocked. In this situation it + makes sense to allow the user to enforce the request and have + Privoxy ignore the block.

+ +

In the default configuration Privoxy's "Blocked" page contains a "go there anyway" link to adds a special string + (the force prefix) to the request URL. If that link is used, + Privoxy will detect the force + prefix, remove it again and let the request pass.

+ +

Of course Privoxy can also + be used to enforce a network policy. In that case the user + obviously should not be able to bypass any blocks, and that's + what the "enforce-blocks" option is + for. If it's enabled, Privoxy + hides the "go there anyway" link. If + the user adds the force prefix by hand, it will not be accepted + and the circumvention attempt is logged.

+
+ +
Examples:
+ +
+

enforce-blocks 1

+
+
+
+
+ +
+

7.4.7. ACLs: permit-access + and deny-access

+ +
+
+
Specifies:
+ +
+

Who can access what.

+
+ +
Type of value:
+ +
+

src_addr[:port][/src_masklen] [dst_addr[:port][/dst_masklen]]

+ +

Where src_addr and + dst_addr are IPv4 addresses in + dotted decimal notation or valid DNS names, port is a port number, and src_masklen and dst_masklen are subnet masks in CIDR + notation, i.e. integer values from 2 to 30 representing the + length (in bits) of the network address. The masks and the + whole destination part are optional.

+ +

If your system implements RFC + 3493, then src_addr and + dst_addr can be IPv6 addresses + delimeted by brackets, port can + be a number or a service name, and src_masklen and dst_masklen can be a number from 0 to + 128.

+
+ +
Default value:
+ +
+

Unset

+ +

If no port is specified, any + port will match. If no src_masklen or src_masklen is given, the complete IP + address has to match (i.e. 32 bits for IPv4 and 128 bits for + IPv6).

+
+ +
Effect if unset:
+ +
+

Don't restrict access further than implied by listen-address

+
+ +
Notes:
+ +
+

Access controls are included at the request of ISPs and + systems administrators, and are not usually needed by individual + users. For a typical home user, it will normally suffice + to ensure that Privoxy only + listens on the localhost (127.0.0.1) or internal (home) network + address by means of the listen-address option.

+ +

Please see the warnings in the FAQ that Privoxy is not intended to be a substitute + for a firewall or to encourage anyone to defer addressing basic + security weaknesses.

+ +

Multiple ACL lines are OK. If any ACLs are specified, + Privoxy only talks to IP + addresses that match at least one permit-access line and don't match any + subsequent deny-access line. In other + words, the last match wins, with the default being deny-access.

+ +

If Privoxy is using a + forwarder (see forward below) for a + particular destination URL, the dst_addr that is examined is the address + of the forwarder and NOT the address of the ultimate + target. This is necessary because it may be impossible for the + local Privoxy to determine the + IP address of the ultimate target (that's often what gateways + are used for).

+ +

You should prefer using IP addresses over DNS names, because + the address lookups take time. All DNS names must resolve! You + can not use domain + patterns like "*.org" or partial + domain names. If a DNS name resolves to multiple IP addresses, + only the first one is used.

+ +

Some systems allow IPv4 clients to connect to IPv6 server + sockets. Then the client's IPv4 address will be translated by + the system into IPv6 address space with special prefix + ::ffff:0:0/96 (so called IPv4 mapped IPv6 address). + Privoxy can handle it and maps + such ACL addresses automatically.

+ +

Denying access to particular sites by ACL may have undesired + side effects if the site in question is hosted on a machine + which also hosts other sites (most sites are).

+
+ +
Examples:
+ +
+

Explicitly define the default behavior if no ACL and + listen-address are set: "localhost" is OK. The absence of a dst_addr implies that all destination addresses are + OK:

+ + + + + +
+
+  permit-access  localhost
+
+
+ +

Allow any host on the same class C subnet as www.privoxy.org + access to nothing but www.example.com (or other domains hosted + on the same system):

+ + + + + +
+
+  permit-access  www.privoxy.org/24 www.example.com/32
+
+
+ +

Allow access from any host on the 26-bit subnet + 192.168.45.64 to anywhere, with the exception that + 192.168.45.73 may not access the IP address behind + www.dirty-stuff.example.com:

+ + + + + +
+
+  permit-access  192.168.45.64/26
+  deny-access    192.168.45.73    www.dirty-stuff.example.com
+
+
+ +

Allow access from the IPv4 network 192.0.2.0/24 even if + listening on an IPv6 wild card address (not supported on all + platforms):

+ + + + + +
+
+  permit-access  192.0.2.0/24
+
+
+ +

This is equivalent to the following line even if listening + on an IPv4 address (not supported on all platforms):

+ + + + + +
+
+  permit-access  [::ffff:192.0.2.0]/120
+
+
+
+
+
+
+ +
+

7.4.8. + buffer-limit

+ +
+
+
Specifies:
+ +
+

Maximum size of the buffer for content filtering.

+
+ +
Type of value:
+ +
+

Size in Kbytes

+
+ +
Default value:
+ +
+

4096

+
+ +
Effect if unset:
+ +
+

Use a 4MB (4096 KB) limit.

+
+ +
Notes:
+ +
+

For content filtering, i.e. the +filter and +deanimate-gif actions, it is necessary that + Privoxy buffers the entire + document body. This can be potentially dangerous, since a + server could just keep sending data indefinitely and wait for + your RAM to exhaust -- with nasty consequences. Hence this + option.

+ +

When a document buffer size reaches the buffer-limit, it is flushed to the client + unfiltered and no further attempt to filter the rest of the + document is made. Remember that there may be multiple threads + running, which might require up to buffer-limit Kbytes each, unless you have enabled + "single-threaded" above.

+
+
+
+
+
+ +
+

7.5. + Forwarding

+ +

This feature allows routing of HTTP requests through a chain of + multiple proxies.

+ +

Forwarding can be used to chain Privoxy with a caching proxy to + speed up browsing. Using a parent proxy may also be necessary if the + machine that Privoxy runs on has no + direct Internet access.

+ +

Note that parent proxies can severely decrease your privacy level. + For example a parent proxy could add your IP address to the request + headers and if it's a caching proxy it may add the "Etag" header to revalidation requests again, even + though you configured Privoxy to remove it. It may also ignore + Privoxy's header time randomization and use the original values which + could be used by the server as cookie replacement to track your steps + between visits.

+ +

Also specified here are SOCKS proxies. Privoxy supports the SOCKS 4 and SOCKS 4A + protocols.

+ +
+

7.5.1. + forward

+ +
+
+
Specifies:
+ +
+

To which parent HTTP proxy specific requests should be + routed.

+
+ +
Type of value:
+ +
+

target_pattern http_parent[:port]

+ +

where target_pattern is a + URL pattern that + specifies to which requests (i.e. URLs) this forward rule shall + apply. Use / to denote "all URLs". http_parent[:port] is the DNS name or IP address of + the parent HTTP proxy through which the requests should be + forwarded, optionally followed by its listening port (default: + 8000). Use a single dot (.) to denote + "no forwarding".

+
+ +
Default value:
+ +
+

Unset

+
+ +
Effect if unset:
+ +
+

Don't use parent HTTP proxies.

+
+ +
Notes:
+ +
+

If http_parent is + ".", then requests are not forwarded + to another HTTP proxy but are made directly to the web + servers.

+ +

http_parent can be a + numerical IPv6 address (if RFC 3493 + is implemented). To prevent clashes with the port delimiter, + the whole IP address has to be put into brackets. On the other + hand a target_pattern + containing an IPv6 address has to be put into angle brackets + (normal brackets are reserved for regular expressions + already).

+ +

Multiple lines are OK, they are checked in sequence, and the + last match wins.

+
+ +
Examples:
+ +
+

Everything goes to an example parent proxy, except SSL on + port 443 (which it doesn't handle):

+ + + + + +
+
+  forward   /      parent-proxy.example.org:8080
+  forward   :443   .
+
+
+ +

Everything goes to our example ISP's caching proxy, except + for requests to that ISP's sites:

+ + + + + +
+
+  forward   /                  caching-proxy.isp.example.net:8000
+  forward   .isp.example.net   .
+
+
+ +

Parent proxy specified by an IPv6 address:

+ + + + + +
+
+  forward   /                   [2001:DB8::1]:8000
+
+
+ +

Suppose your parent proxy doesn't support IPv6:

+ + + + + +
+
+  forward  /                        parent-proxy.example.org:8000
+  forward  ipv6-server.example.org  .
+  forward  <[2-3][0-9a-f][0-9a-f][0-9a-f]:*>   .
+
+
+
+
+
+
+ +
+

7.5.2. forward-socks4, + forward-socks4a and forward-socks5

+ +
+
+
Specifies:
+ +
+

Through which SOCKS proxy (and optionally to which parent + HTTP proxy) specific requests should be routed.

+
+ +
Type of value:
+ +
+

target_pattern socks_proxy[:port] http_parent[:port]

+ +

where target_pattern is a + URL pattern that + specifies to which requests (i.e. URLs) this forward rule shall + apply. Use / to denote "all URLs". http_parent and socks_proxy are IP addresses in dotted + decimal notation or valid DNS names (http_parent may be "." to denote "no HTTP + forwarding"), and the optional port parameters are TCP ports, i.e. + integer values from 1 to 65535

+
+ +
Default value:
+ +
+

Unset

+
+ +
Effect if unset:
+ +
+

Don't use SOCKS proxies.

+
+ +
Notes:
+ +
+

Multiple lines are OK, they are checked in sequence, and the + last match wins.

+ +

The difference between forward-socks4 and forward-socks4a is that in the SOCKS 4A + protocol, the DNS resolution of the target hostname happens on + the SOCKS server, while in SOCKS 4 it happens locally.

+ +

With forward-socks5 the DNS + resolution will happen on the remote server as well.

+ +

socks_proxy and http_parent can be a numerical IPv6 + address (if RFC 3493 is implemented). To prevent clashes + with the port delimiter, the whole IP address has to be put + into brackets. On the other hand a target_pattern containing an IPv6 address + has to be put into angle brackets (normal brackets are reserved + for regular expressions already).

+ +

If http_parent is + ".", then requests are not forwarded + to another HTTP proxy but are made (HTTP-wise) directly to the + web servers, albeit through a SOCKS proxy.

+
+ +
Examples:
+ +
+

From the company example.com, direct connections are made to + all "internal" domains, but + everything outbound goes through their ISP's proxy by way of + example.com's corporate SOCKS 4A gateway to the Internet.

+ + + + + +
+
+  forward-socks4a   /              socks-gw.example.com:1080  www-cache.isp.example.net:8080
+  forward           .example.com   .
+
+
+ +

A rule that uses a SOCKS 4 gateway for all destinations but + no HTTP parent looks like this:

+ + + + + +
+
+  forward-socks4   /               socks-gw.example.com:1080  .
+
+
+ +

To chain Privoxy and Tor, both running on the same system, + you would use something like:

+ + + + + +
+
+  forward-socks5   /               127.0.0.1:9050 .
+
+
+ +

The public Tor network + can't be used to reach your local network, if you need to + access local servers you therefore might want to make some + exceptions:

+ + + + + +
+
+  forward         192.168.*.*/     .
+  forward            10.*.*.*/     .
+  forward           127.*.*.*/     .
+
+
+ +

Unencrypted connections to systems in these address ranges + will be as (un)secure as the local network is, but the + alternative is that you can't reach the local network through + Privoxy at all. Of course this + may actually be desired and there is no reason to make these + exceptions if you aren't sure you need them.

+ +

If you also want to be able to reach servers in your local + network by using their names, you will need additional + exceptions that look like this:

+ + + + + +
+
+ forward           localhost/     .
+
+
+
+
+
+
+ +
+

7.5.3. Advanced Forwarding + Examples

+ +

If you have links to multiple ISPs that provide various special + content only to their subscribers, you can configure multiple + Privoxies which have connections to + the respective ISPs to act as forwarders to each other, so that + your users can see the + internal content of all ISPs.

+ +

Assume that host-a has a PPP connection to isp-a.example.net. And + host-b has a PPP connection to isp-b.example.org. Both run + Privoxy. Their forwarding + configuration can look like this:

+ +

host-a:

+ + + + + +
+
+  forward    /           .
+  forward    .isp-b.example.net  host-b:8118
+
+
+ +

host-b:

+ + + + + +
+
+  forward    /           .
+  forward    .isp-a.example.org  host-a:8118
+
+
+ +

Now, your users can set their browser's proxy to use either host-a + or host-b and be able to browse the internal content of both isp-a + and isp-b.

+ +

If you intend to chain Privoxy + and squid locally, then chaining as + browser -> squid -> privoxy is the + recommended way.

+ +

Assuming that Privoxy and + squid run on the same box, your + squid configuration could then look + like this:

+ + + +
+
+  # Define Privoxy as parent proxy (without ICP)
+  cache_peer 127.0.0.1 parent 8118 7 no-query
+
+  # Define ACL for protocol FTP
+  acl ftp proto FTP
 
   # Do not forward FTP requests to Privoxy
-  always_direct allow ftp 
+  always_direct allow ftp
 
   # Forward all the rest to Privoxy
-  never_direct allow all

You would then need to change your browser's proxy settings to squid's address and port. - Squid normally uses port 3128. If unsure consult http_port in squid.conf.

You could just as well decide to only forward requests you suspect - of leading to Windows executables through a virus-scanning parent proxy, - say, on antivir.example.com, port 8010:

  forward   /                          .
-  forward   /.*\.(exe|com|dll|zip)$    antivir.example.com:8010

7.5.4. forwarded-connect-retries

Specifies:

How often Privoxy retries if a forwarded connection request fails. -

Type of value:

Number of retries. -

Default value:

0

Effect if unset:

Connections forwarded through other proxies are treated like direct connections and no retry attempts are made. -

Notes:

forwarded-connect-retries is mainly interesting - for socks4a connections, where Privoxy can't detect why the connections failed. - The connection might have failed because of a DNS timeout in which case a retry makes sense, - but it might also have failed because the server doesn't exist or isn't reachable. In this - case the retry will just delay the appearance of Privoxy's error message. -

Note that in the context of this option, "forwarded connections" includes all connections - that Privoxy forwards through other proxies. This option is not limited to the HTTP CONNECT method. -

Only use this option, if you are getting lots of forwarding-related error messages - that go away when you try again manually. Start with a small value and check Privoxy's - logfile from time to time, to see how many retries are usually needed. -

Examples:

forwarded-connect-retries 1 -

7.5.5. accept-intercepted-requests

Specifies:

Whether intercepted requests should be treated as valid. -

Type of value:

0 or 1 -

Default value:

0

Effect if unset:

Only proxy requests are accepted, intercepted requests are treated as invalid. -

Notes:

If you don't trust your clients and want to force them - to use Privoxy, enable this - option and configure your packet filter to redirect outgoing - HTTP connections into Privoxy. -

Make sure that Privoxy's own requests - aren't redirected as well. Additionally take care that - Privoxy can't intentionally connect - to itself, otherwise you could run into redirection loops if - Privoxy's listening port is reachable - by the outside or an attacker has access to the pages you visit. -

Examples:

accept-intercepted-requests 1 -

7.5.6. allow-cgi-request-crunching

Specifies:

Whether requests to Privoxy's CGI pages can be blocked or redirected. -

Type of value:

0 or 1 -

Default value:

0

Effect if unset:

Privoxy ignores block and redirect actions for its CGI pages. -

Notes:

By default Privoxy ignores block or redirect actions - for its CGI pages. Intercepting these requests can be useful in multi-user - setups to implement fine-grained access control, but it can also render the complete - web interface useless and make debugging problems painful if done without care. -

Don't enable this option unless you're sure that you really need it. -

Examples:

allow-cgi-request-crunching 1 -

7.5.7. split-large-forms

Specifies:

Whether the CGI interface should stay compatible with broken HTTP clients. -

Type of value:

0 or 1 -

Default value:

0

Effect if unset:

The CGI form generate long GET URLs. -

Notes:

Privoxy's CGI forms can lead to - rather long URLs. This isn't a problem as far as the HTTP - standard is concerned, but it can confuse clients with arbitrary - URL length limitations. -

Enabling split-large-forms causes Privoxy - to divide big forms into smaller ones to keep the URL length down. - It makes editing a lot less convenient and you can no longer - submit all changes at once, but at least it works around this - browser bug. -

If you don't notice any editing problems, there is no reason - to enable this option, but if one of the submit buttons appears - to be broken, you should give it a try. -

Examples:

split-large-forms 1 -

7.5.8. keep-alive-timeout

Specifies:

Number of seconds after which an open connection will no longer be reused. -

Type of value:

Time in seconds. -

Default value:

None

Effect if unset:

Connections are not reused. -

Notes:

This option has no effect if Privoxy - has been compiled without keep-alive support. -

Notes:

Note that reusing connections doesn't necessary cause speedups. - There are also a few privacy implications you should be aware of. -

Outgoing connections are shared between clients (if there are more - than one) and closing the client that initiated the outgoing connection - does not affect the connection between Privoxy and the server unless - the client's request hasn't been completed yet. If the outgoing connection - is idle, it will not be closed until either Privoxy's - or the server's timeout is reached. While it's open, the server knows - that the system running Privoxy is still there. -

Examples:

keep-alive-timeout 300 -

7.5.9. socket-timeout

Specifies:

Number of seconds after which a socket times out if - no data is received. -

Type of value:

Time in seconds. -

Default value:

None

Effect if unset:

A default value of 300 seconds is used. -

Notes:

For SOCKS requests the timeout currently doesn't start until - the SOCKS server accepted the request. This will be fixed in - the next release. -

Examples:

socket-timeout 300 -

7.6. Windows GUI Options

Privoxy has a number of options specific to the - Windows GUI interface:

If "activity-animation" is set to 1, the - Privoxy icon will animate when - "Privoxy" is active. To turn off, set to 0.

  activity-animation 1
-   

-

If "log-messages" is set to 1, - Privoxy will log messages to the console - window:

  log-messages 1
-   

-

- If "log-buffer-size" is set to 1, the size of the log buffer, - i.e. the amount of memory used for the log messages displayed in the - console window, will be limited to "log-max-lines" (see below).

Warning: Setting this to 0 will result in the buffer to grow infinitely and - eat up all your memory!

  log-buffer-size 1
-   

-

log-max-lines is the maximum number of lines held - in the log buffer. See above.

  log-max-lines 200
-   

-

If "log-highlight-messages" is set to 1, - Privoxy will highlight portions of the log - messages with a bold-faced font:

  log-highlight-messages 1
-   

-

The font used in the console window:

  log-font-name Comic Sans MS
-   

-

Font size used in the console window:

  log-font-size 8
-   

-

- "show-on-task-bar" controls whether or not - Privoxy will appear as a button on the Task bar - when minimized:

  show-on-task-bar 0
-   

-

If "close-button-minimizes" is set to 1, the Windows close - button will minimize Privoxy instead of closing - the program (close with the exit option on the File menu).

  close-button-minimizes 1
-   

-

The "hide-console" option is specific to the MS-Win console - version of Privoxy. If this option is used, - Privoxy will disconnect from and hide the - command console.

  #hide-console
-   

-


PrevHomeNext
Privoxy Configuration Actions Files
\ No newline at end of file + never_direct allow all +
+
+ +

You would then need to change your browser's proxy settings to + squid's address and port. Squid + normally uses port 3128. If unsure consult http_port in squid.conf.

+ +

You could just as well decide to only forward requests you suspect + of leading to Windows executables through a virus-scanning parent + proxy, say, on antivir.example.com, port + 8010:

+ + + + + +
+
+  forward   /                          .
+  forward   /.*\.(exe|com|dll|zip)$    antivir.example.com:8010
+
+
+
+ +
+

7.5.4. forwarded-connect-retries

+ +
+
+
Specifies:
+ +
+

How often Privoxy retries if a forwarded connection request + fails.

+
+ +
Type of value:
+ +
+

Number of retries.

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

Connections forwarded through other proxies are treated like + direct connections and no retry attempts are made.

+
+ +
Notes:
+ +
+

forwarded-connect-retries is + mainly interesting for socks4a connections, where Privoxy can't detect why the connections + failed. The connection might have failed because of a DNS + timeout in which case a retry makes sense, but it might also + have failed because the server doesn't exist or isn't + reachable. In this case the retry will just delay the + appearance of Privoxy's error message.

+ +

Note that in the context of this option, "forwarded connections" includes all connections + that Privoxy forwards through other proxies. This option is not + limited to the HTTP CONNECT method.

+ +

Only use this option, if you are getting lots of + forwarding-related error messages that go away when you try + again manually. Start with a small value and check Privoxy's + logfile from time to time, to see how many retries are usually + needed.

+
+ +
Examples:
+ +
+

forwarded-connect-retries 1

+
+
+
+
+
+ +
+

7.6. Miscellaneous

+ +
+

7.6.1. + accept-intercepted-requests

+ +
+
+
Specifies:
+ +
+

Whether intercepted requests should be treated as valid.

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

Only proxy requests are accepted, intercepted requests are + treated as invalid.

+
+ +
Notes:
+ +
+

If you don't trust your clients and want to force them to + use Privoxy, enable this + option and configure your packet filter to redirect outgoing + HTTP connections into Privoxy.

+ +

Make sure that Privoxy's + own requests aren't redirected as well. Additionally take care + that Privoxy can't + intentionally connect to itself, otherwise you could run into + redirection loops if Privoxy's + listening port is reachable by the outside or an attacker has + access to the pages you visit.

+
+ +
Examples:
+ +
+

accept-intercepted-requests 1

+
+
+
+
+ +
+

7.6.2. + allow-cgi-request-crunching

+ +
+
+
Specifies:
+ +
+

Whether requests to Privoxy's CGI pages can be blocked or + redirected.

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

Privoxy ignores block and + redirect actions for its CGI pages.

+
+ +
Notes:
+ +
+

By default Privoxy ignores + block or redirect actions for its CGI pages. Intercepting these + requests can be useful in multi-user setups to implement + fine-grained access control, but it can also render the + complete web interface useless and make debugging problems + painful if done without care.

+ +

Don't enable this option unless you're sure that you really + need it.

+
+ +
Examples:
+ +
+

allow-cgi-request-crunching 1

+
+
+
+
+ +
+

7.6.3. split-large-forms

+ +
+
+
Specifies:
+ +
+

Whether the CGI interface should stay compatible with broken + HTTP clients.

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

The CGI form generate long GET URLs.

+
+ +
Notes:
+ +
+

Privoxy's CGI forms can + lead to rather long URLs. This isn't a problem as far as the + HTTP standard is concerned, but it can confuse clients with + arbitrary URL length limitations.

+ +

Enabling split-large-forms causes Privoxy to divide big forms into smaller + ones to keep the URL length down. It makes editing a lot less + convenient and you can no longer submit all changes at once, + but at least it works around this browser bug.

+ +

If you don't notice any editing problems, there is no reason + to enable this option, but if one of the submit buttons appears + to be broken, you should give it a try.

+
+ +
Examples:
+ +
+

split-large-forms 1

+
+
+
+
+ +
+

7.6.4. keep-alive-timeout

+ +
+
+
Specifies:
+ +
+

Number of seconds after which an open connection will no + longer be reused.

+
+ +
Type of value:
+ +
+

Time in seconds.

+
+ +
Default value:
+ +
+

None

+
+ +
Effect if unset:
+ +
+

Connections are not kept alive.

+
+ +
Notes:
+ +
+

This option allows clients to keep the connection to + Privoxy alive. If the server + supports it, Privoxy will keep + the connection to the server alive as well. Under certain + circumstances this may result in speed-ups.

+ +

By default, Privoxy will + close the connection to the server if the client connection + gets closed, or if the specified timeout has been reached + without a new request coming in. This behaviour can be changed + with the connection-sharing option.

+ +

This option has no effect if Privoxy has been compiled without + keep-alive support.

+ +

Note that a timeout of five seconds as used in the default + configuration file significantly decreases the number of + connections that will be reused. The value is used because some + browsers limit the number of connections they open to a single + host and apply the same limit to proxies. This can result in a + single website "grabbing" all the + connections the browser allows, which means connections to + other websites can't be opened until the connections currently + in use time out.

+ +

Several users have reported this as a Privoxy bug, so the + default value has been reduced. Consider increasing it to 300 + seconds or even more if you think your browser can handle it. + If your browser appears to be hanging it can't.

+
+ +
Examples:
+ +
+

keep-alive-timeout 300

+
+
+
+
+ +
+

7.6.5. default-server-timeout

+ +
+
+
Specifies:
+ +
+

Assumed server-side keep-alive timeout if not specified by + the server.

+
+ +
Type of value:
+ +
+

Time in seconds.

+
+ +
Default value:
+ +
+

None

+
+ +
Effect if unset:
+ +
+

Connections for which the server didn't specify the + keep-alive timeout are not reused.

+
+ +
Notes:
+ +
+

Enabling this option significantly increases the number of + connections that are reused, provided the keep-alive-timeout + option is also enabled.

+ +

While it also increases the number of connections problems + when Privoxy tries to reuse a + connection that already has been closed on the server side, or + is closed while Privoxy is + trying to reuse it, this should only be a problem if it happens + for the first request sent by the client. If it happens for + requests on reused client connections, Privoxy will simply close the connection + and the client is supposed to retry the request without + bothering the user.

+ +

Enabling this option is therefore only recommended if the + connection-sharing option is disabled.

+ +

It is an error to specify a value larger than the keep-alive-timeout + value.

+ +

This option has no effect if Privoxy has been compiled without + keep-alive support.

+
+ +
Examples:
+ +
+

default-server-timeout 60

+
+
+
+
+ +
+

7.6.6. connection-sharing

+ +
+
+
Specifies:
+ +
+

Whether or not outgoing connections that have been kept + alive should be shared between different incoming + connections.

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

None

+
+ +
Effect if unset:
+ +
+

Connections are not shared.

+
+ +
Notes:
+ +
+

This option has no effect if Privoxy has been compiled without + keep-alive support, or if it's disabled.

+
+ +
Notes:
+ +
+

Note that reusing connections doesn't necessary cause + speedups. There are also a few privacy implications you should + be aware of.

+ +

If this option is effective, outgoing connections are shared + between clients (if there are more than one) and closing the + browser that initiated the outgoing connection does no longer + affect the connection between Privoxy and the server unless the client's + request hasn't been completed yet.

+ +

If the outgoing connection is idle, it will not be closed + until either Privoxy's or the + server's timeout is reached. While it's open, the server knows + that the system running Privoxy is still there.

+ +

If there are more than one client (maybe even belonging to + multiple users), they will be able to reuse each others + connections. This is potentially dangerous in case of + authentication schemes like NTLM where only the connection is + authenticated, instead of requiring authentication for each + request.

+ +

If there is only a single client, and if said client can + keep connections alive on its own, enabling this option has + next to no effect. If the client doesn't support connection + keep-alive, enabling this option may make sense as it allows + Privoxy to keep outgoing + connections alive even if the client itself doesn't support + it.

+ +

You should also be aware that enabling this option increases + the likelihood of getting the "No server or forwarder data" + error message, especially if you are using a slow connection to + the Internet.

+ +

This option should only be used by experienced users who + understand the risks and can weight them against the + benefits.

+
+ +
Examples:
+ +
+

connection-sharing 1

+
+
+
+
+ +
+

7.6.7. + socket-timeout

+ +
+
+
Specifies:
+ +
+

Number of seconds after which a socket times out if no data + is received.

+
+ +
Type of value:
+ +
+

Time in seconds.

+
+ +
Default value:
+ +
+

None

+
+ +
Effect if unset:
+ +
+

A default value of 300 seconds is used.

+
+ +
Notes:
+ +
+

The default is quite high and you probably want to reduce + it. If you aren't using an occasionally slow proxy like Tor, + reducing it to a few seconds should be fine.

+
+ +
Examples:
+ +
+

socket-timeout 300

+
+
+
+
+ +
+

7.6.8. max-client-connections

+ +
+
+
Specifies:
+ +
+

Maximum number of client connections that will be + served.

+
+ +
Type of value:
+ +
+

Positive number.

+
+ +
Default value:
+ +
+

None

+
+ +
Effect if unset:
+ +
+

Connections are served until a resource limit is + reached.

+
+ +
Notes:
+ +
+

Privoxy creates one thread + (or process) for every incoming client connection that isn't + rejected based on the access control settings.

+ +

If the system is powerful enough, Privoxy can theoretically deal with + several hundred (or thousand) connections at the same time, but + some operating systems enforce resource limits by shutting down + offending processes and their default limits may be below the + ones Privoxy would require + under heavy load.

+ +

Configuring Privoxy to + enforce a connection limit below the thread or process limit + used by the operating system makes sure this doesn't happen. + Simply increasing the operating system's limit would work too, + but if Privoxy isn't the only + application running on the system, you may actually want to + limit the resources used by Privoxy.

+ +

If Privoxy is only used by + a single trusted user, limiting the number of client + connections is probably unnecessary. If there are multiple + possibly untrusted users you probably still want to + additionally use a packet filter to limit the maximal number of + incoming connections per client. Otherwise a malicious user + could intentionally create a high number of connections to + prevent other users from using Privoxy.

+ +

Obviously using this option only makes sense if you choose a + limit below the one enforced by the operating system.

+
+ +
Examples:
+ +
+

max-client-connections 256

+
+
+
+
+ +
+

7.6.9. + handle-as-empty-doc-returns-ok

+ +
+
+
Specifies:
+ +
+

The status code Privoxy returns for pages blocked with + +handle-as-empty-document.

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

Privoxy returns a status 403(forbidden) for all blocked + pages.

+
+ +
Effect if set:
+ +
+

Privoxy returns a status 200(OK) for pages blocked with + +handle-as-empty-document and a status 403(Forbidden) for all + other blocked pages.

+
+ +
Notes:
+ +
+

This is a work-around for Firefox bug 492459: " Websites are no longer rendered if SSL requests for + JavaScripts are blocked by a proxy. " (https://bugzilla.mozilla.org/show_bug.cgi?id=492459) + As the bug has been fixed for quite some time this option + should no longer be needed and will be removed in a future + release. Please speak up if you have a reason why the option + should be kept around.

+
+
+
+
+ +
+

7.6.10. enable-compression

+ +
+
+
Specifies:
+ +
+

Whether or not buffered content is compressed before + delivery.

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

Privoxy does not compress buffered content.

+
+ +
Effect if set:
+ +
+

Privoxy compresses buffered content before delivering it to + the client, provided the client supports it.

+
+ +
Notes:
+ +
+

This directive is only supported if Privoxy has been + compiled with FEATURE_COMPRESSION, which should not to be + confused with FEATURE_ZLIB.

+ +

Compressing buffered content is mainly useful if Privoxy and + the client are running on different systems. If they are + running on the same system, enabling compression is likely to + slow things down. If you didn't measure otherwise, you should + assume that it does and keep this option disabled.

+ +

Privoxy will not compress buffered content below a certain + length.

+
+
+
+
+ +
+

7.6.11. compression-level

+ +
+
+
Specifies:
+ +
+

The compression level that is passed to the zlib library + when compressing buffered content.

+
+ +
Type of value:
+ +
+

Positive number ranging from 0 to + 9.

+
+ +
Default value:
+ +
+

1

+
+ +
Notes:
+ +
+

Compressing the data more takes usually longer than + compressing it less or not compressing it at all. Which level + is best depends on the connection between Privoxy and the + client. If you can't be bothered to benchmark it for yourself, + you should stick with the default and keep compression + disabled.

+ +

If compression is disabled, the compression level is + irrelevant.

+
+ +
Examples:
+ +
+ + + + +
+
+    # Best speed (compared to the other levels)
+    compression-level 1
+    # Best compression
+    compression-level 9
+    # No compression. Only useful for testing as the added header
+    # slightly increases the amount of data that has to be sent.
+    # If your benchmark shows that using this compression level
+    # is superior to using no compression at all, the benchmark
+    # is likely to be flawed.
+    compression-level 0
+
+
+
+
+
+
+
+
+ +
+

7.7. Windows + GUI Options

+ +

Privoxy has a number of options + specific to the Windows GUI interface:

+ +

If "activity-animation" is set to 1, the + Privoxy icon will animate when + "Privoxy" is active. To turn off, set to + 0.

+ +

  activity-animation 1
+    

+ +

If "log-messages" is set to 1, + Privoxy will log messages to the + console window:

+ +

  log-messages 1
+    

+ +

If "log-buffer-size" is set to 1, the + size of the log buffer, i.e. the amount of memory used for the log + messages displayed in the console window, will be limited to + "log-max-lines" (see below).

+ +

Warning: Setting this to 0 will result in the buffer to grow + infinitely and eat up all your memory!

+ +

  log-buffer-size 1
+    

+ +

log-max-lines is the maximum number + of lines held in the log buffer. See above.

+ +

  log-max-lines 200
+    

+ +

If "log-highlight-messages" is set to 1, + Privoxy will highlight portions of the + log messages with a bold-faced font:

+ +

  log-highlight-messages 1
+    

+ +

The font used in the console window:

+ +

  log-font-name Comic Sans MS
+    

+ +

Font size used in the console window:

+ +

  log-font-size 8
+    

+ +

"show-on-task-bar" controls whether or + not Privoxy will appear as a button on + the Task bar when minimized:

+ +

  show-on-task-bar 0
+    

+ +

If "close-button-minimizes" is set to 1, + the Windows close button will minimize Privoxy instead of closing the program (close with + the exit option on the File menu).

+ +

  close-button-minimizes 1
+    

+ +

The "hide-console" option is specific to + the MS-Win console version of Privoxy. + If this option is used, Privoxy will + disconnect from and hide the command console.

+ +

  #hide-console
+    

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/user-manual/configuration.html b/external/privoxy/doc/webserver/user-manual/configuration.html index b4f021e4..923fb87f 100644 --- a/external/privoxy/doc/webserver/user-manual/configuration.html +++ b/external/privoxy/doc/webserver/user-manual/configuration.html @@ -1,514 +1,282 @@ - -Privoxy Configuration - -
Privoxy 3.0.12 User Manual
PrevNext

6. Privoxy Configuration

All Privoxy configuration is stored - in text files. These files can be edited with a text editor. - Many important aspects of Privoxy can - also be controlled easily with a web browser. -

6.1. Controlling Privoxy with Your Web Browser

Privoxy's user interface can be reached through the special - URL http://config.privoxy.org/ - (shortcut: http://p.p/), - which is a built-in page and works without Internet access. - You will see the following section:

 

    Privoxy Menu

        ▪  View & change the current configuration -
        ▪  View the source code version numbers -
        ▪  View the request headers. -
        ▪  Look up which actions apply to a URL and why -
        ▪  Toggle Privoxy on or off -
        ▪  Documentation -

This should be self-explanatory. Note the first item leads to an editor for the - actions files, which is where the ad, banner, - cookie, and URL blocking magic is configured as well as other advanced features of - Privoxy. This is an easy way to adjust various - aspects of Privoxy configuration. The actions - file, and other configuration files, are explained in detail below.

"Toggle Privoxy On or Off" is handy for sites that might - have problems with your current actions and filters. You can in fact use - it as a test to see whether it is Privoxy - causing the problem or not. Privoxy continues - to run as a proxy in this case, but all manipulation is disabled, i.e. - Privoxy acts like a normal forwarding proxy. There - is even a toggle Bookmarklet offered, so - that you can toggle Privoxy with one click from - your browser.

Note that several of the features described above are disabled by default - in Privoxy 3.0.7 beta and later. - Check the - configuration file to learn why - and in which cases it's safe to enable them again.

6.2. Configuration Files Overview

For Unix, *BSD and Linux, all configuration files are located in - /etc/privoxy/ by default. For MS Windows, OS/2, and - AmigaOS these are all in the same directory as the - Privoxy executable.

The installed defaults provide a reasonable starting point, though - some settings may be aggressive by some standards. For the time being, the - principle configuration files are:

  • The main configuration file is named config - on Linux, Unix, BSD, OS/2, and AmigaOS and config.txt - on Windows. This is a required file. -

  • match-all.action is used to define which "actions" - relating to banner-blocking, images, pop-ups, content modification, cookie handling - etc should be applied by default. It should be the first actions file loaded. -

    default.action defines many exceptions (both positive and negative) - from the default set of actions that's configured in match-all.action. - It should be the second actions file loaded and shouldn't be edited by the user. -

    Multiple actions files may be defined in config. These - are processed in the order they are defined. Local customizations and locally - preferred exceptions to the default policies as defined in - match-all.action (which you will most probably want - to define sooner or later) are best applied in user.action, - where you can preserve them across upgrades. The file isn't installed by all - installers, but you can easily create it yourself with a text editor. -

    - There is also a web based editor that can be accessed from - http://config.privoxy.org/show-status - (Shortcut: http://p.p/show-status) for the - various actions files. -

  • "Filter files" (the filter - file) can be used to re-write the raw page content, including - viewable text as well as embedded HTML and JavaScript, and whatever else - lurks on any given web page. The filtering jobs are only pre-defined here; - whether to apply them or not is up to the actions files. - default.filter includes various filters made - available for use by the developers. Some are much more intrusive than - others, and all should be used with caution. You may define additional - filter files in config as you can with - actions files. We suggest user.filter for any - locally defined filters or customizations. -

The syntax of the configuration and filter files may change between different - Privoxy versions, unfortunately some enhancements cost backwards compatibility. -

All files use the "#" character to denote a - comment (the rest of the line will be ignored) and understand line continuation - through placing a backslash ("\") as the very last character - in a line. If the # is preceded by a backslash, it looses - its special function. Placing a # in front of an otherwise - valid configuration line to prevent it from being interpreted is called "commenting - out" that line. Blank lines are ignored.

The actions files and filter files - can use Perl style regular expressions for - maximum flexibility.

After making any changes, there is no need to restart - Privoxy in order for the changes to take - effect. Privoxy detects such changes - automatically. Note, however, that it may take one or two additional - requests for the change to take effect. When changing the listening address - of Privoxy, these "wake up" requests - must obviously be sent to the old listening address.


PrevHomeNext
Starting Privoxy The Main Configuration File
\ No newline at end of file + + + + + + + Privoxy Configuration + + + + + + + + + + + + + +
+

6. Privoxy + Configuration

+ +

All Privoxy configuration is stored + in text files. These files can be edited with a text editor. Many + important aspects of Privoxy can also be + controlled easily with a web browser.

+ +
+

6.1. Controlling + Privoxy with Your Web Browser

+ +

Privoxy's user interface can be + reached through the special URL http://config.privoxy.org/ (shortcut: http://p.p/), which is a built-in page + and works without Internet access. You will see the following + section:

+ + + + + +
+
+
+
+ +

    Privoxy Menu

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+         ▪  View & change the current + configuration
+         ▪  View the source code version numbers
+         ▪  View the request headers.
+         ▪  Look up which actions apply to a URL and + why
+         ▪  Toggle Privoxy on or off
+         ▪  Documentation
+
+ +

This should be self-explanatory. Note the first item leads to an + editor for the actions files, which is + where the ad, banner, cookie, and URL blocking magic is configured as + well as other advanced features of Privoxy. This is an easy way to adjust various + aspects of Privoxy configuration. The + actions file, and other configuration files, are explained in detail + below.

+ +

"Toggle Privoxy On or Off" is handy for + sites that might have problems with your current actions and filters. + You can in fact use it as a test to see whether it is Privoxy causing the problem or not. Privoxy continues to run as a proxy in this case, + but all manipulation is disabled, i.e. Privoxy acts like a normal forwarding proxy. There + is even a toggle Bookmarklet + offered, so that you can toggle Privoxy with one click from your browser.

+ +

Note that several of the features described above are disabled by + default in Privoxy 3.0.7 beta and + later. Check the configuration + file to learn why and in which cases it's safe to enable them + again.

+
+ +
+

6.2. + Configuration Files Overview

+ +

For Unix, *BSD and Linux, all configuration files are located in + /etc/privoxy/ by default. For MS Windows, + OS/2, and AmigaOS these are all in the same directory as the + Privoxy executable.

+ +

The installed defaults provide a reasonable starting point, though + some settings may be aggressive by some standards. For the time being, + the principle configuration files are:

+ +
    +
  • +

    The main configuration file is named + config on Linux, Unix, BSD, OS/2, and + AmigaOS and config.txt on Windows. This + is a required file.

    +
  • + +
  • +

    match-all.action is used to define + which "actions" relating to + banner-blocking, images, pop-ups, content modification, cookie + handling etc should be applied by default. It should be the first + actions file loaded.

    + +

    default.action defines many exceptions + (both positive and negative) from the default set of actions that's + configured in match-all.action. It should + be the second actions file loaded and shouldn't be edited by the + user.

    + +

    Multiple actions files may be defined in config. These are processed in the order they are + defined. Local customizations and locally preferred exceptions to + the default policies as defined in match-all.action (which you will most probably want + to define sooner or later) are best applied in user.action, where you can preserve them across + upgrades. The file isn't installed by all installers, but you can + easily create it yourself with a text editor.

    + +

    There is also a web based editor that can be accessed from + http://config.privoxy.org/show-status (Shortcut: + http://p.p/show-status) for the various actions + files.

    +
  • + +
  • +

    "Filter files" (the filter file) can be used to re-write the raw + page content, including viewable text as well as embedded HTML and + JavaScript, and whatever else lurks on any given web page. The + filtering jobs are only pre-defined here; whether to apply them or + not is up to the actions files. default.filter includes various filters made + available for use by the developers. Some are much more intrusive + than others, and all should be used with caution. You may define + additional filter files in config as you + can with actions files. We suggest user.filter for any locally defined filters or + customizations.

    +
  • +
+ +

The syntax of the configuration and filter files may change between + different Privoxy versions, unfortunately some enhancements cost + backwards compatibility.

+ +

All files use the "#" character to denote a comment (the rest of the + line will be ignored) and understand line continuation through placing + a backslash ("\") as the very last character + in a line. If the # is preceded by a + backslash, it looses its special function. Placing a # in front of an otherwise valid configuration line to + prevent it from being interpreted is called "commenting out" that line. + Blank lines are ignored.

+ +

The actions files and filter files can use Perl style regular expressions for maximum + flexibility.

+ +

After making any changes, there is no need to restart Privoxy in order for the changes to take effect. + Privoxy detects such changes + automatically. Note, however, that it may take one or two additional + requests for the change to take effect. When changing the listening + address of Privoxy, these "wake up" requests must obviously be sent to the + old listening address.

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/user-manual/contact.html b/external/privoxy/doc/webserver/user-manual/contact.html index 3fd43eb3..9b3bc0cf 100644 --- a/external/privoxy/doc/webserver/user-manual/contact.html +++ b/external/privoxy/doc/webserver/user-manual/contact.html @@ -1,514 +1,364 @@ - -Contacting the Developers, Bug Reporting and Feature -Requests - -
Privoxy 3.0.12 User Manual
PrevNext

11. Contacting the Developers, Bug Reporting and Feature -Requests

We value your feedback. In fact, we rely on it to improve - Privoxy and its configuration. - However, please note the following hints, so we can - provide you with the best support:

11.1. Get Support

For casual users, our - support forum at SourceForge - is probably best suited: - http://sourceforge.net/tracker/?group_id=11118&atid=211118

All users are of course welcome to discuss their issues on the users - mailing list, where the developers also hang around.

Please don't sent private support requests to individual Privoxy - developers, either use the mailing lists or the support trackers.

Note that the Privoxy mailing lists are moderated. Posts from unsubscribed - addresses have to be accepted manually by a moderator. This may cause a - delay of several days and if you use a subject that doesn't clearly - mention Privoxy or one of its features, your message may be accidentally - discarded as spam.

If you aren't subscribed, you should therefore spend a few seconds - to come up with a proper subject. Additionally you should make it clear - that you want to get CC'd. Otherwise some responses will be directed to - the mailing list only, and you won't see them.

11.2. Reporting Problems

"Problems" for our purposes, come in two forms:

  • Configuration issues, such as ads that slip through, or sites that - don't function properly due to one Privoxy - "action" or another being turned "on". -

  • "Bugs" in the programming code that makes up - Privoxy, such as that might cause a crash. -

11.2.1. Reporting Ads or Other Configuration Problems

Please send feedback on ads that slipped through, innocent images that were - blocked, sites that don't work properly, and other configuration related problem of - default.action file, to - http://sourceforge.net/tracker/?group_id=11118&atid=460288, - the Actions File Tracker.

New, improved default.action files may occasionally be made - available based on your feedback. These will be announced on the ijbswa-announce - list and available from our the files section of - our project page.

11.2.2. Reporting Bugs

Please report all bugs through our bug tracker: - http://sourceforge.net/tracker/?group_id=11118&atid=111118.

Before doing so, please make sure that the bug has not already been submitted - and observe the additional hints at the top of the submit - form. If already submitted, please feel free to add any info to the - original report that might help to solve the issue.

Please try to verify that it is a Privoxy bug, - and not a browser or site bug or documented behaviour that just happens - to be different than what you expected. If unsure, - try toggling - off Privoxy, and see if the problem persists.

If you are using your own custom configuration, please try - the stock configs to see if the problem is configuration related. - If you're having problems with a feature that is disabled by default, - please ask around on the mailing list if others can reproduce the problem.

If you aren't using the latest Privoxy version, the bug may have been found - and fixed in the meantime. We would appreciate if you could take the time - to upgrade - to the latest version (or even the latest CVS snapshot) and verify - that your bug still exists.

Please be sure to provide the following information:

  • The exact Privoxy version you are using - (if you got the source from CVS, please also provide the source code revisions - as shown in http://config.privoxy.org/show-version). -

  • The operating system and versions you run - Privoxy on, (e.g. Windows - XP SP2), if you are using a Unix flavor, - sending the output of "uname -a" should do, - in case of GNU/Linux, please also name the distribution. -

  • The name, platform, and version of the browser - you were using (e.g. Internet Explorer v5.5 for Mac). -

  • The URL where the problem occurred, or some way for us to duplicate the - problem (e.g. http://somesite.example.com/?somethingelse=123). -

  • Whether your version of Privoxy is one supplied - by the Privoxy developers via SourceForge, - or if you got your copy somewhere else. -

  • Whether you are using Privoxy in tandem with - another proxy such as Tor. If so, please - temporary disable the other proxy to see if the symptoms change. -

  • Whether you are using a personal firewall product. If so, does - Privoxy work without it? -

  • Any other pertinent information to help identify the problem such as config - or log file excerpts (yes, you should have log file entries for each - action taken). -

You don't have to tell us your actual name when filing a problem - report, but please use a nickname so we can differentiate between - your messages and the ones entered by other "anonymous" users that - may respond to your request if they have the same problem or already - found a solution.

Please also check the status of your request a few days after submitting - it, as we may request additional information. If you use a SF id, - you should automatically get a mail when someone responds to your request.

The appendix - of the Privoxy User Manual also has helpful information - on understanding actions, and action debugging.

11.3. Request New Features

You are welcome to submit ideas on new features or other proposals - for improvement through our feature request tracker at - http://sourceforge.net/tracker/?atid=361118&group_id=11118.

11.4. Other

For any other issues, feel free to use the mailing lists. Technically interested users -and people who wish to contribute to the project are also welcome on the developers list! -You can find an overview of all Privoxy-related mailing lists, -including list archives, at: -http://sourceforge.net/mail/?group_id=11118.


PrevHomeNext
Privoxy's Template Files Privoxy Copyright, License and History
\ No newline at end of file + + + + + + + Contacting the Developers, Bug Reporting and Feature + Requests + + + + + + + + + + + + + +
+

11. Contacting the + Developers, Bug Reporting and Feature Requests

+ +

We value your feedback. In fact, we rely on it to improve Privoxy and its configuration. However, please note + the following hints, so we can provide you with the best support:

+ +
+

11.1. + Get Support

+ +

For casual users, our support forum at SourceForge is probably best suited: + http://sourceforge.net/tracker/?group_id=11118&atid=211118

+ +

All users are of course welcome to discuss their issues on the + users mailing list, where the developers also hang + around.

+ +

Please don't sent private support requests to individual Privoxy + developers, either use the mailing lists or the support trackers.

+ +

If you have to contact a Privoxy developer directly for other + reasons, please send a real mail and do not bother with SourceForge's + messaging system. Answers to SourceForge messages are usually bounced + by SourceForge's mail server in which case the developer wasted time + writing a response you don't get. From your point of view it will look + like your message has been completely ignored, so this is frustrating + for all parties involved.

+ +

Note that the Privoxy mailing lists are moderated. Posts from + unsubscribed addresses have to be accepted manually by a moderator. + This may cause a delay of several days and if you use a subject that + doesn't clearly mention Privoxy or one of its features, your message + may be accidentally discarded as spam.

+ +

If you aren't subscribed, you should therefore spend a few seconds + to come up with a proper subject. Additionally you should make it clear + that you want to get CC'd. Otherwise some responses will be directed to + the mailing list only, and you won't see them.

+
+ +
+

11.2. Reporting + Problems

+ +

"Problems" for our purposes, come in two + forms:

+ +
    +
  • +

    Configuration issues, such as ads that slip through, or sites + that don't function properly due to one Privoxy "action" or + another being turned "on".

    +
  • + +
  • +

    "Bugs" in the programming code that + makes up Privoxy, such as that + might cause a crash.

    +
  • +
+ +
+

11.2.1. + Reporting Ads or Other Configuration Problems

+ +

Please send feedback on ads that slipped through, innocent images + that were blocked, sites that don't work properly, and other + configuration related problem of default.action file, to http://sourceforge.net/tracker/?group_id=11118&atid=460288, + the Actions File Tracker.

+ +

New, improved default.action files may + occasionally be made available based on your feedback. These will be + announced on the ijbswa-announce list and available from our the files section of our project page.

+
+ +
+

11.2.2. + Reporting Bugs

+ +

Please report all bugs through our bug tracker: http://sourceforge.net/tracker/?group_id=11118&atid=111118.

+ +

Before doing so, please make sure that the bug has not already been submitted and observe + the additional hints at the top of the submit form. If already submitted, please feel free + to add any info to the original report that might help to solve the + issue.

+ +

Please try to verify that it is a Privoxy bug, and not a browser or site bug or + documented behaviour that just happens to be different than what you + expected. If unsure, try toggling + off Privoxy, and see if the + problem persists.

+ +

If you are using your own custom configuration, please try the + stock configs to see if the problem is configuration related. If + you're having problems with a feature that is disabled by default, + please ask around on the mailing list if others can reproduce the + problem.

+ +

If you aren't using the latest Privoxy version, the bug may have + been found and fixed in the meantime. We would appreciate if you + could take the time to upgrade to the latest version (or even the latest CVS + snapshot) and verify that your bug still exists.

+ +

Please be sure to provide the following information:

+ +
    +
  • +

    The exact Privoxy version you + are using (if you got the source from CVS, please also provide + the source code revisions as shown in http://config.privoxy.org/show-version).

    +
  • + +
  • +

    The operating system and versions you run Privoxy on, (e.g. Windows XP SP2), if you are using a Unix + flavor, sending the output of "uname + -a" should do, in case of GNU/Linux, please also name the + distribution.

    +
  • + +
  • +

    The name, platform, and version of the browser you were using (e.g. Internet Explorer v5.5 for Mac).

    +
  • + +
  • +

    The URL where the problem occurred, or some way for us to + duplicate the problem (e.g. http://somesite.example.com/?somethingelse=123).

    +
  • + +
  • +

    Whether your version of Privoxy is one supplied by the Privoxy developers via SourceForge, or if + you got your copy somewhere else.

    +
  • + +
  • +

    Whether you are using Privoxy + in tandem with another proxy such as Tor. If so, please temporary disable the + other proxy to see if the symptoms change.

    +
  • + +
  • +

    Whether you are using a personal firewall product. If so, does + Privoxy work without it?

    +
  • + +
  • +

    Any other pertinent information to help identify the problem + such as config or log file excerpts (yes, you should have log + file entries for each action taken). To get a meaningful logfile, + please make sure that the logfile + directive is being used and the following debug + options are enabled:

    + +

    + debug     1 # Log the destination for each request Privoxy let through. See also debug 1024.
    + + debug     2 # show each connection status
    + + debug     4 # show I/O status
    + + debug     8 # show header parsing
    + + debug   128 # debug redirects
    + debug   256 # debug GIF de-animation
    + + debug   512 # Common Log Format
    + + debug  1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
    + + debug  4096 # Startup banner and warnings.
    + + debug  8192 # Non-fatal errors

    If you + are having trouble with a filter, please additionally enable + +

    + debug    64 # debug regular expression filters

    If + you are using Privoxy 3.0.17 or later and suspect that it + interprets the request or the response incorrectly, please enable + +

    + debug 32768 # log all data read from the network

    Note + that Privoxy log files may contain sensitive information so + please don't submit any logfiles you didn't read first. You can + mask sensitive information as long as it's clear that you removed + something. +
  • +
+ +

You don't have to tell us your actual name when filing a problem + report, but if you don't, please use a nickname so we can + differentiate between your messages and the ones entered by other + "anonymous" users that may respond to your request if they have the + same problem or already found a solution. Note that due to spam the + trackers may not always allow to post without being logged into + SourceForge. If that's the case, you are still free to create a login + that isn't directly linked to your name, though.

+ +

Please also check the status of your request a few days after + submitting it, as we may request additional information. If you use a + SF id, you should automatically get a mail when someone responds to + your request. Please don't bother to add an email address when using + the tracker. If you prefer to communicate through email, just use one + of the mailing lists directly.

+ +

If you are new to reporting problems, you might be interested in + How to Report Bugs Effectively.

+ +

The appendix of the Privoxy User Manual also has + helpful information on understanding actions, and action + debugging.

+
+
+ +
+

11.3. + Request New Features

+ +

You are welcome to submit ideas on new features or other proposals + for improvement through our feature request tracker at http://sourceforge.net/tracker/?atid=361118&group_id=11118.

+
+ +
+

11.4. + Mailing Lists

+ +

If you prefer to communicate through email, instead of using a web + interface, feel free to use one of the mailing lists. To discuss issues + that haven't been completely diagnosed yet, please use the Privoxy + users list. Technically interested users and people who wish to + contribute to the project are always welcome on the developers list. + You can find an overview of all Privoxy-related mailing lists, including list + archives, at: http://sourceforge.net/mail/?group_id=11118.

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/user-manual/copyright.html b/external/privoxy/doc/webserver/user-manual/copyright.html index b2e1e960..59c76919 100644 --- a/external/privoxy/doc/webserver/user-manual/copyright.html +++ b/external/privoxy/doc/webserver/user-manual/copyright.html @@ -1,424 +1,285 @@ - -Privoxy Copyright, License and History - -
Privoxy 3.0.12 User Manual
PrevNext

12. Privoxy Copyright, License and History

Copyright Š 2001-2009 by Privoxy Developers <ijbswa-developers@lists.sourceforge.net>

Some source code is based on code Copyright Š 1997 by Anonymous Coders - and Junkbusters, Inc. and licensed under the GNU General Public - License.

12.1. License

Privoxy is free software; you can - redistribute it and/or modify it under the terms of the - GNU General Public License, version 2, - as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.

You should have received a copy of the GNU GPL - along with this program; if not, write to the

 Free Software
- Foundation, Inc. 51 Franklin Street, Fifth Floor
BostonMA 02110-1301
USA 

12.2. History

A long time ago, there was the - Internet Junkbuster, - by Anonymous Coders and Junkbusters - Corporation. This saved many users a lot of pain in the early days of - web advertising and user tracking.

But the web, its protocols and standards, and with it, the techniques for - forcing ads on users, give up autonomy over their browsing, and - for tracking them, keeps evolving. Unfortunately, the Internet - Junkbuster did not. Version 2.0.2, published in 1998, was - (and is) the last official - release - available from Junkbusters Corporation. - Fortunately, it had been released under the GNU - GPL, - which allowed further development by others.

So Stefan Waldherr started maintaining an improved version of the - software, to which eventually a number of people contributed patches. - It could already replace banners with a transparent image, and had a first - version of pop-up killing, but it was still very closely based on the - original, with all its limitations, such as the lack of HTTP/1.1 support, - flexible per-site configuration, or content modification. The last release - from this effort was version 2.0.2-10, published in 2000.

Then, some - developers - picked up the thread, and started turning the software inside out, upside down, - and then reassembled it, adding many - new - features along the way.

The result of this is Privoxy, whose first - stable version, 3.0, was released August, 2002. -

12.3. Authors

Current Privoxy Team:

 Fabian Keil, lead developer
- David Schmidt, developer
-
- Hal Burgiss
- Mark Miller
- Gerry Murphy
- Lee Rian
- Roland Rosenfeld
- Jörg Strohmayer

Former Privoxy Team Members:

 Johny Agotnes
- Rodrigo Barbosa
- Moritz Barsnick
- Ian Cummings
- Brian Dessent
- Jon Foster
- Karsten Hopp
- Alexander Lazic
- Daniel Leite
- Gábor Lipták
- Adam Lock
- Guy Laroche
- Justin McMurtry
- Andreas Oesterhelt
- Haroon Rafique
- Georg Sauthoff
- Thomas Steudten
- Rodney Stromlund
- Sviatoslav Sviridov
- Sarantis Paskalis
- Stefan Waldherr

Thanks to the many people who have tested Privoxy, reported bugs, provided - patches, made suggestions or contributed in some way. These include (in - alphabetical order):

 Ken Arromdee
- Devin Bayer
- Gergely Bor
- Reiner Buehl
- Andrew J. Caines
- Clifford Caoile
- Frédéric Crozat
- Michael T. Davis
- Mattes Dolak
- Matthias Drochner
- Peter E.
- Florian Effenberger
- Markus Elfring
- Dean Gaudet
- Stephen Gildea
- Daniel Griscom
- Felix Gröbert
- Aaron Hamid
- Darel Henman
- Magnus Holmgren
- Eric M. Hopper
- Ralf Horstmann
- Stefan Huehner
- Peter Hyman
- Derek Jennings
- Petr Kadlec
- David Laight
- Bert van Leeuwen
- Don Libes
- Paul Lieverse
- Toby Lyward
- Wil Mahan
- Jindrich Makovicka
- David Mediavilla
- Raphael Moll
- Amuro Namie
- Adam Piggott
- Dan Price
- Roberto Ragusa
- Félix Rauch
- Maynard Riley
- Chung-chieh Shan
- Spinor S.
- Bart Schelstraete
- Oliver Stoeneberg
- Peter Thoenen
- Martin Thomas
- Bobby G. Vinyard
- Jochen Voss
- Glenn Washburn
- Song Weijia
- Jörg Weinmann
- Darren Wiebe
- Anduin Withers
- Oliver Yeoh
- Jamie Zawinski

Privoxy is based in part on code originally developed by - Junkbusters Corp. and Anonymous Coders.

Privoxy heavily relies on Philip Hazel's PCRE.

The code to filter compressed content makes use of zlib - which is written by Jean-loup Gailly and Mark Adler.

On systems that lack snprintf(), Privoxy is using a version - written by Mark Martinec. On systems that lack strptime(), - Privoxy is using the one from the GNU C Library written - by Ulrich Drepper.


PrevHomeNext
Contacting the Developers, Bug Reporting and Feature -Requests See Also
\ No newline at end of file + + + + + + + Privoxy Copyright, License and History + + + + + + + + + + + + + +
+

12. Privoxy + Copyright, License and History

+ +

Copyright © 2001-2011 by Privoxy Developers <ijbswa-developers@lists.sourceforge.net>

+ +

Some source code is based on code Copyright © 1997 by Anonymous + Coders and Junkbusters, Inc. and licensed under the GNU General Public License.

+ +
+

12.1. License

+ +

Privoxy is free software; you can + redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by + the Free Software Foundation.

+ +

This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.

+ +

You should have received a copy of the GNU + GPL along with this program; if not, write to the

+ +

 Free Software
+  Foundation, Inc. 51 Franklin + Street, Fifth Floor
+  BostonMA 02110-1301
+  USA 

+
+ +
+

12.2. History

+ +

A long time ago, there was the Internet Junkbuster, by Anonymous Coders and + Junkbusters + Corporation. This saved many users a lot of pain in the early days + of web advertising and user tracking.

+ +

But the web, its protocols and standards, and with it, the + techniques for forcing ads on users, give up autonomy over their + browsing, and for tracking them, keeps evolving. Unfortunately, the + Internet Junkbuster did not. Version + 2.0.2, published in 1998, was (and is) the last official release available from Junkbusters Corporation. Fortunately, it had been + released under the GNU GPL, which allowed further development by others.

+ +

So Stefan Waldherr started maintaining an improved version of the + software, to which eventually a number of people contributed patches. + It could already replace banners with a transparent image, and had a + first version of pop-up killing, but it was still very closely based on + the original, with all its limitations, such as the lack of HTTP/1.1 + support, flexible per-site configuration, or content modification. The + last release from this effort was version 2.0.2-10, published in + 2000.

+ +

Then, some developers picked up the thread, and started turning the + software inside out, upside down, and then reassembled it, adding many + new features along the way.

+ +

The result of this is Privoxy, + whose first stable version, 3.0, was released August, 2002.

+
+ +
+

12.3. Authors

+ +

Current Privoxy Team:

+ +

+  Fabian Keil, lead developer
+  David Schmidt, developer
+  Hal Burgiss
+  Lee Rian
+  Roland Rosenfeld

+ +

Former Privoxy Team Members:

+ +

 Johny Agotnes
+  Rodrigo Barbosa
+  Moritz Barsnick
+  Ian Cummings
+  Brian Dessent
+  Jon Foster
+  Karsten Hopp
+  Alexander Lazic
+  Daniel Leite
+  Gábor Lipták
+  Adam Lock
+  Guy Laroche
+  Justin McMurtry
+  Mark Miller
+  Gerry Murphy
+  Andreas Oesterhelt
+  Haroon Rafique
+  Georg Sauthoff
+  Thomas Steudten
+  Jörg Strohmayer
+  Rodney Stromlund
+  Sviatoslav Sviridov
+  Sarantis Paskalis
+  Stefan Waldherr

+ +

Thanks to the many people who have tested Privoxy, reported bugs, + provided patches, made suggestions or contributed in some way. These + include (in alphabetical order):

+ +

 Ken Arromdee
+  Devin Bayer
+  Havard Berland
+  Gergely Bor
+  Francois Botha
+  Reiner Buehl
+  Andrew J. Caines
+  Clifford Caoile
+  Wan-Teh Chang
+  Billy Crook
+  Frédéric Crozat
+  Michael T. Davis
+  Mattes Dolak
+  Matthias Drochner
+  Peter E.
+  Florian Effenberger
+  Markus Elfring
+  Dean Gaudet
+  Stephen Gildea
+  Daniel Griscom
+  Felix Gröbert
+  Jeff H.
+  Aaron Hamid
+  Darel Henman
+  Magnus Holmgren
+  Eric M. Hopper
+  Ralf Horstmann
+  Stefan Huehner
+  Peter Hyman
+  Derek Jennings
+  Petr Kadlec
+  David Laight
+  Bert van Leeuwen
+  Don Libes
+  Paul Lieverse
+  Han Liu
+  Toby Lyward
+  Wil Mahan
+  Jindrich Makovicka
+  Raphael Marichez
+  Francois Marier
+  David Mediavilla
+  Raphael Moll
+  Amuro Namie
+  Adam Piggott
+  Petr Písar
+  Dan Price
+  Roberto Ragusa
+  Félix Rauch
+  Maynard Riley
+  Chung-chieh Shan
+  Spinor S.
+  Bart Schelstraete
+  Dan Stahlke
+  Oliver Stoeneberg
+  Peter Thoenen
+  Martin Thomas
+  Bobby G. Vinyard
+  Jochen Voss
+  Glenn Washburn
+  Song Weijia
+  Jörg Weinmann
+  Darren Wiebe
+  Anduin Withers
+  Oliver Yeoh
+  Jamie Zawinski

+ +

Privoxy is based in part on code originally developed by Junkbusters + Corp. and Anonymous Coders.

+ +

Privoxy heavily relies on Philip Hazel's PCRE.

+ +

The code to filter compressed content makes use of zlib which is + written by Jean-loup Gailly and Mark Adler.

+ +

On systems that lack snprintf(), Privoxy is using a version written + by Mark Martinec. On systems that lack strptime(), Privoxy is using the + one from the GNU C Library written by Ulrich Drepper.

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/user-manual/filter-file.html b/external/privoxy/doc/webserver/user-manual/filter-file.html index 3a2ec3a3..2a3daff0 100644 --- a/external/privoxy/doc/webserver/user-manual/filter-file.html +++ b/external/privoxy/doc/webserver/user-manual/filter-file.html @@ -1,867 +1,407 @@ - -Filter Files - -
Privoxy 3.0.12 User Manual
PrevNext

9. Filter Files

On-the-fly text substitutions need - to be defined in a "filter file". Once defined, they - can then be invoked as an "action".

Privoxy supports three different filter actions: - filter to - rewrite the content that is send to the client, - client-header-filter - to rewrite headers that are send by the client, and - server-header-filter - to rewrite headers that are send by the server.

Privoxy also supports two tagger actions: - client-header-tagger - and - server-header-tagger. - Taggers and filters use the same syntax in the filter files, the difference - is that taggers don't modify the text they are filtering, but use a rewritten - version of the filtered text as tag. The tags can then be used to change the - applying actions through sections with tag-patterns.

Multiple filter files can be defined through the filterfile config directive. The filters - as supplied by the developers are located in - default.filter. It is recommended that any locally - defined or modified filters go in a separately defined file such as - user.filter. -

Common tasks for content filters are to eliminate common annoyances in - HTML and JavaScript, such as pop-up windows, - exit consoles, crippled windows without navigation tools, the - infamous <BLINK> tag etc, to suppress images with certain - width and height attributes (standard banner sizes or web-bugs), - or just to have fun.

Enabled content filters are applied to any content whose - "Content Type" header is recognised as a sign - of text-based content, with the exception of text/plain. - Use the force-text-mode action - to also filter other content.

Substitutions are made at the source level, so if you want to "roll - your own" filters, you should first be familiar with HTML syntax, - and, of course, regular expressions.

Just like the actions files, the - filter file is organized in sections, which are called filters - here. Each filter consists of a heading line, that starts with one of the - keywords FILTER:, - CLIENT-HEADER-FILTER: or SERVER-HEADER-FILTER: - followed by the filter's name, and a short (one line) - description of what it does. Below that line - come the jobs, i.e. lines that define the actual - text substitutions. By convention, the name of a filter - should describe what the filter eliminates. The - comment is used in the web-based - user interface.

Once a filter called name has been defined - in the filter file, it can be invoked by using an action of the form - +filter{name} - in any actions file.

Filter definitions start with a header line that contains the filter - type, the filter name and the filter description. - A content filter header line for a filter called "foo" could look - like this:

FILTER: foo Replace all "foo" with "bar"

Below that line, and up to the next header line, come the jobs that - define what text replacements the filter executes. They are specified - in a syntax that imitates Perl's - s/// operator. If you are familiar with Perl, you - will find this to be quite intuitive, and may want to look at the - PCRS documentation for the subtle differences to Perl behaviour. Most - notably, the non-standard option letter U is supported, - which turns the default to ungreedy matching.

If you are new to - "Regular - Expressions", you might want to take a look at - the Appendix on regular expressions, and - see the Perl - manual for - the - s/// operator's syntax and Perl-style regular - expressions in general. - The below examples might also help to get you started.

9.1. Filter File Tutorial

Now, let's complete our "foo" content filter. We have already defined - the heading, but the jobs are still missing. Since all it does is to replace - "foo" with "bar", there is only one (trivial) job - needed:

s/foo/bar/

But wait! Didn't the comment say that all occurrences - of "foo" should be replaced? Our current job will only take - care of the first "foo" on each page. For global substitution, - we'll need to add the g option:

s/foo/bar/g

Our complete filter now looks like this:

FILTER: foo Replace all "foo" with "bar"
-s/foo/bar/g

Let's look at some real filters for more interesting examples. Here you see - a filter that protects against some common annoyances that arise from JavaScript - abuse. Let's look at its jobs one after the other:

+ +
FILTER: js-annoyances Get rid of particularly annoying JavaScript abuse
+
+
+
+
+  
+
+  Filter Files
+  
+  
+  
+  
+  
+  
+  
+  
+
+
+
+  
+
+  
+

9. Filter + Files

+ +

On-the-fly text substitutions need to be defined in a "filter file". Once defined, they can then be invoked as + an "action".

+ +

Privoxy supports three different + filter actions: filter to rewrite the content that is + send to the client, client-header-filter to + rewrite headers that are send by the client, and server-header-filter to + rewrite headers that are send by the server.

+ +

Privoxy also supports two tagger + actions: client-header-tagger + and server-header-tagger. + Taggers and filters use the same syntax in the filter files, the + difference is that taggers don't modify the text they are filtering, but + use a rewritten version of the filtered text as tag. The tags can then be + used to change the applying actions through sections with tag-patterns.

+ +

Multiple filter files can be defined through the filterfile config + directive. The filters as supplied by the developers are located in + default.filter. It is recommended that any + locally defined or modified filters go in a separately defined file such + as user.filter.

+ +

Common tasks for content filters are to eliminate common annoyances in + HTML and JavaScript, such as pop-up windows, exit consoles, crippled + windows without navigation tools, the infamous <BLINK> tag etc, to + suppress images with certain width and height attributes (standard banner + sizes or web-bugs), or just to have fun.

+ +

Enabled content filters are applied to any content whose "Content Type" header is recognised as a sign of + text-based content, with the exception of text/plain. Use the force-text-mode action to also + filter other content.

+ +

Substitutions are made at the source level, so if you want to + "roll your own" filters, you should first be + familiar with HTML syntax, and, of course, regular expressions.

+ +

Just like the actions files, the + filter file is organized in sections, which are called filters here. Each filter consists of a + heading line, that starts with one of the keywords FILTER:, + CLIENT-HEADER-FILTER: or SERVER-HEADER-FILTER: followed by the filter's + name, and a short (one line) + description of what it does. + Below that line come the jobs, + i.e. lines that define the actual text substitutions. By convention, the + name of a filter should describe what the filter eliminates. The comment is used in the + web-based user + interface.

+ +

Once a filter called name has been + defined in the filter file, it can be invoked by using an action of the + form +filter{name} in any actions file.

+ +

Filter definitions start with a header line that contains the filter + type, the filter name and the filter description. A content filter header + line for a filter called "foo" could look like + this:

+ + + + + +
+
+FILTER: foo Replace all "foo" with "bar"
+
+
+ +

Below that line, and up to the next header line, come the jobs that + define what text replacements the filter executes. They are specified in + a syntax that imitates Perl's s/// operator. If you are + familiar with Perl, you will find this to be quite intuitive, and may + want to look at the PCRS documentation for the subtle differences to Perl + behaviour. Most notably, the non-standard option letter U is supported, which turns the default to ungreedy + matching.

+ +

If you are new to "Regular Expressions", you might + want to take a look at the Appendix on + regular expressions, and see the Perl manual for + the + s/// operator's syntax and Perl-style regular + expressions in general. The below examples might also help to get you + started.

+ +
+

9.1. Filter File + Tutorial

+ +

Now, let's complete our "foo" content + filter. We have already defined the heading, but the jobs are still + missing. Since all it does is to replace "foo" with "bar", there is + only one (trivial) job needed:

+ + + + + +
+
+s/foo/bar/
+
+
+ +

But wait! Didn't the comment say that all occurrences of "foo" should be replaced? Our current job will only take + care of the first "foo" on each page. For + global substitution, we'll need to add the g + option:

+ + + + + +
+
+s/foo/bar/g
+
+
+ +

Our complete filter now looks like this:

+ + + + + +
+
+FILTER: foo Replace all "foo" with "bar"
+s/foo/bar/g
+
+
+ +

Let's look at some real filters for more interesting examples. Here + you see a filter that protects against some common annoyances that + arise from JavaScript abuse. Let's look at its jobs one after the + other:

+ + + +
+
+FILTER: js-annoyances Get rid of particularly annoying JavaScript abuse
 
 # Get rid of JavaScript referrer tracking. Test page: http://www.randomoddness.com/untitled.htm
 #
-s|(<script.*)document\.referrer(.*</script>)|$1"Not Your Business!"$2|Usg

Following the header line and a comment, you see the job. Note that it uses - | as the delimiter instead of /, because - the pattern contains a forward slash, which would otherwise have to be escaped - by a backslash (\).

Now, let's examine the pattern: it starts with the text <script.* - enclosed in parentheses. Since the dot matches any character, and * - means: "Match an arbitrary number of the element left of myself", this - matches "<script", followed by any text, i.e. - it matches the whole page, from the start of the first <script> tag.

That's more than we want, but the pattern continues: document\.referrer - matches only the exact string "document.referrer". The dot needed to - be escaped, i.e. preceded by a backslash, to take away its - special meaning as a joker, and make it just a regular dot. So far, the meaning is: - Match from the start of the first <script> tag in a the page, up to, and including, - the text "document.referrer", if both are present - in the page (and appear in that order).

But there's still more pattern to go. The next element, again enclosed in parentheses, - is .*</script>. You already know what .* - means, so the whole pattern translates to: Match from the start of the first <script> - tag in a page to the end of the last <script> tag, provided that the text - "document.referrer" appears somewhere in between.

This is still not the whole story, since we have ignored the options and the parentheses: - The portions of the page matched by sub-patterns that are enclosed in parentheses, will be - remembered and be available through the variables $1, $2, ... in - the substitute. The U option switches to ungreedy matching, which means - that the first .* in the pattern will only "eat up" all - text in between "<script" and the first occurrence - of "document.referrer", and that the second .* will - only span the text up to the first "</script>" - tag. Furthermore, the s option says that the match may span - multiple lines in the page, and the g option again means that the - substitution is global.

So, to summarize, the pattern means: Match all scripts that contain the text - "document.referrer". Remember the parts of the script from - (and including) the start tag up to (and excluding) the string - "document.referrer" as $1, and the part following - that string, up to and including the closing tag, as $2.

Now the pattern is deciphered, but wasn't this about substituting things? So - lets look at the substitute: $1"Not Your Business!"$2 is - easy to read: The text remembered as $1, followed by - "Not Your Business!" (including - the quotation marks!), followed by the text remembered as $2. - This produces an exact copy of the original string, with the middle part - (the "document.referrer") replaced by "Not Your - Business!".

The whole job now reads: Replace "document.referrer" by - "Not Your Business!" wherever it appears inside a - <script> tag. Note that this job won't break JavaScript syntax, - since both the original and the replacement are syntactically valid - string objects. The script just won't have access to the referrer - information anymore.

We'll show you two other jobs from the JavaScript taming department, but - this time only point out the constructs of special interest:

+ +
# The status bar is for displaying link targets, not pointless blahblah
+s|(<script.*)document\.referrer(.*</script>)|$1"Not Your Business!"$2|Usg
+
+
+ +

Following the header line and a comment, you see the job. Note that + it uses | as the delimiter instead of + /, because the pattern contains a forward + slash, which would otherwise have to be escaped by a backslash + (\).

+ +

Now, let's examine the pattern: it starts with the text <script.* enclosed in parentheses. Since the dot + matches any character, and * means: + "Match an arbitrary number of the element left of + myself", this matches "<script", + followed by any text, i.e. it + matches the whole page, from the start of the first <script> + tag.

+ +

That's more than we want, but the pattern continues: document\.referrer matches only the exact string + "document.referrer". The dot needed to be + escaped, i.e. preceded by a + backslash, to take away its special meaning as a joker, and make it + just a regular dot. So far, the meaning is: Match from the start of the + first <script> tag in a the page, up to, and including, the text + "document.referrer", if both are present in the page (and appear + in that order).

+ +

But there's still more pattern to go. The next element, again + enclosed in parentheses, is .*</script>. + You already know what .* means, so the whole + pattern translates to: Match from the start of the first <script> + tag in a page to the end of the last <script> tag, provided that + the text "document.referrer" appears + somewhere in between.

+ +

This is still not the whole story, since we have ignored the options + and the parentheses: The portions of the page matched by sub-patterns + that are enclosed in parentheses, will be remembered and be available + through the variables $1, $2, ... in the + substitute. The U option switches to ungreedy + matching, which means that the first .* in the + pattern will only "eat up" all text in + between "<script" and the first occurrence of "document.referrer", and that the second .* will only span the text up to the first "</script>" tag. Furthermore, the s option says that the match may span multiple lines in + the page, and the g option again means that + the substitution is global.

+ +

So, to summarize, the pattern means: Match all scripts that contain + the text "document.referrer". Remember the + parts of the script from (and including) the start tag up to (and + excluding) the string "document.referrer" as + $1, and the part following that string, up to + and including the closing tag, as $2.

+ +

Now the pattern is deciphered, but wasn't this about substituting + things? So lets look at the substitute: $1"Not Your + Business!"$2 is easy to read: The text remembered as $1, followed by "Not Your + Business!" (including + the quotation marks!), followed by the text remembered as $2. This produces an exact copy of the original string, + with the middle part (the "document.referrer") replaced by "Not Your Business!".

+ +

The whole job now reads: Replace "document.referrer" by "Not Your + Business!" wherever it appears inside a <script> tag. Note + that this job won't break JavaScript syntax, since both the original + and the replacement are syntactically valid string objects. The script + just won't have access to the referrer information anymore.

+ +

We'll show you two other jobs from the JavaScript taming department, + but this time only point out the constructs of special interest:

+ + + +
+
+# The status bar is for displaying link targets, not pointless blahblah
 #
-s/window\.status\s*=\s*(['"]).*?\1/dUmMy=1/ig

\s stands for whitespace characters (space, tab, newline, - carriage return, form feed), so that \s* means: "zero - or more whitespace". The ? in .*? - makes this matching of arbitrary text ungreedy. (Note that the U - option is not set). The ['"] construct means: "a single - or a double quote". Finally, \1 is - a back-reference to the first parenthesis just like $1 above, - with the difference that in the pattern, a backslash indicates - a back-reference, whereas in the substitute, it's the dollar.

So what does this job do? It replaces assignments of single- or double-quoted - strings to the "window.status" object with a dummy assignment - (using a variable name that is hopefully odd enough not to conflict with - real variables in scripts). Thus, it catches many cases where e.g. pointless - descriptions are displayed in the status bar instead of the link target when - you move your mouse over links.

+ +
# Kill OnUnload popups. Yummy. Test: http://www.zdnet.com/zdsubs/yahoo/tree/yfs.html
+s/window\.status\s*=\s*(['"]).*?\1/dUmMy=1/ig
+
+
+ +

\s stands for whitespace characters (space, + tab, newline, carriage return, form feed), so that \s* means: "zero or more + whitespace". The ? in .*? makes this matching of arbitrary text ungreedy. + (Note that the U option is not set). The + ['"] construct means: "a + single or a double + quote". Finally, \1 is a back-reference + to the first parenthesis just like $1 above, + with the difference that in the pattern, a backslash indicates a + back-reference, whereas in the substitute, it's the dollar.

+ +

So what does this job do? It replaces assignments of single- or + double-quoted strings to the "window.status" + object with a dummy assignment (using a variable name that is hopefully + odd enough not to conflict with real variables in scripts). Thus, it + catches many cases where e.g. pointless descriptions are displayed in + the status bar instead of the link target when you move your mouse over + links.

+ + + +
+
+# Kill OnUnload popups. Yummy. Test: http://www.zdnet.com/zdsubs/yahoo/tree/yfs.html
 #
-s/(<body [^>]*)onunload(.*>)/$1never$2/iU

Including the - OnUnload - event binding in the HTML DOM was a CRIME. - When I close a browser window, I want it to close and die. Basta. - This job replaces the "onunload" attribute in - "<body>" tags with the dummy word never. - Note that the i option makes the pattern matching - case-insensitive. Also note that ungreedy matching alone doesn't always guarantee - a minimal match: In the first parenthesis, we had to use [^>]* - instead of .* to prevent the match from exceeding the - <body> tag if it doesn't contain "OnUnload", but the page's - content does.

The last example is from the fun department:

+ +
FILTER: fun Fun text replacements
+s/(<body [^>]*)onunload(.*>)/$1never$2/iU
+
+
+ +

Including the OnUnload event binding in the HTML DOM was a + CRIME. When I close a browser + window, I want it to close and die. Basta. This job replaces the + "onunload" attribute in "<body>" tags with the dummy word never. Note that the i option + makes the pattern matching case-insensitive. Also note that ungreedy + matching alone doesn't always guarantee a minimal match: In the first + parenthesis, we had to use [^>]* instead of + .* to prevent the match from exceeding the + <body> tag if it doesn't contain "OnUnload", but the page's content does.

+ +

The last example is from the fun department:

+ + + +
+
+FILTER: fun Fun text replacements
 
 # Spice the daily news:
 #
-s/microsoft(?!\.com)/MicroSuck/ig

Note the (?!\.com) part (a so-called negative lookahead) - in the job's pattern, which means: Don't match, if the string - ".com" appears directly following "microsoft" - in the page. This prevents links to microsoft.com from being trashed, while - still replacing the word everywhere else.

+ +
# Buzzword Bingo (example for extended regex syntax)
+s/microsoft(?!\.com)/MicroSuck/ig
+
+
+ +

Note the (?!\.com) part (a so-called + negative lookahead) in the job's pattern, which means: Don't match, if + the string ".com" appears directly following + "microsoft" in the page. This prevents links + to microsoft.com from being trashed, while still replacing the word + everywhere else.

+ + + +
+
+# Buzzword Bingo (example for extended regex syntax)
 #
 s* industry[ -]leading \
 |  cutting[ -]edge \
@@ -873,780 +413,432 @@ s* industry[ -]leading \
 |  unmatched \
 |  unparalleled \
 |  unrivalled \
-*<font color="red"><b>BINGO!</b></font> \
-*igx

The x option in this job turns on extended syntax, and allows for - e.g. the liberal use of (non-interpreted!) whitespace for nicer formatting.

You get the idea?

9.2. The Pre-defined Filters

The distribution default.filter file contains a selection of -pre-defined filters for your convenience:

js-annoyances

The purpose of this filter is to get rid of particularly annoying JavaScript abuse. - To that end, it -

  • replaces JavaScript references to the browser's referrer information - with the string "Not Your Business!". This compliments the hide-referrer action on the content level. -

  • removes the bindings to the DOM's - unload - event which we feel has no right to exist and is responsible for most "exit consoles", i.e. - nasty windows that pop up when you close another one. -

  • removes code that causes new windows to be opened with undesired properties, such as being - full-screen, non-resizeable, without location, status or menu bar etc. -

-

Use with caution. This is an aggressive filter, and can break sites that - rely heavily on JavaScript. -

js-events

This is a very radical measure. It removes virtually all JavaScript event bindings, which - means that scripts can not react to user actions such as mouse movements or clicks, window - resizing etc, anymore. Use with caution! -

We strongly discourage using this filter as a default since it breaks - many legitimate scripts. It is meant for use only on extra-nasty sites (should you really - need to go there). -

html-annoyances

This filter will undo many common instances of HTML based abuse. -

The BLINK and MARQUEE tags - are neutralized (yeah baby!), and browser windows will be created as - resizeable (as of course they should be!), and will have location, - scroll and menu bars -- even if specified otherwise. -

content-cookies

Most cookies are set in the HTTP dialog, where they can be intercepted - by the - crunch-incoming-cookies - and crunch-outgoing-cookies - actions. But web sites increasingly make use of HTML meta tags and JavaScript - to sneak cookies to the browser on the content level. -

This filter disables most HTML and JavaScript code that reads or sets - cookies. It cannot detect all clever uses of these types of code, so it - should not be relied on as an absolute fix. Use it wherever you would also - use the cookie crunch actions. -

refresh tags

Disable any refresh tags if the interval is greater than nine seconds (so - that redirections done via refresh tags are not destroyed). This is useful - for dial-on-demand setups, or for those who find this HTML feature - annoying. -

unsolicited-popups

This filter attempts to prevent only "unsolicited" pop-up - windows from opening, yet still allow pop-up windows that the user - has explicitly chosen to open. It was added in version 3.0.1, - as an improvement over earlier such filters. -

Technical note: The filter works by redefining the window.open JavaScript - function to a dummy function, PrivoxyWindowOpen(), - during the loading and rendering phase of each HTML page access, and - restoring the function afterward. -

This is recommended only for browsers that cannot perform this function - reliably themselves. And be aware that some sites require such windows - in order to function normally. Use with caution. -

all-popups

Attempt to prevent all pop-up windows from opening. - Note this should be used with even more discretion than the above, since - it is more likely to break some sites that require pop-ups for normal - usage. Use with caution. -

img-reorder

This is a helper filter that has no value if used alone. It makes the - banners-by-size and banners-by-link - (see below) filters more effective and should be enabled together with them. -

banners-by-size

This filter removes image tags purely based on what size they are. Fortunately - for us, many ads and banner images tend to conform to certain standardized - sizes, which makes this filter quite effective for ad stripping purposes. -

Occasionally this filter will cause false positives on images that are not ads, - but just happen to be of one of the standard banner sizes. -

Recommended only for those who require extreme ad blocking. The default - block rules should catch 95+% of all ads without this filter enabled. -

banners-by-link

This is an experimental filter that attempts to kill any banners if - their URLs seem to point to known or suspected click trackers. It is currently - not of much value and is not recommended for use by default. -

webbugs

Webbugs are small, invisible images (technically 1X1 GIF images), that - are used to track users across websites, and collect information on them. - As an HTML page is loaded by the browser, an embedded image tag causes the - browser to contact a third-party site, disclosing the tracking information - through the requested URL and/or cookies for that third-party domain, without - the user ever becoming aware of the interaction with the third-party site. - HTML-ized spam also uses a similar technique to verify email addresses. -

This filter removes the HTML code that loads such "webbugs". -

tiny-textforms

A rather special-purpose filter that can be used to enlarge textareas (those - multi-line text boxes in web forms) and turn off hard word wrap in them. - It was written for the sourceforge.net tracker system where such boxes are - a nuisance, but it can be handy on other sites, too. -

It is not recommended to use this filter as a default. -

jumping-windows

Many consider windows that move, or resize themselves to be abusive. This filter - neutralizes the related JavaScript code. Note that some sites might not display - or behave as intended when using this filter. Use with caution. -

frameset-borders

Some web designers seem to assume that everyone in the world will view their - web sites using the same browser brand and version, screen resolution etc, - because only that assumption could explain why they'd use static frame sizes, - yet prevent their frames from being resized by the user, should they be too - small to show their whole content. -

This filter removes the related HTML code. It should only be applied to sites - which need it. -

demoronizer

Many Microsoft products that generate HTML use non-standard extensions (read: - violations) of the ISO 8859-1 aka Latin-1 character set. This can cause those - HTML documents to display with errors on standard-compliant platforms. -

This filter translates the MS-only characters into Latin-1 equivalents. - It is not necessary when using MS products, and will cause corruption of - all documents that use 8-bit character sets other than Latin-1. It's mostly - worthwhile for Europeans on non-MS platforms, if weird garbage characters - sometimes appear on some pages, or user agents that don't correct for this on - the fly. - -

shockwave-flash

A filter for shockwave haters. As the name suggests, this filter strips code - out of web pages that is used to embed shockwave flash objects. -

quicktime-kioskmode

Change HTML code that embeds Quicktime objects so that kioskmode, which - prevents saving, is disabled. -

fun

Text replacements for subversive browsing fun. Make fun of your favorite - Monopolist or play buzzword bingo. -

crude-parental

A demonstration-only filter that shows how Privoxy - can be used to delete web content on a keyword basis. -

ie-exploits

An experimental collection of text replacements to disable malicious HTML and JavaScript - code that exploits known security holes in Internet Explorer. -

Presently, it only protects against Nimda and a cross-site scripting bug, and - would need active maintenance to provide more substantial protection. -

site-specifics

Some web sites have very specific problems, the cure for which doesn't apply - anywhere else, or could even cause damage on other sites. -

This is a collection of such site-specific cures which should only be applied - to the sites they were intended for, which is what the supplied - default.action file does. Users shouldn't need to change - anything regarding this filter. -

google

A CSS based block for Google text ads. Also removes a width limitation - and the toolbar advertisement. -

yahoo

Another CSS based block, this time for Yahoo text ads. And removes - a width limitation as well. -

msn

Another CSS based block, this time for MSN text ads. And removes - tracking URLs, as well as a width limitation. -

blogspot

Cleans up some Blogspot blogs. Read the fine print before using this one! -

This filter also intentionally removes some navigation stuff and sets the - page width to 100%. As a result, some rounded "corners" would - appear to early or not at all and as fixing this would require a browser - that understands background-size (CSS3), they are removed instead. -

xml-to-html

Server-header filter to change the Content-Type from xml to html. -

html-to-xml

Server-header filter to change the Content-Type from html to xml. -

no-ping

Removes the non-standard ping attribute from - anchor and area HTML tags. -

hide-tor-exit-notation

Client-header filter to remove the Tor exit node notation - found in Host and Referer headers. -

If Privoxy and Tor are chained and Privoxy - is configured to use socks4a, one can use "http://www.example.org.foobar.exit/" - to access the host "www.example.org" through the - Tor exit node "foobar". -

As the HTTP client isn't aware of this notation, it treats the - whole string "www.example.org.foobar.exit" as host and uses it - for the "Host" and "Referer" headers. From the - server's point of view the resulting headers are invalid and can cause problems. -

An invalid "Referer" header can trigger "hot-linking" - protections, an invalid "Host" header will make it impossible for - the server to find the right vhost (several domains hosted on the same IP address). -

This client-header filter removes the "foo.exit" part in those headers - to prevent the mentioned problems. Note that it only modifies - the HTTP headers, it doesn't make it impossible for the server - to detect your Tor exit node based on the IP address - the request is coming from. -


PrevHomeNext
Actions Files Privoxy's Template Files
\ No newline at end of file +*<font color="red"><b>BINGO!</b></font> \ +*igx +
+
+ +

The x option in this job turns on extended + syntax, and allows for e.g. the liberal use of (non-interpreted!) + whitespace for nicer formatting.

+ +

You get the idea?

+
+ +
+

9.2. The Pre-defined Filters

+ +

The distribution default.filter file + contains a selection of pre-defined filters for your convenience:

+ +
+
+
js-annoyances
+ +
+

The purpose of this filter is to get rid of particularly + annoying JavaScript abuse. To that end, it

+ +
    +
  • +

    replaces JavaScript references to the browser's referrer + information with the string "Not Your Business!". This + compliments the hide-referrer + action on the content level.

    +
  • + +
  • +

    removes the bindings to the DOM's unload event which we feel has no right to + exist and is responsible for most "exit + consoles", i.e. nasty windows that pop up when you + close another one.

    +
  • + +
  • +

    removes code that causes new windows to be opened with + undesired properties, such as being full-screen, + non-resizeable, without location, status or menu bar etc.

    +
  • +
+ +

Use with caution. This is an aggressive filter, and can break + sites that rely heavily on JavaScript.

+
+ +
js-events
+ +
+

This is a very radical measure. It removes virtually all + JavaScript event bindings, which means that scripts can not react + to user actions such as mouse movements or clicks, window + resizing etc, anymore. Use with caution!

+ +

We strongly + discourage using this filter as a default since it breaks + many legitimate scripts. It is meant for use only on extra-nasty + sites (should you really need to go there).

+
+ +
html-annoyances
+ +
+

This filter will undo many common instances of HTML based + abuse.

+ +

The BLINK and MARQUEE tags are neutralized (yeah baby!), and + browser windows will be created as resizeable (as of course they + should be!), and will have location, scroll and menu bars -- even + if specified otherwise.

+
+ +
content-cookies
+ +
+

Most cookies are set in the HTTP dialog, where they can be + intercepted by the crunch-incoming-cookies + and crunch-outgoing-cookies + actions. But web sites increasingly make use of HTML meta tags + and JavaScript to sneak cookies to the browser on the content + level.

+ +

This filter disables most HTML and JavaScript code that reads + or sets cookies. It cannot detect all clever uses of these types + of code, so it should not be relied on as an absolute fix. Use it + wherever you would also use the cookie crunch actions.

+
+ +
refresh tags
+ +
+

Disable any refresh tags if the interval is greater than nine + seconds (so that redirections done via refresh tags are not + destroyed). This is useful for dial-on-demand setups, or for + those who find this HTML feature annoying.

+
+ +
unsolicited-popups
+ +
+

This filter attempts to prevent only "unsolicited" pop-up windows from opening, yet + still allow pop-up windows that the user has explicitly chosen to + open. It was added in version 3.0.1, as an improvement over + earlier such filters.

+ +

Technical note: The filter works by redefining the window.open + JavaScript function to a dummy function, PrivoxyWindowOpen(), during the loading and + rendering phase of each HTML page access, and restoring the + function afterward.

+ +

This is recommended only for browsers that cannot perform this + function reliably themselves. And be aware that some sites + require such windows in order to function normally. Use with + caution.

+
+ +
all-popups
+ +
+

Attempt to prevent all pop-up windows from opening. + Note this should be used with even more discretion than the + above, since it is more likely to break some sites that require + pop-ups for normal usage. Use with caution.

+
+ +
img-reorder
+ +
+

This is a helper filter that has no value if used alone. It + makes the banners-by-size and banners-by-link (see below) filters more effective + and should be enabled together with them.

+
+ +
banners-by-size
+ +
+

This filter removes image tags purely based on what size they + are. Fortunately for us, many ads and banner images tend to + conform to certain standardized sizes, which makes this filter + quite effective for ad stripping purposes.

+ +

Occasionally this filter will cause false positives on images + that are not ads, but just happen to be of one of the standard + banner sizes.

+ +

Recommended only for those who require extreme ad blocking. + The default block rules should catch 95+% of all ads without this filter enabled.

+
+ +
banners-by-link
+ +
+

This is an experimental filter that attempts to kill any + banners if their URLs seem to point to known or suspected click + trackers. It is currently not of much value and is not + recommended for use by default.

+
+ +
webbugs
+ +
+

Webbugs are small, invisible images (technically 1X1 GIF + images), that are used to track users across websites, and + collect information on them. As an HTML page is loaded by the + browser, an embedded image tag causes the browser to contact a + third-party site, disclosing the tracking information through the + requested URL and/or cookies for that third-party domain, without + the user ever becoming aware of the interaction with the + third-party site. HTML-ized spam also uses a similar technique to + verify email addresses.

+ +

This filter removes the HTML code that loads such "webbugs".

+
+ +
tiny-textforms
+ +
+

A rather special-purpose filter that can be used to enlarge + textareas (those multi-line text boxes in web forms) and turn off + hard word wrap in them. It was written for the sourceforge.net + tracker system where such boxes are a nuisance, but it can be + handy on other sites, too.

+ +

It is not recommended to use this filter as a default.

+
+ +
jumping-windows
+ +
+

Many consider windows that move, or resize themselves to be + abusive. This filter neutralizes the related JavaScript code. + Note that some sites might not display or behave as intended when + using this filter. Use with caution.

+
+ +
frameset-borders
+ +
+

Some web designers seem to assume that everyone in the world + will view their web sites using the same browser brand and + version, screen resolution etc, because only that assumption + could explain why they'd use static frame sizes, yet prevent + their frames from being resized by the user, should they be too + small to show their whole content.

+ +

This filter removes the related HTML code. It should only be + applied to sites which need it.

+
+ +
demoronizer
+ +
+

Many Microsoft products that generate HTML use non-standard + extensions (read: violations) of the ISO 8859-1 aka Latin-1 + character set. This can cause those HTML documents to display + with errors on standard-compliant platforms.

+ +

This filter translates the MS-only characters into Latin-1 + equivalents. It is not necessary when using MS products, and will + cause corruption of all documents that use 8-bit character sets + other than Latin-1. It's mostly worthwhile for Europeans on + non-MS platforms, if weird garbage characters sometimes appear on + some pages, or user agents that don't correct for this on the + fly.

+
+ +
shockwave-flash
+ +
+

A filter for shockwave haters. As the name suggests, this + filter strips code out of web pages that is used to embed + shockwave flash objects.

+
+ +
quicktime-kioskmode
+ +
+

Change HTML code that embeds Quicktime objects so that + kioskmode, which prevents saving, is disabled.

+
+ +
fun
+ +
+

Text replacements for subversive browsing fun. Make fun of + your favorite Monopolist or play buzzword bingo.

+
+ +
crude-parental
+ +
+

A demonstration-only filter that shows how Privoxy can be used to delete web content on + a keyword basis.

+
+ +
ie-exploits
+ +
+

An experimental collection of text replacements to disable + malicious HTML and JavaScript code that exploits known security + holes in Internet Explorer.

+ +

Presently, it only protects against Nimda and a cross-site + scripting bug, and would need active maintenance to provide more + substantial protection.

+
+ +
site-specifics
+ +
+

Some web sites have very specific problems, the cure for which + doesn't apply anywhere else, or could even cause damage on other + sites.

+ +

This is a collection of such site-specific cures which should + only be applied to the sites they were intended for, which is + what the supplied default.action file + does. Users shouldn't need to change anything regarding this + filter.

+
+ +
google
+ +
+

A CSS based block for Google text ads. Also removes a width + limitation and the toolbar advertisement.

+
+ +
yahoo
+ +
+

Another CSS based block, this time for Yahoo text ads. And + removes a width limitation as well.

+
+ +
msn
+ +
+

Another CSS based block, this time for MSN text ads. And + removes tracking URLs, as well as a width limitation.

+
+ +
blogspot
+ +
+

Cleans up some Blogspot blogs. Read the fine print before + using this one!

+ +

This filter also intentionally removes some navigation stuff + and sets the page width to 100%. As a result, some rounded + "corners" would appear to early or not + at all and as fixing this would require a browser that + understands background-size (CSS3), they are removed instead.

+
+ +
xml-to-html
+ +
+

Server-header filter to change the Content-Type from xml to + html.

+
+ +
html-to-xml
+ +
+

Server-header filter to change the Content-Type from html to + xml.

+
+ +
no-ping
+ +
+

Removes the non-standard ping + attribute from anchor and area HTML tags.

+
+ +
hide-tor-exit-notation
+ +
+

Client-header filter to remove the Tor + exit node notation found in Host and Referer headers.

+ +

If Privoxy and Tor are chained and Privoxy is configured to use socks4a, one + can use "http://www.example.org.foobar.exit/" to access + the host "www.example.org" through the + Tor exit node "foobar".

+ +

As the HTTP client isn't aware of this notation, it treats the + whole string "www.example.org.foobar.exit" as host and uses it + for the "Host" and "Referer" headers. From the server's point of view + the resulting headers are invalid and can cause problems.

+ +

An invalid "Referer" header can + trigger "hot-linking" protections, an + invalid "Host" header will make it + impossible for the server to find the right vhost (several + domains hosted on the same IP address).

+ +

This client-header filter removes the "foo.exit" part in those headers to prevent the + mentioned problems. Note that it only modifies the HTTP headers, + it doesn't make it impossible for the server to detect your + Tor exit node based on the IP address the + request is coming from.

+
+
+
+
+
+ + + + diff --git a/external/privoxy/doc/webserver/user-manual/index.html b/external/privoxy/doc/webserver/user-manual/index.html index 366386b6..1fea85ee 100644 --- a/external/privoxy/doc/webserver/user-manual/index.html +++ b/external/privoxy/doc/webserver/user-manual/index.html @@ -1,963 +1,621 @@ - -Privoxy 3.0.12 User Manual - -

Privoxy 3.0.12 User Manual

Copyright Š 2001-2009 by - Privoxy Developers -

$Id: index.html,v 1.60 2009/03/21 12:58:53 fabiankeil Exp $

The Privoxy User Manual gives users information on how to - install, configure and use Privoxy. -

Privoxy is a non-caching web proxy with advanced filtering capabilities - for enhancing privacy, modifying web page data and HTTP headers, controlling - access, and removing ads and other obnoxious Internet junk. Privoxy has a - flexible configuration and can be customized to suit individual needs and tastes. - It has application for both stand-alone systems and multi-user networks.

Privoxy is Free Software and licensed under the GPL2.

Privoxy is an associated project of Software in the Public Interest (SPI). - Donations are welcome.

You can find the latest version of the Privoxy User Manual at http://www.privoxy.org/user-manual/. - Please see the Contact section on how to - contact the developers. -


Table of Contents
1. Introduction
1.1. Features
2. Installation
2.1. Binary Packages
2.1.1. Red Hat and Fedora RPMs
2.1.2. Debian and Ubuntu
2.1.3. Windows
2.1.4. Solaris
2.1.5. OS/2
2.1.6. Mac OS X
2.1.7. AmigaOS
2.1.8. FreeBSD
2.1.9. Gentoo
2.2. Building from Source
2.3. Keeping your Installation Up-to-Date
3. What's New in this Release
3.1. Note to Upgraders
4. Quickstart to Using Privoxy
4.1. Quickstart to Ad Blocking
5. Starting Privoxy
5.1. Red Hat and Fedora
5.2. Debian
5.3. Windows
5.4. Solaris, NetBSD, FreeBSD, HP-UX and others
5.5. OS/2
5.6. Mac OS X
5.7. AmigaOS
5.8. Gentoo
5.9. Command Line Options
6. Privoxy Configuration
6.1. Controlling Privoxy with Your Web Browser
6.2. Configuration Files Overview
7. The Main Configuration File
7.1. Local Set-up Documentation
7.1.1. user-manual
7.1.2. trust-info-url
7.1.3. admin-address
7.1.4. proxy-info-url
7.2. Configuration and Log File Locations
7.2.1. confdir
7.2.2. templdir
7.2.3. logdir
7.2.4. actionsfile
7.2.5. filterfile
7.2.6. logfile
7.2.7. trustfile
7.3. Debugging
7.3.1. debug
7.3.2. single-threaded
7.3.3. hostname
7.4. Access Control and Security
7.4.1. listen-address
7.4.2. toggle
7.4.3. enable-remote-toggle
7.4.4. enable-remote-http-toggle
7.4.5. enable-edit-actions
7.4.6. enforce-blocks
7.4.7. ACLs: permit-access and deny-access
7.4.8. buffer-limit
7.5. Forwarding
7.5.1. forward
7.5.2. forward-socks4, forward-socks4a and forward-socks5
7.5.3. Advanced Forwarding Examples
7.5.4. forwarded-connect-retries
7.5.5. accept-intercepted-requests
7.5.6. allow-cgi-request-crunching
7.5.7. split-large-forms
7.5.8. keep-alive-timeout
7.5.9. socket-timeout
7.6. Windows GUI Options
8. Actions Files
8.1. Finding the Right Mix
8.2. How to Edit
8.3. How Actions are Applied to Requests
8.4. Patterns
8.4.1. The Domain Pattern
8.4.2. The Path Pattern
8.4.3. The Tag Pattern
8.5. Actions
8.5.1. add-header
8.5.2. block
8.5.3. change-x-forwarded-for
8.5.4. client-header-filter
8.5.5. client-header-tagger
8.5.6. content-type-overwrite
8.5.7. crunch-client-header
8.5.8. crunch-if-none-match
8.5.9. crunch-incoming-cookies
8.5.10. crunch-server-header
8.5.11. crunch-outgoing-cookies
8.5.12. deanimate-gifs
8.5.13. downgrade-http-version
8.5.14. fast-redirects
8.5.15. filter
8.5.16. force-text-mode
8.5.17. forward-override
8.5.18. handle-as-empty-document
8.5.19. handle-as-image
8.5.20. hide-accept-language
8.5.21. hide-content-disposition
8.5.22. hide-if-modified-since
8.5.23. hide-from-header
8.5.24. hide-referrer
8.5.25. hide-user-agent
8.5.26. limit-connect
8.5.27. prevent-compression
8.5.28. overwrite-last-modified
8.5.29. redirect
8.5.30. server-header-filter
8.5.31. server-header-tagger
8.5.32. session-cookies-only
8.5.33. set-image-blocker
8.5.34. Summary
8.6. Aliases
8.7. Actions Files Tutorial
8.7.1. match-all.action
8.7.2. default.action
8.7.3. user.action
9. Filter Files
9.1. Filter File Tutorial
9.2. The Pre-defined Filters
10. Privoxy's Template Files
11. Contacting the Developers, Bug Reporting and Feature -Requests
11.1. Get Support
11.2. Reporting Problems
11.2.1. Reporting Ads or Other Configuration Problems
11.2.2. Reporting Bugs
11.3. Request New Features
11.4. Other
12. Privoxy Copyright, License and History
12.1. License
12.2. History
12.3. Authors
13. See Also
14. Appendix
14.1. Regular Expressions
14.2. Privoxy's Internal Pages
14.2.1. Bookmarklets
14.3. Chain of Events
14.4. Troubleshooting: Anatomy of an Action

  Next
  Introduction
\ No newline at end of file + + + + + + + Privoxy 3.0.19 User Manual + + + + + + + + + +
+
+

Privoxy 3.0.19 User + Manual

+ +

Copyright © + 2001-2011 by Privoxy + Developers

+ +

$Id: user-manual.sgml,v 2.143 2011/11/20 17:16:36 + fabiankeil Exp $

+ +
+ + +

The Privoxy User Manual gives users + information on how to install, configure and use Privoxy.

+ +

Privoxy is a non-caching web proxy with advanced filtering + capabilities for enhancing privacy, modifying web page data and HTTP + headers, controlling access, and removing ads and other obnoxious + Internet junk. Privoxy has a flexible configuration and can be + customized to suit individual needs and tastes. It has application + for both stand-alone systems and multi-user networks.

+ +

Privoxy is Free Software and licensed under the GNU GPLv2.

+ +

Privoxy is an associated project of Software in the Public + Interest (SPI).

+ +

Helping hands and donations are welcome:

+ + + +

You can find the latest version of the Privoxy User Manual at http://www.privoxy.org/user-manual/. Please see the + Contact section on how to contact the + developers.

+
+
+
+ +
+
+
Table of Contents
+ +
1. Introduction
+ +
+
+
1.1. Features
+
+
+ +
2. Installation
+ +
+
+
2.1. Binary + Packages
+ +
+
+
2.1.1. Red Hat and Fedora + RPMs
+ +
2.1.2. Debian and + Ubuntu
+ +
2.1.3. Windows
+ +
2.1.4. Solaris
+ +
2.1.5. OS/2
+ +
2.1.6. Mac + OS X
+ +
2.1.7. AmigaOS
+ +
2.1.8. FreeBSD
+ +
2.1.9. Gentoo
+
+
+ +
2.2. Building + from Source
+ +
2.3. Keeping your + Installation Up-to-Date
+
+
+ +
3. What's New in this Release
+ +
+
+
3.1. Note to + Upgraders
+
+
+ +
4. Quickstart to Using Privoxy
+ +
+
+
4.1. Quickstart to Ad + Blocking
+
+
+ +
5. Starting Privoxy
+ +
+
+
5.1. Red Hat and + Fedora
+ +
5.2. Debian
+ +
5.3. Windows
+ +
5.4. Solaris, NetBSD, + FreeBSD, HP-UX and others
+ +
5.5. OS/2
+ +
5.6. Mac OS X
+ +
5.7. AmigaOS
+ +
5.8. Gentoo
+ +
5.9. Command Line + Options
+
+
+ +
6. Privoxy Configuration
+ +
+
+
6.1. Controlling Privoxy + with Your Web Browser
+ +
6.2. Configuration + Files Overview
+
+
+ +
7. The Main Configuration File
+ +
+
+
7.1. Local Set-up + Documentation
+ +
+
+
7.1.1. user-manual
+ +
7.1.2. trust-info-url
+ +
7.1.3. admin-address
+ +
7.1.4. proxy-info-url
+
+
+ +
7.2. Configuration and Log + File Locations
+ +
+
+
7.2.1. confdir
+ +
7.2.2. templdir
+ +
7.2.3. logdir
+ +
7.2.4. actionsfile
+ +
7.2.5. filterfile
+ +
7.2.6. logfile
+ +
7.2.7. trustfile
+
+
+ +
7.3. Debugging
+ +
+
+
7.3.1. debug
+ +
7.3.2. single-threaded
+ +
7.3.3. hostname
+
+
+ +
7.4. Access Control and + Security
+ +
+
+
7.4.1. listen-address
+ +
7.4.2. toggle
+ +
7.4.3. enable-remote-toggle
+ +
7.4.4. enable-remote-http-toggle
+ +
7.4.5. enable-edit-actions
+ +
7.4.6. enforce-blocks
+ +
7.4.7. ACLs: permit-access and + deny-access
+ +
7.4.8. buffer-limit
+
+
+ +
7.5. Forwarding
+ +
+
+
7.5.1. forward
+ +
7.5.2. forward-socks4, + forward-socks4a and forward-socks5
+ +
7.5.3. Advanced + Forwarding Examples
+ +
7.5.4. forwarded-connect-retries
+
+
+ +
7.6. Miscellaneous
+ +
+
+
7.6.1. accept-intercepted-requests
+ +
7.6.2. allow-cgi-request-crunching
+ +
7.6.3. split-large-forms
+ +
7.6.4. keep-alive-timeout
+ +
7.6.5. default-server-timeout
+ +
7.6.6. connection-sharing
+ +
7.6.7. socket-timeout
+ +
7.6.8. max-client-connections
+ +
7.6.9. handle-as-empty-doc-returns-ok
+ +
7.6.10. enable-compression
+ +
7.6.11. compression-level
+
+
+ +
7.7. Windows GUI + Options
+
+
+ +
8. Actions Files
+ +
+
+
8.1. Finding the Right + Mix
+ +
8.2. How to Edit
+ +
8.3. How Actions + are Applied to Requests
+ +
8.4. Patterns
+ +
+
+
8.4.1. The Domain + Pattern
+ +
8.4.2. The Path + Pattern
+ +
8.4.3. The Tag + Pattern
+
+
+ +
8.5. Actions
+ +
+
+
8.5.1. add-header
+ +
8.5.2. block
+ +
8.5.3. change-x-forwarded-for
+ +
8.5.4. client-header-filter
+ +
8.5.5. client-header-tagger
+ +
8.5.6. content-type-overwrite
+ +
8.5.7. crunch-client-header
+ +
8.5.8. crunch-if-none-match
+ +
8.5.9. crunch-incoming-cookies
+ +
8.5.10. crunch-server-header
+ +
8.5.11. crunch-outgoing-cookies
+ +
8.5.12. deanimate-gifs
+ +
8.5.13. downgrade-http-version
+ +
8.5.14. fast-redirects
+ +
8.5.15. filter
+ +
8.5.16. force-text-mode
+ +
8.5.17. forward-override
+ +
8.5.18. handle-as-empty-document
+ +
8.5.19. handle-as-image
+ +
8.5.20. hide-accept-language
+ +
8.5.21. hide-content-disposition
+ +
8.5.22. hide-if-modified-since
+ +
8.5.23. hide-from-header
+ +
8.5.24. hide-referrer
+ +
8.5.25. hide-user-agent
+ +
8.5.26. limit-connect
+ +
8.5.27. prevent-compression
+ +
8.5.28. overwrite-last-modified
+ +
8.5.29. redirect
+ +
8.5.30. server-header-filter
+ +
8.5.31. server-header-tagger
+ +
8.5.32. session-cookies-only
+ +
8.5.33. set-image-blocker
+ +
8.5.34. Summary
+
+
+ +
8.6. Aliases
+ +
8.7. Actions Files + Tutorial
+ +
+
+
8.7.1. match-all.action
+ +
8.7.2. default.action
+ +
8.7.3. user.action
+
+
+
+
+ +
9. Filter Files
+ +
+
+
9.1. Filter File + Tutorial
+ +
9.2. The + Pre-defined Filters
+
+
+ +
10. Privoxy's Template Files
+ +
11. Contacting the Developers, Bug + Reporting and Feature Requests
+ +
+
+
11.1. Get + Support
+ +
11.2. Reporting + Problems
+ +
+
+
11.2.1. Reporting Ads + or Other Configuration Problems
+ +
11.2.2. Reporting + Bugs
+
+
+ +
11.3. Request New + Features
+ +
11.4. Mailing + Lists
+
+
+ +
12. Privoxy Copyright, License and + History
+ +
+
+
12.1. License
+ +
12.2. History
+ +
12.3. Authors
+
+
+ +
13. See Also
+ +
14. Appendix
+ +
+
+
14.1. Regular + Expressions
+ +
14.2. Privoxy's Internal + Pages
+ +
+
+
14.2.1. Bookmarklets
+
+
+ +
14.3. Chain of Events
+ +
14.4. Troubleshooting: + Anatomy of an Action
+
+
+
+
+
+ + + + diff --git a/external/privoxy/doc/webserver/user-manual/installation.html b/external/privoxy/doc/webserver/user-manual/installation.html index f5fefc22..c8a184b9 100644 --- a/external/privoxy/doc/webserver/user-manual/installation.html +++ b/external/privoxy/doc/webserver/user-manual/installation.html @@ -1,1082 +1,563 @@ - -Installation - -
Privoxy 3.0.12 User Manual
PrevNext

2. Installation

Privoxy is available both in convenient pre-compiled - packages for a wide range of operating systems, and as raw source code. - For most users, we recommend using the packages, which can be downloaded from our - Privoxy Project - Page.

Note: - On some platforms, the installer may remove previously installed versions, if - found. (See below for your platform). In any case be sure to backup - your old configuration if it is valuable to you. See the note to upgraders section below.

2.1. Binary Packages

How to install the binary packages depends on your operating system:

2.1.1. Red Hat and Fedora RPMs

RPMs can be installed with rpm -Uvh privoxy-3.0.12-1.rpm, - and will use /etc/privoxy for the location - of configuration files.

Note that on Red Hat, Privoxy will - not be automatically started on system boot. You will - need to enable that using chkconfig, - ntsysv, or similar methods.

If you have problems with failed dependencies, try rebuilding the SRC RPM: - rpm --rebuild privoxy-3.0.12-1.src.rpm. This - will use your locally installed libraries and RPM version.

Also note that if you have a Junkbuster RPM installed - on your system, you need to remove it first, because the packages conflict. - Otherwise, RPM will try to remove Junkbuster - automatically if found, before installing Privoxy.

2.1.2. Debian and Ubuntu

DEBs can be installed with apt-get install privoxy, - and will use /etc/privoxy for the location of - configuration files.

2.1.3. Windows

Just double-click the installer, which will guide you through - the installation process. You will find the configuration files - in the same directory as you installed Privoxy in.

Version 3.0.5 beta introduced full Windows service - functionality. On Windows only, the Privoxy - program has two new command line arguments to install and uninstall - Privoxy as a service.

Arguments:

--install[:service_name] -

--uninstall[:service_name] -

After invoking Privoxy with - --install, you will need to bring up the - Windows service console to assign the user you - want Privoxy to run under, and whether or not you - want it to run whenever the system starts. You can start the - Windows services console with the following - command: services.msc. If you do not take the manual step - of modifying Privoxy's service settings, it will - not start. Note too that you will need to give Privoxy a user account that - actually exists, or it will not be permitted to - write to its log and configuration files.

2.1.4. Solaris

Create a new directory, cd to it, then unzip and - untar the archive. For the most part, you'll have to figure out where - things go.

2.1.5. OS/2

First, make sure that no previous installations of - Junkbuster and / or - Privoxy are left on your - system. Check that no Junkbuster - or Privoxy objects are in - your startup folder.

Then, just double-click the WarpIN self-installing archive, which will - guide you through the installation process. A shadow of the - Privoxy executable will be placed in your - startup folder so it will start automatically whenever OS/2 starts.

The directory you choose to install Privoxy - into will contain all of the configuration files.

2.1.6. Mac OS X

Unzip the downloaded file (you can either double-click on the zip file - icon from the Finder, or from the desktop if you downloaded it there). - Then, double-click on the package installer icon and follow the - installation process.

The privoxy service will automatically start after a successful - installation (in addition to every time your computer starts up). To - prevent the privoxy service from automatically starting when your - computer starts up, remove or rename the folder named - /Library/StartupItems/Privoxy.

To manually start or stop the privoxy service, use the Privoxy Utility - for Mac OS X. This application controls the privoxy service (e.g. - starting and stopping the service as well as uninstalling the software).

2.1.7. AmigaOS

Copy and then unpack the lha archive to a suitable location. - All necessary files will be installed into Privoxy - directory, including all configuration and log files. To uninstall, just - remove this directory.

2.1.8. FreeBSD

Privoxy is part of FreeBSD's Ports Collection, you can build and install - it with cd /usr/ports/www/privoxy; make install clean.

If you don't use the ports, you can fetch and install - the package with pkg_add -r privoxy.

The port skeleton and the package can also be downloaded from the - File Release - Page, but there's no reason to use them unless you're interested in the - beta releases which are only available there.

2.1.9. Gentoo

Gentoo source packages (Ebuilds) for Privoxy are - contained in the Gentoo Portage Tree (they are not on the download page, - but there is a Gentoo section, where you can see when a new - Privoxy Version is added to the Portage Tree).

Before installing Privoxy under Gentoo just do - first emerge --sync to get the latest changes from the - Portage tree. With emerge privoxy you install the latest - version.

Configuration files are in /etc/privoxy, the - documentation is in /usr/share/doc/privoxy-3.0.12 - and the Log directory is in /var/log/privoxy.

2.2. Building from Source

The most convenient way to obtain the Privoxy sources - is to download the source tarball from our - project download - page.

If you like to live on the bleeding edge and are not afraid of using - possibly unstable development versions, you can check out the up-to-the-minute - version directly from the - CVS repository.

To build Privoxy from source, - autoconf, - GNU make - (gmake), and, of course, a C compiler like gcc are required.

When building from a source tarball, - first unpack the source:

 tar xzvf privoxy-3.0.12-stable-src.tar.gz
- cd privoxy-3.0.12-stable

For retrieving the current CVS sources, you'll need a CVS client installed. - Note that sources from CVS are typically development quality, and may not be - stable, or well tested. To download CVS source, check the Sourceforge - documentation, which might give commands like:

+ +
  cvs -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa login
+
+
+
+
+  
+
+  Installation
+  
+  
+  
+  
+  
+  
+  
+  
+
+
+
+  
+
+  
+

2. + Installation

+ +

Privoxy is available both in + convenient pre-compiled packages for a wide range of operating systems, + and as raw source code. For most users, we recommend using the packages, + which can be downloaded from our Privoxy Project + Page.

+ +

Note: On some platforms, the installer may remove previously installed + versions, if found. (See below for your platform). In any case + be sure to backup your old + configuration if it is valuable to you. See the note to upgraders section below.

+ +
+

2.1. Binary Packages

+ +

How to install the binary packages depends on your operating + system:

+ +
+

2.1.1. Red Hat and Fedora RPMs

+ +

RPMs can be installed with rpm -Uvh + privoxy-3.0.19-1.rpm, and will use /etc/privoxy for the location of configuration + files.

+ +

Note that on Red Hat, Privoxy + will not be automatically + started on system boot. You will need to enable that using chkconfig, ntsysv, or similar + methods.

+ +

If you have problems with failed dependencies, try rebuilding the + SRC RPM: rpm --rebuild + privoxy-3.0.19-1.src.rpm. This will use your locally installed + libraries and RPM version.

+ +

Also note that if you have a Junkbuster RPM installed on your system, you + need to remove it first, because the packages conflict. Otherwise, + RPM will try to remove Junkbuster + automatically if found, before installing Privoxy.

+
+ +
+

2.1.2. Debian and Ubuntu

+ +

DEBs can be installed with apt-get install + privoxy, and will use /etc/privoxy for + the location of configuration files.

+
+ +
+

2.1.3. Windows

+ +

Just double-click the installer, which will guide you through the + installation process. You will find the configuration files in the + same directory as you installed Privoxy in.

+ +

Version 3.0.5 beta introduced full Windows service functionality. On Windows only, + the Privoxy program has two new + command line arguments to install and uninstall Privoxy as a service.

+ +
+
+
Arguments:
+ +
+

--install[:service_name]

+ +

--uninstall[:service_name]

+
+
+
+ +

After invoking Privoxy with + --install, you will need to bring up the + Windows service console to assign + the user you want Privoxy to run + under, and whether or not you want it to run whenever the system + starts. You can start the Windows + services console with the following command: services.msc. If you do not take the manual step of + modifying Privoxy's service + settings, it will not start. Note too that you will need to give + Privoxy a user account that actually exists, or it will not be + permitted to write to its log and configuration files.

+
+ +
+

2.1.4. Solaris

+ +

Create a new directory, cd to it, then + unzip and untar the archive. For the most part, you'll have to figure + out where things go.

+
+ +
+

2.1.5. OS/2

+ +

First, make sure that no previous installations of Junkbuster and / or Privoxy are left on your system. Check that no + Junkbuster or Privoxy objects are in your startup folder.

+ +

Then, just double-click the WarpIN self-installing archive, which + will guide you through the installation process. A shadow of the + Privoxy executable will be placed in + your startup folder so it will start automatically whenever OS/2 + starts.

+ +

The directory you choose to install Privoxy into will contain all of the + configuration files.

+
+ +
+

2.1.6. Mac OS X

+ +

Unzip the downloaded file (you can either double-click on the zip + file icon from the Finder, or from the desktop if you downloaded it + there). Then, double-click on the package installer icon and follow + the installation process.

+ +

The privoxy service will automatically start after a successful + installation (in addition to every time your computer starts up). To + prevent the privoxy service from automatically starting when your + computer starts up, remove or rename the folder named /Library/StartupItems/Privoxy.

+ +

To manually start or stop the privoxy service, use the Privoxy + Utility for Mac OS X. This application controls the privoxy service + (e.g. starting and stopping the service as well as uninstalling the + software).

+
+ +
+

2.1.7. AmigaOS

+ +

Copy and then unpack the lha archive to + a suitable location. All necessary files will be installed into + Privoxy directory, including all + configuration and log files. To uninstall, just remove this + directory.

+
+ +
+

2.1.8. FreeBSD

+ +

Privoxy is part of FreeBSD's Ports Collection, you can build and + install it with cd /usr/ports/www/privoxy; make + install clean.

+ +

If you don't use the ports, you can fetch and install the package + with pkg_add -r privoxy.

+ +

The port skeleton and the package can also be downloaded from the + File Release Page, but there's no reason to use + them unless you're interested in the beta releases which are only + available there.

+
+ +
+

2.1.9. Gentoo

+ +

Gentoo source packages (Ebuilds) for Privoxy are contained in the Gentoo Portage Tree + (they are not on the download page, but there is a Gentoo section, + where you can see when a new Privoxy + Version is added to the Portage Tree).

+ +

Before installing Privoxy under + Gentoo just do first emerge --sync to get + the latest changes from the Portage tree. With emerge privoxy you install the latest version.

+ +

Configuration files are in /etc/privoxy, + the documentation is in /usr/share/doc/privoxy-3.0.19 and the Log directory + is in /var/log/privoxy.

+
+
+ +
+

2.2. Building from Source

+ +

The most convenient way to obtain the Privoxy sources is to download the source tarball + from our project download page.

+ +

If you like to live on the bleeding edge and are not afraid of using + possibly unstable development versions, you can check out the + up-to-the-minute version directly from the CVS + repository.

+ +

To build Privoxy from source, + autoconf, GNU make + (gmake), and, of course, a C compiler like gcc are + required.

+ +

When building from a source tarball, first unpack the source:

+ + + + + +
+
+ tar xzvf privoxy-3.0.19-stable-src.tar.gz
+ cd privoxy-3.0.19-stable
+
+
+ +

For retrieving the current CVS sources, you'll need a CVS client + installed. Note that sources from CVS are typically development + quality, and may not be stable, or well tested. To download CVS source, + check the Sourceforge documentation, which might give commands + like:

+ + + +
+
+  cvs -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa login
   cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co current
-  cd current

This will create a directory named current/, which will - contain the source tree.

You can also check out any Privoxy - "branch", just exchange the current - name with the wanted branch name (Example: v_3_0_branch for the 3.0 cvs - tree).

It is also strongly recommended to not run Privoxy - as root. You should configure/install/run Privoxy as - an unprivileged user, preferably by creating a "privoxy" user - and group just for this purpose. See your local documentation for the correct - command line to do add new users and groups (something like - adduser, but the command syntax may vary from platform - to platform).

/etc/passwd might then look like:

  privoxy:*:7777:7777:privoxy proxy:/no/home:/no/shell

And then /etc/group, like:

  privoxy:*:7777:

Some binary packages may do this for you.

Then, to build from either unpacked tarball or CVS source:

+ +
 autoheader
+  cd current
+
+
+ +

This will create a directory named current/, which will contain the source tree.

+ +

You can also check out any Privoxy + "branch", just exchange the current name with the wanted branch name (Example: + v_3_0_branch for the 3.0 cvs tree).

+ +

It is also strongly recommended to not run Privoxy as root. You should configure/install/run + Privoxy as an unprivileged user, + preferably by creating a "privoxy" user and + group just for this purpose. See your local documentation for the + correct command line to do add new users and groups (something like + adduser, but the command syntax may vary from + platform to platform).

+ +

/etc/passwd might then look like:

+ + + + + +
+
+  privoxy:*:7777:7777:privoxy proxy:/no/home:/no/shell
+
+
+ +

And then /etc/group, like:

+ + + + + +
+
+  privoxy:*:7777:
+
+
+ +

Some binary packages may do this for you.

+ +

Then, to build from either unpacked tarball or CVS source:

+ + + +
+
+ autoheader
  autoconf
  ./configure      # (--help to see options)
- make             # (the make from GNU, sometimes called gmake) 
+ make             # (the make from GNU, sometimes called gmake)
  su               # Possibly required
  make -n install  # (to see where all the files will go)
- make -s install  # (to really install, -s to silence output)

Using GNU make, you can have the first four steps - automatically done for you by just typing:

  make

in the freshly downloaded or unpacked source directory.

To build an executable with security enhanced features so that - users cannot easily bypass the proxy (e.g. "Go There Anyway"), or - alter their own configurations, configure like this:

 ./configure  --disable-toggle  --disable-editor  --disable-force

Then build as above. In Privoxy 3.0.7 and later, all of these options -can also be disabled through the configuration file.

WARNING: If installing as root, the install will fail - unless a non-root user or group is specified, or a privoxy - user and group already exist on the system. If a non-root user is specified, - and no group, then the installation will try to also use a group of the same name - as "user". If a group is specified (and no user), then the - support files will be installed as writable by that group, and owned by the - user running the installation.

configure accepts --with-user and - --with-group options for setting user and group ownership - of the configuration files (which need to be writable by the daemon). The - specified user must already exist. When starting - Privoxy, it must be run as this same user to - insure write access to configuration and log files!

Alternately, you can specify user and group - on the make command line, but be sure both already exist:

 make -s install  USER=privoxy GROUP=privoxy

The default installation path for make install is - /usr/local. This may of course be customized with - the various ./configure path options. If you are doing - an install to anywhere besides /usr/local, be - sure to set the appropriate paths with the correct configure options - (./configure --help). Non-privileged users must of course - have write access permissions to wherever the target installation is going.

If you do install to /usr/local, the install will use - sysconfdir=$prefix/etc/privoxy by default. All other - destinations, and the direct usage of --sysconfdir flag - behave like normal, i.e. will not add the extra privoxy - directory. This is for a safer install, as there may already exist another - program that uses a file with the "config" name, and thus makes - /usr/local/etc cleaner.

If installing to /usr/local, the documentation will go - by default to $prefix/share/doc. But if this directory - doesn't exist, it will then try $prefix/doc and install - there before creating a new $prefix/share/doc just for - Privoxy.

Again, if the installs goes to /usr/local, the - localstatedir (ie: var/) will default - to /var instead of $prefix/var so - the logs will go to /var/log/privoxy/, and the pid file - will be created in /var/run/privoxy.pid.

make install will attempt to set the correct values - in config (main configuration file). You should - check this to make sure all values are correct. If appropriate, - an init script will be installed, but it is up to the user to determine - how and where to start Privoxy. The init - script should be checked for correct paths and values, if anything other than - a default install is done.

If install finds previous versions of local configuration files, most of - these will not be overwritten, and the new ones will be installed with a - "new" extension. default.action and default.filter - will be overwritten. You will then need - to manually update the other installed configuration files as needed. The - default template files will be overwritten. If you have - customized, local templates, these should be stored safely in a separate - directory and defined in config by the - "templdir" directive. It is of course wise to always back-up any - important configuration files "just in case". If a previous - version of Privoxy is already running, you will - have to restart it manually.

For more detailed instructions on how to build Redhat RPMs, - Windows self-extracting installers, building on platforms with - special requirements etc, please consult the developer manual.

2.3. Keeping your Installation Up-to-Date

As user feedback comes in and development continues, we will make updated versions - of both the main actions file (as a separate - package) and the software itself (including the actions file) available for - download.

If you wish to receive an email notification whenever we release updates of - Privoxy or the actions file, subscribe - to our announce mailing list, ijbswa-announce@lists.sourceforge.net.

In order not to lose your personal changes and adjustments when updating - to the latest default.action file we strongly - recommend that you use user.action and - user.filter for your local - customizations of Privoxy. See the Chapter on actions files for details.


PrevHomeNext
Introduction What's New in this Release
\ No newline at end of file + make -s install # (to really install, -s to silence output) +
+
+ +

Using GNU make, you can have the first four + steps automatically done for you by just typing:

+ + + + + +
+
+  make
+
+
+ +

in the freshly downloaded or unpacked source directory.

+ +

To build an executable with security enhanced features so that users + cannot easily bypass the proxy (e.g. "Go There + Anyway"), or alter their own configurations, configure like this:

+ + + + + +
+
+ ./configure  --disable-toggle  --disable-editor  --disable-force
+
+
+ +

Then build as above. In Privoxy 3.0.7 and later, all of these + options can also be disabled through the configuration file.

+ +

WARNING: If installing as + root, the install will fail unless a non-root user or group is + specified, or a privoxy user and group already + exist on the system. If a non-root user is specified, and no group, + then the installation will try to also use a group of the same name as + "user". If a group is specified (and no + user), then the support files will be installed as writable by that + group, and owned by the user running the installation.

+ +

configure accepts --with-user and --with-group + options for setting user and group ownership of the configuration files + (which need to be writable by the daemon). The specified user must already exist. When starting + Privoxy, it must be run as this same + user to insure write access to configuration and log files!

+ +

Alternately, you can specify user and + group on the make + command line, but be sure both already exist:

+ + + + + +
+
+ make -s install  USER=privoxy GROUP=privoxy
+
+
+ +

The default installation path for make + install is /usr/local. This may of course + be customized with the various ./configure path + options. If you are doing an install to anywhere besides /usr/local, be sure to set the appropriate paths with + the correct configure options (./configure + --help). Non-privileged users must of course have write access + permissions to wherever the target installation is going.

+ +

If you do install to /usr/local, the + install will use sysconfdir=$prefix/etc/privoxy by default. All other + destinations, and the direct usage of --sysconfdir flag behave like normal, i.e. will not add + the extra privoxy directory. This is for a + safer install, as there may already exist another program that uses a + file with the "config" name, and thus makes + /usr/local/etc cleaner.

+ +

If installing to /usr/local, the + documentation will go by default to $prefix/share/doc. But if this directory doesn't exist, + it will then try $prefix/doc and install + there before creating a new $prefix/share/doc + just for Privoxy.

+ +

Again, if the installs goes to /usr/local, + the localstatedir (ie: var/) will default to /var + instead of $prefix/var so the logs will go to + /var/log/privoxy/, and the pid file will be + created in /var/run/privoxy.pid.

+ +

make install will attempt to set the correct + values in config (main configuration file). + You should check this to make sure all values are correct. If + appropriate, an init script will be installed, but it is up to the user + to determine how and where to start Privoxy. The init script should be checked for + correct paths and values, if anything other than a default install is + done.

+ +

If install finds previous versions of local configuration files, + most of these will not be overwritten, and the new ones will be + installed with a "new" extension. + default.action and default.filter will be overwritten. You will then need + to manually update the other installed configuration files as needed. + The default template files will be overwritten. If you have + customized, local templates, these should be stored safely in a + separate directory and defined in config by + the "templdir" directive. It is of course + wise to always back-up any important configuration files "just in case". If a previous version of Privoxy is already running, you will have to + restart it manually.

+ +

For more detailed instructions on how to build Redhat RPMs, Windows + self-extracting installers, building on platforms with special + requirements etc, please consult the developer manual.

+
+ +
+

2.3. Keeping your Installation + Up-to-Date

+ +

As user feedback comes in and development continues, we will make + updated versions of both the main actions + file (as a separate package) and the software itself (including + the actions file) available for download.

+ +

If you wish to receive an email notification whenever we release + updates of Privoxy or the actions + file, subscribe to our announce mailing list, + ijbswa-announce@lists.sourceforge.net.

+ +

In order not to lose your personal changes and adjustments when + updating to the latest default.action file we + strongly recommend that you + use user.action and user.filter for your local customizations of + Privoxy. See the Chapter on actions files for details.

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/user-manual/introduction.html b/external/privoxy/doc/webserver/user-manual/introduction.html index aad9cc05..d7d39065 100644 --- a/external/privoxy/doc/webserver/user-manual/introduction.html +++ b/external/privoxy/doc/webserver/user-manual/introduction.html @@ -1,292 +1,182 @@ - -Introduction - -
Privoxy 3.0.12 User Manual
PrevNext

1. Introduction

This documentation is included with the current stable version of - Privoxy, v.3.0.12.

1.1. Features

In addition to the core - features of ad blocking and - cookie management, - Privoxy provides many supplemental - features, - that give the end-user more control, more privacy and more freedom:

  • Can keep outgoing connections alive and reuse them later on. -

  • Supports tagging which allows to change the behaviour - based on client and server headers. -

  • Can be run as an "intercepting" proxy, which obviates the need to - configure browsers individually. -

  • Sophisticated actions and filters for manipulating both server and client - headers. -

  • Can be chained with other proxies. -

  • Integrated browser based configuration and control utility at http://config.privoxy.org/ - (shortcut: http://p.p/). Browser-based - tracing of rule and filter effects. Remote toggling. -

  • Web page filtering (text replacements, removes banners based on size, - invisible "web-bugs", JavaScript and HTML annoyances, - pop-up windows, etc.) -

  • Modularized configuration that allows for standard settings and - user settings to reside in separate files, so that installing updated - actions files won't overwrite individual user settings. -

  • Support for Perl Compatible Regular Expressions in the configuration files, and - a more sophisticated and flexible configuration syntax. -

  • Improved cookie management features (e.g. session based cookies). -

  • GIF de-animation. -

  • Bypass many click-tracking scripts (avoids script redirection). -

  • Multi-threaded (POSIX and native threads). -

  • User-customizable HTML templates for most proxy-generated pages (e.g. "blocked" page). -

  • Auto-detection and re-reading of config file changes. -

  • Improved signal handling, and a true daemon mode (Unix). -

  • Every feature now controllable on a per-site or per-location basis, configuration - more powerful and versatile over-all. -

  • Many smaller new features added, limitations and bugs removed. -


PrevHomeNext
Privoxy 3.0.12 User Manual Installation
\ No newline at end of file + + + + + + + Introduction + + + + + + + + + + + + + +
+

1. + Introduction

+ +

This documentation is included with the current stable version of + Privoxy, v.3.0.19.

+ +
+

1.1. + Features

+ +

In addition to the core features of ad blocking and cookie + management, Privoxy provides many + supplemental features, that give the end-user more control, more + privacy and more freedom:

+ +
    +
  • +

    Supports "Connection: keep-alive". Outgoing connections can be + kept alive independently from the client.

    +
  • + +
  • +

    Supports IPv6, provided the operating system does so too, and + the configure script detects it.

    +
  • + +
  • +

    Supports tagging which allows to change the behaviour based on + client and server headers.

    +
  • + +
  • +

    Can be run as an "intercepting" proxy, which obviates the need + to configure browsers individually.

    +
  • + +
  • +

    Sophisticated actions and filters for manipulating both server + and client headers.

    +
  • + +
  • +

    Can be chained with other proxies.

    +
  • + +
  • +

    Integrated browser-based configuration and control utility at + http://config.privoxy.org/ (shortcut: http://p.p/). Browser-based tracing + of rule and filter effects. Remote toggling.

    +
  • + +
  • +

    Web page filtering (text replacements, removes banners based on + size, invisible "web-bugs" and HTML + annoyances, etc.)

    +
  • + +
  • +

    Modularized configuration that allows for standard settings and + user settings to reside in separate files, so that installing + updated actions files won't overwrite individual user settings.

    +
  • + +
  • +

    Support for Perl Compatible Regular Expressions in the + configuration files, and a more sophisticated and flexible + configuration syntax.

    +
  • + +
  • +

    GIF de-animation.

    +
  • + +
  • +

    Bypass many click-tracking scripts (avoids script + redirection).

    +
  • + +
  • +

    User-customizable HTML templates for most proxy-generated pages + (e.g. "blocked" page).

    +
  • + +
  • +

    Auto-detection and re-reading of config file changes.

    +
  • + +
  • +

    Most features are controllable on a per-site or per-location + basis.

    +
  • + +
  • +

    Many smaller new features added, limitations and bugs + removed.

    +
  • +
+
+
+ + + + diff --git a/external/privoxy/doc/webserver/user-manual/quickstart.html b/external/privoxy/doc/webserver/user-manual/quickstart.html index 03936895..3085eb55 100644 --- a/external/privoxy/doc/webserver/user-manual/quickstart.html +++ b/external/privoxy/doc/webserver/user-manual/quickstart.html @@ -1,943 +1,451 @@ - -Quickstart to Using Privoxy - -
Privoxy 3.0.12 User Manual
PrevNext

4. Quickstart to Using Privoxy

  • Install Privoxy. See the Installation Section below for platform specific - information. -

  • Advanced users and those who want to offer Privoxy - service to more than just their local machine should check the main config file, especially the security-relevant options. These are - off by default. -

  • Start Privoxy, if the installation program has - not done this already (may vary according to platform). See the section - Starting Privoxy. -

  • Set your browser to use Privoxy as HTTP and - HTTPS (SSL) proxy - by setting the proxy configuration for address of - 127.0.0.1 and port 8118. - DO NOT activate proxying for FTP or - any protocols besides HTTP and HTTPS (SSL) unless you intend to prevent your - browser from using these protocols. -

  • Flush your browser's disk and memory caches, to remove any cached ad images. - If using Privoxy to manage - cookies, - you should remove any currently stored cookies too. -

  • A default installation should provide a reasonable starting point for - most. There will undoubtedly be occasions where you will want to adjust the - configuration, but that can be dealt with as the need arises. Little - to no initial configuration is required in most cases, you may want - to enable the - web-based action editor though. - Be sure to read the warnings first. -

    See the Configuration section for more - configuration options, and how to customize your installation. - You might also want to look at the next section for a quick - introduction to how Privoxy blocks ads and - banners.

  • If you experience ads that slip through, innocent images that are - blocked, or otherwise feel the need to fine-tune - Privoxy's behavior, take a look at the actions files. As a quick start, you might - find the richly commented examples - helpful. You can also view and edit the actions files through the web-based user interface. The - Appendix "Troubleshooting: Anatomy of an - Action" has hints on how to understand and debug actions that - "misbehave". -

  • Please see the section Contacting the - Developers on how to report bugs, problems with websites or to get - help. -

  • Now enjoy surfing with enhanced control, comfort and privacy! -

4.1. Quickstart to Ad Blocking

Ad blocking is but one of Privoxy's - array of features. Many of these features are for the technically minded advanced - user. But, ad and banner blocking is surely common ground for everybody.

- This section will provide a quick summary of ad blocking so - you can get up to speed quickly without having to read the more extensive - information provided below, though this is highly recommended.

First a bit of a warning ... blocking ads is much like blocking SPAM: the - more aggressive you are about it, the more likely you are to block - things that were not intended. And the more likely that some things - may not work as intended. So there is a trade off here. If you want - extreme ad free browsing, be prepared to deal with more - "problem" sites, and to spend more time adjusting the - configuration to solve these unintended consequences. In short, there is - not an easy way to eliminate all ads. Either take - the easy way and settle for most ads blocked with the - default configuration, or jump in and tweak it for your personal surfing - habits and preferences.

Secondly, a brief explanation of Privoxy's - "actions". "Actions" in this context, are - the directives we use to tell Privoxy to perform - some task relating to HTTP transactions (i.e. web browsing). We tell - Privoxy to take some "action". Each - action has a unique name and function. While there are many potential - actions in Privoxy's - arsenal, only a few are used for ad blocking. Actions, and action - configuration files, are explained in depth below.

Actions are specified in Privoxy's configuration, - followed by one or more URLs to which the action should apply. URLs - can actually be URL type patterns that use - wildcards so they can apply potentially to a range of similar URLs. The - actions, together with the URL patterns are called a section.

When you connect to a website, the full URL will either match one or more - of the sections as defined in Privoxy's configuration, - or not. If so, then Privoxy will perform the - respective actions. If not, then nothing special happens. Furthermore, web - pages may contain embedded, secondary URLs that your web browser will - use to load additional components of the page, as it parses the - original page's HTML content. An ad image for instance, is just an URL - embedded in the page somewhere. The image itself may be on the same server, - or a server somewhere else on the Internet. Complex web pages will have many - such embedded URLs. Privoxy can deal with each URL individually, so, for - instance, the main page text is not touched, but images from such-and-such - server are blocked.

The most important actions for basic ad blocking are: block, handle-as-image, - handle-as-empty-document,and - set-image-blocker:

  • block - this is perhaps - the single most used action, and is particularly important for ad blocking. - This action stops any contact between your browser and any URL patterns - that match this action's configuration. It can be used for blocking ads, - but also anything that is determined to be unwanted. By itself, it simply - stops any communication with the remote server and sends - Privoxy's own built-in BLOCKED page instead to - let you now what has happened (with some exceptions, see below). -

  • handle-as-image - - tells Privoxy to treat this URL as an image. - Privoxy's default configuration already does this - for all common image types (e.g. GIF), but there are many situations where this - is not so easy to determine. So we'll force it in these cases. This is particularly - important for ad blocking, since only if we know that it's an image of - some kind, can we replace it with an image of our choosing, instead of the - Privoxy BLOCKED page (which would only result in - a "broken image" icon). There are some limitations to this - though. For instance, you can't just brute-force an image substitution for - an entire HTML page in most situations. -

  • handle-as-empty-document - - sends an empty document instead of Privoxy's - normal BLOCKED HTML page. This is useful for file types that are neither - HTML nor images, such as blocking JavaScript files. -

  • set-image-blocker - tells - Privoxy what to display in place of an ad image that - has hit a block rule. For this to come into play, the URL must match a - block action somewhere in the - configuration, and, it must also match an - handle-as-image action. -

    The configuration options on what to display instead of the ad are: -

       pattern - a checkerboard pattern, so that an ad - replacement is obvious. This is the default. -

       blank - A very small empty GIF image is displayed. - This is the so-called "invisible" configuration option. -

       http://<URL> - A redirect to any image anywhere - of the user's choosing (advanced usage). -

Advanced users will eventually want to explore Privoxy - filters as well. Filters - are very different from blocks. - A "block" blocks a site, page, or unwanted contented. Filters - are a way of filtering or modifying what is actually on the page. An example - filter usage: a text replacement of "no-no" for - "nasty-word". That is a very simple example. This process can be - used for ad blocking, but it is more in the realm of advanced usage and has - some pitfalls to be wary off.

The quickest way to adjust any of these settings is with your browser through - the special Privoxy editor at http://config.privoxy.org/show-status - (shortcut: http://p.p/show-status). This - is an internal page, and does not require Internet access.

Note that as of Privoxy 3.0.7 beta the - action editor is disabled by default. Check the - enable-edit-actions - section in the configuration file to learn why and in which - cases it's safe to enable again.

If you decided to enable the action editor, select the appropriate - "actions" file, and click - "Edit". It is best to put personal or - local preferences in user.action since this is not - meant to be overwritten during upgrades, and will over-ride the settings in - other files. Here you can insert new "actions", and URLs for ad - blocking or other purposes, and make other adjustments to the configuration. - Privoxy will detect these changes automatically.

A quick and simple step by step example:

  • Right click on the ad image to be blocked, then select - "Copy Link Location" from the - pop-up menu. -

  • Set your browser to - http://config.privoxy.org/show-status -

  • Find user.action in the top section, and click - on "Edit": -

    Figure 1. Actions Files in Use

    -

  • You should have a section with only - block listed under - "Actions:". - If not, click a "Insert new section below" - button, and in the new section that just appeared, click the - Edit button right under the word "Actions:". - This will bring up a list of all actions. Find - block near the top, and click - in the "Enabled" column, then "Submit" - just below the list. -

  • Now, in the block actions section, - click the "Add" button, and paste the URL the - browser got from "Copy Link Location". - Remove the http:// at the beginning of the URL. Then, click - "Submit" (or - "OK" if in a pop-up window). -

  • Now go back to the original page, and press SHIFT-Reload - (or flush all browser caches). The image should be gone now. -

This is a very crude and simple example. There might be good reasons to use a - wildcard pattern match to include potentially similar images from the same - site. For a more extensive explanation of "patterns", and - the entire actions concept, see the Actions - section.

For advanced users who want to hand edit their config files, you might want - to now go to the Actions Files Tutorial. - The ideas explained therein also apply to the web-based editor.

There are also various - filters that can be used for ad blocking - (filters are a special subset of actions). These - fall into the "advanced" usage category, and are explained in - depth in later sections.


PrevHomeNext
What's New in this Release Starting Privoxy
\ No newline at end of file + + + + + + + Quickstart to Using Privoxy + + + + + + + + + + + + + +
+

4. Quickstart to + Using Privoxy

+ +
    +
  • +

    Install Privoxy. See the Installation Section below for platform + specific information.

    +
  • + +
  • +

    Advanced users and those who want to offer Privoxy service to more than just their local + machine should check the main config file, + especially the security-relevant options. These are + off by default.

    +
  • + +
  • +

    Start Privoxy, if the + installation program has not done this already (may vary according to + platform). See the section Starting + Privoxy.

    +
  • + +
  • +

    Set your browser to use Privoxy + as HTTP and HTTPS (SSL) proxy + by setting the proxy configuration for address of 127.0.0.1 and port 8118. + DO NOT activate proxying + for FTP or any protocols besides HTTP and + HTTPS (SSL) unless you intend to prevent your browser from using + these protocols.

    +
  • + +
  • +

    Flush your browser's disk and memory caches, to remove any cached + ad images. If using Privoxy to + manage cookies, you should remove any currently stored cookies + too.

    +
  • + +
  • +

    A default installation should provide a reasonable starting point + for most. There will undoubtedly be occasions where you will want to + adjust the configuration, but that can be dealt with as the need + arises. Little to no initial configuration is required in most cases, + you may want to enable the web-based action editor though. Be sure to read the + warnings first.

    + +

    See the Configuration section for + more configuration options, and how to customize your installation. + You might also want to look at the next section for a quick + introduction to how Privoxy blocks + ads and banners.

    +
  • + +
  • +

    If you experience ads that slip through, innocent images that are + blocked, or otherwise feel the need to fine-tune Privoxy's behavior, take a look at the actions files. As a quick start, you might + find the richly commented + examples helpful. You can also view and edit the actions files + through the web-based user interface. The Appendix "Troubleshooting: Anatomy + of an Action" has hints on how to understand and debug + actions that "misbehave".

    +
  • + +
  • +

    Please see the section Contacting the + Developers on how to report bugs, problems with websites or to + get help.

    +
  • + +
  • +

    Now enjoy surfing with enhanced control, comfort and privacy!

    +
  • +
+ +
+

4.1. Quickstart to Ad Blocking

+ +

Ad blocking is but one of Privoxy's + array of features. Many of these features are for the technically + minded advanced user. But, ad and banner blocking is surely common + ground for everybody.

+ +

This section will provide a quick summary of ad blocking so you can + get up to speed quickly without having to read the more extensive + information provided below, though this is highly recommended.

+ +

First a bit of a warning ... blocking ads is much like blocking + SPAM: the more aggressive you are about it, the more likely you are to + block things that were not intended. And the more likely that some + things may not work as intended. So there is a trade off here. If you + want extreme ad free browsing, be prepared to deal with more + "problem" sites, and to spend more time + adjusting the configuration to solve these unintended consequences. In + short, there is not an easy way to eliminate all ads. Either take the easy way and + settle for most ads blocked + with the default configuration, or jump in and tweak it for your + personal surfing habits and preferences.

+ +

Secondly, a brief explanation of Privoxy's "actions". + "Actions" in this context, are the + directives we use to tell Privoxy to + perform some task relating to HTTP transactions (i.e. web browsing). We + tell Privoxy to take some "action". Each action has a unique name and function. + While there are many potential actions + in Privoxy's arsenal, only a few are + used for ad blocking. Actions, + and action configuration files, are + explained in depth below.

+ +

Actions are specified in Privoxy's + configuration, followed by one or more URLs to which the action should + apply. URLs can actually be URL type patterns that use wildcards so they + can apply potentially to a range of similar URLs. The actions, together + with the URL patterns are called a section.

+ +

When you connect to a website, the full URL will either match one or + more of the sections as defined in Privoxy's configuration, or not. If so, then + Privoxy will perform the respective + actions. If not, then nothing special happens. Furthermore, web pages + may contain embedded, secondary URLs that your web browser will use to + load additional components of the page, as it parses the original + page's HTML content. An ad image for instance, is just an URL embedded + in the page somewhere. The image itself may be on the same server, or a + server somewhere else on the Internet. Complex web pages will have many + such embedded URLs. Privoxy can deal + with each URL individually, so, for instance, the main page text is not + touched, but images from such-and-such server are blocked.

+ +

The most important actions for basic ad blocking are: block, handle-as-image, + handle-as-empty-document,and + set-image-blocker:

+ +
    +
  • +

    block - this is perhaps the + single most used action, and is particularly important for ad + blocking. This action stops any contact between your browser and + any URL patterns that match this action's configuration. It can be + used for blocking ads, but also anything that is determined to be + unwanted. By itself, it simply stops any communication with the + remote server and sends Privoxy's + own built-in BLOCKED page instead to let you now what has happened + (with some exceptions, see below).

    +
  • + +
  • +

    handle-as-image - + tells Privoxy to treat this URL as + an image. Privoxy's default + configuration already does this for all common image types (e.g. + GIF), but there are many situations where this is not so easy to + determine. So we'll force it in these cases. This is particularly + important for ad blocking, since only if we know that it's an image + of some kind, can we replace it with an image of our choosing, + instead of the Privoxy BLOCKED + page (which would only result in a "broken + image" icon). There are some limitations to this though. For + instance, you can't just brute-force an image substitution for an + entire HTML page in most situations.

    +
  • + +
  • +

    handle-as-empty-document + - sends an empty document instead of Privoxy's normal BLOCKED HTML page. This is + useful for file types that are neither HTML nor images, such as + blocking JavaScript files.

    +
  • + +
  • +

    set-image-blocker - + tells Privoxy what to display in + place of an ad image that has hit a block rule. For this to come + into play, the URL must match a block action somewhere in the + configuration, and, it + must also match an handle-as-image + action.

    + +

    The configuration options on what to display instead of the ad + are:

    + + + + + + + +
       pattern - a checkerboard + pattern, so that an ad replacement is obvious. This is the + default.
    + + + + + + + +
       blank - A very small empty GIF + image is displayed. This is the so-called "invisible" configuration option.
    + + + + + + + +
       http://<URL> - A redirect + to any image anywhere of the user's choosing (advanced + usage).
    +
  • +
+ +

Advanced users will eventually want to explore Privoxy filters as well. Filters are very + different from blocks. A "block" blocks a site, page, or unwanted contented. + Filters are a way of filtering or modifying what is actually on the + page. An example filter usage: a text replacement of "no-no" for "nasty-word". + That is a very simple example. This process can be used for ad + blocking, but it is more in the realm of advanced usage and has some + pitfalls to be wary off.

+ +

The quickest way to adjust any of these settings is with your + browser through the special Privoxy + editor at http://config.privoxy.org/show-status (shortcut: http://p.p/show-status). This is an + internal page, and does not require Internet access.

+ +

Note that as of Privoxy 3.0.7 beta + the action editor is disabled by default. Check the enable-edit-actions + section in the configuration file to learn why and in which cases + it's safe to enable again.

+ +

If you decided to enable the action editor, select the appropriate + "actions" file, and click "Edit". It is best to put + personal or local preferences in user.action + since this is not meant to be overwritten during upgrades, and will + over-ride the settings in other files. Here you can insert new + "actions", and URLs for ad blocking or other + purposes, and make other adjustments to the configuration. Privoxy will detect these changes + automatically.

+ +

A quick and simple step by step example:

+ +
    +
  • +

    Right click on the ad image to be blocked, then select + "Copy Link + Location" from the pop-up menu.

    +
  • + +
  • +

    Set your browser to http://config.privoxy.org/show-status

    +
  • + +
  • +

    Find user.action in the top section, + and click on "Edit":

    + +
    + + +

    Figure 1. Actions Files in Use

    + +
    +

    +
    +
    +
  • + +
  • +

    You should have a section with only block listed under "Actions:". If not, click a "Insert new section + below" button, and in the new section that just + appeared, click the Edit button + right under the word "Actions:". This + will bring up a list of all actions. Find block near the + top, and click in the "Enabled" column, + then "Submit" just below the list.

    +
  • + +
  • +

    Now, in the block actions section, click the + "Add" + button, and paste the URL the browser got from "Copy Link + Location". Remove the http:// at the beginning of the URL. Then, click + "Submit" + (or "OK" + if in a pop-up window).

    +
  • + +
  • +

    Now go back to the original page, and press SHIFT-Reload (or flush all browser caches). The image + should be gone now.

    +
  • +
+ +

This is a very crude and simple example. There might be good reasons + to use a wildcard pattern match to include potentially similar images + from the same site. For a more extensive explanation of "patterns", and the entire actions concept, see the Actions section.

+ +

For advanced users who want to hand edit their config files, you + might want to now go to the Actions Files Tutorial. The ideas + explained therein also apply to the web-based editor.

+ +

There are also various filters that can be used for ad blocking + (filters are a special subset of actions). These fall into the + "advanced" usage category, and are explained + in depth in later sections.

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/user-manual/seealso.html b/external/privoxy/doc/webserver/user-manual/seealso.html index 93a8b2d7..223f1edc 100644 --- a/external/privoxy/doc/webserver/user-manual/seealso.html +++ b/external/privoxy/doc/webserver/user-manual/seealso.html @@ -1,418 +1,208 @@ - -See Also - -
Privoxy 3.0.12 User Manual
PrevNext

13. See Also

Other references and sites of interest to Privoxy - users:

http://www.privoxy.org/, - the Privoxy Home page. -

-

http://www.privoxy.org/faq/, - the Privoxy FAQ. -

-

http://www.privoxy.org/developer-manual/, - the Privoxy developer manual. -

-

https://sourceforge.net/projects/ijbswa/, - the Project Page for Privoxy on - SourceForge. -

-

http://config.privoxy.org/, - the web-based user interface. Privoxy must be - running for this to work. Shortcut: http://p.p/ -

-

https://sourceforge.net/tracker/?group_id=11118&atid=460288, to submit "misses" and other - configuration related suggestions to the developers. -

- - -

http://www.junkbusters.com/ht/en/cookies.html, - an explanation how cookies are used to track web users. -

-

http://www.junkbusters.com/ijb.html, - the original Internet Junkbuster. -

-

http://www.squid-cache.org/, a popular - caching proxy, which is often used together with Privoxy. -

-

http://www.pps.jussieu.fr/~jch/software/polipo/, - Polipo is a caching proxy with advanced features - like pipelining, multiplexing and caching of partial instances. In many setups - it can be used as Squid replacement. -

-

https://www.torproject.org/, - Tor can help anonymize web browsing, - web publishing, instant messaging, IRC, SSH, and other applications. -

-


PrevHomeNext
Privoxy Copyright, License and History Appendix
\ No newline at end of file + + + + + + + See Also + + + + + + + + + + + + + +
+

13. See Also

+ +

Other references and sites of interest to Privoxy users:

+ + + + + + + +
http://www.privoxy.org/, the Privoxy Home page.
+ + + + + + + +
http://www.privoxy.org/faq/, the Privoxy FAQ.
+ + + + + + + +
http://www.privoxy.org/developer-manual/, the + Privoxy developer manual.
+ + + + + + + +
https://sourceforge.net/projects/ijbswa/, the Project + Page for Privoxy on SourceForge.
+ + + + + + + +
http://config.privoxy.org/, the web-based user + interface. Privoxy must be running + for this to work. Shortcut: http://p.p/
+ + + + + + + +
https://sourceforge.net/tracker/?group_id=11118&atid=460288, + to submit "misses" and other + configuration related suggestions to the developers.
+ + + + + + + +
http://www.junkbusters.com/ht/en/cookies.html, an + explanation how cookies are used to track web users.
+ + + + + + + +
http://www.junkbusters.com/ijb.html, the original + Internet Junkbuster.
+ + + + + + + +
http://www.squid-cache.org/, a popular caching proxy, + which is often used together with Privoxy.
+ + + + + + + +
http://www.pps.jussieu.fr/~jch/software/polipo/, + Polipo is a caching proxy with + advanced features like pipelining, multiplexing and caching of + partial instances. In many setups it can be used as Squid replacement.
+ + + + + + + +
https://www.torproject.org/, Tor can help anonymize web browsing, web + publishing, instant messaging, IRC, SSH, and other + applications.
+
+ + + + diff --git a/external/privoxy/doc/webserver/user-manual/startup.html b/external/privoxy/doc/webserver/user-manual/startup.html index e4f0c23a..9c9e9440 100644 --- a/external/privoxy/doc/webserver/user-manual/startup.html +++ b/external/privoxy/doc/webserver/user-manual/startup.html @@ -1,902 +1,458 @@ - -Starting Privoxy - -
Privoxy 3.0.12 User Manual
PrevNext

5. Starting Privoxy

Before launching Privoxy for the first time, you - will want to configure your browser(s) to use - Privoxy as a HTTP and HTTPS (SSL) - proxy. The default is - 127.0.0.1 (or localhost) for the proxy address, and port 8118 (earlier versions - used port 8000). This is the one configuration step that must be done!

Please note that Privoxy can only proxy HTTP and - HTTPS traffic. It will not work with FTP or other protocols.

Figure 2. Proxy Configuration Showing - Mozilla/Netscape HTTP and HTTPS (SSL) Settings

-

- With Firefox, this is typically set under:

 Tools -> Options ->  Advanced -> Network ->Connection -> Settings

- Or optionally on some platforms:

 Edit -> Preferences -> General -> Connection Settings -> Manual Proxy Configuration

- With Netscape (and - Mozilla), this can be set under:

 Edit -> Preferences -> Advanced -> Proxies -> HTTP Proxy

For Internet Explorer v.5-7:

 Tools -> Internet Options -> Connections -> LAN Settings

Then, check "Use Proxy" and fill in the appropriate info - (Address: 127.0.0.1, Port: 8118). Include HTTPS (SSL), if you want HTTPS - proxy support too (sometimes labeled "Secure"). Make sure any - checkboxes like "Use the same proxy server for all protocols" is - UNCHECKED. You want only HTTP and HTTPS (SSL)!

Figure 3. Proxy Configuration Showing - Internet Explorer HTTP and HTTPS (Secure) Settings

-

After doing this, flush your browser's disk and memory caches to force a - re-reading of all pages and to get rid of any ads that may be cached. Remove - any cookies, - if you want Privoxy to manage that. You are now - ready to start enjoying the benefits of using - Privoxy!

Privoxy itself is typically started by specifying the - main configuration file to be used on the command line. If no configuration - file is specified on the command line, Privoxy - will look for a file named config in the current - directory. Except on Win32 where it will try config.txt.

5.1. Red Hat and Fedora

A default Red Hat installation may not start Privoxy upon boot. It will use - the file /etc/privoxy/config as its main configuration - file.

 # /etc/rc.d/init.d/privoxy start

Or ...

 # service privoxy start

5.2. Debian

We use a script. Note that Debian typically starts Privoxy upon booting per - default. It will use the file - /etc/privoxy/config as its main configuration - file.

 # /etc/init.d/privoxy start

5.3. Windows

Click on the Privoxy Icon to start Privoxy. If no configuration file is - specified on the command line, Privoxy will look - for a file named config.txt. Note that Windows will - automatically start Privoxy when the system starts if you chose that option - when installing.

Privoxy can run with full Windows service functionality. - On Windows only, the Privoxy program has two new command line arguments - to install and uninstall Privoxy as a service. See the - Windows Installation - instructions for details.

5.4. Solaris, NetBSD, FreeBSD, HP-UX and others

Example Unix startup command:

 # /usr/sbin/privoxy /etc/privoxy/config

5.5. OS/2

During installation, Privoxy is configured to - start automatically when the system restarts. You can start it manually by - double-clicking on the Privoxy icon in the - Privoxy folder.

5.6. Mac OS X

After downloading the privoxy software, unzip the downloaded file by - double-clicking on the zip file icon. Then, double-click on the - installer package icon and follow the installation process.

The privoxy service will automatically start after a successful - installation. In addition, the privoxy service will automatically - start every time your computer starts up.

To prevent the privoxy service from automatically starting when your - computer starts up, remove or rename the folder named - /Library/StartupItems/Privoxy.

A simple application named Privoxy Utility has been created which - enables administrators to easily start and stop the privoxy service.

In addition, the Privoxy Utility presents a simple way for - administrators to edit the various privoxy config files. A method - to uninstall the software is also available.

An administrator username and password must be supplied in order for - the Privoxy Utility to perform any of the tasks.

5.7. AmigaOS

Start Privoxy (with RUN <>NIL:) in your - startnet script (AmiTCP), in - s:user-startup (RoadShow), as startup program in your - startup script (Genesis), or as startup action (Miami and MiamiDx). - Privoxy will automatically quit when you quit your - TCP/IP stack (just ignore the harmless warning your TCP/IP stack may display that - Privoxy is still running).

5.8. Gentoo

A script is again used. It will use the file /etc/privoxy/config - as its main configuration file.

 /etc/init.d/privoxy start
- 

Note that Privoxy is not automatically started at - boot time by default. You can change this with the rc-update - command.

-
 rc-update add privoxy default
- 

5.9. Command Line Options

Privoxy may be invoked with the following - command-line options:

  • --version -

    Print version info and exit. Unix only. -

  • --help -

    Print short usage info and exit. Unix only. -

  • --no-daemon -

    Don't become a daemon, i.e. don't fork and become process group - leader, and don't detach from controlling tty. Unix only. -

  • --pidfile FILE -

    On startup, write the process ID to FILE. Delete the - FILE on exit. Failure to create or delete the - FILE is non-fatal. If no FILE - option is given, no PID file will be used. Unix only. -

  • --user USER[.GROUP] -

    After (optionally) writing the PID file, assume the user ID of - USER, and if included the GID of GROUP. Exit if the - privileges are not sufficient to do so. Unix only. -

  • --chroot -

    Before changing to the user ID given in the --user option, - chroot to that user's home directory, i.e. make the kernel pretend to the Privoxy - process that the directory tree starts there. If set up carefully, this can limit - the impact of possible vulnerabilities in Privoxy to the files contained in that hierarchy. - Unix only. -

  • --pre-chroot-nslookup hostname -

    Specifies a hostname to look up before doing a chroot. On some systems, initializing the - resolver library involves reading config files from /etc and/or loading additional shared - libraries from /lib. On these systems, doing a hostname lookup before the chroot reduces - the number of files that must be copied into the chroot tree. -

    For fastest startup speed, a good value is a hostname that is not in /etc/hosts but that - your local name server (listed in /etc/resolv.conf) can resolve without recursion - (that is, without having to ask any other name servers). The hostname need not exist, - but if it doesn't, an error message (which can be ignored) will be output. -

  • configfile -

    If no configfile is included on the command line, - Privoxy will look for a file named - "config" in the current directory (except on Win32 - where it will look for "config.txt" instead). Specify - full path to avoid confusion. If no config file is found, - Privoxy will fail to start. -

On MS Windows only there are two additional - command-line options to allow Privoxy to install and - run as a service. See the -Window Installation section -for details.


PrevHomeNext
Quickstart to Using Privoxy Privoxy Configuration
\ No newline at end of file + + + + + + + Starting Privoxy + + + + + + + + + + + + + +
+

5. Starting + Privoxy

+ +

Before launching Privoxy for the + first time, you will want to configure your browser(s) to use + Privoxy as a HTTP and HTTPS (SSL) + proxy. The default is 127.0.0.1 (or localhost) for the proxy + address, and port 8118 (earlier versions used port 8000). This is the one + configuration step that must be + done!

+ +

Please note that Privoxy can only + proxy HTTP and HTTPS traffic. It will not work with FTP or other + protocols.

+ +
+ + +

Figure 2. Proxy Configuration Showing Mozilla/Netscape + HTTP and HTTPS (SSL) Settings

+ +
+

+
+
+ +

With Firefox, this is typically set + under:

+ +

 Tools -> Options ->  Advanced -> Network ->Connection -> Settings

+ +

Or optionally on some platforms:

+ +

 Edit -> Preferences -> General -> Connection Settings -> Manual Proxy Configuration

+ +

With Netscape (and Mozilla), this can be set under:

+ +

 Edit -> Preferences -> Advanced -> Proxies -> HTTP + Proxy

+ +

For Internet Explorer v.5-7:

+ +

 Tools -> Internet + Options -> Connections -> LAN Settings

+ +

Then, check "Use Proxy" and fill in the + appropriate info (Address: 127.0.0.1, Port: 8118). Include HTTPS (SSL), + if you want HTTPS proxy support too (sometimes labeled "Secure"). Make sure any checkboxes like "Use the same proxy server for all protocols" is + UNCHECKED. You want only HTTP + and HTTPS (SSL)!

+ +
+ + +

Figure 3. Proxy Configuration Showing Internet Explorer + HTTP and HTTPS (Secure) Settings

+ +
+

+
+
+ +

After doing this, flush your browser's disk and memory caches to force + a re-reading of all pages and to get rid of any ads that may be cached. + Remove any cookies, if you want Privoxy + to manage that. You are now ready to start enjoying the benefits of using + Privoxy!

+ +

Privoxy itself is typically started + by specifying the main configuration file to be used on the command line. + If no configuration file is specified on the command line, Privoxy will look for a file named config in the current directory. Except on Win32 where it + will try config.txt.

+ +
+

5.1. Red Hat + and Fedora

+ +

A default Red Hat installation may not start Privoxy upon boot. It will use the file /etc/privoxy/config as its main configuration file.

+ + + + + +
+
+ # /etc/rc.d/init.d/privoxy start
+
+
+ +

Or ...

+ + + + + +
+
+ # service privoxy start
+
+
+
+ +
+

5.2. + Debian

+ +

We use a script. Note that Debian typically starts Privoxy upon booting per default. It will use the + file /etc/privoxy/config as its main + configuration file.

+ + + + + +
+
+ # /etc/init.d/privoxy start
+
+
+
+ +
+

5.3. + Windows

+ +

Click on the Privoxy Icon to start + Privoxy. If no configuration file is + specified on the command line, Privoxy + will look for a file named config.txt. Note + that Windows will automatically start Privoxy when the system starts if you chose that + option when installing.

+ +

Privoxy can run with full Windows + service functionality. On Windows only, the Privoxy program has two new command line arguments + to install and uninstall Privoxy as a + service. See the Windows Installation + instructions for details.

+
+ +
+

5.4. + Solaris, NetBSD, FreeBSD, HP-UX and others

+ +

Example Unix startup command:

+ + + + + +
+
+ # /usr/sbin/privoxy /etc/privoxy/config
+
+
+
+ +
+

5.5. OS/2

+ +

During installation, Privoxy is + configured to start automatically when the system restarts. You can + start it manually by double-clicking on the Privoxy icon in the Privoxy folder.

+
+ +
+

5.6. Mac OS + X

+ +

After downloading the privoxy software, unzip the downloaded file by + double-clicking on the zip file icon. Then, double-click on the + installer package icon and follow the installation process.

+ +

The privoxy service will automatically start after a successful + installation. In addition, the privoxy service will automatically start + every time your computer starts up.

+ +

To prevent the privoxy service from automatically starting when your + computer starts up, remove or rename the folder named + /Library/StartupItems/Privoxy.

+ +

A simple application named Privoxy Utility has been created which + enables administrators to easily start and stop the privoxy + service.

+ +

In addition, the Privoxy Utility presents a simple way for + administrators to edit the various privoxy config files. A method to + uninstall the software is also available.

+ +

An administrator username and password must be supplied in order for + the Privoxy Utility to perform any of the tasks.

+
+ +
+

5.7. + AmigaOS

+ +

Start Privoxy (with RUN + <>NIL:) in your startnet script + (AmiTCP), in s:user-startup (RoadShow), as + startup program in your startup script (Genesis), or as startup action + (Miami and MiamiDx). Privoxy will + automatically quit when you quit your TCP/IP stack (just ignore the + harmless warning your TCP/IP stack may display that Privoxy is still running).

+
+ +
+

5.8. + Gentoo

+ +

A script is again used. It will use the file /etc/privoxy/config as its main configuration file.

+ + + + + +
+
+ /etc/init.d/privoxy start
+
+
+
+ +

Note that Privoxy is not + automatically started at boot time by default. You can change this with + the rc-update command.

+ + + + + +
+
+ rc-update add privoxy default
+
+
+
+
+ +
+

5.9. Command + Line Options

+ +

Privoxy may be invoked with the + following command-line options:

+ +
    +
  • +

    --version

    + +

    Print version info and exit. Unix only.

    +
  • + +
  • +

    --help

    + +

    Print short usage info and exit. Unix only.

    +
  • + +
  • +

    --no-daemon

    + +

    Don't become a daemon, i.e. don't fork and become process group + leader, and don't detach from controlling tty. Unix only.

    +
  • + +
  • +

    --pidfile FILE

    + +

    On startup, write the process ID to FILE. Delete the FILE on exit. Failure to create or + delete the FILE is + non-fatal. If no FILE + option is given, no PID file will be used. Unix only.

    +
  • + +
  • +

    --user + USER[.GROUP]

    + +

    After (optionally) writing the PID file, assume the user ID of + USER, and if included the + GID of GROUP. Exit if the privileges are not sufficient to do so. + Unix only.

    +
  • + +
  • +

    --chroot

    + +

    Before changing to the user ID given in the --user option, chroot to that user's + home directory, i.e. make the kernel pretend to the Privoxy process that the directory tree starts + there. If set up carefully, this can limit the impact of possible + vulnerabilities in Privoxy to the + files contained in that hierarchy. Unix only.

    +
  • + +
  • +

    --pre-chroot-nslookup + hostname

    + +

    Specifies a hostname to look up before doing a chroot. On some + systems, initializing the resolver library involves reading config + files from /etc and/or loading additional shared libraries from + /lib. On these systems, doing a hostname lookup before the chroot + reduces the number of files that must be copied into the chroot + tree.

    + +

    For fastest startup speed, a good value is a hostname that is + not in /etc/hosts but that your local name server (listed in + /etc/resolv.conf) can resolve without recursion (that is, without + having to ask any other name servers). The hostname need not exist, + but if it doesn't, an error message (which can be ignored) will be + output.

    +
  • + +
  • +

    configfile

    + +

    If no configfile is + included on the command line, Privoxy will look for a file named + "config" in the current directory + (except on Win32 where it will look for "config.txt" instead). Specify full path to avoid + confusion. If no config file is found, Privoxy will fail to start.

    +
  • +
+ +

On MS Windows only there are two + additional command-line options to allow Privoxy to install and run as a service. See the Window Installation + section for details.

+
+
+ + + + diff --git a/external/privoxy/doc/webserver/user-manual/templates.html b/external/privoxy/doc/webserver/user-manual/templates.html index 7e31c75e..39dac406 100644 --- a/external/privoxy/doc/webserver/user-manual/templates.html +++ b/external/privoxy/doc/webserver/user-manual/templates.html @@ -1,321 +1,172 @@ - -Privoxy's Template Files - -
Privoxy 3.0.12 User Manual
PrevNext

10. Privoxy's Template Files

All Privoxy built-in pages, i.e. error pages such as the - "404 - No Such Domain" - error page, the "BLOCKED" - page - and all pages of its web-based - user interface, are generated from templates. - (Privoxy must be running for the above links to work as - intended.)

These templates are stored in a subdirectory of the configuration - directory called templates. On Unixish platforms, - this is typically - /etc/privoxy/templates/.

The templates are basically normal HTML files, but with place-holders (called symbols - or exports), which Privoxy fills at run time. It - is possible to edit the templates with a normal text editor, should you want - to customize them. (Not recommended for the casual - user). Should you create your own custom templates, you should use - the config setting templdir - to specify an alternate location, so your templates do not get overwritten - during upgrades. -

Note that just like in configuration files, lines starting - with # are ignored when the templates are filled in.

The place-holders are of the form @name@, and you will - find a list of available symbols, which vary from template to template, - in the comments at the start of each file. Note that these comments are not - always accurate, and that it's probably best to look at the existing HTML - code to find out which symbols are supported and what they are filled in with.

A special application of this substitution mechanism is to make whole - blocks of HTML code disappear when a specific symbol is set. We use this - for many purposes, one of them being to include the beta warning in all - our user interface (CGI) pages when Privoxy - is in an alpha or beta development stage:

+ +
<!-- @if-unstable-start -->
+
+
+
+
+  
+
+  Privoxy's Template Files
+  
+  
+  
+  
+  
+  
+  
+  
+
+
+
+  
+
+  
+

10. Privoxy's + Template Files

+ +

All Privoxy built-in pages, i.e. + error pages such as the "404 - No Such Domain" error page, + the "BLOCKED" page and all pages + of its web-based user + interface, are generated from templates. (Privoxy must be running for the above links to work + as intended.)

+ +

These templates are stored in a subdirectory of the configuration directory called templates. On Unixish platforms, this is typically + /etc/privoxy/templates/.

+ +

The templates are basically normal HTML files, but with place-holders + (called symbols or exports), which Privoxy fills at run time. It is possible to edit + the templates with a normal text editor, should you want to customize + them. (Not recommended for the casual + user). Should you create your own custom templates, you should use + the config setting templdir to specify an alternate location, so + your templates do not get overwritten during upgrades.

+ +

Note that just like in configuration files, lines starting with + # are ignored when the templates are filled + in.

+ +

The place-holders are of the form @name@, and + you will find a list of available symbols, which vary from template to + template, in the comments at the start of each file. Note that these + comments are not always accurate, and that it's probably best to look at + the existing HTML code to find out which symbols are supported and what + they are filled in with.

+ +

A special application of this substitution mechanism is to make whole + blocks of HTML code disappear when a specific symbol is set. We use this + for many purposes, one of them being to include the beta warning in all + our user interface (CGI) pages when Privoxy is in an alpha or beta development + stage:

+ + + +
+
+<!-- @if-unstable-start -->
 
   ... beta warning HTML code goes here ...
 
-<!-- if-unstable-end@ -->

If the "unstable" symbol is set, everything in between and including - @if-unstable-start and if-unstable-end@ - will disappear, leaving nothing but an empty comment:

<!--  -->

There's also an if-then-else construct and an #include - mechanism, but you'll sure find out if you are inclined to edit the - templates ;-)

All templates refer to a style located at - http://config.privoxy.org/send-stylesheet. - This is, of course, locally served by Privoxy - and the source for it can be found and edited in the - cgi-style.css template.


PrevHomeNext
Filter Files Contacting the Developers, Bug Reporting and Feature -Requests
\ No newline at end of file +<!-- if-unstable-end@ --> +
+
+ +

If the "unstable" symbol is set, everything in between and including + @if-unstable-start and if-unstable-end@ will disappear, leaving nothing but an + empty comment:

+ + + + + +
+
+<!--  -->
+
+
+ +

There's also an if-then-else construct and an #include mechanism, but you'll sure find out if you are + inclined to edit the templates ;-)

+ +

All templates refer to a style located at http://config.privoxy.org/send-stylesheet. This is, of + course, locally served by Privoxy and + the source for it can be found and edited in the cgi-style.css template.

+
+ + + + diff --git a/external/privoxy/doc/webserver/user-manual/upgradersnote.html b/external/privoxy/doc/webserver/user-manual/upgradersnote.html deleted file mode 100644 index 36be7bc5..00000000 --- a/external/privoxy/doc/webserver/user-manual/upgradersnote.html +++ /dev/null @@ -1,296 +0,0 @@ - -Note to Upgraders
Privoxy 3.0.3 User Manual
PrevNext

3. Note to Upgraders

There are very significant changes from earlier - Junkbuster versions to the current - Privoxy. The number, names, syntax, and - purposes of configuration files have substantially changed. - Junkbuster 2.0.x configuration - files will not migrate, Junkbuster 2.9.x - and Privoxy configurations will need to be - ported. The functionalities of the old blockfile, - cookiefile and imagelist - are now combined into the "actions - files". - default.action, is the main actions file. Local - exceptions should best be put into user.action.

A "filter file" (typically - default.filter) is new as of Privoxy - 2.9.x, and provides some of the new sophistication (explained - below). config is much the same as before.

If upgrading from a 2.0.x version, you will have to use the new config - files, and possibly adapt any personal rules from your older files. - When porting personal rules over from the old blockfile - to the new actions files, please note that even the pattern syntax has - changed. If upgrading from 2.9.x development versions, it is still - recommended to use the new configuration files.

A quick list of things to be aware of before upgrading:

  • The default listening port is now 8118 due to a conflict with another - service (NAS). -

  • - Some installers may remove earlier versions completely. Save any - important configuration files! -

  • Privoxy is controllable with a web browser - at the special URL: http://config.privoxy.org/ - (Shortcut: http://p.p/). Many - aspects of configuration can be done here, including temporarily disabling - Privoxy. -

  • The primary configuration files for cookie management, ad and banner - blocking, and many other aspects of Privoxy - configuration are the actions - files. It is strongly recommended to become familiar with the new - actions concept below, before modifying these files. Locally defined rules - should go into user.action. -

  • - Some installers may not automatically start - Privoxy after installation. -


PrevHomeNext
Installation Quickstart to Using Privoxy
\ No newline at end of file diff --git a/external/privoxy/doc/webserver/user-manual/whatsnew.html b/external/privoxy/doc/webserver/user-manual/whatsnew.html index 5d7c0b25..03730aa4 100644 --- a/external/privoxy/doc/webserver/user-manual/whatsnew.html +++ b/external/privoxy/doc/webserver/user-manual/whatsnew.html @@ -1,351 +1,1060 @@ - -What's New in this Release - -
Privoxy 3.0.12 User Manual
PrevNext

3. What's New in this Release

Privoxy 3.0.12 is mainly a bugfix release:

  • The socket-timeout option now also works on platforms whose - select() implementation modifies the timeout structure. - Previously the timeout was triggered even if the connection - didn't stall. Reported by cyberpatrol. -

  • The Connection: keep-alive code properly deals with files - larger than 2GB. Previously the connection was closed too - early. -

  • The content length for files above 2GB is logged correctly. -

  • The user-manual directive on the show-status page links to - the documentation location specified with the directive, - not to the Privoxy website. -

  • When running in daemon mode, Privoxy doesn't log anything - to the console unless there are errors before the logfile - has been opened. -

  • The show-status page prints warnings about invalid directives - on the same line as the directives themselves. -

  • Fixed several justified (but harmless) compiler warnings, - mostly on 64 bit platforms. -

  • The mingw32 version explicitly requests the default charset - to prevent display problems with some fonts available on more - recent Windows versions. Patch by Burberry. -

  • The mingw32 version uses the Privoxy icon in the alt-tab - windows. Patch by Burberry. -

  • The timestamp and the thread id is omitted in the "Fatal error" - message box on mingw32. -

  • Fixed two related mingw32-only buffer overflows. Triggering - them required control over the configuration file, therefore - this isn't seen as a security issue. -

  • In verbose mode, or if the new option --show-skipped-tests - is used, Privoxy-Regression-Test logs skipped tests and the - skip reason. -

3.1. Note to Upgraders

A quick list of things to be aware of before upgrading from earlier - versions of Privoxy:

  • The recommended way to upgrade Privoxy is to backup your old - configuration files, install the new ones, verify that Privoxy - is working correctly and finally merge back your changes using - diff and maybe patch. -

    There are a number of new features in each Privoxy release and - most of them have to be explicitly enabled in the configuration - files. Old configuration files obviously don't do that and due - to syntax changes using old configuration files with a new - Privoxy isn't always possible anyway. -

  • - Note that some installers remove earlier versions completely, - including configuration files, therefore you should really save - any important configuration files! -

  • - On the other hand, other installers don't overwrite existing configuration - files, thinking you will want to do that yourself. -

  • - standard.action has been merged into - the default.action file. -

  • In the default configuration only fatal errors are logged now. - You can change that in the debug section - of the configuration file. You may also want to enable more verbose - logging until you verified that the new Privoxy version is working - as expected. -

  • Three other config file settings are now off by default: - enable-remote-toggle, - enable-remote-http-toggle, - and enable-edit-actions. - If you use or want these, you will need to explicitly enable them, and - be aware of the security issues involved. -


PrevHomeNext
Installation Quickstart to Using Privoxy
\ No newline at end of file + + + + + + + What's New in this Release + + + + + + + + + + + + + +
+

3. What's New in this + Release

+ +

Privoxy 3.0.19 is a stable release. + The changes since 3.0.18 stable are:

+ +
    +
  • +

    Bug fixes:

    + +
      +
    • +

      Prevent a segmentation fault when de-chunking buffered + content. It could be triggered by malicious web servers if + Privoxy was configured to filter the content and running on a + platform where SIZE_T_MAX isn't larger than UINT_MAX, which + probably includes most 32-bit systems. On those platforms, all + Privoxy versions before 3.0.19 appear to be affected. To be on + the safe side, this bug should be presumed to allow code + execution as proving that it doesn't seems unrealistic.

      +
    • + +
    • +

      Do not expect a response from the SOCKS4/4A server until it + got something to respond to. This regression was introduced in + 3.0.18 and prevented the SOCKS4/4A negotiation from working. + Reported by qqqqqw in #3459781.

      +
    • +
    +
  • + +
  • +

    General improvements:

    + +
      +
    • +

      Fix an off-by-one in an error message about connect + failures.

      +
    • + +
    • +

      Use a GNUMakefile variable for the webserver root directory + and update the path. Sourceforge changed it which broke various + web-related targets.

      +
    • + +
    • +

      Update the CODE_STATUS description.

      +
    • +
    +
  • +
+ +

The following changes were made between 3.0.17 and 3.0.18:

+ +
    +
  • +

    Bug fixes:

    + +
      +
    • +

      If a generated redirect URL contains characters RFC 3986 + doesn't permit, they are (re)encoded. Not doing this makes + Privoxy versions from 3.0.5 to 3.0.17 susceptible to HTTP + response splitting (CWE-113) attacks if the + +fast-redirects{check-decoded-url} action is used.

      +
    • + +
    • +

      Fix a logic bug that could cause Privoxy to reuse a server + socket after it got tainted by a server-header-tagger-induced + block that was triggered before the whole server response had + been read. If keep-alive was enabled and the request following + the blocked one was to the same host and using the same + forwarding settings, Privoxy would send it on the tainted server + socket. While the server would simply treat it as a pipelined + request, Privoxy would later on fail to properly parse the + server's response as it would try to parse the unread data from + the first response as server headers for the second one. + Regression introduced in 3.0.17.

      +
    • + +
    • +

      When implying keep-alive in client_connection(), remember that + the client didn't. Fixes a regression introduced in 3.0.13 that + would cause Privoxy to wait for additional client requests after + receiving a HTTP/1.1 request with "Connection: close" set and + connection sharing enabled. With clients which terminates the + client connection after detecting that the whole body has been + received it doesn't really matter, but with clients that don't + the connection would be kept open until it timed out.

      +
    • + +
    • +

      Fix a subtle race condition between + prepare_csp_for_next_request() and sweep(). A thread preparing + itself for the next client request could briefly appear to be + inactive. If all other threads were already using more recent + files, the thread could get its files swept away under its feet. + So far this has only been reproduced while stress testing in + valgrind while touching action files in a loop. It's unlikely to + have caused any actual problems in the real world.

      +
    • + +
    • +

      Disable filters if SDCH compression is used unless filtering + is forced. If SDCH was combined with a supported compression + algorithm, Privoxy previously could try to decompress it and + ditch the Content-Encoding header even though the SDCH + compression wasn't dealt with. Reported by zebul666 in + #3225863.

      +
    • + +
    • +

      Make a copy of the --user value and only mess with that when + splitting user and group. On some operating systems modifying the + value directly is reflected in the output of ps and friends and + can be misleading. Reported by zepard in #3292710.

      +
    • + +
    • +

      If forwarded-connect-retries is set, only retry if Privoxy is + actually forwarding the request. Previously direct connections + would be retried as well.

      +
    • + +
    • +

      Fixed a small memory leak when retrying connections with IPv6 + support enabled.

      +
    • + +
    • +

      Remove an incorrect assertion in + compile_dynamic_pcrs_job_list() It could be triggered by a pcrs + job with an invalid pcre pattern (for example one that contains a + lone quantifier).

      +
    • + +
    • +

      If the --user argument user[.group] contains a dot, always + bail out if no group has been specified. Previously the intended, + but undocumented (and apparently untested), behaviour was to try + interpreting the whole argument as user name, but the detection + was flawed and checked for '0' instead of '\0', thus merely + preventing group names beginning with a zero.

      +
    • + +
    • +

      In html_code_map[], use a numeric character reference instead + of ' which wasn't standardized before XHTML 1.0.

      +
    • + +
    • +

      Fix an invalid free when compiled with + FEATURE_GRACEFUL_TERMINATION and shut down through + http://config.privoxy.org/die

      +
    • + +
    • +

      In get_actions(), fix the "temporary" backwards compatibility + hack to accept block actions without reason. It also covered + other actions that should be rejected as invalid. Reported by + Billy Crook.

      +
    • +
    +
  • + +
  • +

    General improvements:

    + +
      +
    • +

      Privoxy can (re)compress buffered content before delivering it + to the client. Disabled by default as most users wouldn't benefit + from it.

      +
    • + +
    • +

      The +fast-redirects{check-decoded-url} action checks URL + segments separately. If there are other parameters behind the + redirect URL, this makes it unnecessary to cut them off by + additionally using a +redirect{} pcrs command. Initial patch + submitted by Jamie Zawinski in #3429848.

      +
    • + +
    • +

      When loading action sections, verify that the referenced + filters exist. Currently missing filters only result in an error + message, but eventually the severity will be upgraded to + fatal.

      +
    • + +
    • +

      Allow to bind to multiple separate addresses. Patch set + submitted by Petr Pisar in #3354485.

      +
    • + +
    • +

      Set socket_error to errno if connecting fails in + rfc2553_connect_to(). Previously rejected direct connections + could be incorrectly reported as DNS issues if Privoxy was + compiled with IPv6 support.

      +
    • + +
    • +

      Adjust url_code_map[] so spaces are replaced with %20 instead + of '+' While '+' can be used by client's submitting form data, + this is not actually what Privoxy is using the lookups for. This + is more of a cosmetic issue and doesn't fix any known + problems.

      +
    • + +
    • +

      When compiled without FEATURE_FAST_REDIRECTS, do not silently + ignore +fast-redirect{} directives

      +
    • + +
    • +

      Added a workaround for GNU libc's strptime() reporting + negative year values when the parsed year is only specified with + two digits. On affected systems cookies with such a date would + not be turned into session cookies by the +session-cookies-only + action. Reported by Vaeinoe in #3403560

      +
    • + +
    • +

      Fixed bind failures with certain GNU libc versions if no + non-loopback IP address has been configured on the system. This + is mainly an issue if the system is using DHCP and Privoxy is + started before the network is completely configured. Reported by + Raphael Marichez in #3349356. Additional insight from Petr + Pisar.

      +
    • + +
    • +

      Privoxy log messages now use the ISO 8601 date format + %Y-%m-%d. It's only slightly longer than the old format, but + contains the full date including the year and allows sorting by + date (when grepping in multiple log files) without hassle.

      +
    • + +
    • +

      In get_last_url(), do not bother trying to decode URLs that do + not contain at least one '%' sign. It reduces the log noise and a + number of unnecessary memory allocations.

      +
    • + +
    • +

      In case of SOCKS5 failures, dump the socks response in the log + message.

      +
    • + +
    • +

      Simplify the signal setup in main().

      +
    • + +
    • +

      Streamline socks5_connect() slightly.

      +
    • + +
    • +

      In socks5_connect(), require a complete socks response from + the server. Previously Privoxy didn't care how much data the + server response contained as long as the first two bytes + contained the expected values. While at it, shrink the buffer + size so Privoxy can't read more than a whole socks response.

      +
    • + +
    • +

      In chat(), do not bother to generate a client request in case + of direct CONNECT requests. It will not be used anyway.

      +
    • + +
    • +

      Reduce server_last_modified()'s stack size.

      +
    • + +
    • +

      Shorten get_http_time() by using strftime().

      +
    • + +
    • +

      Constify the known_http_methods pointers in + unknown_method().

      +
    • + +
    • +

      Constify the time_formats pointers in parse_header_time().

      +
    • + +
    • +

      Constify the formerly_valid_actions pointers in + action_used_to_be_valid().

      +
    • + +
    • +

      Introduce a GNUMakefile MAN_PAGE variable that defaults to + privoxy.1. The Debian package uses section 8 for the man page and + this should simplify the patch.

      +
    • + +
    • +

      Deduplicate the INADDR_NONE definition for Solaris by moving + it to jbsockets.h

      +
    • + +
    • +

      In block_url(), ditch the obsolete workaround for ancient + Netscape versions that supposedly couldn't properly deal with + status code 403.

      +
    • + +
    • +

      Remove a useless NULL pointer check in load_trustfile().

      +
    • + +
    • +

      Remove two useless NULL pointer checks in + load_one_re_filterfile().

      +
    • + +
    • +

      Change url_code_map[] from an array of pointers to an array of + arrays It removes an unnecessary layer of indirection and on + 64bit system reduces the size of the binary a bit.

      +
    • + +
    • +

      Fix various typos. Fixes taken from Debian's 29_typos.dpatch + by Roland Rosenfeld.

      +
    • + +
    • +

      Add a dok-tidy GNUMakefile target to clean up the messy HTML + generated by the other dok targets.

      +
    • + +
    • +

      GNUisms in the GNUMakefile have been removed.

      +
    • + +
    • +

      Change the HTTP version in static responses to 1.1

      +
    • + +
    • +

      Synced config.sub and config.guess with upstream + 2011-11-11/386c7218162c145f5f9e1ff7f558a3fbb66c37c5.

      +
    • + +
    • +

      Add a dedicated function to parse the values of toggles. + Reduces duplicated code in load_config() and provides better + error handling. Invalid or missing toggle values are now a fatal + error instead of being silently ignored.

      +
    • + +
    • +

      Terminate HTML lines in static error messages with \n instead + of \r\n.

      +
    • + +
    • +

      Simplify cgi_error_unknown() a bit.

      +
    • + +
    • +

      In LogPutString(), don't bother looking at pszText when not + actually logging anything.

      +
    • + +
    • +

      Change ssplit()'s fourth parameter from int to size_t. Fixes a + clang complaint.

      +
    • + +
    • +

      Add a warning that the statistics currently can't be trusted. + Mention Privoxy-Log-Parser's --statistics option as an + alternative for the time being.

      +
    • + +
    • +

      In rfc2553_connect_to(), start setting cgi->error_message + on error.

      +
    • + +
    • +

      Change the expected status code returned for http://p.p/die + depending on whether or not FEATURE_GRACEFUL_TERMINATION is + available.

      +
    • + +
    • +

      In cgi_die(), mark the client connection for closing. If the + client will fetch the style sheet through another connection it + gets the main thread out of the accept() state and should thus + trigger the actual shutdown.

      +
    • + +
    • +

      Add a proper CGI message for cgi_die().

      +
    • + +
    • +

      Don't enforce a logical line length limit in + read_config_line().

      +
    • + +
    • +

      Slightly refactor server_last_modified() to remove useless + gmtime*() calls.

      +
    • + +
    • +

      In get_content_type(), also recognize '.jpeg' as JPEG + extension.

      +
    • + +
    • +

      Add '.png' to the list of recognized file extensions in + get_content_type().

      +
    • + +
    • +

      In block_url(), consistently use the block reason "Request + blocked by Privoxy" In two places the reason was "Request for + blocked URL" which hides the fact that the request got blocked by + Privoxy and isn't necessarily correct as the block may be due to + tags.

      +
    • + +
    • +

      In listen_loop(), reload the configuration files after + accepting a new connection instead of before. Previously the + first connection that arrived after a configuration change would + still be handled with the old configuration.

      +
    • + +
    • +

      In chat()'s receive-data loop, skip a client socket check if + the socket will be written to right away anyway. This can + increase the transfer speed for unfiltered content on fast + network connections.

      +
    • + +
    • +

      The socket timeout is used for SOCKS negotiations as well + which previously couldn't timeout.

      +
    • + +
    • +

      Don't keep the client connection alive if any configuration + file changed since the time the connection came in. This is + closer to Privoxy's behaviour before keep-alive support for + client connection has been added and also less confusing in + general.

      +
    • + +
    • +

      Treat all Content-Type header values containing the pattern + 'script' as a sign of text. Reported by pribog in #3134970.

      +
    • +
    +
  • + +
  • +

    Action file improvements:

    + +
      +
    • +

      Moved the site-specific block pattern section below the one + for the generic patterns so for requests that are matched in + both, the block reason for the domain is shown which is usually + more useful than showing the one for the generic pattern.

      +
    • + +
    • +

      Remove -prevent-compression from the fragile alias. It's no + longer used anywhere by default and isn't known to break stuff + anyway.

      +
    • + +
    • +

      Add a (disabled) section to block various Facebook tracking + URLs. Reported by Dan Stahlke in #3421764.

      +
    • + +
    • +

      Add a (disabled) section to rewrite and redirect + click-tracking URLs used on news.google.com. Reported by Dan + Stahlke in #3421755.

      +
    • + +
    • +

      Unblock linuxcounter.net/. Reported by Dan Stahlke in + #3422612.

      +
    • + +
    • +

      Block 'www91.intel.com/' which is used by Omniture. Reported + by Adam Piggott in #3167370.

      +
    • + +
    • +

      Disable the handle-as-empty-doc-returns-ok option and mark it + as deprecated. Reminded by tceverling in #2790091.

      +
    • + +
    • +

      Add ".ivwbox.de/" to the "Cross-site user tracking" section. + Reported by Nettozahler in #3172525.

      +
    • + +
    • +

      Unblock and fast-redirect ".awin1.com/.*=http://". Reported by + Adam Piggott in #3170921.

      +
    • + +
    • +

      Block "b.collective-media.net/".

      +
    • + +
    • +

      Widen the Debian popcon exception to "qa.debian.org/popcon". + Seen in Debian's 05_default_action.dpatch by Roland + Rosenfeld.

      +
    • + +
    • +

      Block ".gemius.pl/" which only seems to be used for user + tracking. Reported by johnd16 in #3002731. Additional input from + Lee and movax.

      +
    • + +
    • +

      Disable banners-by-size filters for '.thinkgeek.com/'. The + filter only seems to catch pictures of the inventory.

      +
    • + +
    • +

      Block requests for 'go.idmnet.bbelements.com/please/showit/'. + Reported by kacperdominik in #3372959.

      +
    • + +
    • +

      Unblock adainitiative.org/.

      +
    • + +
    • +

      Add a fast-redirects exception for + '.googleusercontent.com/.*=cache'.

      +
    • + +
    • +

      Add a fast-redirects exception for + webcache.googleusercontent.com/.

      +
    • + +
    • +

      Unblock http://adassier.wordpress.com/ and + http://adassier.files.wordpress.com/.

      +
    • +
    +
  • + +
  • +

    Filter file improvements:

    + +
      +
    • +

      Let the yahoo filter hide '.ads'.

      +
    • + +
    • +

      Let the msn filter hide overlay ads for Facebook 'likes' in + search results and elements with the id 's_notf_div'. They only + seem to be used to advertise site 'enhancements'.

      +
    • + +
    • +

      Let the js-events filter additionally disarm setInterval(). + Suggested by dg1727 in #3423775.

      +
    • +
    +
  • + +
  • +

    Documentation improvements:

    + +
      +
    • +

      Clarify the effect of compiling Privoxy with zlib support. + Suggested by dg1727 in #3423782.

      +
    • + +
    • +

      Point out that the SourceForge messaging system works like a + black hole and should thus not be used to contact individual + developers.

      +
    • + +
    • +

      Mention some of the problems one can experience when not + explicitly configuring an IP addresses as listen address.

      +
    • + +
    • +

      Explicitly mention that hostnames can be used instead of IP + addresses for the listen-address, that only the first address + returned will be used and what happens if the address is invalid. + Requested by Calestyo in #3302213.

      +
    • +
    +
  • + +
  • +

    Log message improvements:

    + +
      +
    • +

      If only the server connection is kept alive, do not pretend to + wait for a new client request.

      +
    • + +
    • +

      Remove a superfluous log message in forget_connection().

      +
    • + +
    • +

      In chat(), properly report missing server responses as such + instead of calling them empty.

      +
    • + +
    • +

      In forwarded_connect(), fix a log message nobody should ever + see.

      +
    • + +
    • +

      Fix a log message in socks5_connect(), a failed write + operation was logged as failed read operation.

      +
    • + +
    • +

      Let load_one_actions_file() properly complain about a missing + '{' at the beginning of the file. Simply stating that a line is + invalid isn't particularly helpful.

      +
    • + +
    • +

      Do not claim to listen on a socket until Privoxy actually + does. Patch submitted by Petr Pisar #3354485

      +
    • + +
    • +

      Prevent a duplicated LOG_LEVEL_CLF message when sending out + the "no-server-data" response.

      +
    • + +
    • +

      Also log the client socket when dropping a connection.

      +
    • + +
    • +

      Include the destination host in the 'Request ... marked for + blocking. limit-connect{...} doesn't allow CONNECT ...' message + Patch submitted by Saperski in #3296250.

      +
    • + +
    • +

      Prevent a duplicated log message if none of the resolved IP + addresses were reachable.

      +
    • + +
    • +

      In connect_to(), do not pretend to retry if + forwarded-connect-retries is zero or unset.

      +
    • + +
    • +

      When a specified user or group can't be found, put the name in + single-quotes when logging it.

      +
    • + +
    • +

      In rfc2553_connect_to(), explain getnameinfo() errors + better.

      +
    • + +
    • +

      Remove a useless log message in chat().

      +
    • + +
    • +

      When retrying to connect, also log the maximum number of + connection attempts.

      +
    • + +
    • +

      Rephrase a log message in compile_dynamic_pcrs_job_list(). + Divide the error code and its meaning with a colon. Call the pcrs + job dynamic and not the filter. Filters may contain dynamic and + non-dynamic pcrs jobs at the same time. Only mention the name of + the filter or tagger, but don't claim it's a filter when it could + be a tagger.

      +
    • + +
    • +

      In a fatal error message in load_one_actions_file(), cover + both URL and TAG patterns.

      +
    • + +
    • +

      In pcrs_strerror(), properly report unknown positive error + code values as such. Previously they were handled like 0 (no + error).

      +
    • + +
    • +

      In compile_dynamic_pcrs_job_list(), also log the actual error + code as pcrs_strerror() doesn't handle all errors reported by + pcre.

      +
    • + +
    • +

      Don't bother trying to continue chatting if the client didn't + ask for it. Reduces log noise a bit.

      +
    • + +
    • +

      Make two fatal error message in load_one_actions_file() more + descriptive.

      +
    • + +
    • +

      In cgi_send_user_manual(), log when rejecting a file name due + to '/' or '..'.

      +
    • + +
    • +

      In load_file(), log a message if opening a file failed. The + CGI error message alone isn't too helpful.

      +
    • + +
    • +

      In connection_destination_matches(), improve two log messages + to help understand why the destinations don't match.

      +
    • + +
    • +

      Rephrase a log message in serve(). Client request arrival + should be differentiated from closed client connections now.

      +
    • + +
    • +

      In serve(), log if a client connection isn't reused due to a + configuration file change.

      +
    • + +
    • +

      Let mark_server_socket_tainted() always mark the server socket + tainted, just don't talk about it in cases where it has no + effect. It doesn't change Privoxy's behaviour, but makes + understanding the log file easier.

      +
    • +
    +
  • + +
  • +

    configure:

    + +
      +
    • +

      Added a --disable-ipv6-support switch for platforms where + support is detected but doesn't actually work.

      +
    • + +
    • +

      Do not check for the existence of strerror() and memmove() + twice

      +
    • + +
    • +

      Remove a useless test for setpgrp(2). Privoxy doesn't need it + and it can cause problems when cross-compiling.

      +
    • + +
    • +

      Rename the --disable-acl-files switch to + --disable-acl-support. Since about 2001, ACL directives are + specified in the standard config file.

      +
    • + +
    • +

      Update the URL of the 'Removing outdated PCRE version after + the next stable release' posting. The old URL stopped working + after one of SF's recent site "optimizations". Reported by Han + Liu.

      +
    • +
    +
  • + +
  • +

    Privoxy-Regression-Test:

    + +
      +
    • +

      Added --shuffle-tests option to increase the chances of + detection race conditions.

      +
    • + +
    • +

      Added a --local-test-file option that allows to use + Privoxy-Regression-Test without Privoxy.

      +
    • + +
    • +

      Added tests for missing socks4 and socks4a forwarders.

      +
    • + +
    • +

      The --privoxy-address option now works with IPv6 addresses + containing brackets, too.

      +
    • + +
    • +

      Perform limited sanity checks for parameters that are supposed + to have numerical values.

      +
    • + +
    • +

      Added a --sleep-time option to specify a number of seconds to + sleep between tests, defaults to 0.

      +
    • + +
    • +

      Disable the range-requests tagger for tests that break if it's + enabled.

      +
    • + +
    • +

      Log messages use the ISO 8601 date format %Y-%m-%d.

      +
    • + +
    • +

      Fix spelling in two error messages.

      +
    • + +
    • +

      In the --help output, include a list of supported tests and + their default levels.

      +
    • + +
    • +

      Adjust the tests to properly deal with FEATURE_TOGGLE being + disabled.

      +
    • +
    +
  • + +
  • +

    Privoxy-Log-Parser:

    + +
      +
    • +

      Perform limited sanity checks for command line parameters that + are supposed to have numerical values.

      +
    • + +
    • +

      Implement a --unbreak-lines-only option to try to revert MUA + breakage.

      +
    • + +
    • +

      Accept and highlight: Added header: Content-Encoding: + deflate

      +
    • + +
    • +

      Accept and highlight: Compressed content from 29258 to 8630 + bytes.

      +
    • + +
    • +

      Accept and highlight: Client request arrived in time on socket + 21.

      +
    • + +
    • +

      Highlight: Didn't receive data in time: a.fsdn.com:443

      +
    • + +
    • +

      Accept log messages with ISO 8601 time stamps, too.

      +
    • +
    +
  • + +
  • +

    uagen:

    + +
      +
    • +

      Bump generated Firefox version to 8.0.

      +
    • + +
    • +

      Only randomize the release date if the new + --randomize-release-date option is enabled. Firefox versions + after 4 use a fixed date string without meaning.

      +
    • +
    +
  • +
+ +
+

3.1. Note + to Upgraders

+ +

A quick list of things to be aware of before upgrading from earlier + versions of Privoxy:

+ +
    +
  • +

    The recommended way to upgrade Privoxy is to backup your old configuration + files, install the new ones, verify that Privoxy is working correctly and finally merge + back your changes using diff and + maybe patch.

    + +

    There are a number of new features in each Privoxy release and most of them have to be + explicitly enabled in the configuration files. Old configuration + files obviously don't do that and due to syntax changes using old + configuration files with a new Privoxy isn't always possible anyway.

    +
  • + +
  • +

    Note that some installers remove earlier versions completely, + including configuration files, therefore you should really save any + important configuration files!

    +
  • + +
  • +

    On the other hand, other installers don't overwrite existing + configuration files, thinking you will want to do that + yourself.

    +
  • + +
  • +

    standard.action has been merged into + the default.action file.

    +
  • + +
  • +

    In the default configuration only fatal errors are logged now. + You can change that in the debug + section of the configuration file. You may also want to enable + more verbose logging until you verified that the new Privoxy version is working as expected.

    +
  • + +
  • +

    Three other config file settings are now off by default: + enable-remote-toggle, + enable-remote-http-toggle, + and enable-edit-actions. If you + use or want these, you will need to explicitly enable them, and be + aware of the security issues involved.

    +
  • +
+
+
+ + + + diff --git a/external/privoxy/encode.c b/external/privoxy/encode.c index d4bb1cec..ad66c099 100644 --- a/external/privoxy/encode.c +++ b/external/privoxy/encode.c @@ -1,4 +1,4 @@ -const char encode_rcs[] = "$Id: encode.c,v 1.14 2008/05/21 15:38:13 fabiankeil Exp $"; +const char encode_rcs[] = "$Id: encode.c,v 1.24 2011/11/06 11:51:57 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/encode.c,v $ @@ -6,14 +6,14 @@ const char encode_rcs[] = "$Id: encode.c,v 1.14 2008/05/21 15:38:13 fabiankeil E * Purpose : Functions to encode and decode URLs, and also to * encode cookies and HTML text. * - * Copyright : Written by and Copyright (C) 2001 the SourceForge + * Copyright : Written by and Copyright (C) 2001 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -31,54 +31,8 @@ const char encode_rcs[] = "$Id: encode.c,v 1.14 2008/05/21 15:38:13 fabiankeil E * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: encode.c,v $ - * Revision 1.14 2008/05/21 15:38:13 fabiankeil - * Garbage-collect cookie_encode(). - * - * Revision 1.13 2007/08/18 14:34:27 fabiankeil - * Make xtoi() extern so it can be used in pcrs.c. - * - * Revision 1.12 2007/08/04 10:15:51 fabiankeil - * Use strlcpy() instead of strcpy(). - * - * Revision 1.11 2006/12/28 18:25:53 fabiankeil - * Fixed gcc43 compiler warning. - * - * Revision 1.10 2006/07/18 14:48:45 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.8 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.7 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.6 2002/03/13 00:27:04 jongfoster - * Killing warnings - * - * Revision 1.5 2002/03/07 03:46:53 oes - * Fixed compiler warnings etc - * - * Revision 1.4 2002/01/22 23:28:07 jongfoster - * Adding convenience function html_encode_and_free_original() - * Making all functions accept NULL paramaters - in this case, they - * simply return NULL. This allows error-checking to be deferred. - * - * Revision 1.3 2001/11/13 00:16:40 jongfoster - * Replacing references to malloc.h with the standard stdlib.h - * (See ANSI or K&R 2nd Ed) - * - * Revision 1.2 2001/05/17 22:52:35 oes - * - Cleaned CRLF's from the sources and related files - * - * Revision 1.1.1.1 2001/05/15 13:58:51 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include "config.h" @@ -93,20 +47,20 @@ const char encode_rcs[] = "$Id: encode.c,v 1.14 2008/05/21 15:38:13 fabiankeil E const char encode_h_rcs[] = ENCODE_H_VERSION; /* Maps special characters in a URL to their equivalent % codes. */ -static const char * const url_code_map[256] = { - NULL, "%01", "%02", "%03", "%04", "%05", "%06", "%07", "%08", "%09", +static const char const url_code_map[256][4] = { + "", "%01", "%02", "%03", "%04", "%05", "%06", "%07", "%08", "%09", "%0A", "%0B", "%0C", "%0D", "%0E", "%0F", "%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17", "%18", "%19", "%1A", "%1B", "%1C", "%1D", - "%1E", "%1F", "+", "%21", "%22", "%23", "%24", "%25", "%26", "%27", - "%28", "%29", NULL, "%2B", "%2C", NULL, NULL, "%2F", NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "%3A", "%3B", - "%3C", "%3D", "%3E", "%3F", NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, "%5B", "%5C", "%5D", "%5E", NULL, "%60", NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, "%7B", "%7C", "%7D", "%7E", "%7F", "%80", "%81", + "%1E", "%1F", "%20", "%21", "%22", "%23", "%24", "%25", "%26", "%27", + "%28", "%29", "", "%2B", "%2C", "", "", "%2F", "", "", + "", "", "", "", "", "", "", "", "%3A", "%3B", + "%3C", "%3D", "%3E", "%3F", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "%5B", "%5C", "%5D", "%5E", "", "%60", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "%7B", "%7C", "%7D", "%7E", "%7F", "%80", "%81", "%82", "%83", "%84", "%85", "%86", "%87", "%88", "%89", "%8A", "%8B", "%8C", "%8D", "%8E", "%8F", "%90", "%91", "%92", "%93", "%94", "%95", "%96", "%97", "%98", "%99", "%9A", "%9B", "%9C", "%9D", "%9E", "%9F", @@ -122,12 +76,12 @@ static const char * const url_code_map[256] = { "%FA", "%FB", "%FC", "%FD", "%FE", "%FF" }; -/* Maps special characters in HTML to their equivalent entites. */ +/* Maps special characters in HTML to their equivalent entities. */ static const char * const html_code_map[256] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL,""",NULL,NULL,NULL,"&",NULL, + NULL, NULL, NULL, NULL,""",NULL,NULL,NULL,"&","'", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "<",NULL,">",NULL,NULL, NULL, NULL, NULL, NULL, NULL, @@ -165,7 +119,7 @@ static const char * const html_code_map[256] = { * Parameters : * 1 : s = String to encode. Null-terminated. * - * Returns : Encoded string, newly allocated on the heap. + * Returns : Encoded string, newly allocated on the heap. * Caller is responsible for freeing it with free(). * If s is NULL, or on out-of memory, returns NULL. * @@ -174,7 +128,7 @@ char * html_encode(const char *s) { char * buf; size_t buf_size; - + if (s == NULL) { return NULL; @@ -224,7 +178,7 @@ char * html_encode(const char *s) * Parameters : * 1 : s = String to encode. Null-terminated. * - * Returns : Encoded string, newly allocated on the heap. + * Returns : Encoded string, newly allocated on the heap. * Caller is responsible for freeing it with free(). * If s is NULL, or on out-of memory, returns NULL. * @@ -232,7 +186,7 @@ char * html_encode(const char *s) char * html_encode_and_free_original(char *s) { char * result; - + if (s == NULL) { return NULL; @@ -253,10 +207,13 @@ char * html_encode_and_free_original(char *s) * query string. Replaces special characters with * the appropriate %xx codes. * + * XXX: url_query_encode() would be a more fitting + * name. + * * Parameters : * 1 : s = String to encode. Null-terminated. * - * Returns : Encoded string, newly allocated on the heap. + * Returns : Encoded string, newly allocated on the heap. * Caller is responsible for freeing it with free(). * If s is NULL, or on out-of memory, returns NULL. * @@ -281,8 +238,8 @@ char * url_encode(const char *s) char * p = buf; while( (c = *s++) != '\0') { - const char * replace_with = url_code_map[(unsigned char) c]; - if (replace_with != NULL) + const char *replace_with = url_code_map[(unsigned char) c]; + if (*replace_with != '\0') { const size_t bytes_written = (size_t)(p - buf); assert(bytes_written < buf_size); @@ -321,7 +278,7 @@ static int xdtoi(const int d) { return(d - '0'); } - else if ((d >= 'a') && (d <= 'f')) + else if ((d >= 'a') && (d <= 'f')) { return(d - 'a' + 10); } @@ -351,12 +308,12 @@ static int xdtoi(const int d) *********************************************************************/ int xtoi(const char *s) { - int d1, d2; + int d1; d1 = xdtoi(*s); if(d1 >= 0) { - d2 = xdtoi(*(s+1)); + int d2 = xdtoi(*(s+1)); if(d2 >= 0) { return (d1 << 4) + d2; @@ -377,7 +334,7 @@ int xtoi(const char *s) * Parameters : * 1 : s = String to decode. Null-terminated. * - * Returns : Decoded string, newly allocated on the heap. + * Returns : Decoded string, newly allocated on the heap. * Caller is responsible for freeing it with free(). * *********************************************************************/ @@ -423,6 +380,83 @@ char *url_decode(const char * s) } +/********************************************************************* + * + * Function : percent_encode_url + * + * Description : Percent-encodes a string so it no longer contains + * any characters that aren't valid in an URL according + * to RFC 3986. + * + * XXX: Do not confuse with encode_url() + * + * Parameters : + * 1 : s = String to encode. Null-terminated. + * + * Returns : Encoded string, newly allocated on the heap. + * Caller is responsible for freeing it with free(). + * If s is NULL, or on out-of memory, returns NULL. + * + *********************************************************************/ +char *percent_encode_url(const char *s) +{ + static const char allowed_characters[128] = { + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '!', '\0', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', + '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', + '\0', '=', '\0', '?', '@', 'A', 'B', 'C', 'D', 'E', + 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', + 'Z', '[', '\0', ']', '\0', '_', '\0', 'a', 'b', 'c', + 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', + 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '\0', '\0', '\0', '~', '\0' + }; + char *buf; + size_t buf_size; + + assert(s != NULL); + + /* Each input char can expand to at most 3 chars. */ + buf_size = (strlen(s) * 3) + 1; + buf = (char *)malloc(buf_size); + + if (buf != NULL) + { + char c; + char *p = buf; + while((c = *s++) != '\0') + { + const unsigned int i = (unsigned char)c; + if (i >= sizeof(allowed_characters) || '\0' == allowed_characters[i]) + { + const char *replace_with = url_code_map[i]; + assert(*replace_with != '\0'); + if (*replace_with != '\0') + { + const size_t bytes_written = (size_t)(p - buf); + assert(bytes_written < buf_size); + p += strlcpy(p, replace_with, buf_size - bytes_written); + } + } + else + { + *p++ = c; + } + } + *p = '\0'; + } + + assert(strlen(buf) < buf_size); + + return(buf); + +} + + /* Local Variables: tab-width: 3 diff --git a/external/privoxy/encode.h b/external/privoxy/encode.h index 728746bb..4d65f6a3 100644 --- a/external/privoxy/encode.h +++ b/external/privoxy/encode.h @@ -1,6 +1,6 @@ #ifndef ENCODE_H_INCLUDED #define ENCODE_H_INCLUDED -#define ENCODE_H_VERSION "$Id: encode.h,v 1.9 2008/05/21 15:38:13 fabiankeil Exp $" +#define ENCODE_H_VERSION "$Id: encode.h,v 1.12 2011/11/06 11:44:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/encode.h,v $ @@ -12,10 +12,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -33,39 +33,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: encode.h,v $ - * Revision 1.9 2008/05/21 15:38:13 fabiankeil - * Garbage-collect cookie_encode(). - * - * Revision 1.8 2007/08/18 14:34:27 fabiankeil - * Make xtoi() extern so it can be used in pcrs.c. - * - * Revision 1.7 2006/07/18 14:48:45 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.5 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.4 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.3 2002/01/22 23:28:07 jongfoster - * Adding convenience function html_encode_and_free_original() - * Making all functions accept NULL paramaters - in this case, they - * simply return NULL. This allows error-checking to be deferred. - * - * Revision 1.2 2001/07/29 18:43:08 jongfoster - * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to - * ANSI C rules. - * - * Revision 1.1.1.1 2001/05/15 13:58:51 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #ifdef __cplusplus extern "C" { @@ -76,6 +45,7 @@ extern char * url_encode(const char *s); extern char * url_decode(const char *str); extern int xtoi(const char *s); extern char * html_encode_and_free_original(char *s); +extern char * percent_encode_url(const char *s); /* Revision control strings from this header and associated .c file */ extern const char encode_rcs[]; diff --git a/external/privoxy/errlog.c b/external/privoxy/errlog.c index ca12d7fc..cfbb4a2b 100644 --- a/external/privoxy/errlog.c +++ b/external/privoxy/errlog.c @@ -1,4 +1,4 @@ -const char errlog_rcs[] = "$Id: errlog.c,v 1.92 2009/03/20 03:39:31 ler762 Exp $"; +const char errlog_rcs[] = "$Id: errlog.c,v 1.112 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/errlog.c,v $ @@ -6,14 +6,14 @@ const char errlog_rcs[] = "$Id: errlog.c,v 1.92 2009/03/20 03:39:31 ler762 Exp $ * Purpose : Log errors to a designated destination in an elegant, * printf-like fashion. * - * Copyright : Written by and Copyright (C) 2001-2009 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2010 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -31,418 +31,14 @@ const char errlog_rcs[] = "$Id: errlog.c,v 1.92 2009/03/20 03:39:31 ler762 Exp $ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: errlog.c,v $ - * Revision 1.92 2009/03/20 03:39:31 ler762 - * I like having the version logged at startup and the Windows GUI stopped logging - * it after LOG_LEVEL_INFO was removed from - * static int debug = (LOG_LEVEL_FATAL | LOG_LEVEL_ERROR | LOG_LEVEL_INFO); - * - * Revision 1.91 2009/03/18 21:56:30 fabiankeil - * In init_error_log(), suppress the "(Re-)Opening logfile" message if - * we're still logging to stderr. This restores the "silent mode", but - * with LOG_LEVEL_INFO enabled, the show_version() info is written to - * the logfile as intended. - * - * Revision 1.90 2009/03/18 20:43:19 fabiankeil - * Don't enable LOG_LEVEL_INFO by default and don't apply the user's - * debug settings until the logfile has been opened (if there is one). - * Patch submitted by Roland in #2624120. - * - * Revision 1.89 2009/03/07 12:56:12 fabiankeil - * Add log_error() support for unsigned long long (%lld). - * - * Revision 1.88 2009/03/07 11:34:36 fabiankeil - * Omit timestamp and thread id in the mingw32 message box. - * - * Revision 1.87 2009/03/01 18:28:24 fabiankeil - * Help clang understand that we aren't dereferencing - * NULL pointers here. - * - * Revision 1.86 2009/02/09 21:21:15 fabiankeil - * Now that init_log_module() is called earlier, call show_version() - * later on from main() directly so it doesn't get called for --help - * or --version. - * - * Revision 1.85 2009/02/06 17:51:38 fabiankeil - * Be prepared if I break the log module initialization again. - * - * Revision 1.84 2008/12/14 15:46:22 fabiankeil - * Give crunched requests their own log level. - * - * Revision 1.83 2008/12/04 18:14:32 fabiankeil - * Fix some cparser warnings. - * - * Revision 1.82 2008/11/23 16:06:58 fabiankeil - * Update a log message I missed in 1.80. - * - * Revision 1.81 2008/11/23 15:59:27 fabiankeil - * - Update copyright range. - * - Remove stray line breaks in a log message - * nobody is supposed to see anyway. - * - * Revision 1.80 2008/11/23 15:49:49 fabiankeil - * In log_error(), don't surround the thread id with "Privoxy(" and ")". - * - * Revision 1.79 2008/10/20 17:09:25 fabiankeil - * Update init_error_log() description to match reality. - * - * Revision 1.78 2008/09/07 16:59:31 fabiankeil - * Update a comment to reflect that we - * have mutex support on mingw32 now. - * - * Revision 1.77 2008/09/07 12:43:44 fabiankeil - * Move the LogPutString() call in log_error() into the locked - * region so the Windows GUI log is consistent with the logfile. - * - * Revision 1.76 2008/09/07 12:35:05 fabiankeil - * Add mutex lock support for _WIN32. - * - * Revision 1.75 2008/09/04 08:13:58 fabiankeil - * Prepare for critical sections on Windows by adding a - * layer of indirection before the pthread mutex functions. - * - * Revision 1.74 2008/08/06 18:33:36 fabiankeil - * If the "close fd first" workaround doesn't work, - * the fatal error message will be lost, so we better - * explain the consequences while we still can. - * - * Revision 1.73 2008/08/04 19:06:55 fabiankeil - * Add a lame workaround for the "can't open an already open - * logfile on OS/2" problem reported by Maynard in #2028842 - * and describe what a real solution would look like. - * - * Revision 1.72 2008/07/27 12:04:28 fabiankeil - * Fix a comment typo. - * - * Revision 1.71 2008/06/28 17:17:15 fabiankeil - * Remove another stray semicolon. - * - * Revision 1.70 2008/06/28 17:10:29 fabiankeil - * Remove stray semicolon in get_log_timestamp(). - * Reported by Jochen Voss in #2005221. - * - * Revision 1.69 2008/05/30 15:55:25 fabiankeil - * Declare variable "debug" static and complain about its name. - * - * Revision 1.68 2008/04/27 16:50:46 fabiankeil - * Remove an incorrect assertion. The value of debug may change if - * the configuration is reloaded in another thread. While we could - * cache the initial value, the assertion doesn't seem worth it. - * - * Revision 1.67 2008/03/27 18:27:23 fabiankeil - * Remove kill-popups action. - * - * Revision 1.66 2008/01/31 15:38:14 fabiankeil - * - Make the logfp assertion more strict. As of 1.63, the "||" could - * have been an "&&", which means we can use two separate assertions - * and skip on of them on Windows. - * - Break a long commit message line in two. - * - * Revision 1.65 2008/01/31 14:44:33 fabiankeil - * Use (a != b) instead of !(a == b) so the sanity check looks less insane. - * - * Revision 1.64 2008/01/21 18:56:46 david__schmidt - * Swap #def from negative to positive, re-joined it so it didn't - * span an assertion (compilation failure on OS/2) - * - * Revision 1.63 2007/12/15 19:49:32 fabiankeil - * Stop overloading logfile to control the mingw32 log window as well. - * It's no longer necessary now that we disable all debug lines by default - * and at least one user perceived it as a regression (added in 1.55). - * - * Revision 1.62 2007/11/30 15:33:46 fabiankeil - * Unbreak LOG_LEVEL_FATAL. It wasn't fatal with logging disabled - * and on mingw32 fatal log messages didn't end up in the log file. - * - * Revision 1.61 2007/11/04 19:03:01 fabiankeil - * Fix another deadlock Hal spotted and that mysteriously didn't affect FreeBSD. - * - * Revision 1.60 2007/11/03 19:03:31 fabiankeil - * - Prevent the Windows GUI from showing the version two times in a row. - * - Stop using the imperative in the "(Re-)Open logfile" message. - * - Ditch the "Switching to daemon mode" message as the detection - * whether or not we're already in daemon mode doesn't actually work. - * - * Revision 1.59 2007/11/01 12:50:56 fabiankeil - * Here's looking at you, deadlock. - * - * Revision 1.58 2007/10/28 19:04:21 fabiankeil - * Don't mention daemon mode in "Logging disabled" message. Some - * platforms call it differently and it's not really relevant anyway. - * - * Revision 1.57 2007/10/27 13:02:26 fabiankeil - * Relocate daemon-mode-related log messages to make sure - * they aren't shown again in case of configuration reloads. - * - * Revision 1.56 2007/10/14 14:26:56 fabiankeil - * Remove the old log_error() version. - * - * Revision 1.55 2007/10/14 14:12:41 fabiankeil - * When in daemon mode, close stderr after the configuration file has been - * parsed the first time. If logfile isn't set, stop logging. Fixes BR#897436. - * - * Revision 1.54 2007/09/22 16:15:34 fabiankeil - * - Let it compile with pcc. - * - Move our includes below system includes to prevent macro conflicts. - * - * Revision 1.53 2007/08/05 13:53:14 fabiankeil - * #1763173 from Stefan Huehner: declare some more functions - * static and use void instead of empty parameter lists. - * - * Revision 1.52 2007/07/14 07:28:47 fabiankeil - * Add translation function for JB_ERR_FOO codes. - * - * Revision 1.51 2007/05/11 11:51:34 fabiankeil - * Fix a type mismatch warning. - * - * Revision 1.50 2007/04/11 10:55:44 fabiankeil - * Enforce some assertions that could be triggered - * on mingw32 and other systems where we use threads - * but no locks. - * - * Revision 1.49 2007/04/08 16:44:15 fabiankeil - * We need for gettimeofday(), not . - * - * Revision 1.48 2007/03/31 13:33:28 fabiankeil - * Add alternative log_error() with timestamps - * that contain milliseconds and without using - * strcpy(), strcat() or sprintf(). - * - * Revision 1.47 2006/11/28 15:25:15 fabiankeil - * Only unlink the pidfile if it's actually used. - * - * Revision 1.46 2006/11/13 19:05:51 fabiankeil - * Make pthread mutex locking more generic. Instead of - * checking for OSX and OpenBSD, check for FEATURE_PTHREAD - * and use mutex locking unless there is an _r function - * available. Better safe than sorry. - * - * Fixes "./configure --disable-pthread" and should result - * in less threading-related problems on pthread-using platforms, - * but it still doesn't fix BR#1122404. - * - * Revision 1.45 2006/08/21 11:15:54 david__schmidt - * MS Visual C++ build updates - * - * Revision 1.44 2006/08/18 16:03:16 david__schmidt - * Tweak for OS/2 build happiness. - * - * Revision 1.43 2006/08/03 02:46:41 david__schmidt - * Incorporate Fabian Keil's patch work: - * http://www.fabiankeil.de/sourcecode/privoxy/ - * - * Revision 1.42 2006/07/18 14:48:46 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.40.2.4 2005/04/03 20:10:50 david__schmidt - * Thanks to Jindrich Makovicka for a race condition fix for the log - * file. The race condition remains for non-pthread implementations. - * Reference patch #1175720. - * - * Revision 1.40.2.3 2003/03/07 03:41:04 david__schmidt - * Wrapping all *_r functions (the non-_r versions of them) with mutex - * semaphores for OSX. Hopefully this will take care of all of those pesky - * crash reports. - * - * Revision 1.40.2.2 2002/09/28 00:30:57 david__schmidt - * Update error logging to give sane values for thread IDs on Mach kernels. - * It's still a hack, but at least it looks farily normal. We print the - * absolute value of the first 4 bytes of the pthread_t modded with 1000. - * - * Revision 1.40.2.1 2002/09/25 12:47:42 oes - * Make log_error safe against NULL string arguments - * - * Revision 1.40 2002/05/22 01:27:27 david__schmidt - * - * Add os2_socket_strerr mirroring w32_socket_strerr. - * - * Revision 1.39 2002/04/03 17:15:27 gliptak - * zero padding thread ids in log - * - * Revision 1.38 2002/03/31 17:18:59 jongfoster - * Win32 only: Enabling STRICT to fix a VC++ compile warning. - * - * Revision 1.37 2002/03/27 14:32:43 david__schmidt - * More compiler warning message maintenance - * - * Revision 1.36 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.35 2002/03/24 15:23:33 jongfoster - * Name changes - * - * Revision 1.34 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.33 2002/03/13 00:27:04 jongfoster - * Killing warnings - * - * Revision 1.32 2002/03/07 03:46:17 oes - * Fixed compiler warnings - * - * Revision 1.31 2002/03/06 23:02:57 jongfoster - * Removing tabs - * - * Revision 1.30 2002/03/05 22:43:45 david__schmidt - * - Better error reporting on OS/2 - * - Fix double-slash comment (oops) - * - * Revision 1.29 2002/03/04 23:45:13 jongfoster - * Printing thread ID if using Win32 native threads - * - * Revision 1.28 2002/03/04 17:59:59 oes - * Deleted deletePidFile(), cosmetics - * - * Revision 1.27 2002/03/04 02:08:01 david__schmidt - * Enable web editing of actions file on OS/2 (it had been broken all this time!) - * - * Revision 1.26 2002/01/09 19:05:45 steudten - * Fix big memory leak. - * - * Revision 1.25 2002/01/09 14:32:08 oes - * Added support for gmtime_r and localtime_r. - * - * Revision 1.24 2001/12/30 14:07:32 steudten - * - Add signal handling (unix) - * - Add SIGHUP handler (unix) - * - Add creation of pidfile (unix) - * - Add action 'top' in rc file (RH) - * - Add entry 'SIGNALS' to manpage - * - Add exit message to logfile (unix) - * - * Revision 1.23 2001/11/07 00:02:13 steudten - * Add line number in error output for lineparsing for - * actionsfile and configfile. - * Special handling for CLF added. - * - * Revision 1.22 2001/11/05 23:43:05 steudten - * Add time+date to log files. - * - * Revision 1.21 2001/10/25 03:40:47 david__schmidt - * Change in porting tactics: OS/2's EMX porting layer doesn't allow multiple - * threads to call select() simultaneously. So, it's time to do a real, live, - * native OS/2 port. See defines for __EMX__ (the porting layer) vs. __OS2__ - * (native). Both versions will work, but using __OS2__ offers multi-threading. - * - * Revision 1.20 2001/09/16 23:04:34 jongfoster - * Fixing a warning - * - * Revision 1.19 2001/09/13 20:08:06 jongfoster - * Adding support for LOG_LEVEL_CGI - * - * Revision 1.18 2001/09/10 11:27:24 oes - * Declaration of w32_socket_strerr now conditional - * - * Revision 1.17 2001/09/10 10:17:13 oes - * Removed unused variable; Fixed sprintf format - * - * Revision 1.16 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.15 2001/07/29 17:41:10 jongfoster - * Now prints thread ID for each message (pthreads only) - * - * Revision 1.14 2001/07/19 19:03:48 haroon - * - Added case for LOG_LEVEL_POPUPS - * - * Revision 1.13 2001/07/13 13:58:58 oes - * - Added case for LOG_LEVEL_DEANIMATE - * - Removed all #ifdef PCRS - * - * Revision 1.12 2001/06/09 10:55:28 jongfoster - * Changing BUFSIZ ==> BUFFER_SIZE - * - * Revision 1.11 2001/06/01 18:14:49 jongfoster - * Changing the calls to strerr() to check HAVE_STRERR (which is defined - * in config.h if appropriate) rather than the NO_STRERR macro. - * - * Revision 1.10 2001/05/29 11:52:21 oes - * Conditional compilation of w32_socket_error - * - * Revision 1.9 2001/05/28 16:15:17 jongfoster - * Improved reporting of errors under Win32. - * - * Revision 1.8 2001/05/26 17:25:14 jongfoster - * Added support for CLF (Common Log Format) and fixed LOG_LEVEL_LOG - * - * Revision 1.7 2001/05/26 15:21:28 jongfoster - * Activity animation in Win32 GUI now works even if debug==0 - * - * Revision 1.6 2001/05/25 21:55:08 jongfoster - * Now cleans up properly on FATAL (removes taskbar icon etc) - * - * Revision 1.5 2001/05/22 18:46:04 oes - * - * - Enabled filtering banners by size rather than URL - * by adding patterns that replace all standard banner - * sizes with the "Junkbuster" gif to the re_filterfile - * - * - Enabled filtering WebBugs by providing a pattern - * which kills all 1x1 images - * - * - Added support for PCRE_UNGREEDY behaviour to pcrs, - * which is selected by the (nonstandard and therefore - * capital) letter 'U' in the option string. - * It causes the quantifiers to be ungreedy by default. - * Appending a ? turns back to greedy (!). - * - * - Added a new interceptor ijb-send-banner, which - * sends back the "Junkbuster" gif. Without imagelist or - * MSIE detection support, or if tinygif = 1, or the - * URL isn't recognized as an imageurl, a lame HTML - * explanation is sent instead. - * - * - Added new feature, which permits blocking remote - * script redirects and firing back a local redirect - * to the browser. - * The feature is conditionally compiled, i.e. it - * can be disabled with --disable-fast-redirects, - * plus it must be activated by a "fast-redirects" - * line in the config file, has its own log level - * and of course wants to be displayed by show-proxy-args - * Note: Boy, all the #ifdefs in 1001 locations and - * all the fumbling with configure.in and acconfig.h - * were *way* more work than the feature itself :-( - * - * - Because a generic redirect template was needed for - * this, tinygif = 3 now uses the same. - * - * - Moved GIFs, and other static HTTP response templates - * to project.h - * - * - Some minor fixes - * - * - Removed some >400 CRs again (Jon, you really worked - * a lot! ;-) - * - * Revision 1.4 2001/05/21 19:32:54 jongfoster - * Added another #ifdef _WIN_CONSOLE - * - * Revision 1.3 2001/05/20 01:11:40 jongfoster - * Added support for LOG_LEVEL_FATAL - * Renamed LOG_LEVEL_FRC to LOG_LEVEL_FORCE, - * and LOG_LEVEL_REF to LOG_LEVEL_RE_FILTER - * - * Revision 1.2 2001/05/17 22:42:01 oes - * - Cleaned CRLF's from the sources and related files - * - Repaired logging for REF and FRC - * - * Revision 1.1.1.1 2001/05/15 13:58:51 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include #include #include #include +#include #include "config.h" #include "miscutil.h" @@ -525,9 +121,9 @@ static inline void unlock_loginit(void) #else /* ! MUTEX_LOCKS_AVAILABLE */ /* * FIXME we need a cross-platform locking mechanism. - * The locking/unlocking functions below should be + * The locking/unlocking functions below should be * fleshed out for non-pthread implementations. - */ + */ static inline void lock_logfile() {} static inline void unlock_logfile() {} static inline void lock_loginit() {} @@ -538,7 +134,7 @@ static inline void unlock_loginit() {} * * Function : fatal_error * - * Description : Displays a fatal error to standard error (or, on + * Description : Displays a fatal error to standard error (or, on * a WIN32 GUI, to a dialog box), and exits Privoxy * with status code 1. * @@ -558,8 +154,8 @@ static void fatal_error(const char *error_message) /* Shouldn't happen but ... */ box_message = error_message; } - MessageBox(g_hwndLogFrame, box_message, "Privoxy Error", - MB_OK | MB_ICONERROR | MB_TASKMODAL | MB_SETFOREGROUND | MB_TOPMOST); + MessageBox(g_hwndLogFrame, box_message, "Privoxy Error", + MB_OK | MB_ICONERROR | MB_TASKMODAL | MB_SETFOREGROUND | MB_TOPMOST); /* Cleanup - remove taskbar icon etc. */ TermLogWindow(); @@ -636,7 +232,7 @@ void init_log_module(void) * XXX: we should only use the LOG_LEVEL_MINIMUM * until the first time the configuration file has * been parsed. - * + * * Parameters : 1: debug_level = The debug level to set. * * Returns : Nothing. @@ -653,7 +249,7 @@ void set_debug_level(int debug_level) * Function : disable_logging * * Description : Disables logging. - * + * * Parameters : None. * * Returns : Nothing. @@ -721,7 +317,7 @@ void init_error_log(const char *prog_name, const char *logfname) * Currently we reopen it every time the config file * has been reloaded, but actually we only have to * reopen it if the file name changed or if the - * configuration reloas was caused by a SIGHUP. + * configuration reload was caused by a SIGHUP. */ log_error(LOG_LEVEL_INFO, "Failed to reopen logfile: \'%s\'. " "Retrying after closing the old file descriptor first. If that " @@ -747,6 +343,21 @@ void init_error_log(const char *prog_name, const char *logfname) { fclose(logfp); } +#ifdef unix + if (daemon_mode && (logfp == stderr)) + { + if (dup2(1, 2) == -1) + { + /* + * We only use fatal_error() to clear the pid + * file and to exit. Given that stderr has just + * been closed, the user will not see the error + * message. + */ + fatal_error("Failed to reserve fd 2."); + } + } +#endif logfp = fp; unlock_logfile(); @@ -764,7 +375,7 @@ void init_error_log(const char *prog_name, const char *logfname) * Description : Returns a number that is different for each thread. * * XXX: Should be moved elsewhere (miscutil.c?) - * + * * Parameters : None * * Returns : thread_id @@ -819,7 +430,7 @@ static long get_thread_id(void) static inline size_t get_log_timestamp(char *buffer, size_t buffer_size) { size_t length; - time_t now; + time_t now; struct tm tm_now; struct timeval tv_now; /* XXX: stupid name */ long msecs; @@ -827,23 +438,22 @@ static inline size_t get_log_timestamp(char *buffer, size_t buffer_size) gettimeofday(&tv_now, NULL); msecs = tv_now.tv_usec / 1000; - - time(&now); + now = tv_now.tv_sec; #ifdef HAVE_LOCALTIME_R tm_now = *localtime_r(&now, &tm_now); -#elif FEATURE_PTHREAD +#elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&localtime_mutex); - tm_now = *localtime(&now); + tm_now = *localtime(&now); privoxy_mutex_unlock(&localtime_mutex); #else - tm_now = *localtime(&now); + tm_now = *localtime(&now); #endif - length = strftime(buffer, buffer_size, "%b %d %H:%M:%S", &tm_now); + length = strftime(buffer, buffer_size, "%Y-%m-%d %H:%M:%S", &tm_now); if (length > (size_t)0) { - msecs_length = snprintf(buffer+length, buffer_size - length, ".%.3ld", msecs); + msecs_length = snprintf(buffer+length, buffer_size - length, ".%.3ld", msecs); } if (msecs_length > 0) { @@ -878,7 +488,7 @@ static inline size_t get_clf_timestamp(char *buffer, size_t buffer_size) * the %z field in strftime() */ time_t now; - struct tm *tm_now; + struct tm *tm_now; struct tm gmt; #ifdef HAVE_LOCALTIME_R struct tm dummy; @@ -887,10 +497,10 @@ static inline size_t get_clf_timestamp(char *buffer, size_t buffer_size) size_t length; int tz_length = 0; - time (&now); + time (&now); #ifdef HAVE_GMTIME_R gmt = *gmtime_r(&now, &gmt); -#elif FEATURE_PTHREAD +#elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&gmtime_mutex); gmt = *gmtime(&now); privoxy_mutex_unlock(&gmtime_mutex); @@ -899,16 +509,16 @@ static inline size_t get_clf_timestamp(char *buffer, size_t buffer_size) #endif #ifdef HAVE_LOCALTIME_R tm_now = localtime_r(&now, &dummy); -#elif FEATURE_PTHREAD +#elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&localtime_mutex); - tm_now = localtime(&now); + tm_now = localtime(&now); privoxy_mutex_unlock(&localtime_mutex); #else - tm_now = localtime(&now); + tm_now = localtime(&now); #endif - days = tm_now->tm_yday - gmt.tm_yday; - hrs = ((days < -1 ? 24 : 1 < days ? -24 : days * 24) + tm_now->tm_hour - gmt.tm_hour); - mins = hrs * 60 + tm_now->tm_min - gmt.tm_min; + days = tm_now->tm_yday - gmt.tm_yday; + hrs = ((days < -1 ? 24 : 1 < days ? -24 : days * 24) + tm_now->tm_hour - gmt.tm_hour); + mins = hrs * 60 + tm_now->tm_min - gmt.tm_min; length = strftime(buffer, buffer_size, "%d/%b/%Y:%H:%M:%S ", tm_now); @@ -936,7 +546,7 @@ static inline size_t get_clf_timestamp(char *buffer, size_t buffer_size) * * Description : Translates a numerical loglevel into a string. * - * Parameters : + * Parameters : * 1 : loglevel = LOG_LEVEL_FOO * * Returns : Log level string. @@ -962,9 +572,12 @@ static inline const char *get_log_level_string(int loglevel) case LOG_LEVEL_CONNECT: log_level_string = "Connect"; break; - case LOG_LEVEL_LOG: + case LOG_LEVEL_WRITING: log_level_string = "Writing"; break; + case LOG_LEVEL_RECEIVED: + log_level_string = "Received"; + break; case LOG_LEVEL_HEADER: log_level_string = "Header"; break; @@ -979,11 +592,9 @@ static inline const char *get_log_level_string(int loglevel) log_level_string = "Force"; break; #endif /* def FEATURE_FORCE_LOAD */ -#ifdef FEATURE_FAST_REDIRECTS case LOG_LEVEL_REDIRECTS: log_level_string = "Redirect"; break; -#endif /* def FEATURE_FAST_REDIRECTS */ case LOG_LEVEL_DEANIMATE: log_level_string = "Gif-Deanimate"; break; @@ -1071,7 +682,7 @@ void log_error(int loglevel, const char *fmt, ...) /* protect the whole function because of the static buffer (outbuf) */ lock_logfile(); - if (NULL == outbuf_save) + if (NULL == outbuf_save) { outbuf_save = (char*)zalloc(log_buffer_size + 1); /* +1 for paranoia */ if (NULL == outbuf_save) @@ -1156,7 +767,7 @@ void log_error(int loglevel, const char *fmt, ...) { unsigned long long lluval = va_arg(ap, unsigned long long); snprintf(tempbuf, sizeof(tempbuf), "%llu", lluval); - ch = *src++; + src++; } else { @@ -1181,45 +792,36 @@ void log_error(int loglevel, const char *fmt, ...) break; case 'N': /* - * Non-standard: Print a counted unterminated string. + * Non-standard: Print a counted unterminated string, + * replacing unprintable bytes with their hex value. * Takes 2 parameters: int length, const char * string. */ ival = va_arg(ap, int); + assert(ival >= 0); sval = va_arg(ap, char *); - if (sval == NULL) + assert(sval != NULL); + + while ((ival-- > 0) && (length < log_buffer_size - 6)) { - format_string = "[null]"; - } - else if (ival <= 0) - { - if (0 == ival) + if (isprint((int)*sval) && (*sval != '\\')) { - /* That's ok (but stupid) */ - tempbuf[0] = '\0'; + outbuf[length++] = *sval; + outbuf[length] = '\0'; } else { - /* - * That's not ok (and even more stupid) - */ - assert(ival >= 0); - format_string = "[counted string lenght < 0]"; + int ret = snprintf(outbuf + length, + log_buffer_size - length - 2, "\\x%.2x", (unsigned char)*sval); + assert(ret == 4); + length += 4; } + sval++; } - else if ((size_t)ival >= sizeof(tempbuf)) - { - /* - * String is too long, copy as much as possible. - * It will be further truncated later. - */ - memcpy(tempbuf, sval, sizeof(tempbuf)-1); - tempbuf[sizeof(tempbuf)-1] = '\0'; - } - else - { - memcpy(tempbuf, sval, (size_t) ival); - tempbuf[ival] = '\0'; - } + /* + * XXX: In case of printable characters at the end of + * the %N string, we're not using the whole buffer. + */ + format_string = (length < log_buffer_size - 6) ? "" : "[too long]"; break; case 'E': /* Non-standard: Print error code from errno */ @@ -1238,7 +840,7 @@ void log_error(int loglevel, const char *fmt, ...) format_string = strerror(ival); } #else /* ifndef _WIN32 */ - ival = errno; + ival = errno; #ifdef HAVE_STRERROR format_string = strerror(ival); #else /* ifndef HAVE_STRERROR */ @@ -1258,14 +860,14 @@ void log_error(int loglevel, const char *fmt, ...) snprintf(tempbuf, sizeof(tempbuf), "Bad format string: \"%s\"", fmt); loglevel = LOG_LEVEL_FATAL; break; - } /* switch( p ) */ + } assert(length < log_buffer_size); length += strlcpy(outbuf + length, format_string, log_buffer_size - length); if (length >= log_buffer_size-2) { - static char warning[] = "... [too long, truncated]"; + static const char warning[] = "... [too long, truncated]"; length = log_buffer_size - sizeof(warning) - 1; length += strlcpy(outbuf + length, warning, log_buffer_size - length); @@ -1273,7 +875,7 @@ void log_error(int loglevel, const char *fmt, ...) break; } - } /* for( p ... ) */ + } /* done with var. args */ va_end(ap); @@ -1343,14 +945,14 @@ void log_error(int loglevel, const char *fmt, ...) * visible to all files that include errlog.h. * * Parameters : - * 1 : error = a valid jb_err code + * 1 : jb_error = a valid jb_err code * * Returns : A string with the jb_err translation * *********************************************************************/ -const char *jb_err_to_string(int error) +const char *jb_err_to_string(int jb_error) { - switch (error) + switch (jb_error) { case JB_ERR_OK: return "Success, no error"; diff --git a/external/privoxy/errlog.h b/external/privoxy/errlog.h index 49063319..41150cfa 100644 --- a/external/privoxy/errlog.h +++ b/external/privoxy/errlog.h @@ -1,6 +1,6 @@ #ifndef ERRLOG_H_INCLUDED #define ERRLOG_H_INCLUDED -#define ERRLOG_H_VERSION "$Id: errlog.h,v 1.22 2009/02/09 21:21:15 fabiankeil Exp $" +#define ERRLOG_H_VERSION "$Id: errlog.h,v 1.27 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/errlog.h,v $ @@ -12,10 +12,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -33,134 +33,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: errlog.h,v $ - * Revision 1.22 2009/02/09 21:21:15 fabiankeil - * Now that init_log_module() is called earlier, call show_version() - * later on from main() directly so it doesn't get called for --help - * or --version. - * - * Revision 1.21 2008/12/14 15:46:22 fabiankeil - * Give crunched requests their own log level. - * - * Revision 1.20 2008/03/27 18:27:23 fabiankeil - * Remove kill-popups action. - * - * Revision 1.19 2007/10/14 14:12:41 fabiankeil - * When in daemon mode, close stderr after the configuration file has been - * parsed the first time. If logfile isn't set, stop logging. Fixes BR#897436. - * - * Revision 1.18 2007/07/14 07:28:47 fabiankeil - * Add translation function for JB_ERR_FOO codes. - * - * Revision 1.17 2007/03/31 13:33:28 fabiankeil - * Add alternative log_error() with timestamps - * that contain milliseconds and without using - * strcpy(), strcat() or sprintf(). - * - * Revision 1.16 2006/11/28 15:29:50 fabiankeil - * Define LOG_LEVEL_REDIRECTS independently of - * FEATURE_FAST_REDIRECTS. It is used by redirect{} - * as well. - * - * Revision 1.15 2006/07/18 14:48:46 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.13.2.1 2002/08/05 17:57:06 oes - * Cosmetic change - * - * Revision 1.13 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.12 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.11 2002/03/06 23:02:57 jongfoster - * Removing tabs - * - * Revision 1.10 2001/09/13 20:08:06 jongfoster - * Adding support for LOG_LEVEL_CGI - * - * Revision 1.9 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.8 2001/07/29 18:43:08 jongfoster - * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to - * ANSI C rules. - * - * Revision 1.7 2001/07/19 19:02:53 haroon - * Added define for LOG_LEVEL_POPUPS - * - * Revision 1.6 2001/07/13 13:59:22 oes - * - Added LOG_LEVEL_DEANIMATE - * - Changed LOG_LEVEL_CLF - * - Removed all #ifdef PCRS - * - * Revision 1.5 2001/05/26 17:25:14 jongfoster - * Added support for CLF (Common Log Format) and fixed LOG_LEVEL_LOG - * - * Revision 1.4 2001/05/25 21:56:06 jongfoster - * Added FIXME comment to (broken) LOG_LEVEL_LOG - * - * Revision 1.3 2001/05/22 18:46:04 oes - * - * - Enabled filtering banners by size rather than URL - * by adding patterns that replace all standard banner - * sizes with the "Junkbuster" gif to the re_filterfile - * - * - Enabled filtering WebBugs by providing a pattern - * which kills all 1x1 images - * - * - Added support for PCRE_UNGREEDY behaviour to pcrs, - * which is selected by the (nonstandard and therefore - * capital) letter 'U' in the option string. - * It causes the quantifiers to be ungreedy by default. - * Appending a ? turns back to greedy (!). - * - * - Added a new interceptor ijb-send-banner, which - * sends back the "Junkbuster" gif. Without imagelist or - * MSIE detection support, or if tinygif = 1, or the - * URL isn't recognized as an imageurl, a lame HTML - * explanation is sent instead. - * - * - Added new feature, which permits blocking remote - * script redirects and firing back a local redirect - * to the browser. - * The feature is conditionally compiled, i.e. it - * can be disabled with --disable-fast-redirects, - * plus it must be activated by a "fast-redirects" - * line in the config file, has its own log level - * and of course wants to be displayed by show-proxy-args - * Note: Boy, all the #ifdefs in 1001 locations and - * all the fumbling with configure.in and acconfig.h - * were *way* more work than the feature itself :-( - * - * - Because a generic redirect template was needed for - * this, tinygif = 3 now uses the same. - * - * - Moved GIFs, and other static HTTP response templates - * to project.h - * - * - Some minor fixes - * - * - Removed some >400 CRs again (Jon, you really worked - * a lot! ;-) - * - * Revision 1.2 2001/05/20 01:11:40 jongfoster - * Added support for LOG_LEVEL_FATAL - * Renamed LOG_LEVEL_FRC to LOG_LEVEL_FORCE, - * and LOG_LEVEL_REF to LOG_LEVEL_RE_FILTER - * - * Revision 1.1.1.1 2001/05/15 13:58:51 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #ifdef __cplusplus extern "C" { @@ -173,7 +47,7 @@ extern "C" { #define LOG_LEVEL_CONNECT 0x0002 #define LOG_LEVEL_IO 0x0004 #define LOG_LEVEL_HEADER 0x0008 -#define LOG_LEVEL_LOG 0x0010 +#define LOG_LEVEL_WRITING 0x0010 #ifdef FEATURE_FORCE_LOAD #define LOG_LEVEL_FORCE 0x0020 #endif /* def FEATURE_FORCE_LOAD */ @@ -183,6 +57,7 @@ extern "C" { #define LOG_LEVEL_CLF 0x0200 /* Common Log File format */ #define LOG_LEVEL_CRUNCH 0x0400 #define LOG_LEVEL_CGI 0x0800 /* CGI / templates */ +#define LOG_LEVEL_RECEIVED 0x8000 /* Following are always on: */ #define LOG_LEVEL_INFO 0x1000 @@ -195,7 +70,7 @@ extern void disable_logging(void); extern void init_log_module(void); extern void show_version(const char *prog_name); extern void log_error(int loglevel, const char *fmt, ...); -extern const char *jb_err_to_string(int error); +extern const char *jb_err_to_string(int jb_error); /* Revision control strings from this header and associated .c file */ extern const char errlog_rcs[]; diff --git a/external/privoxy/filters.c b/external/privoxy/filters.c index 8fa1d4ed..1b7e5ec8 100644 --- a/external/privoxy/filters.c +++ b/external/privoxy/filters.c @@ -1,4 +1,4 @@ -const char filters_rcs[] = "$Id: filters.c,v 1.113 2009/03/08 14:19:23 fabiankeil Exp $"; +const char filters_rcs[] = "$Id: filters.c,v 1.163 2011/12/26 17:03:08 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/filters.c,v $ @@ -13,7 +13,7 @@ const char filters_rcs[] = "$Id: filters.c,v 1.113 2009/03/08 14:19:23 fabiankei * `execute_single_pcrs_command', `rewrite_url', * `get_last_url' * - * Copyright : Written by and Copyright (C) 2001, 2004-2008 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2011 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written @@ -38,623 +38,8 @@ const char filters_rcs[] = "$Id: filters.c,v 1.113 2009/03/08 14:19:23 fabiankei * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: filters.c,v $ - * Revision 1.113 2009/03/08 14:19:23 fabiankeil - * Fix justified (but harmless) compiler warnings - * on platforms where sizeof(int) < sizeof(long). - * - * Revision 1.112 2009/03/01 18:28:23 fabiankeil - * Help clang understand that we aren't dereferencing - * NULL pointers here. - * - * Revision 1.111 2008/12/04 18:13:46 fabiankeil - * Fix a cparser warning. - * - * Revision 1.110 2008/11/10 16:40:25 fabiankeil - * Fix a gcc44 warning. - * - * Revision 1.109 2008/11/08 15:48:41 fabiankeil - * Mention actual values when complaining about - * the chunk size exceeding the buffer size. - * - * Revision 1.108 2008/05/21 15:35:08 fabiankeil - * - Mark csp as immutable for block_acl(). - * - Remove an obsolete complaint about filter_popups(). - * - * Revision 1.107 2008/05/04 17:52:56 fabiankeil - * Adjust parse_http_url() call to new prototype. - * - * Revision 1.106 2008/05/03 16:40:44 fabiankeil - * Change content_filters_enabled()'s parameter from - * csp->action to action so it can be also used in the - * CGI code. Don't bother checking if there are filters - * loaded, as that's somewhat besides the point. - * - * Revision 1.105 2008/03/28 15:13:39 fabiankeil - * Remove inspect-jpegs action. - * - * Revision 1.104 2008/03/27 18:27:24 fabiankeil - * Remove kill-popups action. - * - * Revision 1.103 2008/03/06 16:33:45 fabiankeil - * If limit-connect isn't used, don't limit CONNECT requests to port 443. - * - * Revision 1.102 2008/03/01 14:00:44 fabiankeil - * Let the block action take the reason for the block - * as argument and show it on the "blocked" page. - * - * Revision 1.101 2008/02/23 16:57:12 fabiankeil - * Rename url_actions() to get_url_actions() and let it - * use the standard parameter ordering. - * - * Revision 1.100 2008/02/23 16:33:43 fabiankeil - * Let forward_url() use the standard parameter ordering - * and mark its second parameter immutable. - * - * Revision 1.99 2008/02/03 13:57:58 fabiankeil - * Add SOCKS5 support for forward-override{}. - * - * Revision 1.98 2008/01/04 17:43:45 fabiankeil - * Improve the warning messages that get logged if the action files - * "enable" filters but no filters of that type have been loaded. - * - * Revision 1.97 2007/11/30 15:37:03 fabiankeil - * Use freez instead of free. - * - * Revision 1.96 2007/10/19 16:53:28 fabiankeil - * Add helper function to check if any content filters are enabled. - * - * Revision 1.95 2007/10/17 19:31:20 fabiankeil - * Omitting the zero chunk that ends the chunk transfer encoding seems - * to be the new black. Log the problem and continue filtering anyway. - * - * Revision 1.94 2007/09/29 13:20:20 fabiankeil - * Remove two redundant and one useless log messages. - * - * Revision 1.93 2007/09/29 10:21:16 fabiankeil - * - Move get_filter_function() from jcc.c to filters.c - * so the filter functions can be static. - * - Don't bother filtering body-less responses. - * - * Revision 1.92 2007/09/28 16:38:55 fabiankeil - * - Execute content filters through execute_content_filter(). - * - Add prepare_for_filtering() so filter functions don't have to - * care about de-chunking and decompression. As a side effect this enables - * decompression for gif_deanimate_response() and jpeg_inspect_response(). - * - Change remove_chunked_transfer_coding()'s return type to jb_err. - * Some clowns feel like chunking empty responses in which case - * (size == 0) is valid but previously would be interpreted as error. - * - * Revision 1.91 2007/09/02 15:31:20 fabiankeil - * Move match_portlist() from filter.c to urlmatch.c. - * It's used for url matching, not for filtering. - * - * Revision 1.90 2007/09/02 12:44:17 fabiankeil - * Remove newline at the end of a log_error() message. - * - * Revision 1.89 2007/08/05 13:42:23 fabiankeil - * #1763173 from Stefan Huehner: declare some more functions static. - * - * Revision 1.88 2007/06/01 16:41:11 fabiankeil - * Add forward-override{} to change the forwarding settings through - * action sections. This is mainly interesting to forward different - * clients differently (for example based on User-Agent or request - * origin). - * - * Revision 1.87 2007/04/30 15:53:10 fabiankeil - * Make sure filters with dynamic jobs actually use them. - * - * Revision 1.86 2007/04/30 15:03:28 fabiankeil - * - Introduce dynamic pcrs jobs that can resolve variables. - * - Don't run redirect functions more than once, - * unless they are activated more than once. - * - * Revision 1.85 2007/03/21 12:24:47 fabiankeil - * - Log the content size after decompression in decompress_iob() - * instead of pcrs_filter_response(). - * - * Revision 1.84 2007/03/20 15:16:34 fabiankeil - * Use dedicated header filter actions instead of abusing "filter". - * Replace "filter-client-headers" and "filter-client-headers" - * with "server-header-filter" and "client-header-filter". - * - * Revision 1.83 2007/03/17 15:20:05 fabiankeil - * New config option: enforce-blocks. - * - * Revision 1.82 2007/03/13 11:28:43 fabiankeil - * - Fix port handling in acl_addr() and use a temporary acl spec - * copy so error messages don't contain a truncated version. - * - Log size of iob before and after decompression. - * - * Revision 1.81 2007/03/05 14:40:53 fabiankeil - * - Cosmetical changes for LOG_LEVEL_RE_FILTER messages. - * - Hide the "Go there anyway" link for blocked CONNECT - * requests where going there anyway doesn't work anyway. - * - * Revision 1.80 2007/02/07 10:55:20 fabiankeil - * - Save the reason for generating http_responses. - * - Block (+block) with status code 403 instead of 404. - * - Use a different kludge to remember a failed decompression. - * - * Revision 1.79 2007/01/31 16:21:38 fabiankeil - * Search for Max-Forwards headers case-insensitive, - * don't generate the "501 unsupported" message for invalid - * Max-Forwards values and don't increase negative ones. - * - * Revision 1.78 2007/01/28 13:41:18 fabiankeil - * - Add HEAD support to finish_http_response. - * - Add error favicon to internal HTML error messages. - * - * Revision 1.77 2007/01/12 15:36:44 fabiankeil - * Mark *csp as immutable for is_untrusted_url() - * and is_imageurl(). Closes FR 1237736. - * - * Revision 1.76 2007/01/01 19:36:37 fabiankeil - * Integrate a modified version of Wil Mahan's - * zlib patch (PR #895531). - * - * Revision 1.75 2006/12/29 18:30:46 fabiankeil - * Fixed gcc43 conversion warnings, - * changed sprintf calls to snprintf. - * - * Revision 1.74 2006/12/24 17:37:38 fabiankeil - * Adjust comment in pcrs_filter_response() - * to recent pcrs changes. Hohoho. - * - * Revision 1.73 2006/12/23 16:01:02 fabiankeil - * Don't crash if pcre returns an error code - * that pcrs didn't expect. Fixes BR 1621173. - * - * Revision 1.72 2006/12/22 18:52:53 fabiankeil - * Modified is_untrusted_url to complain in case of - * write errors and to give a reason when adding new - * entries to the trustfile. Closes FR 1097611. - * - * Revision 1.71 2006/12/22 14:24:52 fabiankeil - * Skip empty filter files in pcrs_filter_response, - * but don't ignore the ones that come afterwards. - * Fixes parts of BR 1619208. - * - * Revision 1.70 2006/12/09 13:33:15 fabiankeil - * Added some sanity checks for get_last_url(). - * Fixed possible segfault caused by my last commit. - * - * Revision 1.69 2006/12/08 12:39:13 fabiankeil - * Let get_last_url() catch https URLs as well. - * - * Revision 1.68 2006/12/05 14:45:48 fabiankeil - * Make sure get_last_url() behaves like advertised - * and fast-redirects{} can be combined with redirect{}. - * - * Revision 1.67 2006/11/28 15:19:43 fabiankeil - * Implemented +redirect{s@foo@bar@} to generate - * a redirect based on a rewritten version of the - * original URL. - * - * Revision 1.66 2006/09/23 13:26:38 roro - * Replace TABs by spaces in source code. - * - * Revision 1.65 2006/09/21 12:54:43 fabiankeil - * Fix +redirect{}. Didn't work with -fast-redirects. - * - * Revision 1.64 2006/08/31 10:55:49 fabiankeil - * Block requests for untrusted URLs with status - * code 403 instead of 200. - * - * Revision 1.63 2006/08/31 10:11:28 fabiankeil - * Don't free p which is still in use and will be later - * freed by free_map(). Don't claim the referrer is unknown - * when the client didn't set one. - * - * Revision 1.62 2006/08/14 00:27:47 david__schmidt - * Feature request 595948: Re-Filter logging in single line - * - * Revision 1.61 2006/08/03 02:46:41 david__schmidt - * Incorporate Fabian Keil's patch work: http://www.fabiankeil.de/sourcecode/privoxy/ - * - * Revision 1.60 2006/07/18 14:48:46 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.58.2.9 2006/01/29 23:10:56 david__schmidt - * Multiple filter file support - * - * Revision 1.58.2.8 2005/05/07 21:50:55 david__schmidt - * A few memory leaks plugged (mostly on error paths) - * - * Revision 1.58.2.7 2004/10/03 12:53:32 david__schmidt - * Add the ability to check jpeg images for invalid - * lengths of comment blocks. Defensive strategy - * against the exploit: - * Microsoft Security Bulletin MS04-028 - * Buffer Overrun in JPEG Processing (GDI+) Could - * Allow Code Execution (833987) - * Enabled with +inspect-jpegs in actions files. - * - * Revision 1.58.2.6 2003/12/06 22:18:27 gliptak - * Correcting compile problem with FEATURE_IMAGE_BLOCKING - * - * Revision 1.58.2.5 2003/11/11 13:10:31 oes - * Fixed bug #839859: "See why" link URL now gets url-encoded. - * - * Revision 1.58.2.4 2003/02/28 12:52:45 oes - * Fixed a typo - * - * Revision 1.58.2.3 2002/09/25 14:51:51 oes - * Added basic support for OPTIONS and TRACE HTTP methods: - * New function direct_response which handles OPTIONS and - * TRACE requests whose Max-Forwards header field is zero. - * - * Revision 1.58.2.2 2002/08/01 17:18:28 oes - * Fixed BR 537651 / SR 579724 (MSIE image detect improper for IE/Mac) - * - * Revision 1.58.2.1 2002/07/26 15:18:53 oes - * - Bugfix: Executing a filters without jobs no longer results in - * turing off *all* filters. - * - Security fix: Malicious web servers can't cause a seg fault - * through bogus chunk sizes anymore - * - * Revision 1.58 2002/04/24 02:11:17 oes - * Jon's multiple AF patch: url_actions now evaluates rules - * from all AFs. - * - * Revision 1.57 2002/04/08 20:38:34 swa - * fixed JB spelling - * - * Revision 1.56 2002/04/05 15:51:24 oes - * - bugfix: error-pages now get correct request protocol - * - fix for invalid HTML in trust info - * - * Revision 1.55 2002/04/02 16:13:51 oes - * Fix: No "Go there anyway" for SSL - * - * Revision 1.54 2002/04/02 14:55:56 oes - * Bugfix: is_untrusted_url() now depends on FEATURE_TRUST, not FEATURE_COOKIE_JAR - * - * Revision 1.53 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.52 2002/03/24 16:35:57 jongfoster - * Removing logo - * - * Revision 1.51 2002/03/24 15:23:33 jongfoster - * Name changes - * - * Revision 1.50 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.49 2002/03/16 20:29:14 oes - * Cosmetics - * - * Revision 1.48 2002/03/13 20:25:34 oes - * Better logging for content filters - * - * Revision 1.47 2002/03/13 00:30:52 jongfoster - * Killing warnings - * Added option of always sending redirect for imageblock, - * currently disabled with #if 0. - * - * Revision 1.46 2002/03/12 01:42:49 oes - * Introduced modular filters - * - * Revision 1.45 2002/03/08 16:47:50 oes - * Added choice beween GIF and PNG built-in images - * - * Revision 1.44 2002/03/07 03:49:31 oes - * - Fixed compiler warnings etc - * - Changed built-in images from GIF to PNG - * (with regard to Unisys patent issue) - * - Added a 4x4 pattern PNG which is less intrusive - * than the logo but also clearly marks the deleted banners - * - * Revision 1.43 2002/01/22 23:51:59 jongfoster - * Replacing strsav() with the safer string_append(). - * - * Adding missing html_encode() to error message generators. Where encoded - * and unencoded versions of a string were provided, removing the unencoded - * one. - * - * Revision 1.42 2002/01/17 21:00:32 jongfoster - * Moving all our URL and URL pattern parsing code to urlmatch.c. - * - * Using a single, simple url_match(pattern,url) function - rather than - * the 3-line match routine which was repeated all over the place. - * - * Renaming free_url to free_url_spec, since it frees a struct url_spec. - * - * Using parse_http_url() to parse URLs without faking a HTTP - * request line for parse_http_request(). - * - * Revision 1.41 2001/11/13 00:14:07 jongfoster - * Fixing stupid bug now I've figured out what || means. - * (It always returns 0 or 1, not one of it's paramaters.) - * - * Revision 1.40 2001/10/26 17:37:55 oes - * - Re-enabled Netscape 200/404 bug workaround in block_url(): - * - Removed OS/2 special case - * - Made block_url() independant from sed() having been run - * - Made trust_url independant from sed() having been run - * - Made is_imageurl independant from sed() having been run. - * It now checks User-Agent: and Accept: by itself. - * - * - * Revision 1.39 2001/10/25 03:40:48 david__schmidt - * Change in porting tactics: OS/2's EMX porting layer doesn't allow multiple - * threads to call select() simultaneously. So, it's time to do a real, live, - * native OS/2 port. See defines for __EMX__ (the porting layer) vs. __OS2__ - * (native). Both versions will work, but using __OS2__ offers multi-threading. - * - * Revision 1.38 2001/10/23 21:32:33 jongfoster - * Adding error-checking to selected functions - * - * Revision 1.37 2001/10/22 15:33:56 david__schmidt - * Special-cased OS/2 out of the Netscape-abort-on-404-in-js problem in - * filters.c. Added a FIXME in front of the offending code. I'll gladly - * put in a better/more robust fix for all parties if one is presented... - * It seems that just returning 200 instead of 404 would pretty much fix - * it for everyone, but I don't know all the history of the problem. - * - * Revision 1.36 2001/10/10 16:44:16 oes - * Added match_portlist function - * - * Revision 1.35 2001/10/07 15:41:23 oes - * Replaced 6 boolean members of csp with one bitmap (csp->flags) - * - * New function remove_chunked_transfer_coding that strips chunked - * transfer coding to plain and is called by pcrs_filter_response - * and gif_deanimate_response if neccessary - * - * Improved handling of zero-change re_filter runs - * - * pcrs_filter_response and gif_deanimate_response now remove - * chunked transfer codeing before processing the body. - * - * Revision 1.34 2001/09/20 15:49:36 steudten - * - * Fix BUG: Change int size to size_t size in pcrs_filter_response(). - * See cgi.c fill_template(). - * - * Revision 1.33 2001/09/16 17:05:14 jongfoster - * Removing unused #include showarg.h - * - * Revision 1.32 2001/09/16 13:21:27 jongfoster - * Changes to use new list functions. - * - * Revision 1.31 2001/09/16 11:38:02 jongfoster - * Splitting fill_template() into 2 functions: - * template_load() loads the file - * template_fill() performs the PCRS regexps. - * This is because the CGI edit interface has a "table row" - * template which is used many times in the page - this - * change means it's only loaded from disk once. - * - * Revision 1.30 2001/09/16 11:00:10 jongfoster - * New function alloc_http_response, for symmetry with free_http_response - * - * Revision 1.29 2001/09/13 23:32:40 jongfoster - * Moving image data to cgi.c rather than cgi.h - * Fixing a GPF under Win32 (and any other OS that protects global - * constants from being written to). - * - * Revision 1.28 2001/09/10 10:18:51 oes - * Silenced compiler warnings - * - * Revision 1.27 2001/08/05 16:06:20 jongfoster - * Modifiying "struct map" so that there are now separate header and - * "map_entry" structures. This means that functions which modify a - * map no longer need to return a pointer to the modified map. - * Also, it no longer reverses the order of the entries (which may be - * important with some advanced template substitutions). - * - * Revision 1.26 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.25 2001/07/26 10:09:46 oes - * Made browser detection a little less naive - * - * Revision 1.24 2001/07/25 17:22:51 oes - * Added workaround for Netscape bug that prevents display of page when loading a component fails. - * - * Revision 1.23 2001/07/23 13:40:12 oes - * Fixed bug that caused document body to be dropped when pcrs joblist was empty. - * - * Revision 1.22 2001/07/18 12:29:34 oes - * - Made gif_deanimate_response respect - * csp->action->string[ACTION_STRING_DEANIMATE] - * - Logging cosmetics - * - * Revision 1.21 2001/07/13 13:59:53 oes - * - Introduced gif_deanimate_response which shares the - * generic content modification interface of pcrs_filter_response - * and acts as a wrapper to deanimate.c:gif_deanimate() - * - Renamed re_process_buffer to pcrs_filter_response - * - pcrs_filter_response now returns NULL on failiure - * - Removed all #ifdef PCRS - * - * Revision 1.20 2001/07/01 17:01:04 oes - * Added comments and missing return statement in is_untrusted_url() - * - * Revision 1.19 2001/06/29 21:45:41 oes - * Indentation, CRLF->LF, Tab-> Space - * - * Revision 1.18 2001/06/29 13:27:38 oes - * - Cleaned up, renamed and reorderd functions - * and improved comments - * - * - block_url: - * - Ported to CGI platform. Now delivers - * http_response or NULL - * - Unified HTML and GIF generation (moved image detection - * and GIF generation here from jcc.c:chat()) - * - Fixed HTTP status to: - * - 403 (Forbidden) for the "blocked" HTML message - * - 200 (OK) for GIF answers - * - 302 (Redirect) for redirect to GIF - * - * - trust_url: - * - Ported to CGI platform. Now delivers - * http_response or NULL - * - Separated detection of untrusted URL into - * (bool)is_untrusted_url - * - Added enforcement of untrusted requests - * - * - Moved redirect_url() from cgi.c to here - * and ported it to the CGI platform - * - * - Removed logentry from cancelled commit - * - * Revision 1.17 2001/06/09 10:55:28 jongfoster - * Changing BUFSIZ ==> BUFFER_SIZE - * - * Revision 1.16 2001/06/07 23:10:26 jongfoster - * Allowing unanchored domain patterns to back off and retry - * if they partially match. Optimized right-anchored patterns. - * Moving ACL and forward files into config file. - * Replacing struct gateway with struct forward_spec - * - * Revision 1.15 2001/06/03 19:12:00 oes - * extracted-CGI relevant stuff - * - * Revision 1.14 2001/06/01 10:30:55 oes - * Added optional left-anchoring to domaincmp - * - * Revision 1.13 2001/05/31 21:21:30 jongfoster - * Permissionsfile / actions file changes: - * - Changed "permission" to "action" throughout - * - changes to file format to allow string parameters - * - Moved helper functions to actions.c - * - * Revision 1.12 2001/05/31 17:35:20 oes - * - * - Enhanced domain part globbing with infix and prefix asterisk - * matching and optional unanchored operation - * - * Revision 1.11 2001/05/29 11:53:23 oes - * "See why" link added to "blocked" page - * - * Revision 1.10 2001/05/29 09:50:24 jongfoster - * Unified blocklist/imagelist/permissionslist. - * File format is still under discussion, but the internal changes - * are (mostly) done. - * - * Also modified interceptor behaviour: - * - We now intercept all URLs beginning with one of the following - * prefixes (and *only* these prefixes): - * * http://i.j.b/ - * * http://ijbswa.sf.net/config/ - * * http://ijbswa.sourceforge.net/config/ - * - New interceptors "home page" - go to http://i.j.b/ to see it. - * - Internal changes so that intercepted and fast redirect pages - * are not replaced with an image. - * - Interceptors now have the option to send a binary page direct - * to the client. (i.e. ijb-send-banner uses this) - * - Implemented show-url-info interceptor. (Which is why I needed - * the above interceptors changes - a typical URL is - * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". - * The previous mechanism would not have intercepted that, and - * if it had been intercepted then it then it would have replaced - * it with an image.) - * - * Revision 1.9 2001/05/27 22:17:04 oes - * - * - re_process_buffer no longer writes the modified buffer - * to the client, which was very ugly. It now returns the - * buffer, which it is then written by chat. - * - * - content_length now adjusts the Content-Length: header - * for modified documents rather than crunch()ing it. - * (Length info in csp->content_length, which is 0 for - * unmodified documents) - * - * - For this to work, sed() is called twice when filtering. - * - * Revision 1.8 2001/05/26 17:13:28 jongfoster - * Filled in a function comment. - * - * Revision 1.7 2001/05/26 15:26:15 jongfoster - * ACL feature now provides more security by immediately dropping - * connections from untrusted hosts. - * - * Revision 1.6 2001/05/26 00:28:36 jongfoster - * Automatic reloading of config file. - * Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32). - * Most of the global variables have been moved to a new - * struct configuration_spec, accessed through csp->config->globalname - * Most of the globals remaining are used by the Win32 GUI. - * - * Revision 1.5 2001/05/25 22:34:30 jongfoster - * Hard tabs->Spaces - * - * Revision 1.4 2001/05/22 18:46:04 oes - * - * - Enabled filtering banners by size rather than URL - * by adding patterns that replace all standard banner - * sizes with the "Junkbuster" gif to the re_filterfile - * - * - Enabled filtering WebBugs by providing a pattern - * which kills all 1x1 images - * - * - Added support for PCRE_UNGREEDY behaviour to pcrs, - * which is selected by the (nonstandard and therefore - * capital) letter 'U' in the option string. - * It causes the quantifiers to be ungreedy by default. - * Appending a ? turns back to greedy (!). - * - * - Added a new interceptor ijb-send-banner, which - * sends back the "Junkbuster" gif. Without imagelist or - * MSIE detection support, or if tinygif = 1, or the - * URL isn't recognized as an imageurl, a lame HTML - * explanation is sent instead. - * - * - Added new feature, which permits blocking remote - * script redirects and firing back a local redirect - * to the browser. - * The feature is conditionally compiled, i.e. it - * can be disabled with --disable-fast-redirects, - * plus it must be activated by a "fast-redirects" - * line in the config file, has its own log level - * and of course wants to be displayed by show-proxy-args - * Note: Boy, all the #ifdefs in 1001 locations and - * all the fumbling with configure.in and acconfig.h - * were *way* more work than the feature itself :-( - * - * - Because a generic redirect template was needed for - * this, tinygif = 3 now uses the same. - * - * - Moved GIFs, and other static HTTP response templates - * to project.h - * - * - Some minor fixes - * - * - Removed some >400 CRs again (Jon, you really worked - * a lot! ;-) - * - * Revision 1.3 2001/05/20 16:44:47 jongfoster - * Removing last hardcoded Junkbusters.com URLs. - * - * Revision 1.2 2001/05/20 01:21:20 jongfoster - * Version 2.9.4 checkin. - * - Merged popupfile and cookiefile, and added control over PCRS - * filtering, in new "permissionsfile". - * - Implemented LOG_LEVEL_FATAL, so that if there is a configuration - * file error you now get a message box (in the Win32 GUI) rather - * than the program exiting with no explanation. - * - Made killpopup use the PCRS MIME-type checking and HTTP-header - * skipping. - * - Removed tabs from "config" - * - Moved duplicated url parsing code in "loaders.c" to a new funcition. - * - Bumped up version number. - * - * Revision 1.1.1.1 2001/05/15 13:58:52 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include "config.h" @@ -708,10 +93,158 @@ const char filters_h_rcs[] = FILTERS_H_VERSION; */ #define ijb_isdigit(__X) isdigit((int)(unsigned char)(__X)) +typedef char *(*filter_function_ptr)(); +static filter_function_ptr get_filter_function(const struct client_state *csp); static jb_err remove_chunked_transfer_coding(char *buffer, size_t *size); static jb_err prepare_for_filtering(struct client_state *csp); #ifdef FEATURE_ACL +#ifdef HAVE_RFC2553 +/********************************************************************* + * + * Function : sockaddr_storage_to_ip + * + * Description : Access internal structure of sockaddr_storage + * + * Parameters : + * 1 : addr = socket address + * 2 : ip = IP address as array of octets in network order + * (it points into addr) + * 3 : len = length of IP address in octets + * 4 : port = port number in network order; + * + * Returns : 0 = no errror; -1 otherwise. + * + *********************************************************************/ +static int sockaddr_storage_to_ip(const struct sockaddr_storage *addr, + uint8_t **ip, unsigned int *len, + in_port_t **port) +{ + if (NULL == addr) + { + return(-1); + } + + switch (addr->ss_family) + { + case AF_INET: + if (NULL != len) + { + *len = 4; + } + if (NULL != ip) + { + *ip = (uint8_t *) + &(((struct sockaddr_in *)addr)->sin_addr.s_addr); + } + if (NULL != port) + { + *port = &((struct sockaddr_in *)addr)->sin_port; + } + break; + + case AF_INET6: + if (NULL != len) + { + *len = 16; + } + if (NULL != ip) + { + *ip = ((struct sockaddr_in6 *)addr)->sin6_addr.s6_addr; + } + if (NULL != port) + { + *port = &((struct sockaddr_in6 *)addr)->sin6_port; + } + break; + + default: + /* Unsupported address family */ + return(-1); + } + + return(0); +} + + +/********************************************************************* + * + * Function : match_sockaddr + * + * Description : Check whether address matches network (IP address and port) + * + * Parameters : + * 1 : network = socket address of subnework + * 2 : netmask = network mask as socket address + * 3 : address = checked socket address against given network + * + * Returns : 0 = doesn't match; 1 = does match + * + *********************************************************************/ +static int match_sockaddr(const struct sockaddr_storage *network, + const struct sockaddr_storage *netmask, + const struct sockaddr_storage *address) +{ + uint8_t *network_addr, *netmask_addr, *address_addr; + unsigned int addr_len; + in_port_t *network_port, *netmask_port, *address_port; + int i; + + if (network->ss_family != netmask->ss_family) + { + /* This should never happen */ + log_error(LOG_LEVEL_ERROR, + "Internal error at %s:%llu: network and netmask differ in family", + __FILE__, __LINE__); + return 0; + } + + sockaddr_storage_to_ip(network, &network_addr, &addr_len, &network_port); + sockaddr_storage_to_ip(netmask, &netmask_addr, NULL, &netmask_port); + sockaddr_storage_to_ip(address, &address_addr, NULL, &address_port); + + /* Check for family */ + if ((network->ss_family == AF_INET) && (address->ss_family == AF_INET6) + && IN6_IS_ADDR_V4MAPPED((struct in6_addr *)address_addr)) + { + /* Map AF_INET6 V4MAPPED address into AF_INET */ + address_addr += 12; + addr_len = 4; + } + else if ((network->ss_family == AF_INET6) && (address->ss_family == AF_INET) + && IN6_IS_ADDR_V4MAPPED((struct in6_addr *)network_addr)) + { + /* Map AF_INET6 V4MAPPED network into AF_INET */ + network_addr += 12; + netmask_addr += 12; + addr_len = 4; + } + else if (network->ss_family != address->ss_family) + { + return 0; + } + + /* XXX: Port check is signaled in netmask */ + if (*netmask_port && *network_port != *address_port) + { + return 0; + } + + /* TODO: Optimize by checking by words insted of octets */ + for (i = 0; (i < addr_len) && netmask_addr[i]; i++) + { + if ((network_addr[i] & netmask_addr[i]) != + (address_addr[i] & netmask_addr[i])) + { + return 0; + } + } + + return 1; +} +#endif /* def HAVE_RFC2553 */ + + /********************************************************************* * * Function : block_acl @@ -741,7 +274,13 @@ int block_acl(const struct access_control_addr *dst, const struct client_state * /* search the list */ while (acl != NULL) { - if ((csp->ip_addr_long & acl->src->mask) == acl->src->addr) + if ( +#ifdef HAVE_RFC2553 + match_sockaddr(&acl->src->addr, &acl->src->mask, &csp->tcp_addr) +#else + (csp->ip_addr_long & acl->src->mask) == acl->src->addr +#endif + ) { if (dst == NULL) { @@ -750,9 +289,28 @@ int block_acl(const struct access_control_addr *dst, const struct client_state * { return(0); } + else + { + return(1); + } } - else if ( ((dst->addr & acl->dst->mask) == acl->dst->addr) - && ((dst->port == acl->dst->port) || (acl->dst->port == 0))) + else if ( +#ifdef HAVE_RFC2553 + /* + * XXX: An undefined acl->dst is full of zeros and should be + * considered a wildcard address. sockaddr_storage_to_ip() + * fails on such destinations because of unknown sa_familly + * (glibc only?). However this test is not portable. + * + * So, we signal the acl->dst is wildcard in wildcard_dst. + */ + acl->wildcard_dst || + match_sockaddr(&acl->dst->addr, &acl->dst->mask, &dst->addr) +#else + ((dst->addr & acl->dst->mask) == acl->dst->addr) + && ((dst->port == acl->dst->port) || (acl->dst->port == 0)) +#endif + ) { if (acl->action == ACL_PERMIT) { @@ -788,12 +346,24 @@ int block_acl(const struct access_control_addr *dst, const struct client_state * int acl_addr(const char *aspec, struct access_control_addr *aca) { int i, masklength; +#ifdef HAVE_RFC2553 + struct addrinfo hints, *result; + uint8_t *mask_data; + in_port_t *mask_port; + unsigned int addr_len; +#else long port; +#endif /* def HAVE_RFC2553 */ char *p; char *acl_spec = NULL; +#ifdef HAVE_RFC2553 + /* XXX: Depend on ai_family */ + masklength = 128; +#else masklength = 32; port = 0; +#endif /* * Use a temporary acl spec copy so we can log @@ -817,13 +387,54 @@ int acl_addr(const char *aspec, struct access_control_addr *aca) masklength = atoi(p); } - if ((masklength < 0) || (masklength > 32)) + if ((masklength < 0) || +#ifdef HAVE_RFC2553 + (masklength > 128) +#else + (masklength > 32) +#endif + ) { freez(acl_spec); return(-1); } - if ((p = strchr(acl_spec, ':')) != NULL) + if ((*acl_spec == '[') && (NULL != (p = strchr(acl_spec, ']')))) + { + *p = '\0'; + memmove(acl_spec, acl_spec + 1, (size_t)(p - acl_spec)); + + if (*++p != ':') + { + p = NULL; + } + } + else + { + p = strchr(acl_spec, ':'); + } + +#ifdef HAVE_RFC2553 + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + + i = getaddrinfo(acl_spec, ((p) ? ++p : NULL), &hints, &result); + + if (i != 0) + { + log_error(LOG_LEVEL_ERROR, "Can not resolve [%s]:%s: %s", + acl_spec, p, gai_strerror(i)); + freez(acl_spec); + return(-1); + } + freez(acl_spec); + + /* TODO: Allow multihomed hostnames */ + memcpy(&(aca->addr), result->ai_addr, result->ai_addrlen); + freeaddrinfo(result); +#else + if (p != NULL) { char *endptr; @@ -847,8 +458,56 @@ int acl_addr(const char *aspec, struct access_control_addr *aca) /* XXX: This will be logged as parse error. */ return(-1); } +#endif /* def HAVE_RFC2553 */ /* build the netmask */ +#ifdef HAVE_RFC2553 + /* Clip masklength according to current family. */ + if ((aca->addr.ss_family == AF_INET) && (masklength > 32)) + { + masklength = 32; + } + + aca->mask.ss_family = aca->addr.ss_family; + if (sockaddr_storage_to_ip(&aca->mask, &mask_data, &addr_len, &mask_port)) + { + return(-1); + } + + if (p) + { + /* ACL contains a port number, check ports in the future. */ + *mask_port = 1; + } + + /* + * XXX: This could be optimized to operate on whole words instead + * of octets (128-bit CPU could do it in one iteration). + */ + /* + * Octets after prefix can be omitted because of + * previous initialization to zeros. + */ + for (i = 0; (i < addr_len) && masklength; i++) + { + if (masklength >= 8) + { + mask_data[i] = 0xFF; + masklength -= 8; + } + else + { + /* + * XXX: This assumes MSB of octet is on the left side. + * This should be true for all architectures or solved + * by the link layer. + */ + mask_data[i] = (uint8_t)~((1 << (8 - masklength)) - 1); + masklength = 0; + } + } + +#else aca->mask = 0; for (i=1; i <= masklength ; i++) { @@ -859,6 +518,7 @@ int acl_addr(const char *aspec, struct access_control_addr *aca) * (i.e. save on the network portion of the address). */ aca->addr = aca->addr & aca->mask; +#endif /* def HAVE_RFC2553 */ return(0); @@ -914,7 +574,7 @@ struct http_response *block_url(struct client_state *csp) } if (csp->action->flags & ACTION_REDIRECT) { - log_error(LOG_LEVEL_ERROR, "redirect{} overruled by block."); + log_error(LOG_LEVEL_ERROR, "redirect{} overruled by block."); } /* * Else, prepare a response @@ -940,7 +600,6 @@ struct http_response *block_url(struct client_state *csp) { log_error(LOG_LEVEL_ERROR, "handle-as-empty-document overruled by handle-as-image."); } -#if 1 /* Two alternative strategies, use this one for now: */ /* and handle accordingly: */ if ((p == NULL) || (0 == strcmpic(p, "pattern"))) @@ -965,7 +624,6 @@ struct http_response *block_url(struct client_state *csp) return cgi_error_memory(); } } - else if (0 == strcmpic(p, "blank")) { rsp->status = strdup("403 Request blocked by Privoxy"); @@ -988,7 +646,6 @@ struct http_response *block_url(struct client_state *csp) return cgi_error_memory(); } } - else { rsp->status = strdup("302 Local Redirect from Privoxy"); @@ -1005,35 +662,13 @@ struct http_response *block_url(struct client_state *csp) } } -#else /* Following code is disabled for now */ - - /* and handle accordingly: */ - if ((p == NULL) || (0 == strcmpic(p, "pattern"))) - { - p = CGI_PREFIX "send-banner?type=pattern"; - } - else if (0 == strcmpic(p, "blank")) - { - p = CGI_PREFIX "send-banner?type=blank"; - } - rsp->status = strdup("302 Local Redirect from Privoxy"); - if (rsp->status == NULL) - { - free_http_response(rsp); - return cgi_error_memory(); - } - - if (enlist_unique_header(rsp->headers, "Location", p)) - { - free_http_response(rsp); - return cgi_error_memory(); - } -#endif /* Preceeding code is disabled for now */ } - else if(csp->action->flags & ACTION_HANDLE_AS_EMPTY_DOCUMENT) + else +#endif /* def FEATURE_IMAGE_BLOCKING */ + if(csp->action->flags & ACTION_HANDLE_AS_EMPTY_DOCUMENT) { /* - * Send empty document. + * Send empty document. */ new_content_type = csp->action->string[ACTION_STRING_CONTENT_TYPE]; @@ -1041,7 +676,21 @@ struct http_response *block_url(struct client_state *csp) rsp->body = strdup(" "); rsp->content_length = 1; - rsp->status = strdup("403 Request blocked by Privoxy"); + if (csp->config->feature_flags & RUNTIME_FEATURE_EMPTY_DOC_RETURNS_OK) + { + /* + * Workaround for firefox bug 492459 + * https://bugzilla.mozilla.org/show_bug.cgi?id=492459 + * Return a 200 OK status for pages blocked with +handle-as-empty-document + * if the "handle-as-empty-doc-returns-ok" runtime config option is set. + */ + rsp->status = strdup("200 Request blocked by Privoxy"); + } + else + { + rsp->status = strdup("403 Request blocked by Privoxy"); + } + if (rsp->status == NULL) { free_http_response(rsp); @@ -1058,7 +707,6 @@ struct http_response *block_url(struct client_state *csp) } } else -#endif /* def FEATURE_IMAGE_BLOCKING */ /* * Else, generate an HTML "blocked" message: @@ -1066,27 +714,8 @@ struct http_response *block_url(struct client_state *csp) { jb_err err; struct map * exports; - char *p; - - /* - * Workaround for stupid Netscape bug which prevents - * pages from being displayed if loading a referenced - * JavaScript or style sheet fails. So make it appear - * as if it succeeded. - */ - if ( NULL != (p = get_header_value(csp->headers, "User-Agent:")) - && !strncmpic(p, "mozilla", 7) /* Catch Netscape but */ - && !strstr(p, "Gecko") /* save Mozilla, */ - && !strstr(p, "compatible") /* MSIE */ - && !strstr(p, "Opera")) /* and Opera. */ - { - rsp->status = strdup("200 Request for blocked URL"); - } - else - { - rsp->status = strdup("403 Request for blocked URL"); - } + rsp->status = strdup("403 Request blocked by Privoxy"); if (rsp->status == NULL) { free_http_response(rsp); @@ -1148,7 +777,7 @@ struct http_response *block_url(struct client_state *csp) return cgi_error_memory(); } } - rsp->reason = RSP_REASON_BLOCKED; + rsp->crunch_reason = BLOCKED; return finish_http_response(csp, rsp); @@ -1207,7 +836,7 @@ struct http_response *trust_url(struct client_state *csp) * Export the protocol, host, port, and referrer information */ err = map(exports, "hostport", 1, csp->http->hostport, 1); - if (!err) err = map(exports, "protocol", 1, csp->http->ssl ? "https://" : "http://", 1); + if (!err) err = map(exports, "protocol", 1, csp->http->ssl ? "https://" : "http://", 1); if (!err) err = map(exports, "path", 1, csp->http->path, 1); if (NULL != (p = get_header_value(csp->headers, "Referer:"))) @@ -1308,7 +937,7 @@ struct http_response *trust_url(struct client_state *csp) free_http_response(rsp); return cgi_error_memory(); } - rsp->reason = RSP_REASON_UNTRUSTED; + rsp->crunch_reason = UNTRUSTED; return finish_http_response(csp, rsp); } @@ -1327,7 +956,7 @@ struct http_response *trust_url(struct client_state *csp) * 2 : b = The filter list to compile * * Returns : NULL in case of errors, otherwise the - * pcrs job list. + * pcrs job list. * *********************************************************************/ pcrs_job *compile_dynamic_pcrs_job_list(const struct client_state *csp, const struct re_filterfile_spec *b) @@ -1354,10 +983,9 @@ pcrs_job *compile_dynamic_pcrs_job_list(const struct client_state *csp, const st dummy = pcrs_compile_dynamic_command(pattern->str, variables, &error); if (NULL == dummy) { - assert(error < 0); log_error(LOG_LEVEL_ERROR, - "Adding filter job \'%s\' to dynamic filter %s failed: %s", - pattern->str, b->name, pcrs_strerror(error)); + "Compiling dynamic pcrs job '%s' for '%s' failed with error code %d: %s", + pattern->str, b->name, error, pcrs_strerror(error)); continue; } else @@ -1397,7 +1025,7 @@ pcrs_job *compile_dynamic_pcrs_job_list(const struct client_state *csp, const st * 2 : pcrs_command = pcrs command formatted as string (s@foo@bar@) * * - * Returns : NULL if the pcrs_command didn't change the url, or + * Returns : NULL if the pcrs_command didn't change the url, or * the result of the modification. * *********************************************************************/ @@ -1456,7 +1084,7 @@ char *rewrite_url(char *old_url, const char *pcrs_command) * * Parameters : * 1 : subject = the string to check - * 2 : redirect_mode = +fast-redirect{} mode + * 2 : redirect_mode = +fast-redirect{} mode * * Returns : NULL if no URL was found, or * the last URL found. @@ -1477,22 +1105,78 @@ char *get_last_url(char *subject, const char *redirect_mode) return NULL; } - if (0 == strcmpic(redirect_mode, "check-decoded-url")) + if (0 == strcmpic(redirect_mode, "check-decoded-url") && strchr(subject, '%')) { - log_error(LOG_LEVEL_REDIRECTS, "Decoding \"%s\" if necessary.", subject); - new_url = url_decode(subject); - if (new_url != NULL) - { - freez(subject); - subject = new_url; - } - else - { - log_error(LOG_LEVEL_ERROR, "Unable to decode \"%s\".", subject); - } - } + log_error(LOG_LEVEL_REDIRECTS, + "Checking \"%s\" for encoded redirects.", subject); - log_error(LOG_LEVEL_REDIRECTS, "Checking \"%s\" for redirects.", subject); + /* + * Check each parameter in the URL separately. + * Sectionize the URL at "?" and "&", + * go backwards through the segments, URL-decode them + * and look for a URL in the decoded result. + * Stop the search after the first match. + */ + char *url_segment = NULL; + /* + * XXX: This estimate is guaranteed to be high enough as we + * let ssplit() ignore empty fields, but also a bit wasteful. + */ + size_t max_segments = strlen(subject) / 2; + char **url_segments = malloc(max_segments * sizeof(char *)); + int segments; + + if (NULL == url_segments) + { + log_error(LOG_LEVEL_ERROR, "Out of memory while decoding URL: %s", new_url); + freez(subject); + return NULL; + } + + segments = ssplit(subject, "?&", url_segments, max_segments, 1, 1); + + while (segments-- > 0) + { + char *dtoken = url_decode(url_segments[segments]); + if (NULL == dtoken) + { + log_error(LOG_LEVEL_ERROR, "Unable to decode \"%s\".", url_segments[segments]); + continue; + } + url_segment = strstr(dtoken, "http://"); + if (NULL == url_segment) + { + url_segment = strstr(dtoken, "https://"); + } + if (NULL != url_segment) + { + url_segment = strdup(url_segment); + freez(dtoken); + if (url_segment == NULL) + { + log_error(LOG_LEVEL_ERROR, + "Out of memory while searching for redirects."); + return NULL; + } + break; + } + freez(dtoken); + } + freez(subject); + freez(url_segments); + + if (url_segment == NULL) + { + return NULL; + } + subject = url_segment; + } + else + { + /* Look for a URL inside this one, without decoding anything. */ + log_error(LOG_LEVEL_REDIRECTS, + "Checking \"%s\" for unencoded redirects.", subject); + } /* * Find the last URL encoded in the request @@ -1515,7 +1199,7 @@ char *get_last_url(char *subject, const char *redirect_mode) )) { /* - * Return new URL if we found a redirect + * Return new URL if we found a redirect * or if the subject already was a URL. * * The second case makes sure that we can @@ -1621,9 +1305,24 @@ struct http_response *redirect_url(struct client_state *csp) #endif /* def FEATURE_FAST_REDIRECTS */ csp->action->flags &= ~ACTION_REDIRECT; - /* Did any redirect action trigger? */ + /* Did any redirect action trigger? */ if (new_url) { + if (url_requires_percent_encoding(new_url)) + { + char *encoded_url; + log_error(LOG_LEVEL_REDIRECTS, "Percent-encoding redirect URL: %N", + strlen(new_url), new_url); + encoded_url = percent_encode_url(new_url); + freez(new_url); + if (encoded_url == NULL) + { + return cgi_error_memory(); + } + new_url = encoded_url; + assert(FALSE == url_requires_percent_encoding(new_url)); + } + if (0 == strcmpic(new_url, csp->http->url)) { log_error(LOG_LEVEL_ERROR, @@ -1641,14 +1340,14 @@ struct http_response *redirect_url(struct client_state *csp) return cgi_error_memory(); } - if ( enlist_unique_header(rsp->headers, "Location", new_url) - || (NULL == (rsp->status = strdup("302 Local Redirect from Privoxy"))) ) + if (enlist_unique_header(rsp->headers, "Location", new_url) + || (NULL == (rsp->status = strdup("302 Local Redirect from Privoxy")))) { freez(new_url); free_http_response(rsp); return cgi_error_memory(); } - rsp->reason = RSP_REASON_REDIRECTED; + rsp->crunch_reason = REDIRECTED; freez(new_url); return finish_http_response(csp, rsp); @@ -1863,7 +1562,8 @@ int is_untrusted_url(const struct client_state *csp) *********************************************************************/ static char *pcrs_filter_response(struct client_state *csp) { - int hits=0; + int hits = 0; + int i; size_t size, prev_size; char *old = NULL; @@ -1874,9 +1574,7 @@ static char *pcrs_filter_response(struct client_state *csp) struct re_filterfile_spec *b; struct list_entry *filtername; - int i, found_filters = 0; - - /* + /* * Sanity first */ if (csp->iob->cur >= csp->iob->eod) @@ -1884,23 +1582,7 @@ static char *pcrs_filter_response(struct client_state *csp) return(NULL); } - /* - * Need to check the set of re_filterfiles... - */ - for (i = 0; i < MAX_AF_FILES; i++) - { - fl = csp->rlist[i]; - if (NULL != fl) - { - if (NULL != fl->f) - { - found_filters = 1; - break; - } - } - } - - if (0 == found_filters) + if (filters_available(csp) == FALSE) { log_error(LOG_LEVEL_ERROR, "Inconsistent configuration: " "content filtering enabled, but no content filters available."); @@ -2108,42 +1790,10 @@ static char *gif_deanimate_response(struct client_state *csp) * NULL if no content filter is active * *********************************************************************/ -filter_function_ptr get_filter_function(struct client_state *csp) +static filter_function_ptr get_filter_function(const struct client_state *csp) { filter_function_ptr filter_function = NULL; - /* - * Are we enabling text mode by force? - */ - if (csp->action->flags & ACTION_FORCE_TEXT_MODE) - { - /* - * Do we really have to? - */ - if (csp->content_type & CT_TEXT) - { - log_error(LOG_LEVEL_HEADER, "Text mode is already enabled."); - } - else - { - csp->content_type |= CT_TEXT; - log_error(LOG_LEVEL_HEADER, "Text mode enabled by force. Take cover!"); - } - } - - if (!(csp->content_type & CT_DECLARED)) - { - /* - * The server didn't bother to declare a MIME-Type. - * Assume it's text that can be filtered. - * - * This also regulary happens with 304 responses, - * therefore logging anything here would cause - * too much noise. - */ - csp->content_type |= CT_TEXT; - } - /* * Choose the applying filter function based on * the content type and action settings. @@ -2204,13 +1854,15 @@ static jb_err remove_chunked_transfer_coding(char *buffer, size_t *size) return JB_ERR_PARSE; } - if ((newsize += chunksize) >= *size) + if (chunksize >= *size - newsize) { log_error(LOG_LEVEL_ERROR, - "Chunk size %d exceeds buffer size %d in \"chunked\" transfer coding", - chunksize, *size); + "Chunk size %u exceeds buffered data left. " + "Already digested %u of %u buffered bytes.", + chunksize, (unsigned int)newsize, (unsigned int)*size); return JB_ERR_PARSE; } + newsize += chunksize; from_p += 2; memmove(to_p, from_p, (size_t) chunksize); @@ -2223,7 +1875,7 @@ static jb_err remove_chunked_transfer_coding(char *buffer, size_t *size) break; } } - + /* XXX: Should get its own loglevel. */ log_error(LOG_LEVEL_RE_FILTER, "De-chunking successful. Shrunk from %d to %d", *size, newsize); @@ -2311,20 +1963,23 @@ static jb_err prepare_for_filtering(struct client_state *csp) /********************************************************************* * - * Function : execute_content_filter + * Function : execute_content_filters * * Description : Executes a given content filter. * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) - * 2 : content_filter = The filter function to execute * * Returns : Pointer to the modified buffer, or * NULL if filtering failed or wasn't necessary. * *********************************************************************/ -char *execute_content_filter(struct client_state *csp, filter_function_ptr content_filter) +char *execute_content_filters(struct client_state *csp) { + filter_function_ptr content_filter; + + assert(content_filters_enabled(csp->action)); + if (0 == csp->iob->eod - csp->iob->cur) { /* @@ -2350,6 +2005,8 @@ char *execute_content_filter(struct client_state *csp, filter_function_ptr conte return NULL; } + content_filter = get_filter_function(csp); + return ((*content_filter)(csp)); } @@ -2521,18 +2178,9 @@ const static struct forward_spec *get_forward_override_settings(struct client_st if (NULL != socks_proxy) { /* Parse the SOCKS proxy host[:port] */ - fwd->gateway_host = strdup(socks_proxy); - - if (NULL != (socks_proxy = strchr(fwd->gateway_host, ':'))) - { - *socks_proxy++ = '\0'; - fwd->gateway_port = (int)strtol(socks_proxy, NULL, 0); - } - - if (fwd->gateway_port <= 0) - { - fwd->gateway_port = 1080; - } + fwd->gateway_port = 1080; + parse_forwarder_address(socks_proxy, + &fwd->gateway_host, &fwd->gateway_port); http_parent = vec[2]; } @@ -2548,18 +2196,9 @@ const static struct forward_spec *get_forward_override_settings(struct client_st /* Parse http forwarding settings */ if (strcmp(http_parent, ".") != 0) { - fwd->forward_host = strdup(http_parent); - - if (NULL != (http_parent = strchr(fwd->forward_host, ':'))) - { - *http_parent++ = '\0'; - fwd->forward_port = (int)strtol(http_parent, NULL, 0); - } - - if (fwd->forward_port <= 0) - { - fwd->forward_port = 8000; - } + fwd->forward_port = 8000; + parse_forwarder_address(http_parent, + &fwd->forward_host, &fwd->forward_port); } assert (NULL != fwd); @@ -2615,7 +2254,7 @@ const struct forward_spec *forward_url(struct client_state *csp, /********************************************************************* * - * Function : direct_response + * Function : direct_response * * Description : Check if Max-Forwards == 0 for an OPTIONS or TRACE * request and if so, return a HTTP 501 to the client. @@ -2624,7 +2263,7 @@ const struct forward_spec *forward_url(struct client_state *csp, * requests properly. Still, what we do here is rfc- * compliant, whereas ignoring or forwarding are not. * - * Parameters : + * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) * * Returns : http_response if , NULL if nonmatch or handler fail @@ -2640,7 +2279,7 @@ struct http_response *direct_response(struct client_state *csp) { for (p = csp->headers->first; (p != NULL) ; p = p->next) { - if (!strncmpic("Max-Forwards:", p->str, 13)) + if (!strncmpic(p->str, "Max-Forwards:", 13)) { unsigned int max_forwards; @@ -2664,7 +2303,7 @@ struct http_response *direct_response(struct client_state *csp) { return cgi_error_memory(); } - + if (NULL == (rsp->status = strdup("501 Not Implemented"))) { free_http_response(rsp); @@ -2672,7 +2311,7 @@ struct http_response *direct_response(struct client_state *csp) } rsp->is_static = 1; - rsp->reason = RSP_REASON_UNSUPPORTED; + rsp->crunch_reason = UNSUPPORTED; return(finish_http_response(csp, rsp)); } @@ -2683,6 +2322,81 @@ struct http_response *direct_response(struct client_state *csp) } +/********************************************************************* + * + * Function : content_requires_filtering + * + * Description : Checks whether there are any content filters + * enabled for the current request and if they + * can actually be applied.. + * + * Parameters : + * 1 : csp = Current client state (buffers, headers, etc...) + * + * Returns : TRUE for yes, FALSE otherwise + * + *********************************************************************/ +int content_requires_filtering(struct client_state *csp) +{ + if ((csp->content_type & CT_TABOO) + && !(csp->action->flags & ACTION_FORCE_TEXT_MODE)) + { + return FALSE; + } + + /* + * Are we enabling text mode by force? + */ + if (csp->action->flags & ACTION_FORCE_TEXT_MODE) + { + /* + * Do we really have to? + */ + if (csp->content_type & CT_TEXT) + { + log_error(LOG_LEVEL_HEADER, "Text mode is already enabled."); + } + else + { + csp->content_type |= CT_TEXT; + log_error(LOG_LEVEL_HEADER, "Text mode enabled by force. Take cover!"); + } + } + + if (!(csp->content_type & CT_DECLARED)) + { + /* + * The server didn't bother to declare a MIME-Type. + * Assume it's text that can be filtered. + * + * This also regulary happens with 304 responses, + * therefore logging anything here would cause + * too much noise. + */ + csp->content_type |= CT_TEXT; + } + + /* + * Choose the applying filter function based on + * the content type and action settings. + */ + if ((csp->content_type & CT_TEXT) && + (csp->rlist != NULL) && + (!list_is_empty(csp->action->multi[ACTION_MULTI_FILTER]))) + { + return TRUE; + } + else if ((csp->content_type & CT_GIF) && + (csp->action->flags & ACTION_DEANIMATE)) + { + return TRUE; + } + + return FALSE; + +} + + /********************************************************************* * * Function : content_filters_enabled @@ -2690,7 +2404,7 @@ struct http_response *direct_response(struct client_state *csp) * Description : Checks whether there are any content filters * enabled for the current request. * - * Parameters : + * Parameters : * 1 : action = Action spec to check. * * Returns : TRUE for yes, FALSE otherwise @@ -2702,6 +2416,34 @@ int content_filters_enabled(const struct current_action_spec *action) !list_is_empty(action->multi[ACTION_MULTI_FILTER])); } + +/********************************************************************* + * + * Function : filters_available + * + * Description : Checks whether there are any filters available. + * + * Parameters : + * 1 : csp = Current client state (buffers, headers, etc...) + * + * Returns : TRUE for yes, FALSE otherwise. + * + *********************************************************************/ +int filters_available(const struct client_state *csp) +{ + int i; + for (i = 0; i < MAX_AF_FILES; i++) + { + const struct file_list *fl = csp->rlist[i]; + if ((NULL != fl) && (NULL != fl->f)) + { + return TRUE; + } + } + return FALSE; +} + + /* Local Variables: tab-width: 3 diff --git a/external/privoxy/filters.h b/external/privoxy/filters.h index 66794e1f..0bd2b950 100644 --- a/external/privoxy/filters.h +++ b/external/privoxy/filters.h @@ -1,6 +1,6 @@ #ifndef FILTERS_H_INCLUDED #define FILTERS_H_INCLUDED -#define FILTERS_H_VERSION "$Id: filters.h,v 1.36 2008/05/21 15:35:08 fabiankeil Exp $" +#define FILTERS_H_VERSION "$Id: filters.h,v 1.43 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/filters.h,v $ @@ -12,14 +12,14 @@ * `ij_untrusted_url', `intercept_url', `re_process_buffer', * `show_proxy_args', and `trust_url' * - * Copyright : Written by and Copyright (C) 2001, 2004 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2010 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -37,244 +37,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: filters.h,v $ - * Revision 1.36 2008/05/21 15:35:08 fabiankeil - * - Mark csp as immutable for block_acl(). - * - Remove an obsolete complaint about filter_popups(). - * - * Revision 1.35 2008/05/03 16:40:45 fabiankeil - * Change content_filters_enabled()'s parameter from - * csp->action to action so it can be also used in the - * CGI code. Don't bother checking if there are filters - * loaded, as that's somewhat besides the point. - * - * Revision 1.34 2008/03/02 12:25:25 fabiankeil - * Also use shiny new connect_port_is_forbidden() in jcc.c. - * - * Revision 1.33 2008/02/23 16:57:12 fabiankeil - * Rename url_actions() to get_url_actions() and let it - * use the standard parameter ordering. - * - * Revision 1.32 2008/02/23 16:33:43 fabiankeil - * Let forward_url() use the standard parameter ordering - * and mark its second parameter immutable. - * - * Revision 1.31 2007/10/19 16:53:28 fabiankeil - * Add helper function to check if any content filters are enabled. - * - * Revision 1.30 2007/09/29 10:21:16 fabiankeil - * - Move get_filter_function() from jcc.c to filters.c - * so the filter functions can be static. - * - Don't bother filtering body-less responses. - * - * Revision 1.29 2007/09/28 16:38:55 fabiankeil - * - Execute content filters through execute_content_filter(). - * - Add prepare_for_filtering() so filter functions don't have to - * care about de-chunking and decompression. As a side effect this enables - * decompression for gif_deanimate_response() and jpeg_inspect_response(). - * - Change remove_chunked_transfer_coding()'s return type to jb_err. - * Some clowns feel like chunking empty responses in which case - * (size == 0) is valid but previously would be interpreted as error. - * - * Revision 1.28 2007/09/02 15:31:20 fabiankeil - * Move match_portlist() from filter.c to urlmatch.c. - * It's used for url matching, not for filtering. - * - * Revision 1.27 2007/04/30 15:02:18 fabiankeil - * Introduce dynamic pcrs jobs that can resolve variables. - * - * Revision 1.26 2007/03/13 11:28:43 fabiankeil - * - Fix port handling in acl_addr() and use a temporary acl spec - * copy so error messages don't contain a truncated version. - * - Log size of iob before and after decompression. - * - * Revision 1.25 2007/01/12 15:36:44 fabiankeil - * Mark *csp as immutable for is_untrusted_url() - * and is_imageurl(). Closes FR 1237736. - * - * Revision 1.24 2006/12/29 18:30:46 fabiankeil - * Fixed gcc43 conversion warnings, - * changed sprintf calls to snprintf. - * - * Revision 1.23 2006/11/28 15:19:43 fabiankeil - * Implemented +redirect{s@foo@bar@} to generate - * a redirect based on a rewritten version of the - * original URL. - * - * Revision 1.22 2006/07/18 14:48:46 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.20.2.2 2004/10/03 12:53:32 david__schmidt - * Add the ability to check jpeg images for invalid - * lengths of comment blocks. Defensive strategy - * against the exploit: - * Microsoft Security Bulletin MS04-028 - * Buffer Overrun in JPEG Processing (GDI+) Could - * Allow Code Execution (833987) - * Enabled with +inspect-jpegs in actions files. - * - * Revision 1.20.2.1 2002/09/25 14:51:51 oes - * Added basic support for OPTIONS and TRACE HTTP methods: - * New function direct_response which handles OPTIONS and - * TRACE requests whose Max-Forwards header field is zero. - * - * Revision 1.20 2002/04/02 14:56:16 oes - * Bugfix: is_untrusted_url() and trust_url() now depend on FEATURE_TRUST, not FEATURE_COOKIE_JAR - * - * Revision 1.19 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.18 2002/03/25 22:12:45 oes - * Added fix for undefined INADDR_NONE on Solaris by Bart Schelstraete - * - * Revision 1.17 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.16 2002/01/17 21:01:02 jongfoster - * Moving all our URL and URL pattern parsing code to urlmatch.c. - * - * Revision 1.15 2001/10/10 16:44:16 oes - * Added match_portlist function - * - * Revision 1.14 2001/10/07 15:41:40 oes - * Added prototype for remove_chunked_transfer_coding - * - * Revision 1.13 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.12 2001/07/29 19:01:11 jongfoster - * Changed _FILENAME_H to FILENAME_H_INCLUDED. - * Added forward declarations for needed structures. - * - * Revision 1.11 2001/07/13 14:00:18 oes - * - Introduced gif_deanimate_response - * - Renamed re_process_buffer to pcrs_filter_response - * - Removed all #ifdef PCRS - * - * Revision 1.10 2001/06/29 13:29:01 oes - * Cleaned up and updated to reflect the changesin - * filters.c - * - * Revision 1.9 2001/06/07 23:10:53 jongfoster - * Replacing struct gateway with struct forward_spec - * - * Revision 1.8 2001/06/03 19:12:00 oes - * extracted-CGI relevant stuff - * - * Revision 1.7 2001/05/31 21:21:30 jongfoster - * Permissionsfile / actions file changes: - * - Changed "permission" to "action" throughout - * - changes to file format to allow string parameters - * - Moved helper functions to actions.c - * - * Revision 1.6 2001/05/29 09:50:24 jongfoster - * Unified blocklist/imagelist/permissionslist. - * File format is still under discussion, but the internal changes - * are (mostly) done. - * - * Also modified interceptor behaviour: - * - We now intercept all URLs beginning with one of the following - * prefixes (and *only* these prefixes): - * * http://i.j.b/ - * * http://ijbswa.sf.net/config/ - * * http://ijbswa.sourceforge.net/config/ - * - New interceptors "home page" - go to http://i.j.b/ to see it. - * - Internal changes so that intercepted and fast redirect pages - * are not replaced with an image. - * - Interceptors now have the option to send a binary page direct - * to the client. (i.e. ijb-send-banner uses this) - * - Implemented show-url-info interceptor. (Which is why I needed - * the above interceptors changes - a typical URL is - * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". - * The previous mechanism would not have intercepted that, and - * if it had been intercepted then it then it would have replaced - * it with an image.) - * - * Revision 1.5 2001/05/27 22:17:04 oes - * - * - re_process_buffer no longer writes the modified buffer - * to the client, which was very ugly. It now returns the - * buffer, which it is then written by chat. - * - * - content_length now adjusts the Content-Length: header - * for modified documents rather than crunch()ing it. - * (Length info in csp->content_length, which is 0 for - * unmodified documents) - * - * - For this to work, sed() is called twice when filtering. - * - * Revision 1.4 2001/05/26 15:26:15 jongfoster - * ACL feature now provides more security by immediately dropping - * connections from untrusted hosts. - * - * Revision 1.3 2001/05/22 18:46:04 oes - * - * - Enabled filtering banners by size rather than URL - * by adding patterns that replace all standard banner - * sizes with the "Junkbuster" gif to the re_filterfile - * - * - Enabled filtering WebBugs by providing a pattern - * which kills all 1x1 images - * - * - Added support for PCRE_UNGREEDY behaviour to pcrs, - * which is selected by the (nonstandard and therefore - * capital) letter 'U' in the option string. - * It causes the quantifiers to be ungreedy by default. - * Appending a ? turns back to greedy (!). - * - * - Added a new interceptor ijb-send-banner, which - * sends back the "Junkbuster" gif. Without imagelist or - * MSIE detection support, or if tinygif = 1, or the - * URL isn't recognized as an imageurl, a lame HTML - * explanation is sent instead. - * - * - Added new feature, which permits blocking remote - * script redirects and firing back a local redirect - * to the browser. - * The feature is conditionally compiled, i.e. it - * can be disabled with --disable-fast-redirects, - * plus it must be activated by a "fast-redirects" - * line in the config file, has its own log level - * and of course wants to be displayed by show-proxy-args - * Note: Boy, all the #ifdefs in 1001 locations and - * all the fumbling with configure.in and acconfig.h - * were *way* more work than the feature itself :-( - * - * - Because a generic redirect template was needed for - * this, tinygif = 3 now uses the same. - * - * - Moved GIFs, and other static HTTP response templates - * to project.h - * - * - Some minor fixes - * - * - Removed some >400 CRs again (Jon, you really worked - * a lot! ;-) - * - * Revision 1.2 2001/05/20 01:21:20 jongfoster - * Version 2.9.4 checkin. - * - Merged popupfile and cookiefile, and added control over PCRS - * filtering, in new "permissionsfile". - * - Implemented LOG_LEVEL_FATAL, so that if there is a configuration - * file error you now get a message box (in the Win32 GUI) rather - * than the program exiting with no explanation. - * - Made killpopup use the PCRS MIME-type checking and HTTP-header - * skipping. - * - Removed tabs from "config" - * - Moved duplicated url parsing code in "loaders.c" to a new funcition. - * - Bumped up version number. - * - * Revision 1.1.1.1 2001/05/15 13:58:52 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include "project.h" @@ -325,8 +89,8 @@ extern int connect_port_is_forbidden(const struct client_state *csp); */ extern void get_url_actions(struct client_state *csp, struct http_request *http); -extern void apply_url_actions(struct current_action_spec *action, - struct http_request *http, +extern void apply_url_actions(struct current_action_spec *action, + struct http_request *http, struct url_actions *b); /* * Determining parent proxies @@ -337,33 +101,23 @@ extern const struct forward_spec *forward_url(struct client_state *csp, /* * Content modification */ - -typedef char *(*filter_function_ptr)(); -extern char *execute_content_filter(struct client_state *csp, filter_function_ptr content_filter); - -extern filter_function_ptr get_filter_function(struct client_state *csp); +extern char *execute_content_filters(struct client_state *csp); extern char *execute_single_pcrs_command(char *subject, const char *pcrs_command, int *hits); extern char *rewrite_url(char *old_url, const char *pcrs_command); extern char *get_last_url(char *subject, const char *redirect_mode); extern pcrs_job *compile_dynamic_pcrs_job_list(const struct client_state *csp, const struct re_filterfile_spec *b); +extern int content_requires_filtering(struct client_state *csp); extern int content_filters_enabled(const struct current_action_spec *action); +extern int filters_available(const struct client_state *csp); /* * Handling Max-Forwards: */ extern struct http_response *direct_response(struct client_state *csp); - /* - * Solaris fix: - */ -#ifndef INADDR_NONE -#define INADDR_NONE -1 -#endif - -/* * Revision control strings from this header and associated .c file */ extern const char filters_rcs[]; diff --git a/external/privoxy/gateway.c b/external/privoxy/gateway.c index 1e4ffd0e..b96fbb2b 100644 --- a/external/privoxy/gateway.c +++ b/external/privoxy/gateway.c @@ -1,4 +1,4 @@ -const char gateway_rcs[] = "$Id: gateway.c,v 1.48 2009/02/13 17:20:36 fabiankeil Exp $"; +const char gateway_rcs[] = "$Id: gateway.c,v 1.83 2011/12/24 15:28:45 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/gateway.c,v $ @@ -7,7 +7,7 @@ const char gateway_rcs[] = "$Id: gateway.c,v 1.48 2009/02/13 17:20:36 fabiankeil * using a "forwarder" (i.e. HTTP proxy and/or a SOCKS4 * or SOCKS5 proxy). * - * Copyright : Written by and Copyright (C) 2001-2009 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2009 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written @@ -32,217 +32,8 @@ const char gateway_rcs[] = "$Id: gateway.c,v 1.48 2009/02/13 17:20:36 fabiankeil * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: gateway.c,v $ - * Revision 1.48 2009/02/13 17:20:36 fabiankeil - * Reword keep-alive support warning and only show - * it #if !defined(HAVE_POLL) && !defined(_WIN32). - * - * Revision 1.47 2008/12/24 17:06:19 fabiankeil - * Keep a thread around to timeout alive connections - * even if no new requests are coming in. - * - * Revision 1.46 2008/12/13 11:07:23 fabiankeil - * Remove duplicated debugging checks - * in connection_destination_matches(). - * - * Revision 1.45 2008/12/04 18:17:07 fabiankeil - * Fix some cparser warnings. - * - * Revision 1.44 2008/11/22 11:54:04 fabiankeil - * Move log message around to include the socket number. - * - * Revision 1.43 2008/11/13 09:15:51 fabiankeil - * Make keep_alive_timeout static. - * - * Revision 1.42 2008/11/13 09:08:42 fabiankeil - * Add new config option: keep-alive-timeout. - * - * Revision 1.41 2008/11/08 15:29:58 fabiankeil - * Unify two debug messages. - * - * Revision 1.40 2008/11/08 15:14:05 fabiankeil - * Fix duplicated debugging check. - * - * Revision 1.39 2008/10/25 11:33:01 fabiankeil - * Remove already out-commented line left over from debugging. - * - * Revision 1.38 2008/10/24 17:33:00 fabiankeil - * - Tone the "keep-alive support is experimental" warning - * down a bit as hackish 0-chunk detection has been - * implemented recently. - * - Only show the "ndef HAVE_POLL" warning once on start-up. - * - * Revision 1.37 2008/10/23 17:40:53 fabiankeil - * Fix forget_connection() and mark_connection_unused(), - * which would both under certain circumstances access - * reusable_connection[MAX_REUSABLE_CONNECTIONS]. Oops. - * - * Revision 1.36 2008/10/18 19:49:15 fabiankeil - * - Factor close_unusable_connections() out of - * get_reusable_connection() to make sure we really check - * all the remembered connections, not just the ones before - * the next reusable one. - * - Plug two file descriptor leaks. Internally marking - * connections as closed doesn't cut it. - * - * Revision 1.35 2008/10/17 17:12:01 fabiankeil - * In socket_is_still_usable(), use select() - * and FD_ISSET() if poll() isn't available. - * - * Revision 1.34 2008/10/17 17:07:13 fabiankeil - * Add preliminary timeout support. - * - * Revision 1.33 2008/10/16 16:34:21 fabiankeil - * Fix two gcc44 warnings. - * - * Revision 1.32 2008/10/16 16:27:22 fabiankeil - * Fix compiler warning. - * - * Revision 1.31 2008/10/16 07:31:11 fabiankeil - * - Factor socket_is_still_usable() out of get_reusable_connection(). - * - If poll() isn't available, show a warning and assume the socket - * is still usable. - * - * Revision 1.30 2008/10/13 17:31:03 fabiankeil - * If a remembered connection is no longer usable and - * has been marked closed, don't bother checking if the - * destination matches. - * - * Revision 1.29 2008/10/11 16:59:41 fabiankeil - * Add missing dots for two log messages. - * - * Revision 1.28 2008/10/09 18:21:41 fabiankeil - * Flush work-in-progress changes to keep outgoing connections - * alive where possible. Incomplete and mostly #ifdef'd out. - * - * Revision 1.27 2008/09/27 15:05:51 fabiankeil - * Return only once in forwarded_connect(). - * - * Revision 1.26 2008/08/18 17:42:06 fabiankeil - * Fix typo in macro name. - * - * Revision 1.25 2008/02/07 18:09:46 fabiankeil - * In socks5_connect: - * - make the buffers quite a bit smaller. - * - properly report "socks5 server unreachable" failures. - * - let strncpy() use the whole buffer. Using a length of 0xffu wasn't actually - * wrong, but requires too much thinking as it doesn't depend on the buffer size. - * - log a message if the socks5 server sends more data than expected. - * - add some assertions and comments. - * - * Revision 1.24 2008/02/04 14:56:29 fabiankeil - * - Fix a compiler warning. - * - Stop assuming that htonl(INADDR_NONE) equals INADDR_NONE. - * - * Revision 1.23 2008/02/04 13:11:35 fabiankeil - * Remember the cause of the SOCKS5 error for the CGI message. - * - * Revision 1.22 2008/02/03 13:46:15 fabiankeil - * Add SOCKS5 support. Patch #1862863 by Eric M. Hopper with minor changes. - * - * Revision 1.21 2007/07/28 12:30:03 fabiankeil - * Modified patch from Song Weijia (#1762559) to - * fix socks requests on big-endian platforms. - * - * Revision 1.20 2007/05/14 10:23:48 fabiankeil - * - Use strlcpy() instead of strcpy(). - * - Use the same buffer for socks requests and socks responses. - * - Fix bogus warning about web_server_addr being used uninitialized. - * - * Revision 1.19 2007/01/25 14:09:45 fabiankeil - * - Save errors in socks4_connect() to csp->error_message. - * - Silence some gcc43 warnings, hopefully the right way. - * - * Revision 1.18 2006/07/18 14:48:46 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.16 2002/05/12 21:36:29 jongfoster - * Correcting function comments - * - * Revision 1.15 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.14 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.13 2002/03/13 00:29:59 jongfoster - * Killing warnings - * - * Revision 1.12 2002/03/09 20:03:52 jongfoster - * - Making various functions return int rather than size_t. - * (Undoing a recent change). Since size_t is unsigned on - * Windows, functions like read_socket that return -1 on - * error cannot return a size_t. - * - * THIS WAS A MAJOR BUG - it caused frequent, unpredictable - * crashes, and also frequently caused JB to jump to 100% - * CPU and stay there. (Because it thought it had just - * read ((unsigned)-1) == 4Gb of data...) - * - * - The signature of write_socket has changed, it now simply - * returns success=0/failure=nonzero. - * - * - Trying to get rid of a few warnings --with-debug on - * Windows, I've introduced a new type "jb_socket". This is - * used for the socket file descriptors. On Windows, this - * is SOCKET (a typedef for unsigned). Everywhere else, it's - * an int. The error value can't be -1 any more, so it's - * now JB_INVALID_SOCKET (which is -1 on UNIX, and in - * Windows it maps to the #define INVALID_SOCKET.) - * - * - The signature of bind_port has changed. - * - * Revision 1.11 2002/03/08 17:46:04 jongfoster - * Fixing int/size_t warnings - * - * Revision 1.10 2002/03/07 03:50:19 oes - * - Improved handling of failed DNS lookups - * - Fixed compiler warnings - * - * Revision 1.9 2001/10/25 03:40:48 david__schmidt - * Change in porting tactics: OS/2's EMX porting layer doesn't allow multiple - * threads to call select() simultaneously. So, it's time to do a real, live, - * native OS/2 port. See defines for __EMX__ (the porting layer) vs. __OS2__ - * (native). Both versions will work, but using __OS2__ offers multi-threading. - * - * Revision 1.8 2001/09/13 20:10:12 jongfoster - * Fixing missing #include under Windows - * - * Revision 1.7 2001/09/12 17:58:26 steudten - * - * add #include - * - * Revision 1.6 2001/09/10 10:41:16 oes - * Added #include in.h - * - * Revision 1.5 2001/07/29 18:47:57 jongfoster - * Adding missing #include project.h - * - * Revision 1.4 2001/07/24 12:47:06 oes - * Applied BeOS support update by Eugenia - * - * Revision 1.3 2001/06/09 10:55:28 jongfoster - * Changing BUFSIZ ==> BUFFER_SIZE - * - * Revision 1.2 2001/06/07 23:11:38 jongfoster - * Removing gateways[] list - no longer used. - * Replacing function pointer in struct gateway with a directly - * called function forwarded_connect(), which can do the common - * task of deciding whether to connect to the web server or HTTP - * proxy. - * Replacing struct gateway with struct forward_spec - * Fixing bug with SOCKS4A and HTTP proxy server in combination. - * It was a bug which led to the connection being made to the web - * server rather than the HTTP proxy, and also a buffer overrun. - * - * Revision 1.1.1.1 2001/05/15 13:58:54 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include "config.h" @@ -277,7 +68,7 @@ const char gateway_rcs[] = "$Id: gateway.c,v 1.48 2009/02/13 17:20:36 fabiankeil #include "miscutil.h" #ifdef FEATURE_CONNECTION_KEEP_ALIVE #ifdef HAVE_POLL -#ifdef __GLIBC__ +#ifdef __GLIBC__ #include #else #include @@ -297,21 +88,24 @@ static jb_socket socks5_connect(const struct forward_spec *fwd, int target_port, struct client_state *csp); +enum { + SOCKS4_REQUEST_GRANTED = 90, + SOCKS4_REQUEST_REJECT = 91, + SOCKS4_REQUEST_IDENT_FAILED = 92, + SOCKS4_REQUEST_IDENT_CONFLICT = 93 +}; -#define SOCKS_REQUEST_GRANTED 90 -#define SOCKS_REQUEST_REJECT 91 -#define SOCKS_REQUEST_IDENT_FAILED 92 -#define SOCKS_REQUEST_IDENT_CONFLICT 93 - -#define SOCKS5_REQUEST_GRANTED 0 -#define SOCKS5_REQUEST_FAILED 1 -#define SOCKS5_REQUEST_DENIED 2 -#define SOCKS5_REQUEST_NETWORK_UNREACHABLE 3 -#define SOCKS5_REQUEST_HOST_UNREACHABLE 4 -#define SOCKS5_REQUEST_CONNECTION_REFUSED 5 -#define SOCKS5_REQUEST_TTL_EXPIRED 6 -#define SOCKS5_REQUEST_PROTOCOL_ERROR 7 -#define SOCKS5_REQUEST_BAD_ADDRESS_TYPE 8 +enum { + SOCKS5_REQUEST_GRANTED = 0, + SOCKS5_REQUEST_FAILED = 1, + SOCKS5_REQUEST_DENIED = 2, + SOCKS5_REQUEST_NETWORK_UNREACHABLE = 3, + SOCKS5_REQUEST_HOST_UNREACHABLE = 4, + SOCKS5_REQUEST_CONNECTION_REFUSED = 5, + SOCKS5_REQUEST_TTL_EXPIRED = 6, + SOCKS5_REQUEST_PROTOCOL_ERROR = 7, + SOCKS5_REQUEST_BAD_ADDRESS_TYPE = 8 +}; /* structure of a socks client operation */ struct socks_op { @@ -334,32 +128,13 @@ struct socks_reply { static const char socks_userid[] = "anonymous"; -#ifdef FEATURE_CONNECTION_KEEP_ALIVE +#ifdef FEATURE_CONNECTION_SHARING #define MAX_REUSABLE_CONNECTIONS 100 -static int keep_alive_timeout = DEFAULT_KEEP_ALIVE_TIMEOUT; - -struct reusable_connection -{ - jb_socket sfd; - int in_use; - char *host; - int port; - time_t timestamp; - - int forwarder_type; - char *gateway_host; - int gateway_port; - char *forward_host; - int forward_port; -}; +static unsigned int keep_alive_timeout = DEFAULT_KEEP_ALIVE_TIMEOUT; static struct reusable_connection reusable_connection[MAX_REUSABLE_CONNECTIONS]; - -static int mark_connection_unused(jb_socket sfd); -static void mark_connection_closed(struct reusable_connection *closed_connection); -static int socket_is_still_usable(jb_socket sfd); - +static int mark_connection_unused(const struct reusable_connection *connection); /********************************************************************* * @@ -397,25 +172,23 @@ extern void initialize_reusable_connections(void) * * Function : remember_connection * - * Description : Remembers a connection for reuse later on. + * Description : Remembers a server connection for reuse later on. * * Parameters : - * 1 : sfd = Open socket to remember. - * 2 : http = The destination for the connection. - * 3 : fwd = The forwarder settings used. + * 1 : connection = The server connection to remember. * * Returns : void * *********************************************************************/ -void remember_connection(jb_socket sfd, const struct http_request *http, - const struct forward_spec *fwd) +void remember_connection(const struct reusable_connection *connection) { unsigned int slot = 0; int free_slot_found = FALSE; - assert(sfd != JB_INVALID_SOCKET); + assert(NULL != connection); + assert(connection->sfd != JB_INVALID_SOCKET); - if (mark_connection_unused(sfd)) + if (mark_connection_unused(connection)) { return; } @@ -430,7 +203,7 @@ void remember_connection(jb_socket sfd, const struct http_request *http, assert(reusable_connection[slot].in_use == 0); log_error(LOG_LEVEL_CONNECT, "Remembering socket %d for %s:%d in slot %d.", - sfd, http->host, http->port, slot); + connection->sfd, connection->host, connection->port, slot); free_slot_found = TRUE; break; } @@ -440,34 +213,36 @@ void remember_connection(jb_socket sfd, const struct http_request *http, { log_error(LOG_LEVEL_CONNECT, "No free slots found to remembering socket for %s:%d. Last slot %d.", - http->host, http->port, slot); + connection->host, connection->port, slot); privoxy_mutex_unlock(&connection_reuse_mutex); - close_socket(sfd); + close_socket(connection->sfd); return; } - assert(NULL != http->host); - reusable_connection[slot].host = strdup(http->host); + assert(NULL != connection->host); + reusable_connection[slot].host = strdup(connection->host); if (NULL == reusable_connection[slot].host) { log_error(LOG_LEVEL_FATAL, "Out of memory saving socket."); } - reusable_connection[slot].sfd = sfd; - reusable_connection[slot].port = http->port; + reusable_connection[slot].sfd = connection->sfd; + reusable_connection[slot].port = connection->port; reusable_connection[slot].in_use = 0; - reusable_connection[slot].timestamp = time(NULL); + reusable_connection[slot].timestamp = connection->timestamp; + reusable_connection->request_sent = connection->request_sent; + reusable_connection->response_received = connection->response_received; + reusable_connection[slot].keep_alive_timeout = connection->keep_alive_timeout; - assert(NULL != fwd); assert(reusable_connection[slot].gateway_host == NULL); assert(reusable_connection[slot].gateway_port == 0); assert(reusable_connection[slot].forwarder_type == SOCKS_NONE); assert(reusable_connection[slot].forward_host == NULL); assert(reusable_connection[slot].forward_port == 0); - reusable_connection[slot].forwarder_type = fwd->type; - if (NULL != fwd->gateway_host) + reusable_connection[slot].forwarder_type = connection->forwarder_type; + if (NULL != connection->gateway_host) { - reusable_connection[slot].gateway_host = strdup(fwd->gateway_host); + reusable_connection[slot].gateway_host = strdup(connection->gateway_host); if (NULL == reusable_connection[slot].gateway_host) { log_error(LOG_LEVEL_FATAL, "Out of memory saving gateway_host."); @@ -477,11 +252,11 @@ void remember_connection(jb_socket sfd, const struct http_request *http, { reusable_connection[slot].gateway_host = NULL; } - reusable_connection[slot].gateway_port = fwd->gateway_port; + reusable_connection[slot].gateway_port = connection->gateway_port; - if (NULL != fwd->forward_host) + if (NULL != connection->forward_host) { - reusable_connection[slot].forward_host = strdup(fwd->forward_host); + reusable_connection[slot].forward_host = strdup(connection->forward_host); if (NULL == reusable_connection[slot].forward_host) { log_error(LOG_LEVEL_FATAL, "Out of memory saving forward_host."); @@ -491,18 +266,19 @@ void remember_connection(jb_socket sfd, const struct http_request *http, { reusable_connection[slot].forward_host = NULL; } - reusable_connection[slot].forward_port = fwd->forward_port; + reusable_connection[slot].forward_port = connection->forward_port; privoxy_mutex_unlock(&connection_reuse_mutex); } +#endif /* def FEATURE_CONNECTION_SHARING */ +#ifdef FEATURE_CONNECTION_KEEP_ALIVE /********************************************************************* * * Function : mark_connection_closed * * Description : Marks a reused connection closed. - * Must be called with connection_reuse_mutex locked. * * Parameters : * 1 : closed_connection = The connection to mark as closed. @@ -510,21 +286,26 @@ void remember_connection(jb_socket sfd, const struct http_request *http, * Returns : void * *********************************************************************/ -static void mark_connection_closed(struct reusable_connection *closed_connection) +void mark_connection_closed(struct reusable_connection *closed_connection) { closed_connection->in_use = FALSE; closed_connection->sfd = JB_INVALID_SOCKET; freez(closed_connection->host); closed_connection->port = 0; closed_connection->timestamp = 0; + closed_connection->request_sent = 0; + closed_connection->response_received = 0; + closed_connection->keep_alive_timeout = 0; closed_connection->forwarder_type = SOCKS_NONE; freez(closed_connection->gateway_host); closed_connection->gateway_port = 0; freez(closed_connection->forward_host); closed_connection->forward_port = 0; } +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ +#ifdef FEATURE_CONNECTION_SHARING /********************************************************************* * * Function : forget_connection @@ -557,19 +338,17 @@ void forget_connection(jb_socket sfd) sfd, reusable_connection[slot].host, reusable_connection[slot].port, slot); mark_connection_closed(&reusable_connection[slot]); - privoxy_mutex_unlock(&connection_reuse_mutex); - - return; + break; } } - log_error(LOG_LEVEL_CONNECT, - "Socket %d already forgotten or never remembered.", sfd); - privoxy_mutex_unlock(&connection_reuse_mutex); + } +#endif /* def FEATURE_CONNECTION_SHARING */ +#ifdef FEATURE_CONNECTION_KEEP_ALIVE /********************************************************************* * * Function : connection_destination_matches @@ -586,9 +365,9 @@ void forget_connection(jb_socket sfd) * Returns : TRUE for yes, FALSE otherwise. * *********************************************************************/ -static int connection_destination_matches(const struct reusable_connection *connection, - const struct http_request *http, - const struct forward_spec *fwd) +int connection_destination_matches(const struct reusable_connection *connection, + const struct http_request *http, + const struct forward_spec *fwd) { if ((connection->forwarder_type != fwd->type) || (connection->gateway_port != fwd->gateway_port) @@ -603,7 +382,9 @@ static int connection_destination_matches(const struct reusable_connection *conn && strcmpic(connection->gateway_host, fwd->gateway_host)) && (connection->gateway_host != fwd->gateway_host)) { - log_error(LOG_LEVEL_CONNECT, "Gateway mismatch."); + log_error(LOG_LEVEL_CONNECT, + "Gateway mismatch. Previous gateway: %s. Current gateway: %s", + connection->gateway_host, fwd->gateway_host); return FALSE; } @@ -612,15 +393,19 @@ static int connection_destination_matches(const struct reusable_connection *conn && strcmpic(connection->forward_host, fwd->forward_host)) && (connection->forward_host != fwd->forward_host)) { - log_error(LOG_LEVEL_CONNECT, "Forwarding proxy mismatch."); + log_error(LOG_LEVEL_CONNECT, + "Forwarding proxy mismatch. Previous proxy: %s. Current proxy: %s", + connection->forward_host, fwd->forward_host); return FALSE; } return (!strcmpic(connection->host, http->host)); } +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ +#ifdef FEATURE_CONNECTION_SHARING /********************************************************************* * * Function : close_unusable_connections @@ -646,19 +431,23 @@ int close_unusable_connections(void) && (JB_INVALID_SOCKET != reusable_connection[slot].sfd)) { time_t time_open = time(NULL) - reusable_connection[slot].timestamp; + time_t latency = (reusable_connection[slot].response_received - + reusable_connection[slot].request_sent) / 2; - if (keep_alive_timeout < time_open) + if (reusable_connection[slot].keep_alive_timeout < time_open + latency) { log_error(LOG_LEVEL_CONNECT, "The connection to %s:%d in slot %d timed out. " - "Closing socket %d. Timeout is: %d.", + "Closing socket %d. Timeout is: %d. Assumed latency: %d.", reusable_connection[slot].host, reusable_connection[slot].port, slot, - reusable_connection[slot].sfd, keep_alive_timeout); + reusable_connection[slot].sfd, + reusable_connection[slot].keep_alive_timeout, + latency); close_socket(reusable_connection[slot].sfd); mark_connection_closed(&reusable_connection[slot]); } - else if (!socket_is_still_usable(reusable_connection[slot].sfd)) + else if (!socket_is_still_alive(reusable_connection[slot].sfd)) { log_error(LOG_LEVEL_CONNECT, "The connection to %s:%d in slot %d is no longer usable. " @@ -682,66 +471,6 @@ int close_unusable_connections(void) } -/********************************************************************* - * - * Function : socket_is_still_usable - * - * Description : Decides whether or not an open socket is still usable. - * - * Parameters : - * 1 : sfd = The socket to check. - * - * Returns : TRUE for yes, otherwise FALSE. - * - *********************************************************************/ -static int socket_is_still_usable(jb_socket sfd) -{ -#ifdef HAVE_POLL - int poll_result; - struct pollfd poll_fd[1]; - - memset(poll_fd, 0, sizeof(poll_fd)); - poll_fd[0].fd = sfd; - poll_fd[0].events = POLLIN; - - poll_result = poll(poll_fd, 1, 0); - - if (-1 != poll_result) - { - return !(poll_fd[0].revents & POLLIN); - } - else - { - log_error(LOG_LEVEL_CONNECT, "Polling socket %d failed.", sfd); - return FALSE; - } -#else - fd_set readable_fds; - struct timeval timeout; - int ret; - int socket_is_alive = 0; - - memset(&timeout, '\0', sizeof(timeout)); - FD_ZERO(&readable_fds); - FD_SET(sfd, &readable_fds); - - ret = select((int)sfd+1, &readable_fds, NULL, NULL, &timeout); - if (ret < 0) - { - log_error(LOG_LEVEL_ERROR, "select() failed!: %E"); - } - - /* - * XXX: I'm not sure why !FD_ISSET() works, - * but apparently it does. - */ - socket_is_alive = !FD_ISSET(sfd, &readable_fds); - - return socket_is_alive; -#endif /* def HAVE_POLL */ -} - - /********************************************************************* * * Function : get_reusable_connection @@ -777,8 +506,13 @@ static jb_socket get_reusable_connection(const struct http_request *http, reusable_connection[slot].in_use = TRUE; sfd = reusable_connection[slot].sfd; log_error(LOG_LEVEL_CONNECT, - "Found reusable socket %d for %s:%d in slot %d.", - sfd, reusable_connection[slot].host, reusable_connection[slot].port, slot); + "Found reusable socket %d for %s:%d in slot %d. " + "Timestamp made %d seconds ago. Timeout: %d. Latency: %d.", + sfd, reusable_connection[slot].host, reusable_connection[slot].port, + slot, time(NULL) - reusable_connection[slot].timestamp, + reusable_connection[slot].keep_alive_timeout, + (int)(reusable_connection[slot].response_received - + reusable_connection[slot].request_sent)); break; } } @@ -798,33 +532,33 @@ static jb_socket get_reusable_connection(const struct http_request *http, * Description : Gives a remembered connection free for reuse. * * Parameters : - * 1 : sfd = The socket belonging to the connection in question. + * 1 : connection = The connection in question. * * Returns : TRUE => Socket found and marked as unused. * FALSE => Socket not found. * *********************************************************************/ -static int mark_connection_unused(jb_socket sfd) +static int mark_connection_unused(const struct reusable_connection *connection) { unsigned int slot = 0; int socket_found = FALSE; - assert(sfd != JB_INVALID_SOCKET); + assert(connection->sfd != JB_INVALID_SOCKET); privoxy_mutex_lock(&connection_reuse_mutex); for (slot = 0; slot < SZ(reusable_connection); slot++) { - if (reusable_connection[slot].sfd == sfd) + if (reusable_connection[slot].sfd == connection->sfd) { assert(reusable_connection[slot].in_use); socket_found = TRUE; log_error(LOG_LEVEL_CONNECT, "Marking open socket %d for %s:%d in slot %d as unused.", - sfd, reusable_connection[slot].host, + connection->sfd, reusable_connection[slot].host, reusable_connection[slot].port, slot); reusable_connection[slot].in_use = 0; - reusable_connection[slot].timestamp = time(NULL); + reusable_connection[slot].timestamp = connection->timestamp; break; } } @@ -849,11 +583,11 @@ static int mark_connection_unused(jb_socket sfd) * Returns : void * *********************************************************************/ -void set_keep_alive_timeout(int timeout) +void set_keep_alive_timeout(unsigned int timeout) { keep_alive_timeout = timeout; } -#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ +#endif /* def FEATURE_CONNECTION_SHARING */ /********************************************************************* @@ -879,13 +613,17 @@ jb_socket forwarded_connect(const struct forward_spec * fwd, int dest_port; jb_socket sfd = JB_INVALID_SOCKET; -#ifdef FEATURE_CONNECTION_KEEP_ALIVE - sfd = get_reusable_connection(http, fwd); - if (JB_INVALID_SOCKET != sfd) +#ifdef FEATURE_CONNECTION_SHARING + if ((csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_SHARING) + && !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED)) { - return sfd; + sfd = get_reusable_connection(http, fwd); + if (JB_INVALID_SOCKET != sfd) + { + return sfd; + } } -#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ +#endif /* def FEATURE_CONNECTION_SHARING */ /* Figure out if we need to connect to the web server or a HTTP proxy. */ if (fwd->forward_host) @@ -917,7 +655,7 @@ jb_socket forwarded_connect(const struct forward_spec * fwd, default: /* Should never get here */ log_error(LOG_LEVEL_FATAL, - "SOCKS4 impossible internal error - bad SOCKS type."); + "Internal error in forwarded_connect(). Bad proxy type: %d", fwd->type); } if (JB_INVALID_SOCKET != sfd) @@ -960,7 +698,7 @@ static jb_socket socks4_connect(const struct forward_spec * fwd, int target_port, struct client_state *csp) { - unsigned int web_server_addr; + unsigned long web_server_addr; char buf[BUFFER_SIZE]; struct socks_op *c = (struct socks_op *)buf; struct socks_reply *s = (struct socks_reply *)buf; @@ -986,7 +724,7 @@ static jb_socket socks4_connect(const struct forward_spec * fwd, if (err) { log_error(LOG_LEVEL_CONNECT, "socks4_connect: %s", errstr); - csp->error_message = strdup(errstr); + csp->error_message = strdup(errstr); errno = EINVAL; return(JB_INVALID_SOCKET); } @@ -1067,12 +805,8 @@ static jb_socket socks4_connect(const struct forward_spec * fwd, if (sfd == JB_INVALID_SOCKET) { - /* - * XXX: connect_to should fill in the exact reason. - * Most likely resolving the IP of the forwarder failed. - */ - errstr = "connect_to failed: see logfile for details"; - err = 1; + /* The error an its reason have already been logged by connect_to() */ + return(JB_INVALID_SOCKET); } else if (write_socket(sfd, (char *)c, csiz)) { @@ -1081,6 +815,20 @@ static jb_socket socks4_connect(const struct forward_spec * fwd, err = 1; close_socket(sfd); } + else if (!data_is_available(sfd, csp->config->socket_timeout)) + { + if (socket_is_still_alive(sfd)) + { + errstr = "SOCKS4 negotiation timed out"; + } + else + { + errstr = "SOCKS4 negotiation got aborted by the server"; + } + log_error(LOG_LEVEL_CONNECT, "socks4_connect: %s", errstr); + err = 1; + close_socket(sfd); + } else if (read_socket(sfd, buf, sizeof(buf)) != sizeof(*s)) { errstr = "SOCKS4 negotiation read failed."; @@ -1091,24 +839,24 @@ static jb_socket socks4_connect(const struct forward_spec * fwd, if (err) { - csp->error_message = strdup(errstr); + csp->error_message = strdup(errstr); return(JB_INVALID_SOCKET); } switch (s->cd) { - case SOCKS_REQUEST_GRANTED: + case SOCKS4_REQUEST_GRANTED: return(sfd); - case SOCKS_REQUEST_REJECT: + case SOCKS4_REQUEST_REJECT: errstr = "SOCKS request rejected or failed."; errno = EINVAL; break; - case SOCKS_REQUEST_IDENT_FAILED: + case SOCKS4_REQUEST_IDENT_FAILED: errstr = "SOCKS request rejected because " "SOCKS server cannot connect to identd on the client."; errno = EACCES; break; - case SOCKS_REQUEST_IDENT_CONFLICT: + case SOCKS4_REQUEST_IDENT_CONFLICT: errstr = "SOCKS request rejected because " "the client program and identd report " "different user-ids."; @@ -1195,7 +943,7 @@ static jb_socket socks5_connect(const struct forward_spec *fwd, { int err = 0; char cbuf[300]; - char sbuf[30]; + char sbuf[10]; size_t client_pos = 0; int server_size = 0; size_t hostlen = 0; @@ -1251,6 +999,8 @@ static jb_socket socks5_connect(const struct forward_spec *fwd, { errstr = "socks5 server unreachable"; log_error(LOG_LEVEL_CONNECT, "socks5_connect: %s", errstr); + /* Free the generic error message provided by connect_to() */ + freez(csp->error_message); csp->error_message = strdup(errstr); return(JB_INVALID_SOCKET); } @@ -1269,7 +1019,20 @@ static jb_socket socks5_connect(const struct forward_spec *fwd, return(JB_INVALID_SOCKET); } - if (read_socket(sfd, sbuf, sizeof(sbuf)) != 2) + if (!data_is_available(sfd, csp->config->socket_timeout)) + { + if (socket_is_still_alive(sfd)) + { + errstr = "SOCKS5 negotiation timed out"; + } + else + { + errstr = "SOCKS5 negotiation got aborted by the server"; + } + err = 1; + } + + if (!err && read_socket(sfd, sbuf, sizeof(sbuf)) != 2) { errstr = "SOCKS5 negotiation read failed"; err = 1; @@ -1318,7 +1081,7 @@ static jb_socket socks5_connect(const struct forward_spec *fwd, if (write_socket(sfd, cbuf, client_pos)) { - errstr = "SOCKS5 negotiation read failed"; + errstr = "SOCKS5 negotiation write failed"; csp->error_message = strdup(errstr); log_error(LOG_LEVEL_CONNECT, "%s", errstr); close_socket(sfd); @@ -1327,44 +1090,33 @@ static jb_socket socks5_connect(const struct forward_spec *fwd, } server_size = read_socket(sfd, sbuf, sizeof(sbuf)); - if (server_size < 3) + if (server_size != sizeof(sbuf)) { errstr = "SOCKS5 negotiation read failed"; - err = 1; } - else if (server_size > 20) + else { - /* This is somewhat unexpected but doesn't realy matter. */ - log_error(LOG_LEVEL_CONNECT, "socks5_connect: read %d bytes " - "from socks server. Would have accepted up to %d.", - server_size, sizeof(sbuf)); - } - - if (!err && (sbuf[0] != '\x05')) - { - errstr = "SOCKS5 negotiation protocol version error"; - err = 1; - } - - if (!err && (sbuf[2] != '\x00')) - { - errstr = "SOCKS5 negotiation protocol error"; - err = 1; - } - - if (!err) - { - if (sbuf[1] == SOCKS5_REQUEST_GRANTED) + if (sbuf[0] != '\x05') + { + errstr = "SOCKS5 negotiation protocol version error"; + } + else if (sbuf[2] != '\x00') + { + errstr = "SOCKS5 negotiation protocol error"; + } + else if (sbuf[1] != SOCKS5_REQUEST_GRANTED) + { + errstr = translate_socks5_error(sbuf[1]); + } + else { return(sfd); } - errstr = translate_socks5_error(sbuf[1]); - err = 1; } assert(errstr != NULL); csp->error_message = strdup(errstr); - log_error(LOG_LEVEL_CONNECT, "socks5_connect: %s", errstr); + log_error(LOG_LEVEL_CONNECT, "socks5_connect: %s: %N", errstr, server_size, sbuf); close_socket(sfd); errno = EINVAL; diff --git a/external/privoxy/gateway.h b/external/privoxy/gateway.h index 94115f72..4787f82c 100644 --- a/external/privoxy/gateway.h +++ b/external/privoxy/gateway.h @@ -1,6 +1,6 @@ #ifndef GATEWAY_H_INCLUDED #define GATEWAY_H_INCLUDED -#define GATEWAY_H_VERSION "$Id: gateway.h,v 1.12 2008/12/24 17:06:19 fabiankeil Exp $" +#define GATEWAY_H_VERSION "$Id: gateway.h,v 1.21 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/gateway.h,v $ @@ -9,14 +9,14 @@ * using a "gateway" (i.e. HTTP proxy and/or SOCKS4 * proxy). Also contains the list of gateway types. * - * Copyright : Written by and Copyright (C) 2001 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2009 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -34,74 +34,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: gateway.h,v $ - * Revision 1.12 2008/12/24 17:06:19 fabiankeil - * Keep a thread around to timeout alive connections - * even if no new requests are coming in. - * - * Revision 1.11 2008/11/13 09:08:42 fabiankeil - * Add new config option: keep-alive-timeout. - * - * Revision 1.10 2008/10/09 18:21:41 fabiankeil - * Flush work-in-progress changes to keep outgoing connections - * alive where possible. Incomplete and mostly #ifdef'd out. - * - * Revision 1.9 2006/07/18 14:48:46 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.7 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.6 2002/03/25 22:12:45 oes - * Added fix for undefined INADDR_NONE on Solaris by Bart Schelstraete - * - * Revision 1.5 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.4 2002/03/09 20:03:52 jongfoster - * - Making various functions return int rather than size_t. - * (Undoing a recent change). Since size_t is unsigned on - * Windows, functions like read_socket that return -1 on - * error cannot return a size_t. - * - * THIS WAS A MAJOR BUG - it caused frequent, unpredictable - * crashes, and also frequently caused JB to jump to 100% - * CPU and stay there. (Because it thought it had just - * read ((unsigned)-1) == 4Gb of data...) - * - * - The signature of write_socket has changed, it now simply - * returns success=0/failure=nonzero. - * - * - Trying to get rid of a few warnings --with-debug on - * Windows, I've introduced a new type "jb_socket". This is - * used for the socket file descriptors. On Windows, this - * is SOCKET (a typedef for unsigned). Everywhere else, it's - * an int. The error value can't be -1 any more, so it's - * now JB_INVALID_SOCKET (which is -1 on UNIX, and in - * Windows it maps to the #define INVALID_SOCKET.) - * - * - The signature of bind_port has changed. - * - * Revision 1.3 2001/07/29 18:58:15 jongfoster - * Removing nested #includes, adding forward declarations for needed - * structures, and changing the #define _FILENAME_H to FILENAME_H_INCLUDED. - * - * Revision 1.2 2001/06/07 23:12:14 jongfoster - * Removing gateways[] list - no longer used. - * Replacing function pointer in struct gateway with a directly - * called function forwarded_connect(), which can do the common - * task of deciding whether to connect to the web server or HTTP - * proxy. - * Replacing struct gateway with struct forward_spec - * - * Revision 1.1.1.1 2001/05/15 13:58:54 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #ifdef __cplusplus extern "C" { @@ -111,10 +45,9 @@ struct forward_spec; struct http_request; struct client_state; -extern jb_socket forwarded_connect(const struct forward_spec * fwd, - struct http_request *http, +extern jb_socket forwarded_connect(const struct forward_spec * fwd, + struct http_request *http, struct client_state *csp); -#ifdef FEATURE_CONNECTION_KEEP_ALIVE /* * Default number of seconds after which an @@ -122,22 +55,20 @@ extern jb_socket forwarded_connect(const struct forward_spec * fwd, */ #define DEFAULT_KEEP_ALIVE_TIMEOUT 180 -extern void set_keep_alive_timeout(int timeout); +#ifdef FEATURE_CONNECTION_SHARING +extern void set_keep_alive_timeout(unsigned int timeout); extern void initialize_reusable_connections(void); extern void forget_connection(jb_socket sfd); -extern void remember_connection(jb_socket sfd, - const struct http_request *http, - const struct forward_spec *fwd); +extern void remember_connection(const struct reusable_connection *connection); extern int close_unusable_connections(void); -#endif /* FEATURE_CONNECTION_KEEP_ALIVE */ +#endif /* FEATURE_CONNECTION_SHARING */ - -/* - * Solaris fix - */ -#ifndef INADDR_NONE -#define INADDR_NONE -1 -#endif +#ifdef FEATURE_CONNECTION_KEEP_ALIVE +extern void mark_connection_closed(struct reusable_connection *closed_connection); +extern int connection_destination_matches(const struct reusable_connection *connection, + const struct http_request *http, + const struct forward_spec *fwd); +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ /* * Revision control strings from this header and associated .c file diff --git a/external/privoxy/icons/off.ico b/external/privoxy/icons/off.ico index cea8778a..76ef561a 100644 Binary files a/external/privoxy/icons/off.ico and b/external/privoxy/icons/off.ico differ diff --git a/external/privoxy/icons/privoxy.ico b/external/privoxy/icons/privoxy.ico index 4c96d0b1..52920ba8 100644 Binary files a/external/privoxy/icons/privoxy.ico and b/external/privoxy/icons/privoxy.ico differ diff --git a/external/privoxy/jarfile b/external/privoxy/jarfile deleted file mode 100644 index e69de29b..00000000 diff --git a/external/privoxy/jbsockets.c b/external/privoxy/jbsockets.c index 4548ff26..95db6517 100644 --- a/external/privoxy/jbsockets.c +++ b/external/privoxy/jbsockets.c @@ -1,4 +1,4 @@ -const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.50 2008/12/20 14:53:55 fabiankeil Exp $"; +const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.111 2011/12/10 17:26:30 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $ @@ -8,14 +8,14 @@ const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.50 2008/12/20 14:53:55 fabian * OS-independent. Contains #ifdefs to make this work * on many platforms. * - * Copyright : Written by and Copyright (C) 2001-2007 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2011 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -33,240 +33,8 @@ const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.50 2008/12/20 14:53:55 fabian * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: jbsockets.c,v $ - * Revision 1.50 2008/12/20 14:53:55 fabiankeil - * Add config option socket-timeout to control the time - * Privoxy waits for data to arrive on a socket. Useful - * in case of stale ssh tunnels or when fuzz-testing. - * - * Revision 1.49 2008/11/10 17:03:57 fabiankeil - * Fix a gcc44 warning and remove a now-obsolete cast. - * - * Revision 1.48 2008/09/04 08:13:58 fabiankeil - * Prepare for critical sections on Windows by adding a - * layer of indirection before the pthread mutex functions. - * - * Revision 1.47 2008/03/26 18:07:07 fabiankeil - * Add hostname directive. Closes PR#1918189. - * - * Revision 1.46 2008/03/21 11:13:57 fabiankeil - * Only gather host information if it's actually needed. - * Also move the code out of accept_connection() so it's less likely - * to delay other incoming connections if the host is misconfigured. - * - * Revision 1.45 2007/09/30 16:59:22 fabiankeil - * Set the maximum listen() backlog to 128. Apparently SOMAXCONN is - * neither high enough, nor a hard limit on mingw32. Again for BR#1795281. - * - * Revision 1.44 2007/09/15 13:01:31 fabiankeil - * Increase listen() backlog to SOMAXCONN (or 128) to decrease - * chances of dropped connections under load. Problem reported - * and fix suggested by nobody in BR#1795281. - * - * Revision 1.43 2007/06/01 18:16:36 fabiankeil - * Use the same mutex for gethostbyname() and gethostbyaddr() to prevent - * deadlocks and crashes on OpenBSD and possibly other OS with neither - * gethostbyname_r() nor gethostaddr_r(). Closes BR#1729174. - * Thanks to Ralf Horstmann for report and solution. - * - * Revision 1.42 2007/04/01 17:37:07 fabiankeil - * - Add DNS retries for Solaris and other systems - * whose gethostbyname_r version takes five arguments. - * - Move maximum number of DNS retries into a macro. - * - * Revision 1.41 2006/11/13 19:05:51 fabiankeil - * Make pthread mutex locking more generic. Instead of - * checking for OSX and OpenBSD, check for FEATURE_PTHREAD - * and use mutex locking unless there is an _r function - * available. Better safe than sorry. - * - * Fixes "./configure --disable-pthread" and should result - * in less threading-related problems on pthread-using platforms, - * but it still doesn't fix BR#1122404. - * - * Revision 1.40 2006/09/02 15:36:42 fabiankeil - * Follow the OpenBSD port's lead and protect the resolve - * functions on OpenBSD as well. - * - * Revision 1.39 2006/08/03 02:46:41 david__schmidt - * Incorporate Fabian Keil's patch work: http://www.fabiankeil.de/sourcecode/privoxy/ - * - * Revision 1.38 2006/07/18 14:48:46 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.35.2.8 2006/01/21 16:16:08 david__schmidt - * Thanks to Edward Carrel for his patch to modernize OSX's pthreads support. See bug #1409623. - * - * Revision 1.35.2.7 2005/05/07 21:50:55 david__schmidt - * A few memory leaks plugged (mostly on error paths) - * - * Revision 1.35.2.6 2003/12/17 16:34:40 oes - * Cosmetics - * - * Revision 1.35.2.5 2003/04/29 11:32:54 oes - * Don't rely on h_addr being non-NULL after gethostbyname. - * Works around an oddness in Max OSX and closes bug #724796 - * - * Revision 1.35.2.4 2003/04/04 12:40:20 oes - * Made sure the errno set by bind, not close[socket] is used in - * bind_port. Probably fixes bugs #713777, #705562. - * - * Revision 1.35.2.3 2003/03/07 03:41:04 david__schmidt - * Wrapping all *_r functions (the non-_r versions of them) with mutex semaphores for OSX. Hopefully this will take care of all of those pesky crash reports. - * - * Revision 1.35.2.2 2002/11/20 14:37:24 oes - * Fixed Win32 error logging in bind_port. - * Thanks to Oliver Stoeneberg for the hint. - * - * Revision 1.35.2.1 2002/05/26 23:41:27 joergs - * AmigaOS: Fixed wrong type of len in write_socket() - * - * Revision 1.35 2002/04/26 15:50:04 joergs - * AmigaOS: No socklen_t, added AMIGA to the systems using int instead. - * - * Revision 1.34 2002/04/08 20:31:41 swa - * fixed JB spelling - * - * Revision 1.33 2002/04/03 16:02:18 gliptak - * Correcting compile warning with older gcc - * - * Revision 1.32 2002/03/31 17:18:59 jongfoster - * Win32 only: Enabling STRICT to fix a VC++ compile warning. - * - * Revision 1.31 2002/03/29 03:33:13 david__schmidt - * Fix Mac OSX compiler warnings - * - * Revision 1.30 2002/03/27 14:32:43 david__schmidt - * More compiler warning message maintenance - * - * Revision 1.29 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.28 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.27 2002/03/13 00:27:05 jongfoster - * Killing warnings - * - * Revision 1.26 2002/03/11 22:07:02 david__schmidt - * OS/2 port maintenance: - * - Fixed EMX build - it had decayed a little - * - Fixed inexplicable crash during FD_ZERO - must be due to a bad macro. - * substituted a memset for now. - * - * Revision 1.25 2002/03/09 20:03:52 jongfoster - * - Making various functions return int rather than size_t. - * (Undoing a recent change). Since size_t is unsigned on - * Windows, functions like read_socket that return -1 on - * error cannot return a size_t. - * - * THIS WAS A MAJOR BUG - it caused frequent, unpredictable - * crashes, and also frequently caused JB to jump to 100% - * CPU and stay there. (Because it thought it had just - * read ((unsigned)-1) == 4Gb of data...) - * - * - The signature of write_socket has changed, it now simply - * returns success=0/failure=nonzero. - * - * - Trying to get rid of a few warnings --with-debug on - * Windows, I've introduced a new type "jb_socket". This is - * used for the socket file descriptors. On Windows, this - * is SOCKET (a typedef for unsigned). Everywhere else, it's - * an int. The error value can't be -1 any more, so it's - * now JB_INVALID_SOCKET (which is -1 on UNIX, and in - * Windows it maps to the #define INVALID_SOCKET.) - * - * - The signature of bind_port has changed. - * - * Revision 1.24 2002/03/07 03:51:36 oes - * - Improved handling of failed DNS lookups - * - Fixed compiler warnings etc - * - * Revision 1.23 2002/03/05 00:36:01 jongfoster - * Fixing bug 514988 - unable to restart Junkbuster - * - * Revision 1.22 2002/03/04 02:08:02 david__schmidt - * Enable web editing of actions file on OS/2 (it had been broken all this time!) - * - * Revision 1.21 2002/01/09 14:32:33 oes - * Added support for gethostbyname_r and gethostbyaddr_r. - * - * Revision 1.20 2001/11/16 00:48:48 jongfoster - * Enabling duplicate-socket detection for all platforms, not - * just Win32. - * - * Revision 1.19 2001/10/25 03:40:47 david__schmidt - * Change in porting tactics: OS/2's EMX porting layer doesn't allow multiple - * threads to call select() simultaneously. So, it's time to do a real, live, - * native OS/2 port. See defines for __EMX__ (the porting layer) vs. __OS2__ - * (native). Both versions will work, but using __OS2__ offers multi-threading. - * - * Revision 1.18 2001/09/21 23:02:02 david__schmidt - * Cleaning up 2 compiler warnings on OS/2. - * - * Revision 1.17 2001/09/13 20:11:46 jongfoster - * Fixing 2 compiler warnings under Win32 - * - * Revision 1.16 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.15 2001/07/29 17:40:43 jongfoster - * Fixed compiler warning by adding a cast - * - * Revision 1.14 2001/07/18 13:47:59 oes - * Eliminated dirty hack for getsockbyname() - * - * Revision 1.13 2001/07/15 13:56:57 jongfoster - * Removing unused local variable. - * - * Revision 1.12 2001/07/01 17:04:11 oes - * Bugfix: accept_connection no longer uses the obsolete hstrerror() function - * - * Revision 1.11 2001/06/29 21:45:41 oes - * Indentation, CRLF->LF, Tab-> Space - * - * Revision 1.10 2001/06/29 13:29:15 oes - * - Added remote (server) host IP to csp->http->host_ip_addr_str - * - Added detection of local socket IP and fqdn - * - Removed logentry from cancelled commit - * - * Revision 1.9 2001/06/07 23:06:09 jongfoster - * The host parameter to connect_to() is now const. - * - * Revision 1.8 2001/06/03 19:12:07 oes - * filled comment - * - * Revision 1.7 2001/05/28 16:14:00 jongfoster - * Fixing bug in LOG_LEVEL_LOG - * - * Revision 1.6 2001/05/26 17:28:32 jongfoster - * Fixed LOG_LEVEL_LOG - * - * Revision 1.5 2001/05/26 15:26:15 jongfoster - * ACL feature now provides more security by immediately dropping - * connections from untrusted hosts. - * - * Revision 1.4 2001/05/26 00:37:42 jongfoster - * Cosmetic indentation correction. - * - * Revision 1.3 2001/05/25 21:57:54 jongfoster - * Now gives a warning under Windows if you try to bind - * it to a port that's already in use. - * - * Revision 1.2 2001/05/17 23:01:01 oes - * - Cleaned CRLF's from the sources and related files - * - * Revision 1.1.1.1 2001/05/15 13:58:54 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include "config.h" @@ -315,17 +83,30 @@ const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.50 2008/12/20 14:53:55 fabian #endif +#ifdef FEATURE_CONNECTION_KEEP_ALIVE +#ifdef HAVE_POLL +#ifdef __GLIBC__ +#include +#else +#include +#endif /* def __GLIBC__ */ +#endif /* HAVE_POLL */ +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ + #include "project.h" -#ifdef FEATURE_PTHREAD +/* For mutex semaphores only */ #include "jcc.h" -/* jcc.h is for mutex semaphores only */ -#endif /* def FEATURE_PTHREAD */ #include "jbsockets.h" #include "filters.h" #include "errlog.h" +/* Mac OSX doesn't define AI_NUMERICSESRV */ +#ifndef AI_NUMERICSERV +#define AI_NUMERICSERV 0 +#endif + const char jbsockets_h_rcs[] = JBSOCKETS_H_VERSION; /* @@ -337,6 +118,11 @@ const char jbsockets_h_rcs[] = JBSOCKETS_H_VERSION; #define MAX_LISTEN_BACKLOG 128 +#ifdef HAVE_RFC2553 +static jb_socket rfc2553_connect_to(const char *host, int portnum, struct client_state *csp); +#else +static jb_socket no_rfc2553_connect_to(const char *host, int portnum, struct client_state *csp); +#endif /********************************************************************* * @@ -349,27 +135,283 @@ const char jbsockets_h_rcs[] = JBSOCKETS_H_VERSION; * 1 : host = hostname to connect to * 2 : portnum = port to connent on (XXX: should be unsigned) * 3 : csp = Current client state (buffers, headers, etc...) - * Not modified, only used for source IP and ACL. * * Returns : JB_INVALID_SOCKET => failure, else it is the socket * file descriptor. * *********************************************************************/ jb_socket connect_to(const char *host, int portnum, struct client_state *csp) +{ + jb_socket fd; + int forwarded_connect_retries = 0; + + do + { + /* + * XXX: The whole errno overloading is ridiculous and should + * be replaced with something sane and thread safe + */ + /* errno = 0;*/ +#ifdef HAVE_RFC2553 + fd = rfc2553_connect_to(host, portnum, csp); +#else + fd = no_rfc2553_connect_to(host, portnum, csp); +#endif + if ((fd != JB_INVALID_SOCKET) || (errno == EINVAL) + || (csp->fwd == NULL) + || ((csp->fwd->forward_host == NULL) && (csp->fwd->type == SOCKS_NONE))) + { + break; + } + forwarded_connect_retries++; + if (csp->config->forwarded_connect_retries != 0) + { + log_error(LOG_LEVEL_ERROR, + "Attempt %d of %d to connect to %s failed. Trying again.", + forwarded_connect_retries, csp->config->forwarded_connect_retries + 1, host); + } + + } while (forwarded_connect_retries < csp->config->forwarded_connect_retries); + + return fd; +} + +#ifdef HAVE_RFC2553 +/* Getaddrinfo implementation */ +static jb_socket rfc2553_connect_to(const char *host, int portnum, struct client_state *csp) +{ + struct addrinfo hints, *result, *rp; + char service[6]; + int retval; + jb_socket fd; + fd_set wfds; + struct timeval timeout; +#if !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) && !defined(__OS2__) + int flags; +#endif + int connect_failed; + /* + * XXX: Initializeing it here is only necessary + * because not all situations are properly + * covered yet. + */ + int socket_error = 0; + +#ifdef FEATURE_ACL + struct access_control_addr dst[1]; +#endif /* def FEATURE_ACL */ + + /* Don't leak memory when retrying. */ + freez(csp->error_message); + freez(csp->http->host_ip_addr_str); + + retval = snprintf(service, sizeof(service), "%d", portnum); + if ((-1 == retval) || (sizeof(service) <= retval)) + { + log_error(LOG_LEVEL_ERROR, + "Port number (%d) ASCII decimal representation doesn't fit into 6 bytes", + portnum); + csp->error_message = strdup("Invalid port number"); + csp->http->host_ip_addr_str = strdup("unknown"); + return(JB_INVALID_SOCKET); + } + + memset((char *)&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_NUMERICSERV; /* avoid service look-up */ +#ifdef AI_ADDRCONFIG + hints.ai_flags |= AI_ADDRCONFIG; +#endif + if ((retval = getaddrinfo(host, service, &hints, &result))) + { + log_error(LOG_LEVEL_INFO, + "Can not resolve %s: %s", host, gai_strerror(retval)); + /* XXX: Should find a better way to propagate this error. */ + errno = EINVAL; + csp->error_message = strdup(gai_strerror(retval)); + csp->http->host_ip_addr_str = strdup("unknown"); + return(JB_INVALID_SOCKET); + } + + csp->http->host_ip_addr_str = malloc(NI_MAXHOST); + if (NULL == csp->http->host_ip_addr_str) + { + freeaddrinfo(result); + log_error(LOG_LEVEL_ERROR, + "Out of memory while getting the server IP address."); + return JB_INVALID_SOCKET; + } + + for (rp = result; rp != NULL; rp = rp->ai_next) + { + +#ifdef FEATURE_ACL + memcpy(&dst->addr, rp->ai_addr, rp->ai_addrlen); + + if (block_acl(dst, csp)) + { +#ifdef __OS2__ + socket_error = errno = SOCEPERM; +#else + socket_error = errno = EPERM; +#endif + continue; + } +#endif /* def FEATURE_ACL */ + + retval = getnameinfo(rp->ai_addr, rp->ai_addrlen, + csp->http->host_ip_addr_str, NI_MAXHOST, NULL, 0, NI_NUMERICHOST); + if (retval) + { + log_error(LOG_LEVEL_ERROR, + "Failed to get the host name from the socket structure: %s", + gai_strerror(retval)); + continue; + } + + fd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); +#ifdef _WIN32 + if (fd == JB_INVALID_SOCKET) +#else + if (fd < 0) +#endif + { + continue; + } + +#ifdef TCP_NODELAY + { /* turn off TCP coalescence */ + int mi = 1; + setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *) &mi, sizeof (int)); + } +#endif /* def TCP_NODELAY */ + +#if !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) && !defined(__OS2__) + if ((flags = fcntl(fd, F_GETFL, 0)) != -1) + { + flags |= O_NDELAY; + fcntl(fd, F_SETFL, flags); + } +#endif /* !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) && !defined(__OS2__) */ + + connect_failed = 0; + while (connect(fd, rp->ai_addr, rp->ai_addrlen) == JB_INVALID_SOCKET) + { +#ifdef __OS2__ + errno = sock_errno(); +#endif /* __OS2__ */ + +#ifdef _WIN32 + if (errno == WSAEINPROGRESS) +#else /* ifndef _WIN32 */ + if (errno == EINPROGRESS) +#endif /* ndef _WIN32 || __OS2__ */ + { + break; + } + + if (errno != EINTR) + { + socket_error = errno; + close_socket(fd); + connect_failed = 1; + break; + } + } + if (connect_failed) + { + continue; + } + +#if !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) && !defined(__OS2__) + if (flags != -1) + { + flags &= ~O_NDELAY; + fcntl(fd, F_SETFL, flags); + } +#endif /* !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) && !defined(__OS2__) */ + + /* wait for connection to complete */ + FD_ZERO(&wfds); + FD_SET(fd, &wfds); + + memset(&timeout, 0, sizeof(timeout)); + timeout.tv_sec = 30; + + /* MS Windows uses int, not SOCKET, for the 1st arg of select(). Weird! */ + if ((select((int)fd + 1, NULL, &wfds, NULL, &timeout) > 0) + && FD_ISSET(fd, &wfds)) + { + socklen_t optlen = sizeof(socket_error); + if (!getsockopt(fd, SOL_SOCKET, SO_ERROR, &socket_error, &optlen)) + { + if (!socket_error) + { + /* Connection established, no need to try other addresses. */ + break; + } + if (rp->ai_next != NULL) + { + /* + * There's another address we can try, so log that this + * one didn't work out. If the last one fails, too, + * it will get logged outside the loop body so we don't + * have to mention it here. + */ + log_error(LOG_LEVEL_CONNECT, "Could not connect to [%s]:%s: %s.", + csp->http->host_ip_addr_str, service, strerror(socket_error)); + } + } + else + { + socket_error = errno; + log_error(LOG_LEVEL_ERROR, "Could not get the state of " + "the connection to [%s]:%s: %s; dropping connection.", + csp->http->host_ip_addr_str, service, strerror(errno)); + } + } + + /* Connection failed, try next address */ + close_socket(fd); + } + + freeaddrinfo(result); + if (!rp) + { + log_error(LOG_LEVEL_CONNECT, "Could not connect to [%s]:%s: %s.", + host, service, strerror(socket_error)); + csp->error_message = strdup(strerror(socket_error)); + return(JB_INVALID_SOCKET); + } + log_error(LOG_LEVEL_CONNECT, "Connected to %s[%s]:%s.", + host, csp->http->host_ip_addr_str, service); + + return(fd); + +} + +#else /* ndef HAVE_RFC2553 */ +/* Pre-getaddrinfo implementation */ + +static jb_socket no_rfc2553_connect_to(const char *host, int portnum, struct client_state *csp) { struct sockaddr_in inaddr; jb_socket fd; unsigned int addr; fd_set wfds; struct timeval tv[1]; -#if !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) +#if !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) && !defined(__OS2__) int flags; -#endif /* !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) */ +#endif #ifdef FEATURE_ACL struct access_control_addr dst[1]; #endif /* def FEATURE_ACL */ + /* Don't leak memory when retrying. */ + freez(csp->http->host_ip_addr_str); + memset((char *)&inaddr, 0, sizeof inaddr); if ((addr = resolve_hostname_to_ip(host)) == INADDR_NONE) @@ -410,10 +452,11 @@ jb_socket connect_to(const char *host, int portnum, struct client_state *csp) } #endif /* ndef _WIN32 */ + fd = socket(inaddr.sin_family, SOCK_STREAM, 0); #ifdef _WIN32 - if ((fd = socket(inaddr.sin_family, SOCK_STREAM, 0)) == JB_INVALID_SOCKET) + if (fd == JB_INVALID_SOCKET) #else - if ((fd = socket(inaddr.sin_family, SOCK_STREAM, 0)) < 0) + if (fd < 0) #endif { return(JB_INVALID_SOCKET); @@ -438,7 +481,7 @@ jb_socket connect_to(const char *host, int portnum, struct client_state *csp) { #ifdef _WIN32 if (errno == WSAEINPROGRESS) -#elif __OS2__ +#elif __OS2__ if (sock_errno() == EINPROGRESS) #else /* ifndef _WIN32 */ if (errno == EINPROGRESS) @@ -447,7 +490,7 @@ jb_socket connect_to(const char *host, int portnum, struct client_state *csp) break; } -#ifdef __OS2__ +#ifdef __OS2__ if (sock_errno() != EINTR) #else if (errno != EINTR) @@ -473,7 +516,7 @@ jb_socket connect_to(const char *host, int portnum, struct client_state *csp) tv->tv_sec = 30; tv->tv_usec = 0; - /* MS Windows uses int, not SOCKET, for the 1st arg of select(). Wierd! */ + /* MS Windows uses int, not SOCKET, for the 1st arg of select(). Weird! */ if (select((int)fd + 1, NULL, &wfds, NULL, tv) <= 0) { close_socket(fd); @@ -482,6 +525,7 @@ jb_socket connect_to(const char *host, int portnum, struct client_state *csp) return(fd); } +#endif /* ndef HAVE_RFC2553 */ /********************************************************************* @@ -510,12 +554,7 @@ int write_socket(jb_socket fd, const char *buf, size_t len) return 0; } - if (len < 0) /* constant condition - size_t isn't ever negative */ - { - return 1; - } - - log_error(LOG_LEVEL_LOG, "%N", len, buf); + log_error(LOG_LEVEL_WRITING, "to socket %d: %N", fd, len, buf); #if defined(_WIN32) return (send(fd, buf, (int)len, 0) != (int)len); @@ -528,7 +567,7 @@ int write_socket(jb_socket fd, const char *buf, size_t len) */ #define SOCKET_SEND_MAX 65000 { - int write_len = 0, send_len, send_rc = 0, i = 0; + int send_len, send_rc = 0, i = 0; while ((i < len) && (send_rc != -1)) { if ((i + SOCKET_SEND_MAX) > len) @@ -576,18 +615,27 @@ int write_socket(jb_socket fd, const char *buf, size_t len) *********************************************************************/ int read_socket(jb_socket fd, char *buf, int len) { + int ret; + if (len <= 0) { return(0); } #if defined(_WIN32) - return(recv(fd, buf, len, 0)); + ret = recv(fd, buf, len, 0); #elif defined(__BEOS__) || defined(AMIGA) || defined(__OS2__) - return(recv(fd, buf, (size_t)len, 0)); + ret = recv(fd, buf, (size_t)len, 0); #else - return(read(fd, buf, (size_t)len)); + ret = (int)read(fd, buf, (size_t)len); #endif + + if (ret > 0) + { + log_error(LOG_LEVEL_RECEIVED, "from socket %d: %N", fd, ret, buf); + } + + return ret; } @@ -607,6 +655,7 @@ int read_socket(jb_socket fd, char *buf, int len) *********************************************************************/ int data_is_available(jb_socket fd, int seconds_to_wait) { + char buf[10]; fd_set rfds; struct timeval timeout; int n; @@ -627,7 +676,7 @@ int data_is_available(jb_socket fd, int seconds_to_wait) /* * XXX: Do we care about the different error conditions? */ - return (n == 1); + return ((n == 1) && (1 == recv(fd, buf, 1, MSG_PEEK))); } @@ -648,7 +697,7 @@ void close_socket(jb_socket fd) #if defined(_WIN32) || defined(__BEOS__) closesocket(fd); #elif defined(AMIGA) - CloseSocket(fd); + CloseSocket(fd); #elif defined(__OS2__) soclose(fd); #else @@ -677,7 +726,19 @@ void close_socket(jb_socket fd) *********************************************************************/ int bind_port(const char *hostnam, int portnum, jb_socket *pfd) { +#ifdef HAVE_RFC2553 + struct addrinfo hints; + struct addrinfo *result, *rp; + /* + * XXX: portnum should be a string to allow symbolic service + * names in the configuration file and to avoid the following + * int2string. + */ + char servnam[6]; + int retval; +#else struct sockaddr_in inaddr; +#endif /* def HAVE_RFC2553 */ jb_socket fd; #ifndef _WIN32 int one = 1; @@ -685,6 +746,45 @@ int bind_port(const char *hostnam, int portnum, jb_socket *pfd) *pfd = JB_INVALID_SOCKET; +#ifdef HAVE_RFC2553 + retval = snprintf(servnam, sizeof(servnam), "%d", portnum); + if ((-1 == retval) || (sizeof(servnam) <= retval)) + { + log_error(LOG_LEVEL_ERROR, + "Port number (%d) ASCII decimal representation doesn't fit into 6 bytes", + portnum); + return -1; + } + + memset(&hints, 0, sizeof(struct addrinfo)); + if (hostnam == NULL) + { + /* + * XXX: This is a hack. The right thing to do + * would be to bind to both AF_INET and AF_INET6. + * This will also fail if there is no AF_INET + * version available. + */ + hints.ai_family = AF_INET; + } + else + { + hints.ai_family = AF_UNSPEC; + } + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_PASSIVE; + hints.ai_protocol = 0; /* Really any stream protocol or TCP only */ + hints.ai_canonname = NULL; + hints.ai_addr = NULL; + hints.ai_next = NULL; + + if ((retval = getaddrinfo(hostnam, servnam, &hints, &result))) + { + log_error(LOG_LEVEL_ERROR, + "Can not resolve %s: %s", hostnam, gai_strerror(retval)); + return -2; + } +#else memset((char *)&inaddr, '\0', sizeof inaddr); inaddr.sin_family = AF_INET; @@ -707,8 +807,15 @@ int bind_port(const char *hostnam, int portnum, jb_socket *pfd) inaddr.sin_port = htonl((unsigned long) portnum); } #endif /* ndef _WIN32 */ +#endif /* def HAVE_RFC2553 */ +#ifdef HAVE_RFC2553 + for (rp = result; rp != NULL; rp = rp->ai_next) + { + fd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); +#else fd = socket(AF_INET, SOCK_STREAM, 0); +#endif /* def HAVE_RFC2553 */ #ifdef _WIN32 if (fd == JB_INVALID_SOCKET) @@ -716,7 +823,11 @@ int bind_port(const char *hostnam, int portnum, jb_socket *pfd) if (fd < 0) #endif { +#ifdef HAVE_RFC2553 + continue; +#else return(-1); +#endif } #ifndef _WIN32 @@ -735,7 +846,11 @@ int bind_port(const char *hostnam, int portnum, jb_socket *pfd) setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof(one)); #endif /* ndef _WIN32 */ +#ifdef HAVE_RFC2553 + if (bind(fd, rp->ai_addr, rp->ai_addrlen) < 0) +#else if (bind(fd, (struct sockaddr *)&inaddr, sizeof(inaddr)) < 0) +#endif { #ifdef _WIN32 errno = WSAGetLastError(); @@ -744,15 +859,41 @@ int bind_port(const char *hostnam, int portnum, jb_socket *pfd) if (errno == EADDRINUSE) #endif { +#ifdef HAVE_RFC2553 + freeaddrinfo(result); +#endif close_socket(fd); return(-3); } else { close_socket(fd); +#ifndef HAVE_RFC2553 return(-1); } } +#else + } + } + else + { + /* bind() succeeded, escape from for-loop */ + /* + * XXX: Support multiple listening sockets (e.g. localhost + * resolves to AF_INET and AF_INET6, but only the first address + * is used + */ + break; + } + } + + freeaddrinfo(result); + if (rp == NULL) + { + /* All bind()s failed */ + return(-1); + } +#endif /* ndef HAVE_RFC2553 */ while (listen(fd, MAX_LISTEN_BACKLOG) == -1) { @@ -783,23 +924,32 @@ int bind_port(const char *hostnam, int portnum, jb_socket *pfd) * 1 : afd = File descriptor returned from accept(). * 2 : ip_address = Pointer to return the pointer to * the ip address string. - * 3 : hostname = Pointer to return the pointer to + * 3 : port = Pointer to return the pointer to + * the TCP port string. + * 4 : hostname = Pointer to return the pointer to * the hostname or NULL if the caller * isn't interested in it. * * Returns : void. * *********************************************************************/ -void get_host_information(jb_socket afd, char **ip_address, char **hostname) +void get_host_information(jb_socket afd, char **ip_address, char **port, + char **hostname) { +#ifdef HAVE_RFC2553 + struct sockaddr_storage server; + int retval; +#else struct sockaddr_in server; struct hostent *host = NULL; +#endif /* HAVE_RFC2553 */ #if defined(_WIN32) || defined(__OS2__) || defined(__APPLE_CC__) || defined(AMIGA) /* according to accept_connection() this fixes a warning. */ - int s_length; + int s_length, s_length_provided; #else - socklen_t s_length; + socklen_t s_length, s_length_provided; #endif +#ifndef HAVE_RFC2553 #if defined(HAVE_GETHOSTBYADDR_R_8_ARGS) || defined(HAVE_GETHOSTBYADDR_R_7_ARGS) || defined(HAVE_GETHOSTBYADDR_R_5_ARGS) struct hostent result; #if defined(HAVE_GETHOSTBYADDR_R_5_ARGS) @@ -809,18 +959,54 @@ void get_host_information(jb_socket afd, char **ip_address, char **hostname) int thd_err; #endif /* def HAVE_GETHOSTBYADDR_R_5_ARGS */ #endif /* def HAVE_GETHOSTBYADDR_R_(8|7|5)_ARGS */ - s_length = sizeof(server); +#endif /* ifndef HAVE_RFC2553 */ + s_length = s_length_provided = sizeof(server); if (NULL != hostname) { *hostname = NULL; } *ip_address = NULL; + *port = NULL; if (!getsockname(afd, (struct sockaddr *) &server, &s_length)) { + if (s_length > s_length_provided) + { + log_error(LOG_LEVEL_ERROR, "getsockname() truncated server address"); + return; + } + *port = malloc(NI_MAXSERV); + if (NULL == *port) + { + log_error(LOG_LEVEL_ERROR, + "Out of memory while getting the client's port."); + return; + } +#ifdef HAVE_RFC2553 + *ip_address = malloc(NI_MAXHOST); + if (NULL == *ip_address) + { + log_error(LOG_LEVEL_ERROR, + "Out of memory while getting the client's IP address."); + freez(*port); + return; + } + retval = getnameinfo((struct sockaddr *) &server, s_length, + *ip_address, NI_MAXHOST, *port, NI_MAXSERV, + NI_NUMERICHOST|NI_NUMERICSERV); + if (retval) + { + log_error(LOG_LEVEL_ERROR, + "Unable to print my own IP address: %s", gai_strerror(retval)); + freez(*ip_address); + freez(*port); + return; + } +#else *ip_address = strdup(inet_ntoa(server.sin_addr)); - + snprintf(*port, NI_MAXSERV, "%hu", ntohs(server.sin_port)); +#endif /* HAVE_RFC2553 */ if (NULL == hostname) { /* @@ -829,6 +1015,24 @@ void get_host_information(jb_socket afd, char **ip_address, char **hostname) */ return; } + +#ifdef HAVE_RFC2553 + *hostname = malloc(NI_MAXHOST); + if (NULL == *hostname) + { + log_error(LOG_LEVEL_ERROR, + "Out of memory while getting the client's hostname."); + return; + } + retval = getnameinfo((struct sockaddr *) &server, s_length, + *hostname, NI_MAXHOST, NULL, 0, NI_NAMEREQD); + if (retval) + { + log_error(LOG_LEVEL_ERROR, + "Unable to resolve my own IP address: %s", gai_strerror(retval)); + freez(*hostname); + } +#else #if defined(HAVE_GETHOSTBYADDR_R_8_ARGS) gethostbyaddr_r((const char *)&server.sin_addr, sizeof(server.sin_addr), AF_INET, @@ -849,13 +1053,13 @@ void get_host_information(jb_socket afd, char **ip_address, char **hostname) { host = NULL; } -#elif FEATURE_PTHREAD +#elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&resolver_mutex); - host = gethostbyaddr((const char *)&server.sin_addr, + host = gethostbyaddr((const char *)&server.sin_addr, sizeof(server.sin_addr), AF_INET); privoxy_mutex_unlock(&resolver_mutex); #else - host = gethostbyaddr((const char *)&server.sin_addr, + host = gethostbyaddr((const char *)&server.sin_addr, sizeof(server.sin_addr), AF_INET); #endif if (host == NULL) @@ -866,6 +1070,7 @@ void get_host_information(jb_socket afd, char **ip_address, char **hostname) { *hostname = strdup(host->h_name); } +#endif /* else def HAVE_RFC2553 */ } return; @@ -876,21 +1081,27 @@ void get_host_information(jb_socket afd, char **ip_address, char **hostname) * * Function : accept_connection * - * Description : Accepts a connection on a socket. Socket must have - * been created using bind_port(). + * Description : Accepts a connection on one of possibly multiple + * sockets. The socket(s) to check must have been + * created using bind_port(). * * Parameters : - * 1 : csp = Client state, cfd, ip_addr_str, and - * ip_addr_long will be set by this routine. - * 2 : fd = file descriptor returned from bind_port + * 1 : csp = Client state, cfd, ip_addr_str, and + * ip_addr_long will be set by this routine. + * 2 : fds = File descriptors returned from bind_port * * Returns : when a connection is accepted, it returns 1 (TRUE). * On an error it returns 0 (FALSE). * *********************************************************************/ -int accept_connection(struct client_state * csp, jb_socket fd) +int accept_connection(struct client_state * csp, jb_socket fds[]) { +#ifdef HAVE_RFC2553 + /* XXX: client is stored directly into csp->tcp_addr */ +#define client (csp->tcp_addr) +#else struct sockaddr_in client; +#endif jb_socket afd; #if defined(_WIN32) || defined(__OS2__) || defined(__APPLE_CC__) || defined(AMIGA) /* Wierdness - fix a warning. */ @@ -898,9 +1109,69 @@ int accept_connection(struct client_state * csp, jb_socket fd) #else socklen_t c_length; #endif + int retval; + int i; + int max_selected_socket; + fd_set selected_fds; + jb_socket fd; c_length = sizeof(client); + /* + * Wait for a connection on any socket. + * Return immediately if no socket is listening. + * XXX: Why not treat this as fatal error? + */ + FD_ZERO(&selected_fds); + max_selected_socket = 0; + for (i = 0; i < MAX_LISTENING_SOCKETS; i++) + { + if (JB_INVALID_SOCKET != fds[i]) + { + FD_SET(fds[i], &selected_fds); + if (max_selected_socket < fds[i] + 1) + { + max_selected_socket = fds[i] + 1; + } + } + } + if (0 == max_selected_socket) + { + return 0; + } + do + { + retval = select(max_selected_socket, &selected_fds, NULL, NULL, NULL); + } while (retval < 0 && errno == EINTR); + if (retval <= 0) + { + if (0 == retval) + { + log_error(LOG_LEVEL_ERROR, + "Waiting on new client failed because select(2) returned 0." + " This should not happen."); + } + else + { + log_error(LOG_LEVEL_ERROR, + "Waiting on new client failed because of problems in select(2): " + "%s.", strerror(errno)); + } + return 0; + } + for (i = 0; i < MAX_LISTENING_SOCKETS && !FD_ISSET(fds[i], &selected_fds); + i++); + if (i >= MAX_LISTENING_SOCKETS) + { + log_error(LOG_LEVEL_ERROR, + "select(2) reported connected clients (number = %u, " + "descriptor boundary = %u), but none found.", + retval, max_selected_socket); + return 0; + } + fd = fds[i]; + + /* Accept selected connection */ #ifdef _WIN32 afd = accept (fd, (struct sockaddr *) &client, &c_length); if (afd == JB_INVALID_SOCKET) @@ -910,6 +1181,12 @@ int accept_connection(struct client_state * csp, jb_socket fd) #else do { +#if defined(FEATURE_ACCEPT_FILTER) && defined(SO_ACCEPTFILTER) + struct accept_filter_arg af_options; + bzero(&af_options, sizeof(af_options)); + strlcpy(af_options.af_name, "httpready", sizeof(af_options.af_name)); + setsockopt(fd, SOL_SOCKET, SO_ACCEPTFILTER, &af_options, sizeof(af_options)); +#endif afd = accept (fd, (struct sockaddr *) &client, &c_length); } while (afd < 1 && errno == EINTR); if (afd < 0) @@ -919,8 +1196,27 @@ int accept_connection(struct client_state * csp, jb_socket fd) #endif csp->cfd = afd; +#ifdef HAVE_RFC2553 + csp->ip_addr_str = malloc(NI_MAXHOST); + if (NULL == csp->ip_addr_str) + { + log_error(LOG_LEVEL_ERROR, + "Out of memory while getting the client's IP address."); + return 0; + } + retval = getnameinfo((struct sockaddr *) &client, c_length, + csp->ip_addr_str, NI_MAXHOST, NULL, 0, NI_NUMERICHOST); + if (!csp->ip_addr_str || retval) + { + log_error(LOG_LEVEL_ERROR, "Can not save csp->ip_addr_str: %s", + (csp->ip_addr_str) ? gai_strerror(retval) : "Insuffcient memory"); + freez(csp->ip_addr_str); + } +#undef client +#else csp->ip_addr_str = strdup(inet_ntoa(client.sin_addr)); csp->ip_addr_long = ntohl(client.sin_addr.s_addr); +#endif /* def HAVE_RFC2553 */ return 1; @@ -937,14 +1233,13 @@ int accept_connection(struct client_state * csp, jb_socket fd) * Parameters : * 1 : host = hostname to resolve * - * Returns : INADDR_NONE => failure, INADDR_ANY or tcp/ip address if succesful. + * Returns : INADDR_NONE => failure, INADDR_ANY or tcp/ip address if successful. * *********************************************************************/ unsigned long resolve_hostname_to_ip(const char *host) { struct sockaddr_in inaddr; struct hostent *hostp; - unsigned int dns_retries = 0; #if defined(HAVE_GETHOSTBYNAME_R_6_ARGS) || defined(HAVE_GETHOSTBYNAME_R_5_ARGS) || defined(HAVE_GETHOSTBYNAME_R_3_ARGS) struct hostent result; #if defined(HAVE_GETHOSTBYNAME_R_6_ARGS) || defined(HAVE_GETHOSTBYNAME_R_5_ARGS) @@ -964,11 +1259,12 @@ unsigned long resolve_hostname_to_ip(const char *host) if ((inaddr.sin_addr.s_addr = inet_addr(host)) == -1) { + unsigned int dns_retries = 0; #if defined(HAVE_GETHOSTBYNAME_R_6_ARGS) while (gethostbyname_r(host, &result, hbuf, HOSTENT_BUFFER_SIZE, &hostp, &thd_err) && (thd_err == TRY_AGAIN) && (dns_retries++ < MAX_DNS_RETRIES)) - { + { log_error(LOG_LEVEL_ERROR, "Timeout #%u while trying to resolve %s. Trying again.", dns_retries, host); @@ -977,7 +1273,7 @@ unsigned long resolve_hostname_to_ip(const char *host) while (NULL == (hostp = gethostbyname_r(host, &result, hbuf, HOSTENT_BUFFER_SIZE, &thd_err)) && (thd_err == TRY_AGAIN) && (dns_retries++ < MAX_DNS_RETRIES)) - { + { log_error(LOG_LEVEL_ERROR, "Timeout #%u while trying to resolve %s. Trying again.", dns_retries, host); @@ -995,11 +1291,11 @@ unsigned long resolve_hostname_to_ip(const char *host) { hostp = NULL; } -#elif FEATURE_PTHREAD +#elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&resolver_mutex); while (NULL == (hostp = gethostbyname(host)) && (h_errno == TRY_AGAIN) && (dns_retries++ < MAX_DNS_RETRIES)) - { + { log_error(LOG_LEVEL_ERROR, "Timeout #%u while trying to resolve %s. Trying again.", dns_retries, host); @@ -1032,7 +1328,7 @@ unsigned long resolve_hostname_to_ip(const char *host) errno = WSAEPROTOTYPE; #else errno = EPROTOTYPE; -#endif +#endif log_error(LOG_LEVEL_ERROR, "hostname %s resolves to unknown address type.", host); return(INADDR_NONE); } @@ -1047,6 +1343,63 @@ unsigned long resolve_hostname_to_ip(const char *host) } +#ifdef FEATURE_CONNECTION_KEEP_ALIVE +/********************************************************************* + * + * Function : socket_is_still_alive + * + * Description : Figures out whether or not a socket is still alive. + * + * Parameters : + * 1 : sfd = The socket to check. + * + * Returns : TRUE for yes, otherwise FALSE. + * + *********************************************************************/ +int socket_is_still_alive(jb_socket sfd) +{ + char buf[10]; + int no_data_waiting; + +#ifdef HAVE_POLL + int poll_result; + struct pollfd poll_fd[1]; + + memset(poll_fd, 0, sizeof(poll_fd)); + poll_fd[0].fd = sfd; + poll_fd[0].events = POLLIN; + + poll_result = poll(poll_fd, 1, 0); + + if (-1 == poll_result) + { + log_error(LOG_LEVEL_CONNECT, "Polling socket %d failed.", sfd); + return FALSE; + } + no_data_waiting = !(poll_fd[0].revents & POLLIN); +#else + fd_set readable_fds; + struct timeval timeout; + int ret; + + memset(&timeout, '\0', sizeof(timeout)); + FD_ZERO(&readable_fds); + FD_SET(sfd, &readable_fds); + + ret = select((int)sfd+1, &readable_fds, NULL, NULL, &timeout); + if (ret < 0) + { + log_error(LOG_LEVEL_CONNECT, "select() on socket %d failed: %E", sfd); + return FALSE; + } + no_data_waiting = !FD_ISSET(sfd, &readable_fds); +#endif /* def HAVE_POLL */ + + return (no_data_waiting || (1 == recv(sfd, buf, 1, MSG_PEEK))); +} +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ + + /* Local Variables: tab-width: 3 diff --git a/external/privoxy/jbsockets.h b/external/privoxy/jbsockets.h index 115cb6ae..727bd69c 100644 --- a/external/privoxy/jbsockets.h +++ b/external/privoxy/jbsockets.h @@ -1,6 +1,6 @@ #ifndef JBSOCKETS_H_INCLUDED #define JBSOCKETS_H_INCLUDED -#define JBSOCKETS_H_VERSION "$Id: jbsockets.h,v 1.14 2008/12/20 14:53:55 fabiankeil Exp $" +#define JBSOCKETS_H_VERSION "$Id: jbsockets.h,v 1.20 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jbsockets.h,v $ @@ -10,14 +10,14 @@ * OS-independent. Contains #ifdefs to make this work * on many platforms. * - * Copyright : Written by and Copyright (C) 2001 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2009 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -35,78 +35,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: jbsockets.h,v $ - * Revision 1.14 2008/12/20 14:53:55 fabiankeil - * Add config option socket-timeout to control the time - * Privoxy waits for data to arrive on a socket. Useful - * in case of stale ssh tunnels or when fuzz-testing. - * - * Revision 1.13 2008/03/21 11:13:59 fabiankeil - * Only gather host information if it's actually needed. - * Also move the code out of accept_connection() so it's less likely - * to delay other incoming connections if the host is misconfigured. - * - * Revision 1.12 2006/07/18 14:48:46 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.9.2.1 2002/05/26 23:41:27 joergs - * AmigaOS: Fixed wrong type of len in write_socket() - * - * Revision 1.9 2002/04/08 20:31:41 swa - * fixed JB spelling - * - * Revision 1.8 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.7 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.6 2002/03/13 00:27:05 jongfoster - * Killing warnings - * - * Revision 1.5 2002/03/09 20:03:52 jongfoster - * - Making various functions return int rather than size_t. - * (Undoing a recent change). Since size_t is unsigned on - * Windows, functions like read_socket that return -1 on - * error cannot return a size_t. - * - * THIS WAS A MAJOR BUG - it caused frequent, unpredictable - * crashes, and also frequently caused JB to jump to 100% - * CPU and stay there. (Because it thought it had just - * read ((unsigned)-1) == 4Gb of data...) - * - * - The signature of write_socket has changed, it now simply - * returns success=0/failure=nonzero. - * - * - Trying to get rid of a few warnings --with-debug on - * Windows, I've introduced a new type "jb_socket". This is - * used for the socket file descriptors. On Windows, this - * is SOCKET (a typedef for unsigned). Everywhere else, it's - * an int. The error value can't be -1 any more, so it's - * now JB_INVALID_SOCKET (which is -1 on UNIX, and in - * Windows it maps to the #define INVALID_SOCKET.) - * - * - The signature of bind_port has changed. - * - * Revision 1.4 2002/03/07 03:51:36 oes - * - Improved handling of failed DNS lookups - * - Fixed compiler warnings etc - * - * Revision 1.3 2001/07/29 19:01:11 jongfoster - * Changed _FILENAME_H to FILENAME_H_INCLUDED. - * Added forward declarations for needed structures. - * - * Revision 1.2 2001/06/07 23:06:09 jongfoster - * The host parameter to connect_to() is now const. - * - * Revision 1.1.1.1 2001/05/15 13:58:54 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include "project.h" @@ -127,15 +57,26 @@ extern int data_is_available(jb_socket fd, int seconds_to_wait); extern void close_socket(jb_socket fd); extern int bind_port(const char *hostnam, int portnum, jb_socket *pfd); -extern int accept_connection(struct client_state * csp, jb_socket fd); -extern void get_host_information(jb_socket afd, char **ip_address, char **hostname); +extern int accept_connection(struct client_state * csp, jb_socket fds[]); +extern void get_host_information(jb_socket afd, char **ip_address, char **port, char **hostname); extern unsigned long resolve_hostname_to_ip(const char *host); +extern int socket_is_still_alive(jb_socket sfd); + /* Revision control strings from this header and associated .c file */ extern const char jbsockets_rcs[]; extern const char jbsockets_h_rcs[]; +/* + * Solaris workaround + * XXX: still necessary? + */ +#ifndef INADDR_NONE +#define INADDR_NONE -1 +#endif + + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/external/privoxy/jcc.c b/external/privoxy/jcc.c index 10071283..721d187b 100644 --- a/external/privoxy/jcc.c +++ b/external/privoxy/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.235 2009/03/18 21:01:20 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.375 2011/12/10 17:26:11 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -6,7 +6,7 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.235 2009/03/18 21:01:20 fabiankeil Exp $" * Purpose : Main file. Contains main() method, main loop, and * the main connection-handling function. * - * Copyright : Written by and Copyright (C) 2001-2009 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2010 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written @@ -31,1205 +31,8 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.235 2009/03/18 21:01:20 fabiankeil Exp $" * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: jcc.c,v $ - * Revision 1.235 2009/03/18 21:01:20 fabiankeil - * Comment fix. Spotted by Roland. - * - * Revision 1.234 2009/03/18 20:48:42 fabiankeil - * If the --no-daemon option is used, enable LOG_LEVEL_INFO - * before the config file has been parsed (as we always did). - * - * Revision 1.233 2009/03/13 14:10:07 fabiankeil - * Fix some more harmless warnings on amd64. - * - * Revision 1.232 2009/03/08 19:29:16 fabiankeil - * Reinitialize the timeout structure every time before passing - * it to select(). Apparently some implementations mess with it. - * Probably fixes #2669131 reported by cyberpatrol. - * - * Revision 1.231 2009/03/08 14:19:23 fabiankeil - * Fix justified (but harmless) compiler warnings - * on platforms where sizeof(int) < sizeof(long). - * - * Revision 1.230 2009/03/07 13:09:17 fabiankeil - * Change csp->expected_content and_csp->expected_content_length from - * size_t to unsigned long long to reduce the likelihood of integer - * overflows that would let us close the connection prematurely. - * Bug found while investigating #2669131, reported by cyberpatrol. - * - * Revision 1.229 2009/03/07 11:17:01 fabiankeil - * Fix compiler warning. - * - * Revision 1.228 2009/03/06 20:30:13 fabiankeil - * Log unsigned values as such. - * - * Revision 1.227 2009/03/02 19:18:11 fabiankeil - * Streamline parse_http_request()'s prototype. As - * cparser pointed out it doesn't actually use csp. - * - * Revision 1.226 2009/03/01 18:28:24 fabiankeil - * Help clang understand that we aren't dereferencing - * NULL pointers here. - * - * Revision 1.225 2009/02/19 18:09:32 fabiankeil - * Unbreak build without FEATURE_CONNECTION_KEEP_ALIVE. - * Noticed by David. - * - * Revision 1.224 2009/02/14 15:32:04 fabiankeil - * Add the request URL to the timeout message in chat(). - * Suggested by Lee. - * - * Revision 1.223 2009/02/09 21:21:16 fabiankeil - * Now that init_log_module() is called earlier, call show_version() - * later on from main() directly so it doesn't get called for --help - * or --version. - * - * Revision 1.222 2009/02/08 12:56:51 fabiankeil - * Call initialize_mutexes() before init_log_module() again. - * Broken since r220, might be the cause of Lee's #2579448. - * - * Revision 1.221 2009/02/06 18:02:58 fabiankeil - * When dropping privileges, also give up membership in supplementary - * groups. Thanks to Matthias Drochner for reporting the problem, - * providing the initial patch and testing the final version. - * - * Revision 1.220 2009/02/04 18:29:07 fabiankeil - * Initialize the log module before parsing arguments. - * Thanks to Matthias Drochner for the report. - * - * Revision 1.219 2009/01/31 16:08:21 fabiankeil - * Remove redundant error check in receive_client_request(). - * - * Revision 1.218 2009/01/31 12:25:54 fabiankeil - * Flatten indentation in receive_client_request(). - * - * Revision 1.217 2009/01/07 19:50:09 fabiankeil - * - If the socket-timeout has been reached and the client - * hasn't received any data yet, send an explanation before - * closing the connection. - * - In get_request_line(), signal timeouts the right way. - * - * Revision 1.216 2008/12/24 22:13:11 ler762 - * fix GCC 3.4.4 warning - * - * Revision 1.215 2008/12/24 17:06:19 fabiankeil - * Keep a thread around to timeout alive connections - * even if no new requests are coming in. - * - * Revision 1.214 2008/12/20 14:53:55 fabiankeil - * Add config option socket-timeout to control the time - * Privoxy waits for data to arrive on a socket. Useful - * in case of stale ssh tunnels or when fuzz-testing. - * - * Revision 1.213 2008/12/15 18:45:51 fabiankeil - * When logging crunches, log the whole URL, so one can easily - * differentiate between vanilla HTTP and CONNECT requests. - * - * Revision 1.212 2008/12/14 15:46:22 fabiankeil - * Give crunched requests their own log level. - * - * Revision 1.211 2008/12/06 10:05:03 fabiankeil - * Downgrade "Received x bytes while expecting y." message to - * LOG_LEVEL_CONNECT as it doesn't necessarily indicate an error. - * - * Revision 1.210 2008/12/02 22:03:18 fabiankeil - * Don't miscalculate byte_count if we don't get all the - * server headers with one read_socket() call. With keep-alive - * support enabled, this caused delays until the server closed - * the connection. - * - * Revision 1.209 2008/11/27 09:44:04 fabiankeil - * Cosmetics for the last commit: Don't watch out for - * the last chunk if the content isn't chunk-encoded or - * if we already determined the content length previously. - * - * Revision 1.208 2008/11/26 18:24:17 fabiankeil - * Recognize that the server response is complete if the - * last chunk is read together with the server headers. - * Reported by Lee. - * - * Revision 1.207 2008/11/25 17:25:16 fabiankeil - * Don't convert the client-header list to text until we need to. - * - * Revision 1.206 2008/11/23 17:00:11 fabiankeil - * Some more chat() cosmetics. - * - * Revision 1.205 2008/11/16 12:43:49 fabiankeil - * Turn keep-alive support into a runtime feature - * that is disabled by setting keep-alive-timeout - * to a negative value. - * - * Revision 1.204 2008/11/06 19:42:17 fabiankeil - * Fix last-chunk detection hack to also apply - * if buf[] contains nothing but the last-chunk. - * - * Revision 1.203 2008/11/06 18:34:35 fabiankeil - * Factor receive_client_request() and - * parse_client_request() out of chat(). - * - * Revision 1.202 2008/11/02 18:40:34 fabiankeil - * If we received a different amount of data than we expected, - * log a warning and make sure the server socket isn't reused. - * - * Revision 1.201 2008/11/02 16:48:20 fabiankeil - * Revert revision 1.195 and try again. - * - * Revision 1.200 2008/10/26 16:53:18 fabiankeil - * Fix gcc44 warning. - * - * Revision 1.199 2008/10/26 15:36:10 fabiankeil - * Remove two debug messages with LOG_LEVEL_INFO. - * - * Revision 1.198 2008/10/22 15:19:55 fabiankeil - * Once More, With Feeling: if there is no logfile - * because the user didn't specify one, we shouldn't - * call init_error_log() after receiving SIGHUP either. - * - * Revision 1.197 2008/10/20 17:02:40 fabiankeil - * If SIGHUP is received while we aren't running in daemon - * mode, calling init_error_log() would be a mistake. - * - * Revision 1.196 2008/10/16 09:16:41 fabiankeil - * - Fix two gcc44 conversion warnings. - * - Don't bother logging the last five bytes - * of the 0-chunk. - * - * Revision 1.195 2008/10/13 16:04:37 fabiankeil - * Make sure we don't try to reuse tainted server sockets. - * - * Revision 1.194 2008/10/12 18:35:18 fabiankeil - * The last commit was a bit too ambitious, apparently the content - * length adjustment is only necessary if we aren't buffering. - * - * Revision 1.193 2008/10/12 15:57:35 fabiankeil - * Fix content length calculation if we read headers - * and the start of the body at once. Now that we have - * FEATURE_CONNECTION_KEEP_ALIVE, it actually matters. - * - * Revision 1.192 2008/10/11 18:19:14 fabiankeil - * Even more chat() cosmetics. - * - * Revision 1.191 2008/10/11 18:00:14 fabiankeil - * Reformat some comments in chat(). - * - * Revision 1.190 2008/10/11 14:58:00 fabiankeil - * In case of chunk-encoded content, stop reading if - * the buffer looks like it ends with the last chunk. - * - * Revision 1.189 2008/10/11 09:53:00 fabiankeil - * Let server_response_is_complete() deal properly with - * content that is neither buffered nor read all at once. - * - * Revision 1.188 2008/10/09 18:21:41 fabiankeil - * Flush work-in-progress changes to keep outgoing connections - * alive where possible. Incomplete and mostly #ifdef'd out. - * - * Revision 1.187 2008/09/07 12:35:05 fabiankeil - * Add mutex lock support for _WIN32. - * - * Revision 1.186 2008/09/04 08:13:58 fabiankeil - * Prepare for critical sections on Windows by adding a - * layer of indirection before the pthread mutex functions. - * - * Revision 1.185 2008/08/30 12:03:07 fabiankeil - * Remove FEATURE_COOKIE_JAR. - * - * Revision 1.184 2008/08/22 15:34:45 fabiankeil - * - Silence LLVM/Clang complaint. - * - Make received_hup_signal static. - * - Hide definitions for basedir, pidfile and received_hup_signal - * from __EMX__ as they only seem to be used in case of #ifdef unix. - * - * Revision 1.183 2008/08/21 07:09:35 fabiankeil - * Accept Shoutcast responses again. Problem reported - * and fix suggested by Stefan in #2062860. - * - * Revision 1.182 2008/06/27 11:13:56 fabiankeil - * Fix possible NULL-pointer dereference reported - * by din_a4 in #2003937. Pointy hat to me. - * - * Revision 1.181 2008/05/21 15:47:15 fabiankeil - * Streamline sed()'s prototype and declare - * the header parse and add structures static. - * - * Revision 1.180 2008/05/21 15:26:32 fabiankeil - * - Mark csp as immutable for send_crunch_response(). - * - Fix comment spelling. - * - * Revision 1.179 2008/05/20 20:13:32 fabiankeil - * Factor update_server_headers() out of sed(), ditch the - * first_run hack and make server_patterns_light static. - * - * Revision 1.178 2008/05/10 13:23:38 fabiankeil - * Don't provide get_header() with the whole client state - * structure when it only needs access to csp->iob. - * - * Revision 1.177 2008/05/10 11:51:12 fabiankeil - * Make the "read the rest of the headers" loop a bit more readable. - * - * Revision 1.176 2008/05/10 11:37:57 fabiankeil - * - Instead of logging when the IIS5 hack is enabled, log when it fails. - * - Remove useless comment. - * - * Revision 1.175 2008/05/09 18:53:59 fabiankeil - * Fix comment grammar. - * - * Revision 1.174 2008/05/07 18:05:53 fabiankeil - * Remove the pointless buffer in client_protocol_is_unsupported(). - * - * Revision 1.173 2008/05/06 15:09:00 fabiankeil - * Least-effort fix for bug #1821930 (reported by Lee): - * If the response doesn't look like HTTP, - * tell the client and log the problem. - * - * Revision 1.172 2008/04/16 16:38:21 fabiankeil - * Don't pass the whole csp structure to flush_socket() - * when it only needs a file descriptor and a buffer. - * - * Revision 1.171 2008/03/27 18:27:25 fabiankeil - * Remove kill-popups action. - * - * Revision 1.170 2008/03/06 16:33:46 fabiankeil - * If limit-connect isn't used, don't limit CONNECT requests to port 443. - * - * Revision 1.169 2008/03/04 18:30:39 fabiankeil - * Remove the treat-forbidden-connects-like-blocks action. We now - * use the "blocked" page for forbidden CONNECT requests by default. - * - * Revision 1.168 2008/03/02 12:25:25 fabiankeil - * Also use shiny new connect_port_is_forbidden() in jcc.c. - * - * Revision 1.167 2008/02/23 16:57:12 fabiankeil - * Rename url_actions() to get_url_actions() and let it - * use the standard parameter ordering. - * - * Revision 1.166 2008/02/23 16:33:43 fabiankeil - * Let forward_url() use the standard parameter ordering - * and mark its second parameter immutable. - * - * Revision 1.165 2008/02/02 19:36:56 fabiankeil - * Remove the "Listening ... for local connections only" log message. - * Whether or not remote connections are able to reach Privoxy is up - * to the operating system. - * - * Revision 1.164 2007/12/16 18:32:46 fabiankeil - * Prevent the log messages for CONNECT requests to unacceptable - * ports from printing the limit-connect argument as [null] if - * limit-connect hasn't been explicitly enabled. - * - * Revision 1.163 2007/12/13 01:47:11 david__schmidt - * Make sure all console-mode apps get a usage() instance - * - * Revision 1.162 2007/12/06 17:54:57 fabiankeil - * Reword NO_SERVER_DATA_RESPONSE to make it harder - * to misunderstand what the message is all about. - * - * Revision 1.161 2007/12/04 19:44:22 fabiankeil - * Unbreak trustfile which previously didn't work without - * FEATURE_TOGGLE. Fixes BR#1843585, reported by Lee. - * - * Revision 1.160 2007/11/29 18:00:29 fabiankeil - * Plug memory leak. Spotted by Valgrind, triggered by - * Privoxy-Regression-Test feeding proxyfuzz.py. - * - * Revision 1.159 2007/11/24 14:34:09 fabiankeil - * In the HTTP snipplets, refer to the client as client. - * - * Revision 1.158 2007/11/11 16:44:17 fabiankeil - * Emit a log message when activating the MS IIS5 hack. - * - * Revision 1.157 2007/11/03 17:34:49 fabiankeil - * Log the "weak randomization factor" warning only - * once for mingw32 and provide some more details. - * - * Revision 1.156 2007/11/01 18:20:58 fabiankeil - * Initialize log module after initializing mutexes, future - * deadlocks in that code should now work cross-platform. - * - * Revision 1.155 2007/10/23 20:12:45 fabiankeil - * Fix first CSUCCEED line to end in \r\n as required by RFC1945. - * Reported by Bert van Leeuwen in BR#1818808. - * - * Revision 1.154 2007/10/19 17:00:08 fabiankeil - * Downgrade "Flushing header and buffers" message to LOG_LEVEL_INFO. - * - * Revision 1.153 2007/10/14 14:12:41 fabiankeil - * When in daemon mode, close stderr after the configuration file has been - * parsed the first time. If logfile isn't set, stop logging. Fixes BR#897436. - * - * Revision 1.152 2007/10/04 18:03:34 fabiankeil - * - Fix a crash when parsing invalid requests whose first header - * is rejected by get_header(). Regression (re?)introduced - * in r1.143 by yours truly. - * - Move ACTION_VANILLA_WAFER handling into parsers.c's - * client_cookie_adder() to make sure send-vanilla-wafer can be - * controlled through tags (and thus regression-tested). - * - * Revision 1.151 2007/09/29 10:21:16 fabiankeil - * - Move get_filter_function() from jcc.c to filters.c - * so the filter functions can be static. - * - Don't bother filtering body-less responses. - * - * Revision 1.150 2007/09/28 16:39:29 fabiankeil - * Execute content filters through execute_content_filter(). - * - * Revision 1.149 2007/09/04 15:08:48 fabiankeil - * Initialize req to NULL to make sure it's defined if the - * first read_socket() call fails. Reported by icmp30. - * - * Revision 1.148 2007/08/26 16:47:13 fabiankeil - * Add Stephen Gildea's --pre-chroot-nslookup patch [#1276666], - * extensive comments moved to user manual. - * - * Revision 1.147 2007/08/25 14:42:40 fabiankeil - * Don't crash if a broken header filter wiped out the request line. - * - * Revision 1.146 2007/08/20 17:09:32 fabiankeil - * Fix byte_count calculation in case of flushes - * and don't parse the server headers a second time. - * - * Revision 1.145 2007/08/19 13:13:31 fabiankeil - * - If there's a connection problem after we already forwarded - * parts of the original content, just hang up. Fixes BR#1776724. - * - Fix warnings about unused code on mingw32. - * - In case of flushes, calculate the byte count - * less incorrectly (I think). - * - * Revision 1.144 2007/08/11 14:43:22 fabiankeil - * Add some more prototypes for static functions. - * - * Revision 1.143 2007/08/05 13:58:19 fabiankeil - * Comment out request_contains_null_bytes() until it's used again. - * - * Revision 1.142 2007/08/05 13:50:26 fabiankeil - * #1763173 from Stefan Huehner: s@const static@static const@ - * and declare some more functions static. - * - * Revision 1.141 2007/08/04 09:56:23 fabiankeil - * - Log rejected CONNECT requests with LOG_LEVEL_INFO - * and explain why they were rejected in the first place. - * - Fix the LOG_LEVEL_CLF message for crunches of unallowed - * CONNECT requests. The request line was missing. - * - Add two more XXX reminders as we don't have enough already. - * - * Revision 1.140 2007/07/21 11:51:36 fabiankeil - * As Hal noticed, checking dispatch_cgi() as the last cruncher - * looks like a bug if CGI requests are blocked unintentionally, - * so don't do it unless the user enabled the new config option - * "allow-cgi-request-crunching". - * - * Revision 1.139 2007/07/14 07:46:41 fabiankeil - * - Allow to rewrite the request destination behind the client's back. - * - Turn the weird-looking unconditional for loop that - * reads the client request into a conditional while loop. - * Move the stuff that only runs once out of the loop. - * - Move parts of chat(), server_content_type() and the - * necessary stuff to fix BR#1750917 into get_filter_function(). - * - * Revision 1.138 2007/06/03 18:45:18 fabiankeil - * Temporary workaround for BR#1730105. - * - * Revision 1.137 2007/06/01 18:16:36 fabiankeil - * Use the same mutex for gethostbyname() and gethostbyaddr() to prevent - * deadlocks and crashes on OpenBSD and possibly other OS with neither - * gethostbyname_r() nor gethostaddr_r(). Closes BR#1729174. - * Thanks to Ralf Horstmann for report and solution. - * - * Revision 1.136 2007/06/01 16:41:11 fabiankeil - * Add forward-override{} to change the forwarding settings through - * action sections. This is mainly interesting to forward different - * clients differently (for example based on User-Agent or request - * origin). - * - * Revision 1.135 2007/05/24 17:03:50 fabiankeil - * - Let usage() mention the --chroot parameter. - * - Use read_socket() consistently and always leave - * the last buffer byte alone, even in cases where - * null termination (currently) doesn't matter. - * - * Revision 1.134 2007/05/16 14:59:46 fabiankeil - * - Fix config file loading on Unix if no config file is specified. - * Since r1.97 Privoxy would always interpret the last argument as - * config file, even if it's a valid command line option. - * - Abort in case of unrecognized command line options. Closes #1719696. - * - Remove a bunch of unnecessary strcpy() calls (yay for c&p without thinking). - * - Replace the remaining strcpy() and strcat() calls with strlcpy() and strcat(). - * - * Revision 1.133 2007/05/04 11:23:19 fabiankeil - * - Don't rerun crunchers that only depend on the request URL. - * - Don't count redirects and CGI requests as "blocked requests". - * - * Revision 1.132 2007/04/25 15:15:17 fabiankeil - * Support crunching based on tags created by server-header taggers. - * - * Revision 1.131 2007/04/22 13:24:50 fabiankeil - * Make HTTP snippets static (again). Add a Content-Type for those - * with content so the browser doesn't guess it based on the URL. - * - * Revision 1.130 2007/04/19 13:47:34 fabiankeil - * Move crunching and request line rebuilding out of chat(). - * - * Revision 1.129 2007/04/15 16:39:20 fabiankeil - * Introduce tags as alternative way to specify which - * actions apply to a request. At the moment tags can be - * created based on client and server headers. - * - * Revision 1.128 2007/03/25 16:55:54 fabiankeil - * Don't CLF-log CONNECT requests twice. - * - * Revision 1.127 2007/03/20 13:53:17 fabiankeil - * Log the source address for ACL-related connection drops. - * - * Revision 1.126 2007/03/17 15:20:05 fabiankeil - * New config option: enforce-blocks. - * - * Revision 1.125 2007/03/09 14:12:00 fabiankeil - * - Move null byte check into separate function. - * - Don't confuse the client with error pages - * if a CONNECT request was already confirmed. - * - * Revision 1.124 2007/02/23 14:59:54 fabiankeil - * Speed up NULL byte escaping and only log the complete - * NULL byte requests with header debugging enabled. - * - * Revision 1.123 2007/02/21 18:42:10 fabiankeil - * Answer requests that contain NULL bytes with - * a custom response instead of waiting for more - * data until the client eventually hangs up. - * - * Revision 1.122 2007/02/07 11:12:02 fabiankeil - * - Move delivery and logging of crunched responses - * from chat() into send_crunch_response(). - * - Display the reason for generating http_responses. - * - Log the content length for LOG_LEVEL_CLF correctly - * (still incorrect for some fixed responses). - * - Reword an incorrect comment about - * treat-forbidden-connects-like-blocks violating - * the specs. - * - Add some log messages. - * - * Revision 1.121 2007/01/27 10:52:56 fabiankeil - * Move mutex initialization into separate - * function and exit in case of errors. - * - * Revision 1.120 2007/01/26 14:18:42 fabiankeil - * - Start to reduce chat()'s line count and move - * parts of it into separate functions. - * - Add "HTTP/1.1 100 Continue" hack for BR 756734. - * - * Revision 1.119 2007/01/25 14:02:30 fabiankeil - * - Add Proxy-Agent header to HTTP snippets that are - * supposed to reach HTTP clients only. - * - Made a few CONNECT log messages more descriptive. - * - Catch completely empty server responses (as seen - * with Tor's fake ".noconnect" top level domain). - * - Use shiny new "forwarding-failed" template for socks errors. - * - * Revision 1.118 2007/01/07 07:43:43 joergs - * AmigaOS4 support added. - * - * Revision 1.117 2006/12/31 17:56:37 fabiankeil - * Added config option accept-intercepted-requests - * and disabled it by default. - * - * Revision 1.116 2006/12/29 19:08:22 fabiankeil - * Reverted parts of my last commit - * to keep error handling working. - * - * Revision 1.115 2006/12/29 17:38:57 fabiankeil - * Fixed gcc43 conversion warnings. - * - * Revision 1.114 2006/12/27 18:52:02 fabiankeil - * Fix -pedantic ISO C warning about converting - * from function pointer to object pointer. - * - * Revision 1.113 2006/12/26 17:38:50 fabiankeil - * Silence compiler warning I introduced with my last commit. - * - * Revision 1.112 2006/12/26 17:31:41 fabiankeil - * Mutex protect rand() if POSIX threading - * is used, warn the user if that's not possible - * and stop using it on _WIN32 where it could - * cause crashes. - * - * Revision 1.111 2006/12/23 16:15:06 fabiankeil - * Don't prevent core dumps by catching SIGABRT. - * It's rude and makes debugging unreasonable painful. - * - * Revision 1.110 2006/12/13 14:52:53 etresoft - * Fix build failure on MacOS X. Global symbols can be either static or extern, but not both. - * - * Revision 1.109 2006/12/06 19:41:40 fabiankeil - * Privoxy is now able to run as intercepting - * proxy in combination with any packet filter - * that does the port redirection. The destination - * is extracted from the "Host:" header which - * should be available for nearly all requests. - * - * Moved HTTP snipplets into jcc.c. - * Added error message for gopher proxy requests. - * - * Revision 1.108 2006/11/28 15:38:51 fabiankeil - * Only unlink the pidfile if it's actually used. - * - * Change order of interception checks to make - * it possible to block or redirect requests for - * the cgi pages. - * - * Revision 1.107 2006/11/13 19:05:51 fabiankeil - * Make pthread mutex locking more generic. Instead of - * checking for OSX and OpenBSD, check for FEATURE_PTHREAD - * and use mutex locking unless there is an _r function - * available. Better safe than sorry. - * - * Fixes "./configure --disable-pthread" and should result - * in less threading-related problems on pthread-using platforms, - * but it still doesn't fix BR#1122404. - * - * Revision 1.106 2006/11/06 19:58:23 fabiankeil - * Move pthread.h inclusion from jcc.c to jcc.h. - * Fixes build on x86-freebsd1 (FreeBSD 5.4-RELEASE). - * - * Revision 1.105 2006/11/06 14:26:02 fabiankeil - * Don't exit after receiving the second SIGHUP on Solaris. - * - * Fixes BR 1052235, but the same problem may exist on other - * systems. Once 3.0.6 is out we should use sigset() - * where available and see if it breaks anything. - * - * Revision 1.104 2006/09/23 13:26:38 roro - * Replace TABs by spaces in source code. - * - * Revision 1.103 2006/09/21 12:54:43 fabiankeil - * Fix +redirect{}. Didn't work with -fast-redirects. - * - * Revision 1.102 2006/09/06 13:03:04 fabiankeil - * Respond with 400 and a short text message - * if the client tries to use Privoxy as FTP proxy. - * - * Revision 1.101 2006/09/06 09:23:37 fabiankeil - * Make number of retries in case of forwarded-connect problems - * a config file option (forwarded-connect-retries) and use 0 as - * default. - * - * Revision 1.100 2006/09/03 19:42:59 fabiankeil - * Set random(3) seed. - * - * Revision 1.99 2006/09/02 15:36:42 fabiankeil - * Follow the OpenBSD port's lead and protect the resolve - * functions on OpenBSD as well. - * - * Revision 1.98 2006/08/24 11:01:34 fabiankeil - * --user fix. Only use the user as group if no group is specified. - * Solves BR 1492612. Thanks to Spinor S. and David Laight. - * - * Revision 1.97 2006/08/18 15:23:17 david__schmidt - * Windows service (re-)integration - * - * The new args are: - * - * --install[:service_name] - * --uninstall[:service_name] - * --service - * - * They work as follows: - * --install will create a service for you and then terminate. - * By default the service name will be "privoxy" (without the quotes). - * However you can run multiple services if you wish, just by adding - * a colon and then a name (no spaces). - * - * --uninstall follows the exact same rules a --install. - * - * --service is used when the program is executed by the service - * control manager, and in normal circumstances would never be - * used as a command line argument. - * - * Revision 1.96 2006/08/15 20:12:36 david__schmidt - * Windows service integration - * - * Revision 1.95 2006/08/03 02:46:41 david__schmidt - * Incorporate Fabian Keil's patch work: -http://www.fabiankeil.de/sourcecode/privoxy/ - * - * Revision 1.94 2006/07/18 14:48:46 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.92.2.16 2005/04/03 20:10:50 david__schmidt - * Thanks to Jindrich Makovicka for a race condition fix for the log - * file. The race condition remains for non-pthread implementations. - * Reference patch #1175720. - * - * Revision 1.92.2.15 2004/10/03 12:53:32 david__schmidt - * Add the ability to check jpeg images for invalid - * lengths of comment blocks. Defensive strategy - * against the exploit: - * Microsoft Security Bulletin MS04-028 - * Buffer Overrun in JPEG Processing (GDI+) Could - * Allow Code Execution (833987) - * Enabled with +inspect-jpegs in actions files. - * - * Revision 1.92.2.14 2003/12/12 12:52:53 oes - * - Fixed usage info for non-unix platforms - * - Fixed small cmdline parsing bug - * - * Revision 1.92.2.13 2003/11/27 19:20:27 oes - * Diagnostics: Now preserve the returncode of pthread_create - * in errno. Closes BR #775721. Thanks to Geoffrey Hausheer. - * - * Revision 1.92.2.12 2003/07/11 11:34:19 oes - * No longer ignore SIGCHLD. Fixes bug #769381 - * - * Revision 1.92.2.11 2003/05/14 12:32:02 oes - * Close jarfile on graceful exit, remove stray line - * - * Revision 1.92.2.10 2003/05/08 15:13:46 oes - * Cosmetics: Killed a warning, a typo and an allocation left at exit - * - * Revision 1.92.2.9 2003/04/03 15:08:42 oes - * No longer rely on non-POSIX.1 extensions of getcwd(). - * Fixes bug #711001 - * - * Revision 1.92.2.8 2003/03/31 13:12:32 oes - * Replaced setenv() by posix-compliant putenv() - * Thanks to Neil McCalden (nmcc AT users.sf.net). - * - * Revision 1.92.2.7 2003/03/17 16:48:59 oes - * Added chroot ability, thanks to patch by Sviatoslav Sviridov - * - * Revision 1.92.2.6 2003/03/11 11:55:00 oes - * Clean-up and extension of improvements for forked mode: - * - Child's return code now consists of flags RC_FLAG_* - * - Reporting toggle to parent now properly #ifdef'ed - * - Children now report blocking to parent. This enables - * statistics in forked mode - * - * Revision 1.92.2.5 2003/03/10 23:45:32 oes - * Fixed bug #700381: Non-Threaded version now capable of being toggled. - * Children now report having been toggled through _exit(17), parents - * watch for that code and toggle themselves if found. - * - * Revision 1.92.2.4 2003/03/07 03:41:04 david__schmidt - * Wrapping all *_r functions (the non-_r versions of them) with - * mutex semaphores for OSX. Hopefully this will take care of all - * of those pesky crash reports. - * - * Revision 1.92.2.3 2003/02/28 12:53:06 oes - * Fixed two mostly harmless mem leaks - * - * Revision 1.92.2.2 2002/11/20 14:37:47 oes - * Fix: Head of global clients list now initialized to NULL - * - * Revision 1.92.2.1 2002/09/25 14:52:24 oes - * Added basic support for OPTIONS and TRACE HTTP methods: - * - New interceptor direct_response() added in chat(). - * - sed() moved to earlier in the process, so that the - * Host: header is evaluated before actions and forwarding - * are decided on. - * - * Revision 1.92 2002/05/08 16:00:46 oes - * Chat's buffer handling: - * - Fixed bug with unchecked out-of-mem conditions - * while reading client request & server headers - * - No longer predict if the buffer limit will be exceeded - * in the next read -- check add_to_iob's new - * return code. If buffer couldn't be extended - * (policy or out-of-mem) while - * - reading from client: abort - * - reading server headers: send error page - * - buffering server body for filter: flush, - * and if that fails: send error page - * - * Revision 1.91 2002/04/08 20:35:58 swa - * fixed JB spelling - * - * Revision 1.90 2002/04/02 14:57:28 oes - * Made sending wafers independent of FEATURE_COOKIE_JAR - * - * Revision 1.89 2002/03/31 17:18:59 jongfoster - * Win32 only: Enabling STRICT to fix a VC++ compile warning. - * - * Revision 1.88 2002/03/27 14:32:43 david__schmidt - * More compiler warning message maintenance - * - * Revision 1.87 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.86 2002/03/25 17:04:55 david__schmidt - * Workaround for closing the jarfile before load_config() comes around again - * - * Revision 1.85 2002/03/24 15:23:33 jongfoster - * Name changes - * - * Revision 1.84 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.83 2002/03/16 23:54:06 jongfoster - * Adding graceful termination feature, to help look for memory leaks. - * If you enable this (which, by design, has to be done by hand - * editing config.h) and then go to http://i.j.b/die, then the program - * will exit cleanly after the *next* request. It should free all the - * memory that was used. - * - * Revision 1.82 2002/03/13 00:27:05 jongfoster - * Killing warnings - * - * Revision 1.81 2002/03/12 01:42:50 oes - * Introduced modular filters - * - * Revision 1.80 2002/03/11 22:07:05 david__schmidt - * OS/2 port maintenance: - * - Fixed EMX build - it had decayed a little - * - Fixed inexplicable crash during FD_ZERO - must be due to a bad macro. - * substituted a memset for now. - * - * Revision 1.79 2002/03/09 20:03:52 jongfoster - * - Making various functions return int rather than size_t. - * (Undoing a recent change). Since size_t is unsigned on - * Windows, functions like read_socket that return -1 on - * error cannot return a size_t. - * - * THIS WAS A MAJOR BUG - it caused frequent, unpredictable - * crashes, and also frequently caused JB to jump to 100% - * CPU and stay there. (Because it thought it had just - * read ((unsigned)-1) == 4Gb of data...) - * - * - The signature of write_socket has changed, it now simply - * returns success=0/failure=nonzero. - * - * - Trying to get rid of a few warnings --with-debug on - * Windows, I've introduced a new type "jb_socket". This is - * used for the socket file descriptors. On Windows, this - * is SOCKET (a typedef for unsigned). Everywhere else, it's - * an int. The error value can't be -1 any more, so it's - * now JB_INVALID_SOCKET (which is -1 on UNIX, and in - * Windows it maps to the #define INVALID_SOCKET.) - * - * - The signature of bind_port has changed. - * - * Revision 1.78 2002/03/08 21:35:04 oes - * Added optional group supplement to --user option. Will now use default group of user if no group given - * - * Revision 1.77 2002/03/07 03:52:06 oes - * - Fixed compiler warnings etc - * - Improved handling of failed DNS lookups - * - * Revision 1.76 2002/03/06 22:54:35 jongfoster - * Automated function-comment nitpicking. - * - * Revision 1.75 2002/03/06 10:02:19 oes - * Fixed stupid bug when --user was not given - * - * Revision 1.74 2002/03/06 00:49:31 jongfoster - * Fixing warning on Windows - * Making #ifdefs that refer to the same variable consistently - * use #ifdef unix rather than mixing #ifdef unix & #ifndef OS2 - * - * Revision 1.73 2002/03/05 23:57:30 hal9 - * Stray character 's' on line 1618 was breaking build. - * - * Revision 1.72 2002/03/05 21:33:45 david__schmidt - * - Re-enable OS/2 building after new parms were added - * - Fix false out of memory report when resolving CGI templates when no IP - * address is available of failed attempt (a la no such domain) - * - * Revision 1.71 2002/03/05 18:13:56 oes - * Added --user option - * - * Revision 1.70 2002/03/05 04:52:42 oes - * Deleted non-errlog debugging code - * - * Revision 1.69 2002/03/04 23:50:00 jongfoster - * Splitting off bind_port() call into bind_port_helper(), with - * improved logging. - * - * Revision 1.68 2002/03/04 20:17:32 oes - * Fixed usage info - * - * Revision 1.67 2002/03/04 18:18:57 oes - * - Removed _DEBUG mode - * - Cleand up cmdline parsing - * - Introduced --no-daemon, --pidfile options - * - Cleaned up signal handling: - * - Terminate cleanly on INT, TERM and ABRT - * - Schedule logfile for re-opening on HUP - * - Ignore CHLD and PIPE - * - Leave the rest with their default handlers - * - Uniform handler registration - * - Added usage() function - * - Played styleguide police - * - * Revision 1.66 2002/03/03 15:06:55 oes - * Re-enabled automatic config reloading - * - * Revision 1.65 2002/03/03 14:49:11 oes - * Fixed CLF logging: Now uses client's original HTTP request - * - * Revision 1.64 2002/03/03 09:18:03 joergs - * Made jumbjuster work on AmigaOS again. - * - * Revision 1.63 2002/03/02 04:14:50 david__schmidt - * Clean up a little CRLF unpleasantness that suddenly appeared - * - * Revision 1.62 2002/02/20 23:17:23 jongfoster - * Detecting some out-of memory conditions and exiting with a log message. - * - * Revision 1.61 2002/01/17 21:01:52 jongfoster - * Moving all our URL and URL pattern parsing code to urlmatch.c. - * - * Revision 1.60 2001/12/30 14:07:32 steudten - * - Add signal handling (unix) - * - Add SIGHUP handler (unix) - * - Add creation of pidfile (unix) - * - Add action 'top' in rc file (RH) - * - Add entry 'SIGNALS' to manpage - * - Add exit message to logfile (unix) - * - * Revision 1.59 2001/12/13 14:07:18 oes - * Fixed Bug: 503 error page now sent OK - * - * Revision 1.58 2001/11/30 23:37:24 jongfoster - * Renaming the Win32 config file to config.txt - this is almost the - * same as the corresponding UNIX name "config" - * - * Revision 1.57 2001/11/16 00:47:43 jongfoster - * Changing the tty-disconnection code to use setsid(). - * - * Revision 1.56 2001/11/13 20:20:54 jongfoster - * Tabs->spaces, fixing a bug with missing {} around an if() - * - * Revision 1.55 2001/11/13 20:14:53 jongfoster - * Patch for FreeBSD setpgrp() as suggested by Alexander Lazic - * - * Revision 1.54 2001/11/07 00:03:14 steudten - * Give reliable return value if an error - * occurs not just 0 with new daemon mode. - * - * Revision 1.53 2001/11/05 21:41:43 steudten - * Add changes to be a real daemon just for unix os. - * (change cwd to /, detach from controlling tty, set - * process group and session leader to the own process. - * Add DBG() Macro. - * Add some fatal-error log message for failed malloc(). - * Add '-d' if compiled with 'configure --with-debug' to - * enable debug output. - * - * Revision 1.52 2001/10/26 20:11:20 jongfoster - * Fixing type mismatch - * - * Revision 1.51 2001/10/26 17:38:28 oes - * Cosmetics - * - * Revision 1.50 2001/10/25 03:40:48 david__schmidt - * Change in porting tactics: OS/2's EMX porting layer doesn't allow multiple - * threads to call select() simultaneously. So, it's time to do a real, live, - * native OS/2 port. See defines for __EMX__ (the porting layer) vs. __OS2__ - * (native). Both versions will work, but using __OS2__ offers multi-threading. - * - * Revision 1.49 2001/10/23 21:41:35 jongfoster - * Added call to initialize the (statically-allocated of course) - * "out of memory" CGI response. - * - * Revision 1.48 2001/10/10 19:56:46 jongfoster - * Moving some code that wasn't cookie-related out of an #ifdef - * FEATURE_COOKIE_JAR - * - * Revision 1.47 2001/10/10 16:44:36 oes - * Added CONNECT destination port limitation check - * - * Revision 1.46 2001/10/08 15:17:41 oes - * Re-enabled SSL forwarding - * - * Revision 1.45 2001/10/07 15:42:11 oes - * Replaced 6 boolean members of csp with one bitmap (csp->flags) - * - * Moved downgrading of the HTTP version from parse_http_request to - * chat(), since we can't decide if it is necessary before we have - * determined the actions for the URL. The HTTP command is now - * *always* re-built so the repairs need no longer be special-cased. - * - * filter_popups now gets a csp pointer so it can raise the new - * CSP_FLAG_MODIFIED flag. - * - * Bugfix - * - * Added configurable size limit for the IOB. If the IOB grows so - * large that the next read would exceed the limit, the header - * is generated, and the header & unfiltered buffer are flushed - * to the client. Chat then continues in non-buffering, - * non-filtering body mode. - * - * Revision 1.44 2001/10/02 18:13:57 oes - * Ooops - * - * Revision 1.43 2001/10/02 15:32:13 oes - * Moved generation of hdr - * - * Revision 1.42 2001/09/21 23:02:02 david__schmidt - * Cleaning up 2 compiler warnings on OS/2. - * - * Revision 1.41 2001/09/16 17:05:14 jongfoster - * Removing unused #include showarg.h - * - * Revision 1.40 2001/09/16 15:41:45 jongfoster - * Fixing signed/unsigned comparison warning. - * - * Revision 1.39 2001/09/16 13:21:27 jongfoster - * Changes to use new list functions. - * - * Revision 1.38 2001/09/16 13:01:46 jongfoster - * Removing redundant function call that zeroed zalloc()'d memory. - * - * Revision 1.37 2001/09/10 11:12:24 oes - * Deleted unused variable - * - * Revision 1.36 2001/09/10 10:56:15 oes - * Silenced compiler warnings - * - * Revision 1.35 2001/07/31 14:44:22 oes - * Deleted unused size parameter from filter_popups() - * - * Revision 1.34 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.33 2001/07/29 19:32:00 jongfoster - * Renaming _main() [mingw32 only] to real_main(), for ANSI compliance. - * - * Revision 1.32 2001/07/29 18:47:05 jongfoster - * Adding missing #include "loadcfg.h" - * - * Revision 1.31 2001/07/29 12:17:48 oes - * Applied pthread fix by Paul Lieverse - * - * Revision 1.30 2001/07/25 22:57:13 jongfoster - * __BEOS__ no longer overrides FEATURE_PTHREAD. - * This is because FEATURE_PTHREAD will soon be widely used, so I - * want to keep it simple. - * - * Revision 1.29 2001/07/24 12:47:06 oes - * Applied BeOS support update by Eugenia - * - * Revision 1.28 2001/07/23 13:26:12 oes - * Fixed bug in popup-killing for the first read that caused binary garbage to be sent between headers and body - * - * Revision 1.27 2001/07/19 19:09:47 haroon - * - Added code to take care of the situation where while processing the first - * server response (which includes the server header), after finding the end - * of the headers we were not looking past the end of the headers for - * content modification. I enabled it for filter_popups. - * Someone else should look to see if other similar operations should be - * done to the discarded portion of the buffer. - * - * Note 2001/07/20: No, the other content modification mechanisms will process - * the whole iob later anyway. --oes - * - * Revision 1.26 2001/07/18 12:31:36 oes - * cosmetics - * - * Revision 1.25 2001/07/15 19:43:49 jongfoster - * Supports POSIX threads. - * Also removed some unused #includes. - * - * Revision 1.24 2001/07/13 14:00:40 oes - * - Generic content modification scheme: - * Each feature has its own applicability flag that is set - * from csp->action->flags. - * Replaced the "filtering" int flag , by a function pointer - * "content_filter" to the function that will do the content - * modification. If it is != NULL, the document will be buffered - * and processed through *content_filter, which must set - * csp->content_length and return a modified copy of the body - * or return NULL (on failiure). - * - Changed csp->is_text to the more generic bitmap csp->content_type - * which can currently take the valued CT_TEXT or CT_GIF - * - Reformatting etc - * - Removed all #ifdef PCRS - * - * Revision 1.23 2001/07/02 02:28:25 iwanttokeepanon - * Added "#ifdef ACL_FILES" conditional compilation to line 1291 to exclude - * the `block_acl' call. This prevents a compilation error when the user - * does not wish to use the "ACL" feature. - * - * Revision 1.22 2001/06/29 21:45:41 oes - * Indentation, CRLF->LF, Tab-> Space - * - * Revision 1.21 2001/06/29 13:29:36 oes - * - Cleaned up, improved comments - * - Unified all possible interceptors (CGI, - * block, trust, fast_redirect) in one - * place, with one (CGI) answer generation - * mechansim. Much clearer now. - * - Removed the GIF image generation, which - * is now done in filters.c:block_url() - * - Made error conditions like domain lookup - * failiure or (various) problems while talking - * to the server use cgi.c:error_response() - * instead of generating HTML/HTTP in chat() (yuck!) - * - Removed logentry from cancelled commit - * - * Revision 1.20 2001/06/09 10:55:28 jongfoster - * Changing BUFSIZ ==> BUFFER_SIZE - * - * Revision 1.19 2001/06/07 23:12:52 jongfoster - * Replacing function pointer in struct gateway with a directly - * called function forwarded_connect(). - * Replacing struct gateway with struct forward_spec - * - * Revision 1.18 2001/06/03 19:12:16 oes - * introduced new cgi handling - * - * Revision 1.17 2001/06/01 20:07:23 jongfoster - * Now uses action +image-blocker{} rather than config->tinygif - * - * Revision 1.16 2001/06/01 18:49:17 jongfoster - * Replaced "list_share" with "list" - the tiny memory gain was not - * worth the extra complexity. - * - * Revision 1.15 2001/05/31 21:24:47 jongfoster - * Changed "permission" to "action" throughout. - * Removed DEFAULT_USER_AGENT - it must now be specified manually. - * Moved vanilla wafer check into chat(), since we must now - * decide whether or not to add it based on the URL. - * - * Revision 1.14 2001/05/29 20:14:01 joergs - * AmigaOS bugfix: PCRS needs a lot of stack, stacksize for child threads - * increased. - * - * Revision 1.13 2001/05/29 09:50:24 jongfoster - * Unified blocklist/imagelist/permissionslist. - * File format is still under discussion, but the internal changes - * are (mostly) done. - * - * Also modified interceptor behaviour: - * - We now intercept all URLs beginning with one of the following - * prefixes (and *only* these prefixes): - * * http://i.j.b/ - * * http://ijbswa.sf.net/config/ - * * http://ijbswa.sourceforge.net/config/ - * - New interceptors "home page" - go to http://i.j.b/ to see it. - * - Internal changes so that intercepted and fast redirect pages - * are not replaced with an image. - * - Interceptors now have the option to send a binary page direct - * to the client. (i.e. ijb-send-banner uses this) - * - Implemented show-url-info interceptor. (Which is why I needed - * the above interceptors changes - a typical URL is - * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". - * The previous mechanism would not have intercepted that, and - * if it had been intercepted then it then it would have replaced - * it with an image.) - * - * Revision 1.12 2001/05/27 22:17:04 oes - * - * - re_process_buffer no longer writes the modified buffer - * to the client, which was very ugly. It now returns the - * buffer, which it is then written by chat. - * - * - content_length now adjusts the Content-Length: header - * for modified documents rather than crunch()ing it. - * (Length info in csp->content_length, which is 0 for - * unmodified documents) - * - * - For this to work, sed() is called twice when filtering. - * - * Revision 1.11 2001/05/26 17:27:53 jongfoster - * Added support for CLF and fixed LOG_LEVEL_LOG. - * Also did CRLF->LF fix of my previous patch. - * - * Revision 1.10 2001/05/26 15:26:15 jongfoster - * ACL feature now provides more security by immediately dropping - * connections from untrusted hosts. - * - * Revision 1.9 2001/05/26 00:28:36 jongfoster - * Automatic reloading of config file. - * Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32). - * Most of the global variables have been moved to a new - * struct configuration_spec, accessed through csp->config->globalname - * Most of the globals remaining are used by the Win32 GUI. - * - * Revision 1.8 2001/05/25 22:43:18 jongfoster - * Fixing minor memory leak and buffer overflow. - * - * Revision 1.7 2001/05/25 22:34:30 jongfoster - * Hard tabs->Spaces - * - * Revision 1.6 2001/05/23 00:13:58 joergs - * AmigaOS support fixed. - * - * Revision 1.5 2001/05/22 18:46:04 oes - * - * - Enabled filtering banners by size rather than URL - * by adding patterns that replace all standard banner - * sizes with the "Junkbuster" gif to the re_filterfile - * - * - Enabled filtering WebBugs by providing a pattern - * which kills all 1x1 images - * - * - Added support for PCRE_UNGREEDY behaviour to pcrs, - * which is selected by the (nonstandard and therefore - * capital) letter 'U' in the option string. - * It causes the quantifiers to be ungreedy by default. - * Appending a ? turns back to greedy (!). - * - * - Added a new interceptor ijb-send-banner, which - * sends back the "Junkbuster" gif. Without imagelist or - * MSIE detection support, or if tinygif = 1, or the - * URL isn't recognized as an imageurl, a lame HTML - * explanation is sent instead. - * - * - Added new feature, which permits blocking remote - * script redirects and firing back a local redirect - * to the browser. - * The feature is conditionally compiled, i.e. it - * can be disabled with --disable-fast-redirects, - * plus it must be activated by a "fast-redirects" - * line in the config file, has its own log level - * and of course wants to be displayed by show-proxy-args - * Note: Boy, all the #ifdefs in 1001 locations and - * all the fumbling with configure.in and acconfig.h - * were *way* more work than the feature itself :-( - * - * - Because a generic redirect template was needed for - * this, tinygif = 3 now uses the same. - * - * - Moved GIFs, and other static HTTP response templates - * to project.h - * - * - Some minor fixes - * - * - Removed some >400 CRs again (Jon, you really worked - * a lot! ;-) - * - * Revision 1.4 2001/05/21 19:34:01 jongfoster - * Made failure to bind() a fatal error. - * - * Revision 1.3 2001/05/20 01:21:20 jongfoster - * Version 2.9.4 checkin. - * - Merged popupfile and cookiefile, and added control over PCRS - * filtering, in new "permissionsfile". - * - Implemented LOG_LEVEL_FATAL, so that if there is a configuration - * file error you now get a message box (in the Win32 GUI) rather - * than the program exiting with no explanation. - * - Made killpopup use the PCRS MIME-type checking and HTTP-header - * skipping. - * - Removed tabs from "config" - * - Moved duplicated url parsing code in "loaders.c" to a new funcition. - * - Bumped up version number. - * - * Revision 1.2 2001/05/17 22:34:44 oes - * - Added hint on GIF char array generation to jcc.c - * - Cleaned CRLF's from the sources and related files - * - Repaired logging for REF and FRC - * - * Revision 1.1.1.1 2001/05/15 13:58:56 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include "config.h" @@ -1316,8 +119,8 @@ http://www.fabiankeil.de/sourcecode/privoxy/ const char jcc_h_rcs[] = JCC_H_VERSION; const char project_h_rcs[] = PROJECT_H_VERSION; -int no_daemon = 0; -struct client_state clients[1]; +int daemon_mode = 1; +struct client_states clients[1]; struct file_list files[1]; #ifdef FEATURE_STATISTICS @@ -1348,7 +151,9 @@ static void serve(struct client_state *csp); static void usage(const char *myname); #endif static void initialize_mutexes(void); -static jb_socket bind_port_helper(struct configuration_spec *config); +static jb_socket bind_port_helper(const char *haddr, int hport); +static void bind_ports_helper(struct configuration_spec *config, jb_socket sockets[]); +static void close_ports_helper(jb_socket sockets[]); static void listen_loop(void); #ifdef AMIGA @@ -1403,78 +208,65 @@ static int received_hup_signal = 0; /* HTTP snipplets. */ static const char CSUCCEED[] = - "HTTP/1.0 200 Connection established\r\n" + "HTTP/1.1 200 Connection established\r\n" "Proxy-Agent: Privoxy/" VERSION "\r\n\r\n"; static const char CHEADER[] = - "HTTP/1.0 400 Invalid header received from client\r\n" + "HTTP/1.1 400 Invalid header received from client\r\n" "Proxy-Agent: Privoxy " VERSION "\r\n" "Content-Type: text/plain\r\n" "Connection: close\r\n\r\n" "Invalid header received from client.\r\n"; static const char FTP_RESPONSE[] = - "HTTP/1.0 400 Invalid request received from client\r\n" + "HTTP/1.1 400 Invalid request received from client\r\n" "Content-Type: text/plain\r\n" "Connection: close\r\n\r\n" "Invalid request. Privoxy doesn't support FTP.\r\n"; static const char GOPHER_RESPONSE[] = - "HTTP/1.0 400 Invalid request received from client\r\n" + "HTTP/1.1 400 Invalid request received from client\r\n" "Content-Type: text/plain\r\n" "Connection: close\r\n\r\n" "Invalid request. Privoxy doesn't support gopher.\r\n"; /* XXX: should be a template */ static const char MISSING_DESTINATION_RESPONSE[] = - "HTTP/1.0 400 Bad request received from client\r\n" + "HTTP/1.1 400 Bad request received from client\r\n" "Proxy-Agent: Privoxy " VERSION "\r\n" "Content-Type: text/plain\r\n" "Connection: close\r\n\r\n" "Bad request. Privoxy was unable to extract the destination.\r\n"; -/* XXX: should be a template */ -static const char NO_SERVER_DATA_RESPONSE[] = - "HTTP/1.0 502 Server or forwarder response empty\r\n" - "Proxy-Agent: Privoxy " VERSION "\r\n" - "Content-Type: text/plain\r\n" - "Connection: close\r\n\r\n" - "Empty server or forwarder response.\r\n" - "The connection has been closed but Privoxy didn't receive any data.\r\n"; - /* XXX: should be a template */ static const char INVALID_SERVER_HEADERS_RESPONSE[] = - "HTTP/1.0 502 Server or forwarder response invalid\r\n" + "HTTP/1.1 502 Server or forwarder response invalid\r\n" "Proxy-Agent: Privoxy " VERSION "\r\n" "Content-Type: text/plain\r\n" "Connection: close\r\n\r\n" "Bad response. The server or forwarder response doesn't look like HTTP.\r\n"; -#if 0 -/* XXX: should be a template */ -static const char NULL_BYTE_RESPONSE[] = - "HTTP/1.0 400 Bad request received from client\r\n" - "Proxy-Agent: Privoxy " VERSION "\r\n" - "Content-Type: text/plain\r\n" - "Connection: close\r\n\r\n" - "Bad request. Null byte(s) before end of request.\r\n"; -#endif - /* XXX: should be a template */ static const char MESSED_UP_REQUEST_RESPONSE[] = - "HTTP/1.0 400 Malformed request after rewriting\r\n" + "HTTP/1.1 400 Malformed request after rewriting\r\n" "Proxy-Agent: Privoxy " VERSION "\r\n" "Content-Type: text/plain\r\n" "Connection: close\r\n\r\n" "Bad request. Messed up with header filters.\r\n"; -/* XXX: should be a template */ -static const char CONNECTION_TIMEOUT_RESPONSE[] = - "HTTP/1.0 502 Connection timeout\r\n" +static const char TOO_MANY_CONNECTIONS_RESPONSE[] = + "HTTP/1.1 503 Too many open connections\r\n" "Proxy-Agent: Privoxy " VERSION "\r\n" "Content-Type: text/plain\r\n" "Connection: close\r\n\r\n" - "The connection timed out.\r\n"; + "Maximum number of open connections reached.\r\n"; + +static const char CLIENT_CONNECTION_TIMEOUT_RESPONSE[] = + "HTTP/1.1 504 Connection timeout\r\n" + "Proxy-Agent: Privoxy " VERSION "\r\n" + "Content-Type: text/plain\r\n" + "Connection: close\r\n\r\n" + "The connection timed out because the client request didn't arrive in time.\r\n"; /* A function to crunch a response */ typedef struct http_response *(*crunch_func_ptr)(struct client_state *); @@ -1525,7 +317,7 @@ static const struct cruncher crunchers_light[] = { #if !defined(_WIN32) && !defined(__OS2__) && !defined(AMIGA) /********************************************************************* * - * Function : sig_handler + * Function : sig_handler * * Description : Signal handler for different signals. * Exit gracefully on TERM and INT @@ -1535,7 +327,7 @@ static const struct cruncher crunchers_light[] = { * Parameters : * 1 : the_signal = the signal cause this function to call * - * Returns : - + * Returns : - * *********************************************************************/ static void sig_handler(int the_signal) @@ -1558,10 +350,10 @@ static void sig_handler(int the_signal) #if defined(unix) received_hup_signal = 1; #endif - break; + break; default: - /* + /* * We shouldn't be here, unless we catch signals * in main() that we can't handle here! */ @@ -1681,8 +473,10 @@ static jb_err get_request_destination_elsewhere(struct client_state *csp, struct } else if (JB_ERR_OK == get_destination_from_headers(headers, csp->http)) { +#ifndef FEATURE_EXTENDED_HOST_PATTERNS /* Split the domain we just got for pattern matching */ init_domain_components(csp->http); +#endif return JB_ERR_OK; } @@ -1771,7 +565,7 @@ static jb_err get_server_headers(struct client_state *csp) log_error(LOG_LEVEL_HEADER, "Continue hack in da house."); continue_hack_in_da_house = 1; } - else if (*header == '\0') + else if (*header == '\0') { /* * If the header is empty, but the Continue hack @@ -1823,35 +617,41 @@ static const char *crunch_reason(const struct http_response *rsp) return "Internal error while searching for crunch reason"; } - switch (rsp->reason) + switch (rsp->crunch_reason) { - case RSP_REASON_UNSUPPORTED: + case UNSUPPORTED: reason = "Unsupported HTTP feature"; break; - case RSP_REASON_BLOCKED: + case BLOCKED: reason = "Blocked"; break; - case RSP_REASON_UNTRUSTED: + case UNTRUSTED: reason = "Untrusted"; break; - case RSP_REASON_REDIRECTED: + case REDIRECTED: reason = "Redirected"; break; - case RSP_REASON_CGI_CALL: + case CGI_CALL: reason = "CGI Call"; break; - case RSP_REASON_NO_SUCH_DOMAIN: + case NO_SUCH_DOMAIN: reason = "DNS failure"; break; - case RSP_REASON_FORWARDING_FAILED: + case FORWARDING_FAILED: reason = "Forwarding failed"; break; - case RSP_REASON_CONNECT_FAILED: + case CONNECT_FAILED: reason = "Connection failure"; break; - case RSP_REASON_OUT_OF_MEMORY: + case OUT_OF_MEMORY: reason = "Out of memory (may mask other reasons)"; break; + case CONNECTION_TIMEOUT: + reason = "Connection timeout"; + break; + case NO_SERVER_DATA: + reason = "No server data received"; + break; default: reason = "No reason recorded"; break; @@ -1886,24 +686,12 @@ static void send_crunch_response(const struct client_state *csp, struct http_res if (rsp == NULL) { - /* - * Not supposed to happen. If it does - * anyway, treat it as an unknown error. - */ - cgi_error_unknown(csp, rsp, RSP_REASON_INTERNAL_ERROR); - /* return code doesn't matter */ - } - - if (rsp == NULL) - { - /* If rsp is still NULL, we have serious internal problems. */ - log_error(LOG_LEVEL_FATAL, - "NULL response in send_crunch_response and cgi_error_unknown failed as well."); + log_error(LOG_LEVEL_FATAL, "NULL response in send_crunch_response."); } /* * Extract the status code from the actual head - * that was send to the client. It is the only + * that will be send to the client. It is the only * way to get it right for all requests, including * the fixed ones for out-of-memory problems. * @@ -1916,90 +704,30 @@ static void send_crunch_response(const struct client_state *csp, struct http_res status_code[2] = rsp->head[11]; status_code[3] = '\0'; - /* Write the answer to the client */ - if (write_socket(csp->cfd, rsp->head, rsp->head_length) - || write_socket(csp->cfd, rsp->body, rsp->content_length)) - { - /* There is nothing we can do about it. */ - log_error(LOG_LEVEL_ERROR, "write to: %s failed: %E", csp->http->host); - } - /* Log that the request was crunched and why. */ log_error(LOG_LEVEL_CRUNCH, "%s: %s", crunch_reason(rsp), http->url); log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" %s %u", csp->ip_addr_str, http->ocmd, status_code, rsp->content_length); + /* Write the answer to the client */ + if (write_socket(csp->cfd, rsp->head, rsp->head_length) + || write_socket(csp->cfd, rsp->body, rsp->content_length)) + { + /* There is nothing we can do about it. */ + log_error(LOG_LEVEL_ERROR, + "Couldn't deliver the error message through client socket %d: %E", + csp->cfd); + } + /* Clean up and return */ if (cgi_error_memory() != rsp) { free_http_response(rsp); - } + } return; } -#if 0 -/********************************************************************* - * - * Function : request_contains_null_bytes - * - * Description : Checks for NULL bytes in the request and sends - * an error message to the client if any were found. - * - * XXX: currently not used, see comment in chat(). - * - * Parameters : - * 1 : csp = Current client state (buffers, headers, etc...) - * 2 : buf = Data from the client's request to check. - * 3 : len = The data length. - * - * Returns : TRUE if the request contained one or more NULL bytes, or - * FALSE otherwise. - * - *********************************************************************/ -static int request_contains_null_bytes(const struct client_state *csp, char *buf, int len) -{ - size_t c_len; /* Request lenght when treated as C string */ - - c_len = strlen(buf); - - if (c_len < len) - { - /* - * Null byte(s) found. Log the request, - * return an error response and hang up. - */ - size_t tmp_len = c_len; - - do - { - /* - * Replace NULL byte(s) with '°' characters - * so the request can be logged as string. - * XXX: Is there a better replacement character? - */ - buf[tmp_len]='°'; - tmp_len += strlen(buf+tmp_len); - } while (tmp_len < len); - - log_error(LOG_LEVEL_ERROR, "%s\'s request contains at least one NULL byte " - "(length=%d, strlen=%u).", csp->ip_addr_str, len, c_len); - log_error(LOG_LEVEL_HEADER, - "Offending request data with NULL bytes turned into \'°\' characters: %s", buf); - - write_socket(csp->cfd, NULL_BYTE_RESPONSE, strlen(NULL_BYTE_RESPONSE)); - - /* XXX: Log correct size */ - log_error(LOG_LEVEL_CLF, "%s - - [%T] \"Invalid request\" 400 0", csp->ip_addr_str); - - return TRUE; - } - - return FALSE; -} -#endif - - /********************************************************************* * * Function : crunch_response_triggered @@ -2023,13 +751,14 @@ static int crunch_response_triggered(struct client_state *csp, const struct crun /* * If CGI request crunching is disabled, * check the CGI dispatcher out of order to - * prevent unintentional blocks or redirects. + * prevent unintentional blocks or redirects. */ if (!(csp->config->feature_flags & RUNTIME_FEATURE_CGI_CRUNCHING) && (NULL != (rsp = dispatch_cgi(csp)))) { /* Deliver, log and free the interception response. */ send_crunch_response(csp, rsp); + csp->flags |= CSP_FLAG_CRUNCHED; return TRUE; } @@ -2049,6 +778,7 @@ static int crunch_response_triggered(struct client_state *csp, const struct crun { /* Deliver, log and free the interception response. */ send_crunch_response(csp, rsp); + csp->flags |= CSP_FLAG_CRUNCHED; #ifdef FEATURE_STATISTICS if (c->flags & CF_COUNT_AS_REJECT) { @@ -2204,7 +934,7 @@ static int server_response_is_complete(struct client_state *csp, content_length_known = TRUE; } - if (csp->http->status == 304) + if (csp->http->status == 204 || csp->http->status == 304) { /* * Expect no body. XXX: incomplete "list" of status codes? @@ -2218,6 +948,7 @@ static int server_response_is_complete(struct client_state *csp, } +#ifdef FEATURE_CONNECTION_SHARING /********************************************************************* * * Function : wait_for_alive_connections @@ -2229,7 +960,7 @@ static int server_response_is_complete(struct client_state *csp, * Returns : N/A * *********************************************************************/ -static void wait_for_alive_connections() +static void wait_for_alive_connections(void) { int connections_alive = close_unusable_connections(); @@ -2245,6 +976,164 @@ static void wait_for_alive_connections() log_error(LOG_LEVEL_CONNECT, "No connections to wait for left."); } +#endif /* def FEATURE_CONNECTION_SHARING */ + + +/********************************************************************* + * + * Function : save_connection_destination + * + * Description : Remembers a connection for reuse later on. + * + * Parameters : + * 1 : sfd = Open socket to remember. + * 2 : http = The destination for the connection. + * 3 : fwd = The forwarder settings used. + * 3 : server_connection = storage. + * + * Returns : void + * + *********************************************************************/ +void save_connection_destination(jb_socket sfd, + const struct http_request *http, + const struct forward_spec *fwd, + struct reusable_connection *server_connection) +{ + assert(sfd != JB_INVALID_SOCKET); + assert(NULL != http->host); + + server_connection->sfd = sfd; + server_connection->host = strdup(http->host); + if (NULL == server_connection->host) + { + log_error(LOG_LEVEL_FATAL, "Out of memory saving socket."); + } + server_connection->port = http->port; + + assert(NULL != fwd); + assert(server_connection->gateway_host == NULL); + assert(server_connection->gateway_port == 0); + assert(server_connection->forwarder_type == 0); + assert(server_connection->forward_host == NULL); + assert(server_connection->forward_port == 0); + + server_connection->forwarder_type = fwd->type; + if (NULL != fwd->gateway_host) + { + server_connection->gateway_host = strdup(fwd->gateway_host); + if (NULL == server_connection->gateway_host) + { + log_error(LOG_LEVEL_FATAL, "Out of memory saving gateway_host."); + } + } + else + { + server_connection->gateway_host = NULL; + } + server_connection->gateway_port = fwd->gateway_port; + + if (NULL != fwd->forward_host) + { + server_connection->forward_host = strdup(fwd->forward_host); + if (NULL == server_connection->forward_host) + { + log_error(LOG_LEVEL_FATAL, "Out of memory saving forward_host."); + } + } + else + { + server_connection->forward_host = NULL; + } + server_connection->forward_port = fwd->forward_port; +} + + +/********************************************************************* + * + * Function : verify_request_length + * + * Description : Checks if we already got the whole client requests + * and sets CSP_FLAG_CLIENT_REQUEST_COMPLETELY_READ if + * we do. + * + * Data that doesn't belong to the current request is + * thrown away to let the client retry on a clean socket. + * + * XXX: This is a hack until we can deal with multiple + * pipelined requests at the same time. + * + * + * Parameters : + * 1 : csp = Current client state (buffers, headers, etc...) + * + * Returns : void + * + *********************************************************************/ +static void verify_request_length(struct client_state *csp) +{ + unsigned long long buffered_request_bytes = + (unsigned long long)(csp->iob->eod - csp->iob->cur); + + if ((csp->expected_client_content_length != 0) + && (buffered_request_bytes != 0)) + { + if (csp->expected_client_content_length >= buffered_request_bytes) + { + csp->expected_client_content_length -= buffered_request_bytes; + log_error(LOG_LEVEL_CONNECT, "Reduced expected bytes to %llu " + "to account for the %llu ones we already got.", + csp->expected_client_content_length, buffered_request_bytes); + } + else + { + assert(csp->iob->eod > csp->iob->cur + csp->expected_client_content_length); + csp->iob->eod = csp->iob->cur + csp->expected_client_content_length; + log_error(LOG_LEVEL_CONNECT, "Reducing expected bytes to 0. " + "Marking the server socket tainted after throwing %llu bytes away.", + buffered_request_bytes - csp->expected_client_content_length); + csp->expected_client_content_length = 0; + csp->flags |= CSP_FLAG_SERVER_SOCKET_TAINTED; + } + + if (csp->expected_client_content_length == 0) + { + csp->flags |= CSP_FLAG_CLIENT_REQUEST_COMPLETELY_READ; + } + } + + if (!(csp->flags & CSP_FLAG_CLIENT_REQUEST_COMPLETELY_READ) + && ((csp->iob->cur[0] != '\0') || (csp->expected_client_content_length != 0))) + { + csp->flags |= CSP_FLAG_SERVER_SOCKET_TAINTED; + if (strcmpic(csp->http->gpc, "GET") + && strcmpic(csp->http->gpc, "HEAD") + && strcmpic(csp->http->gpc, "TRACE") + && strcmpic(csp->http->gpc, "OPTIONS") + && strcmpic(csp->http->gpc, "DELETE")) + { + /* XXX: this is an incomplete hack */ + csp->flags &= ~CSP_FLAG_CLIENT_REQUEST_COMPLETELY_READ; + log_error(LOG_LEVEL_CONNECT, + "There might be a request body. The connection will not be kept alive."); + } + else + { + /* XXX: and so is this */ + csp->flags |= CSP_FLAG_CLIENT_REQUEST_COMPLETELY_READ; + log_error(LOG_LEVEL_CONNECT, + "Possible pipeline attempt detected. The connection will not " + "be kept alive and we will only serve the first request."); + /* Nuke the pipelined requests from orbit, just to be sure. */ + csp->iob->buf[0] = '\0'; + csp->iob->eod = csp->iob->cur = csp->iob->buf; + } + } + else + { + csp->flags |= CSP_FLAG_CLIENT_REQUEST_COMPLETELY_READ; + log_error(LOG_LEVEL_CONNECT, "Complete client request received."); + } +} #endif /* FEATURE_CONNECTION_KEEP_ALIVE */ @@ -2264,11 +1153,20 @@ static void wait_for_alive_connections() *********************************************************************/ static void mark_server_socket_tainted(struct client_state *csp) { - if ((csp->flags & CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE)) + /* + * For consistency we always mark the server socket + * tainted, however, to reduce the log noise we only + * emit a log message if the server socket could have + * actually been reused. + */ + if ((csp->flags & CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE) + && !(csp->flags |= CSP_FLAG_SERVER_SOCKET_TAINTED)) { - log_error(LOG_LEVEL_CONNECT, "Unsetting keep-alive flag."); - csp->flags &= ~CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE; + log_error(LOG_LEVEL_CONNECT, + "Marking the server socket %d tainted.", + csp->server_connection.sfd); } + csp->flags |= CSP_FLAG_SERVER_SOCKET_TAINTED; } /********************************************************************* @@ -2295,10 +1193,11 @@ static char *get_request_line(struct client_state *csp) { if (!data_is_available(csp->cfd, csp->config->socket_timeout)) { - log_error(LOG_LEVEL_ERROR, - "Stopped waiting for the request line."); - write_socket(csp->cfd, CONNECTION_TIMEOUT_RESPONSE, - strlen(CONNECTION_TIMEOUT_RESPONSE)); + log_error(LOG_LEVEL_CONNECT, + "Stopped waiting for the request line. Timeout: %d.", + csp->config->socket_timeout); + write_socket(csp->cfd, CLIENT_CONNECTION_TIMEOUT_RESPONSE, + strlen(CLIENT_CONNECTION_TIMEOUT_RESPONSE)); return NULL; } @@ -2331,10 +1230,6 @@ static char *get_request_line(struct client_state *csp) * Description : Read the client's request (more precisely the * client headers) and answer it if necessary. * - * Note that since we're not using select() we could get - * blocked here if a client connected, then didn't say - * anything! - * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) * @@ -2361,6 +1256,7 @@ static jb_err receive_client_request(struct client_state *csp) req = get_request_line(csp); if (req == NULL) { + mark_server_socket_tainted(csp); return JB_ERR_PARSE; } assert(*req != '\0'); @@ -2428,6 +1324,7 @@ static jb_err receive_client_request(struct client_state *csp) { log_error(LOG_LEVEL_ERROR, "Stopped grabbing the client headers."); + destroy_list(headers); return JB_ERR_PARSE; } @@ -2438,7 +1335,7 @@ static jb_err receive_client_request(struct client_state *csp) destroy_list(headers); return JB_ERR_PARSE; } - + if (add_to_iob(csp, buf, len)) { /* @@ -2453,7 +1350,7 @@ static jb_err receive_client_request(struct client_state *csp) { /* * We were able to read a complete - * header and can finaly enlist it. + * header and can finally enlist it. */ enlist(headers, p); freez(p); @@ -2496,7 +1393,7 @@ static jb_err receive_client_request(struct client_state *csp) get_url_actions(csp, http); } - /* + /* * Save a copy of the original request for logging */ http->ocmd = strdup(http->cmd); @@ -2538,6 +1435,16 @@ static jb_err parse_client_request(struct client_state *csp) struct http_request *http = csp->http; jb_err err; +#ifdef FEATURE_CONNECTION_KEEP_ALIVE + if ((csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE) + && (!strcmpic(csp->http->ver, "HTTP/1.1")) + && (csp->http->ssl == 0)) + { + /* Assume persistence until further notice */ + csp->flags |= CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE; + } +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ + err = sed(csp, FILTER_CLIENT_HEADERS); if (JB_ERR_OK != err) { @@ -2566,6 +1473,13 @@ static jb_err parse_client_request(struct client_state *csp) return JB_ERR_PARSE; } +#ifdef FEATURE_CONNECTION_KEEP_ALIVE + if (csp->http->ssl == 0) + { + verify_request_length(csp); + } +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ + return JB_ERR_OK; } @@ -2575,11 +1489,16 @@ static jb_err parse_client_request(struct client_state *csp) * * Function : chat * - * Description : Once a connection to the client has been accepted, + * Description : Once a connection from the client has been accepted, * this function is called (via serve()) to handle the - * main business of the communication. When this - * function returns, the caller must close the client - * socket handle. + * main business of the communication. This function + * returns after dealing with a single request. It can + * be called multiple times with the same client socket + * if the client is keeping the connection alive. + * + * The decision whether or not a client connection will + * be kept alive is up to the caller which also must + * close the client socket when done. * * FIXME: chat is nearly thousand lines long. * Ridiculous. @@ -2601,18 +1520,17 @@ static void chat(struct client_state *csp) int server_body; int ms_iis5_hack = 0; unsigned long long byte_count = 0; - int forwarded_connect_retries = 0; - int max_forwarded_connect_retries = csp->config->forwarded_connect_retries; const struct forward_spec *fwd; struct http_request *http; long len = 0; /* for buffer sizes (and negative error codes) */ - - /* Function that does the content filtering for the current request */ - filter_function_ptr content_filter = NULL; + int buffer_and_filter_content = 0; /* Skeleton for HTTP response, if we should intercept the request */ struct http_response *rsp; struct timeval timeout; +#ifdef FEATURE_CONNECTION_KEEP_ALIVE + int watch_client_socket = 1; +#endif memset(buf, 0, sizeof(buf)); @@ -2679,8 +1597,8 @@ static void chat(struct client_state *csp) csp->action->string[ACTION_STRING_LIMIT_CONNECT]; assert(NULL != acceptable_connect_ports); log_error(LOG_LEVEL_INFO, "Request from %s marked for blocking. " - "limit-connect{%s} doesn't allow CONNECT requests to port %d.", - csp->ip_addr_str, acceptable_connect_ports, csp->http->port); + "limit-connect{%s} doesn't allow CONNECT requests to %s", + csp->ip_addr_str, acceptable_connect_ports, csp->http->hostport); csp->action->flags |= ACTION_BLOCK; http->ssl = 0; } @@ -2697,12 +1615,8 @@ static void chat(struct client_state *csp) if (crunch_response_triggered(csp, crunchers_all)) { /* - * Yes. The client got the crunch response - * and we are done here after cleaning up. + * Yes. The client got the crunch response and we're done here. */ - /* XXX: why list_remove_all()? */ - list_remove_all(csp->headers); - return; } @@ -2710,7 +1624,7 @@ static void chat(struct client_state *csp) if (fwd->forward_host) { - log_error(LOG_LEVEL_CONNECT, "via %s:%d to: %s", + log_error(LOG_LEVEL_CONNECT, "via [%s]:%d to: %s", fwd->forward_host, fwd->forward_port, http->hostport); } else @@ -2720,63 +1634,82 @@ static void chat(struct client_state *csp) /* here we connect to the server, gateway, or the forwarder */ - while ((csp->sfd = forwarded_connect(fwd, http, csp)) - && (errno == EINVAL) - && (forwarded_connect_retries++ < max_forwarded_connect_retries)) +#ifdef FEATURE_CONNECTION_KEEP_ALIVE + if ((csp->server_connection.sfd != JB_INVALID_SOCKET) + && socket_is_still_alive(csp->server_connection.sfd) + && connection_destination_matches(&csp->server_connection, http, fwd)) { - log_error(LOG_LEVEL_ERROR, - "failed request #%u to connect to %s. Trying again.", - forwarded_connect_retries, http->hostport); + log_error(LOG_LEVEL_CONNECT, + "Reusing server socket %u. Opened for %s.", + csp->server_connection.sfd, csp->server_connection.host); } - - if (csp->sfd == JB_INVALID_SOCKET) + else { - if (fwd->type != SOCKS_NONE) + if (csp->server_connection.sfd != JB_INVALID_SOCKET) { - /* Socks error. */ - rsp = error_response(csp, "forwarding-failed", errno); - } - else if (errno == EINVAL) - { - rsp = error_response(csp, "no-such-domain", errno); - } - else - { - rsp = error_response(csp, "connect-failed", errno); - log_error(LOG_LEVEL_CONNECT, "connect to: %s failed: %E", - http->hostport); + log_error(LOG_LEVEL_CONNECT, + "Closing server socket %u. Opened for %s.", + csp->server_connection.sfd, csp->server_connection.host); + close_socket(csp->server_connection.sfd); + mark_connection_closed(&csp->server_connection); } +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ - /* Write the answer to the client */ - if (rsp != NULL) - { - send_crunch_response(csp, rsp); - } + csp->server_connection.sfd = forwarded_connect(fwd, http, csp); - return; + if (csp->server_connection.sfd == JB_INVALID_SOCKET) + { + if (fwd->type != SOCKS_NONE) + { + /* Socks error. */ + rsp = error_response(csp, "forwarding-failed"); + } + else if (errno == EINVAL) + { + rsp = error_response(csp, "no-such-domain"); + } + else + { + rsp = error_response(csp, "connect-failed"); + } + + /* Write the answer to the client */ + if (rsp != NULL) + { + send_crunch_response(csp, rsp); + } + + return; + } +#ifdef FEATURE_CONNECTION_KEEP_ALIVE + save_connection_destination(csp->server_connection.sfd, + http, fwd, &csp->server_connection); + csp->server_connection.keep_alive_timeout = + (unsigned)csp->config->keep_alive_timeout; } - - hdr = list_to_text(csp->headers); - if (hdr == NULL) - { - /* FIXME Should handle error properly */ - log_error(LOG_LEVEL_FATAL, "Out of memory parsing client header"); - } - list_remove_all(csp->headers); +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ if (fwd->forward_host || (http->ssl == 0)) { + hdr = list_to_text(csp->headers); + if (hdr == NULL) + { + /* FIXME Should handle error properly */ + log_error(LOG_LEVEL_FATAL, "Out of memory parsing client header"); + } + list_remove_all(csp->headers); + /* * Write the client's (modified) header to the server * (along with anything else that may be in the buffer) */ - if (write_socket(csp->sfd, hdr, strlen(hdr)) - || (flush_socket(csp->sfd, csp->iob) < 0)) + if (write_socket(csp->server_connection.sfd, hdr, strlen(hdr)) + || (flush_socket(csp->server_connection.sfd, csp->iob) < 0)) { log_error(LOG_LEVEL_CONNECT, "write header to: %s failed: %E", http->hostport); - rsp = error_response(csp, "connect-failed", errno); + rsp = error_response(csp, "connect-failed"); if (rsp) { send_crunch_response(csp, rsp); @@ -2785,17 +1718,18 @@ static void chat(struct client_state *csp) freez(hdr); return; } + freez(hdr); } else { /* * We're running an SSL tunnel and we're not forwarding, - * so just send the "connect succeeded" message to the - * client, flush the rest, and get out of the way. + * so just ditch the client headers, send the "connect succeeded" + * message to the client, flush the rest, and get out of the way. */ + list_remove_all(csp->headers); if (write_socket(csp->cfd, CSUCCEED, strlen(CSUCCEED))) { - freez(hdr); return; } IOB_RESET(csp); @@ -2803,10 +1737,10 @@ static void chat(struct client_state *csp) log_error(LOG_LEVEL_CONNECT, "to %s successful", http->hostport); - /* we're finished with the client's header */ - freez(hdr); + csp->server_connection.request_sent = time(NULL); - maxfd = (csp->cfd > csp->sfd) ? csp->cfd : csp->sfd; + maxfd = (csp->cfd > csp->server_connection.sfd) ? + csp->cfd : csp->server_connection.sfd; /* pass data between the client and server * until one or the other shuts down the connection. @@ -2825,8 +1759,18 @@ static void chat(struct client_state *csp) #else FD_ZERO(&rfds); #endif - FD_SET(csp->cfd, &rfds); - FD_SET(csp->sfd, &rfds); +#ifdef FEATURE_CONNECTION_KEEP_ALIVE + if (!watch_client_socket) + { + maxfd = csp->server_connection.sfd; + } + else +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ + { + FD_SET(csp->cfd, &rfds); + } + + FD_SET(csp->server_connection.sfd, &rfds); #ifdef FEATURE_CONNECTION_KEEP_ALIVE if ((csp->flags & CSP_FLAG_CHUNKED) @@ -2834,19 +1778,34 @@ static void chat(struct client_state *csp) && ((csp->iob->eod - csp->iob->cur) >= 5) && !memcmp(csp->iob->eod-5, "0\r\n\r\n", 5)) { + /* + * XXX: This check should be obsolete now, + * but let's wait a while to be sure. + */ log_error(LOG_LEVEL_CONNECT, - "Looks like we read the last chunk together with " - "the server headers. We better stop reading."); + "Looks like we got the last chunk together with " + "the server headers but didn't detect it earlier. " + "We better stop reading."); byte_count = (unsigned long long)(csp->iob->eod - csp->iob->cur); csp->expected_content_length = byte_count; csp->flags |= CSP_FLAG_CONTENT_LENGTH_SET; } if (server_body && server_response_is_complete(csp, byte_count)) { - log_error(LOG_LEVEL_CONNECT, - "Done reading from server. Expected content length: %llu. " - "Actual content length: %llu. Most recently received: %d.", - csp->expected_content_length, byte_count, len); + if (csp->expected_content_length == byte_count) + { + log_error(LOG_LEVEL_CONNECT, + "Done reading from server. Content length: %llu as expected. " + "Bytes most recently read: %d.", + byte_count, len); + } + else + { + log_error(LOG_LEVEL_CONNECT, + "Done reading from server. Expected content length: %llu. " + "Actual content length: %llu. Bytes most recently read: %d.", + csp->expected_content_length, byte_count, len); + } len = 0; /* * XXX: should not jump around, @@ -2866,8 +1825,7 @@ static void chat(struct client_state *csp) "Didn't receive data in time: %s", http->url); if ((byte_count == 0) && (http->ssl == 0)) { - write_socket(csp->cfd, CONNECTION_TIMEOUT_RESPONSE, - strlen(CONNECTION_TIMEOUT_RESPONSE)); + send_crunch_response(csp, error_response(csp, "connection-timeout")); } mark_server_socket_tainted(csp); return; @@ -2882,10 +1840,57 @@ static void chat(struct client_state *csp) /* * This is the body of the browser's request, * just read and write it. + * + * XXX: Make sure the client doesn't use pipelining + * behind Privoxy's back. */ if (FD_ISSET(csp->cfd, &rfds)) { - len = read_socket(csp->cfd, buf, sizeof(buf) - 1); + int max_bytes_to_read = sizeof(buf) - 1; + +#ifdef FEATURE_CONNECTION_KEEP_ALIVE + if ((csp->flags & CSP_FLAG_CLIENT_REQUEST_COMPLETELY_READ)) + { + if (data_is_available(csp->cfd, 0)) + { + /* + * If the next request is already waiting, we have + * to stop select()ing the client socket. Otherwise + * we would always return right away and get nothing + * else done. + */ + watch_client_socket = 0; + log_error(LOG_LEVEL_CONNECT, + "Stopping to watch the client socket. " + "There's already another request waiting."); + continue; + } + /* + * If the client socket is set, but there's no data + * available on the socket, the client went fishing + * and continuing talking to the server makes no sense. + */ + log_error(LOG_LEVEL_CONNECT, + "The client closed socket %d while " + "the server socket %d is still open.", + csp->cfd, csp->server_connection.sfd); + mark_server_socket_tainted(csp); + break; + } + if (csp->expected_client_content_length != 0) + { + if (csp->expected_client_content_length < (sizeof(buf) - 1)) + { + max_bytes_to_read = (int)csp->expected_client_content_length; + } + log_error(LOG_LEVEL_CONNECT, + "Waiting for up to %d bytes from the client.", + max_bytes_to_read); + } + assert(max_bytes_to_read < sizeof(buf)); +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ + + len = read_socket(csp->cfd, buf, max_bytes_to_read); if (len <= 0) { @@ -2894,7 +1899,25 @@ static void chat(struct client_state *csp) break; /* "game over, man" */ } - if (write_socket(csp->sfd, buf, (size_t)len)) +#ifdef FEATURE_CONNECTION_KEEP_ALIVE + if (csp->expected_client_content_length != 0) + { + assert(len <= max_bytes_to_read); + csp->expected_client_content_length -= (unsigned)len; + log_error(LOG_LEVEL_CONNECT, + "Expected client content length set to %llu " + "after reading %d bytes.", + csp->expected_client_content_length, len); + if (csp->expected_client_content_length == 0) + { + log_error(LOG_LEVEL_CONNECT, + "Done reading from the client."); + csp->flags |= CSP_FLAG_CLIENT_REQUEST_COMPLETELY_READ; + } + } +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ + + if (write_socket(csp->server_connection.sfd, buf, (size_t)len)) { log_error(LOG_LEVEL_ERROR, "write to: %s failed: %E", http->host); mark_server_socket_tainted(csp); @@ -2908,10 +1931,32 @@ static void chat(struct client_state *csp) * If `hdr' is null, then it's the header otherwise it's the body. * FIXME: Does `hdr' really mean `host'? No. */ - if (FD_ISSET(csp->sfd, &rfds)) + if (FD_ISSET(csp->server_connection.sfd, &rfds)) { - fflush(0); - len = read_socket(csp->sfd, buf, sizeof(buf) - 1); +#ifdef FEATURE_CONNECTION_KEEP_ALIVE + /* + * If we are buffering content, we don't want to eat up to + * buffer-limit bytes if the client no longer cares about them. + * If we aren't buffering, however, a dead client socket will be + * noticed pretty much right away anyway, so we can reduce the + * overhead by skipping the check. + */ + if (buffer_and_filter_content && !socket_is_still_alive(csp->cfd)) + { +#ifdef _WIN32 + log_error(LOG_LEVEL_CONNECT, + "The server still wants to talk, but the client may already have hung up on us."); +#else + log_error(LOG_LEVEL_CONNECT, + "The server still wants to talk, but the client hung up on us."); + mark_server_socket_tainted(csp); + return; +#endif /* def _WIN32 */ + } +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ + + fflush(NULL); + len = read_socket(csp->server_connection.sfd, buf, sizeof(buf) - 1); if (len < 0) { @@ -2942,14 +1987,11 @@ static void chat(struct client_state *csp) mark_server_socket_tainted(csp); return; } - - rsp = error_response(csp, "connect-failed", errno); - if (rsp) - { - send_crunch_response(csp, rsp); - } - - return; + /* + * XXX: Consider handling the cases above the same. + */ + mark_server_socket_tainted(csp); + len = 0; } #ifdef FEATURE_CONNECTION_KEEP_ALIVE @@ -3003,11 +2045,11 @@ static void chat(struct client_state *csp) * now is the time to apply content modification * and send the result to the client. */ - if (content_filter) + if (buffer_and_filter_content) { - p = execute_content_filter(csp, content_filter); + p = execute_content_filters(csp); /* - * If the content filter fails, use the original + * If content filtering fails, use the original * buffer and length. * (see p != NULL ? p : csp->iob->cur below) */ @@ -3015,6 +2057,20 @@ static void chat(struct client_state *csp) { csp->content_length = (size_t)(csp->iob->eod - csp->iob->cur); } +#ifdef FEATURE_COMPRESSION + else if ((csp->flags & CSP_FLAG_CLIENT_SUPPORTS_DEFLATE) + && (csp->content_length > LOWER_LENGTH_LIMIT_FOR_COMPRESSION)) + { + char *compressed_content = compress_buffer(p, + (size_t *)&csp->content_length, csp->config->compression_level); + if (compressed_content != NULL) + { + freez(p); + p = compressed_content; + csp->flags |= CSP_FLAG_BUFFERED_CONTENT_DEFLATED; + } + } +#endif if (JB_ERR_OK != update_server_headers(csp)) { @@ -3069,7 +2125,7 @@ static void chat(struct client_state *csp) */ if (server_body || http->ssl) { - if (content_filter) + if (buffer_and_filter_content) { /* * If there is no memory left for buffering the content, or the buffer limit @@ -3087,7 +2143,7 @@ static void chat(struct client_state *csp) hdr = list_to_text(csp->headers); if (hdr == NULL) { - /* + /* * Memory is too tight to even generate the header. * Send our static "Out-of-memory" page. */ @@ -3117,7 +2173,7 @@ static void chat(struct client_state *csp) */ byte_count = (unsigned long long)flushed; freez(hdr); - content_filter = NULL; + buffer_and_filter_content = 0; server_body = 1; } } @@ -3135,7 +2191,6 @@ static void chat(struct client_state *csp) } else { - const char *header_start; /* * We're still looking for the end of the server's header. * Buffer up the data we just read. If that fails, there's @@ -3145,13 +2200,11 @@ static void chat(struct client_state *csp) { log_error(LOG_LEVEL_ERROR, "Out of memory while looking for end of server headers."); rsp = cgi_error_memory(); - send_crunch_response(csp, rsp); + send_crunch_response(csp, rsp); mark_server_socket_tainted(csp); return; } - header_start = csp->iob->cur; - /* Convert iob into something sed() can digest */ if (JB_ERR_PARSE == get_server_headers(csp)) { @@ -3162,9 +2215,14 @@ static void chat(struct client_state *csp) * The header is incomplete and there isn't anything * we can do about it. */ - log_error(LOG_LEVEL_INFO, - "MS IIS5 hack didn't produce valid headers."); - break; + log_error(LOG_LEVEL_ERROR, "Invalid server headers. " + "Applying the MS IIS5 hack didn't help."); + log_error(LOG_LEVEL_CLF, + "%s - - [%T] \"%s\" 502 0", csp->ip_addr_str, http->cmd); + write_socket(csp->cfd, INVALID_SERVER_HEADERS_RESPONSE, + strlen(INVALID_SERVER_HEADERS_RESPONSE)); + mark_server_socket_tainted(csp); + return; } else { @@ -3172,22 +2230,41 @@ static void chat(struct client_state *csp) * Since we have to wait for more from the server before * we can parse the headers we just continue here. */ - long header_offset = csp->iob->cur - header_start; - assert(csp->iob->cur >= header_start); - byte_count += (unsigned long long)(len - header_offset); - log_error(LOG_LEVEL_CONNECT, "Continuing buffering headers. " - "byte_count: %llu. header_offset: %d. len: %d.", - byte_count, header_offset, len); + log_error(LOG_LEVEL_CONNECT, + "Continuing buffering headers. Bytes most recently read: %d.", + len); continue; } } + else + { + /* + * Account for the content bytes we + * might have gotten with the headers. + */ + assert(csp->iob->eod >= csp->iob->cur); + byte_count = (unsigned long long)(csp->iob->eod - csp->iob->cur); + } /* Did we actually get anything? */ if (NULL == csp->headers->first) { - log_error(LOG_LEVEL_ERROR, "Empty server or forwarder response."); - log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" 502 0", csp->ip_addr_str, http->cmd); - write_socket(csp->cfd, NO_SERVER_DATA_RESPONSE, strlen(NO_SERVER_DATA_RESPONSE)); + if ((csp->flags & CSP_FLAG_REUSED_CLIENT_CONNECTION)) + { + log_error(LOG_LEVEL_ERROR, + "No server or forwarder response received on socket %d. " + "Closing client socket %d without sending data.", + csp->server_connection.sfd, csp->cfd); + log_error(LOG_LEVEL_CLF, + "%s - - [%T] \"%s\" 502 0", csp->ip_addr_str, http->cmd); + } + else + { + log_error(LOG_LEVEL_ERROR, + "No server or forwarder response received on socket %d.", + csp->server_connection.sfd); + send_crunch_response(csp, error_response(csp, "no-server-data")); + } free_http_request(http); mark_server_socket_tainted(csp); return; @@ -3233,6 +2310,21 @@ static void chat(struct client_state *csp) log_error(LOG_LEVEL_FATAL, "Out of memory parsing server header"); } + if ((csp->flags & CSP_FLAG_CHUNKED) + && !(csp->flags & CSP_FLAG_CONTENT_LENGTH_SET) + && ((csp->iob->eod - csp->iob->cur) >= 5) + && !memcmp(csp->iob->eod-5, "0\r\n\r\n", 5)) + { + log_error(LOG_LEVEL_CONNECT, + "Looks like we got the last chunk together with " + "the server headers. We better stop reading."); + byte_count = (unsigned long long)(csp->iob->eod - csp->iob->cur); + csp->expected_content_length = byte_count; + csp->flags |= CSP_FLAG_CONTENT_LENGTH_SET; + } + + csp->server_connection.response_received = time(NULL); + if (crunch_response_triggered(csp, crunchers_light)) { /* @@ -3249,12 +2341,12 @@ static void chat(struct client_state *csp) if (!http->ssl) /* We talk plaintext */ { - content_filter = get_filter_function(csp); + buffer_and_filter_content = content_requires_filtering(csp); } /* * Only write if we're not buffering for content modification */ - if (!content_filter) + if (!buffer_and_filter_content) { /* * Write the server's (modified) header to @@ -3275,18 +2367,6 @@ static void chat(struct client_state *csp) mark_server_socket_tainted(csp); return; } - - byte_count += (unsigned long long)len; - } - else - { - /* - * XXX: the header lenght should probably - * be calculated by get_server_headers(). - */ - long header_length = csp->iob->cur - header_start; - assert(csp->iob->cur > header_start); - byte_count += (unsigned long long)(len - header_length); } /* we're finished with the server's header */ @@ -3301,9 +2381,15 @@ static void chat(struct client_state *csp) */ if (ms_iis5_hack) { - log_error(LOG_LEVEL_INFO, - "Closed server connection detected with MS IIS5 hack enabled."); - break; + log_error(LOG_LEVEL_ERROR, + "Closed server connection detected. " + "Applying the MS IIS5 hack didn't help."); + log_error(LOG_LEVEL_CLF, + "%s - - [%T] \"%s\" 502 0", csp->ip_addr_str, http->cmd); + write_socket(csp->cfd, INVALID_SERVER_HEADERS_RESPONSE, + strlen(INVALID_SERVER_HEADERS_RESPONSE)); + mark_server_socket_tainted(csp); + return; } } continue; @@ -3315,7 +2401,7 @@ static void chat(struct client_state *csp) if (csp->content_length == 0) { /* - * If Privoxy didn't recalculate the Content-Lenght, + * If Privoxy didn't recalculate the Content-Length, * byte_count is still correct. */ csp->content_length = byte_count; @@ -3334,15 +2420,62 @@ static void chat(struct client_state *csp) log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" 200 %llu", csp->ip_addr_str, http->ocmd, csp->content_length); + + csp->server_connection.timestamp = time(NULL); } +#ifdef FEATURE_CONNECTION_KEEP_ALIVE +/********************************************************************* + * + * Function : prepare_csp_for_next_request + * + * Description : Put the csp in a mostly vergin state. + * + * Parameters : + * 1 : csp = Current client state (buffers, headers, etc...) + * + * Returns : N/A + * + *********************************************************************/ +static void prepare_csp_for_next_request(struct client_state *csp) +{ + unsigned int toggled_on_flag_set = (0 != (csp->flags & CSP_FLAG_TOGGLED_ON)); + + csp->content_type = 0; + csp->content_length = 0; + csp->expected_content_length = 0; + csp->expected_client_content_length = 0; + list_remove_all(csp->headers); + freez(csp->iob->buf); + memset(csp->iob, 0, sizeof(csp->iob)); + freez(csp->error_message); + free_http_request(csp->http); + destroy_list(csp->headers); + destroy_list(csp->tags); + free_current_action(csp->action); + if (NULL != csp->fwd) + { + unload_forward_spec(csp->fwd); + csp->fwd = NULL; + } + /* XXX: Store per-connection flags someplace else. */ + csp->flags = (CSP_FLAG_ACTIVE | CSP_FLAG_REUSED_CLIENT_CONNECTION); + if (toggled_on_flag_set) + { + csp->flags |= CSP_FLAG_TOGGLED_ON; + } +} +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ + + /********************************************************************* * * Function : serve * * Description : This is little more than chat. We only "serve" to - * to close any socket that chat may have opened. + * to close (or remember) any socket that chat may have + * opened. * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) @@ -3356,37 +2489,165 @@ void serve(struct client_state *csp) static void serve(struct client_state *csp) #endif /* def AMIGA */ { - chat(csp); - close_socket(csp->cfd); - - if (csp->sfd != JB_INVALID_SOCKET) - { #ifdef FEATURE_CONNECTION_KEEP_ALIVE - static int monitor_thread_running = 0; +#ifdef FEATURE_CONNECTION_SHARING + static int monitor_thread_running = 0; +#endif /* def FEATURE_CONNECTION_SHARING */ + int continue_chatting = 0; - if ((csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE) - && (csp->flags & CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE)) + do + { + unsigned int latency; + int config_file_change_detected = 0; /* Only used for debugging */ + + chat(csp); + + /* + * If the request has been crunched, + * the calculated latency is zero. + */ + latency = (unsigned)(csp->server_connection.response_received - + csp->server_connection.request_sent) / 2; + + continue_chatting = (csp->config->feature_flags + & RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE) + && !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED) + && ((csp->flags & CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE) + || (csp->flags & CSP_FLAG_CRUNCHED)) + && (csp->cfd != JB_INVALID_SOCKET) + && ((csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE) + || (csp->config->feature_flags & + RUNTIME_FEATURE_CONNECTION_SHARING)); + + if (continue_chatting && !(csp->flags & CSP_FLAG_CRUNCHED)) { - remember_connection(csp->sfd, csp->http, forward_url(csp, csp->http)); - privoxy_mutex_lock(&connection_reuse_mutex); - if (!monitor_thread_running) + continue_chatting = (csp->server_connection.sfd != JB_INVALID_SOCKET) + && socket_is_still_alive(csp->server_connection.sfd); + if (continue_chatting) { - monitor_thread_running = 1; - privoxy_mutex_unlock(&connection_reuse_mutex); - wait_for_alive_connections(); - privoxy_mutex_lock(&connection_reuse_mutex); - monitor_thread_running = 0; + if (!(csp->flags & CSP_FLAG_SERVER_KEEP_ALIVE_TIMEOUT_SET)) + { + csp->server_connection.keep_alive_timeout = csp->config->default_server_timeout; + log_error(LOG_LEVEL_CONNECT, + "The server didn't specify how long the connection will stay open. " + "Assumed timeout is: %u.", csp->server_connection.keep_alive_timeout); + } + continue_chatting = (latency < csp->server_connection.keep_alive_timeout); } - privoxy_mutex_unlock(&connection_reuse_mutex); } - else + + if (continue_chatting && any_loaded_file_changed(csp->config->config_file_list)) { - forget_connection(csp->sfd); - close_socket(csp->sfd); + continue_chatting = 0; + config_file_change_detected = 1; } + + if (continue_chatting) + { + unsigned int client_timeout = 1; /* XXX: Use something else here? */ + + if (0 != (csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE)) + { + if (csp->server_connection.sfd != JB_INVALID_SOCKET) + { + client_timeout = (unsigned)csp->server_connection.keep_alive_timeout - latency; + log_error(LOG_LEVEL_CONNECT, + "Waiting for the next client request on socket %d. " + "Keeping the server socket %d to %s open.", + csp->cfd, csp->server_connection.sfd, csp->server_connection.host); + } + else + { + log_error(LOG_LEVEL_CONNECT, + "Waiting for the next client request on socket %d. " + "No server socket to keep open.", csp->cfd); + } + } + if ((csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE) + && data_is_available(csp->cfd, (int)client_timeout) + && socket_is_still_alive(csp->cfd)) + { + log_error(LOG_LEVEL_CONNECT, + "Client request arrived in time on socket %d.", csp->cfd); + prepare_csp_for_next_request(csp); + } + else + { + if (0 != (csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE)) + { + log_error(LOG_LEVEL_CONNECT, + "No additional client request received in time on socket %d.", + csp->cfd); + } +#ifdef FEATURE_CONNECTION_SHARING + if ((csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_SHARING) + && (socket_is_still_alive(csp->server_connection.sfd))) + { + time_t time_open = time(NULL) - csp->server_connection.timestamp; + + if (csp->server_connection.keep_alive_timeout < time_open - (time_t)latency) + { + break; + } + + remember_connection(&csp->server_connection); + csp->server_connection.sfd = JB_INVALID_SOCKET; + close_socket(csp->cfd); + csp->cfd = JB_INVALID_SOCKET; + privoxy_mutex_lock(&connection_reuse_mutex); + if (!monitor_thread_running) + { + monitor_thread_running = 1; + privoxy_mutex_unlock(&connection_reuse_mutex); + wait_for_alive_connections(); + privoxy_mutex_lock(&connection_reuse_mutex); + monitor_thread_running = 0; + } + privoxy_mutex_unlock(&connection_reuse_mutex); + } +#endif /* def FEATURE_CONNECTION_SHARING */ + break; + } + } + else if (csp->server_connection.sfd != JB_INVALID_SOCKET) + { + log_error(LOG_LEVEL_CONNECT, + "The connection on server socket %d to %s isn't reusable. Closing. " + "Server connection: keep-alive %u, tainted: %u, socket alive %u. " + "Client connection: socket alive: %u. Server timeout: %u. " + "Configuration file change detected: %u", + csp->server_connection.sfd, csp->server_connection.host, + 0 != (csp->flags & CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE), + 0 != (csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED), + socket_is_still_alive(csp->server_connection.sfd), + socket_is_still_alive(csp->cfd), + csp->server_connection.keep_alive_timeout, + config_file_change_detected); + } + } while (continue_chatting); + #else - close_socket(csp->sfd); + chat(csp); #endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ + + if (csp->server_connection.sfd != JB_INVALID_SOCKET) + { +#ifdef FEATURE_CONNECTION_SHARING + if (csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_SHARING) + { + forget_connection(csp->server_connection.sfd); + } +#endif /* def FEATURE_CONNECTION_SHARING */ + close_socket(csp->server_connection.sfd); + } + +#ifdef FEATURE_CONNECTION_KEEP_ALIVE + mark_connection_closed(&csp->server_connection); +#endif + + if (csp->cfd != JB_INVALID_SOCKET) + { + close_socket(csp->cfd); } csp->flags &= ~CSP_FLAG_ACTIVE; @@ -3586,6 +2847,7 @@ static void initialize_mutexes(void) #ifndef HAVE_RANDOM privoxy_mutex_init(&rand_mutex); #endif /* ndef HAVE_RANDOM */ + #endif /* def MUTEX_LOCKS_AVAILABLE */ } @@ -3614,9 +2876,9 @@ static void initialize_mutexes(void) * *********************************************************************/ #ifdef __MINGW32__ -int real_main(int argc, const char *argv[]) +int real_main(int argc, char **argv) #else -int main(int argc, const char *argv[]) +int main(int argc, char **argv) #endif { int argc_pos = 0; @@ -3624,7 +2886,6 @@ int main(int argc, const char *argv[]) #ifdef unix struct passwd *pw = NULL; struct group *grp = NULL; - char *p; int do_chroot = 0; char *pre_chroot_nslookup_to_load_resolver = NULL; #endif @@ -3663,7 +2924,7 @@ int main(int argc, const char *argv[]) pName++; exit( (install_service(pName)) ? 0 : 1 ); } - else if (strncmp(argv[argc_pos], "--uninstall", + 11) == 0) + else if (strncmp(argv[argc_pos], "--uninstall", 11) == 0) { const char *pName = argv[argc_pos] + 11; if (*pName == ':') @@ -3698,7 +2959,7 @@ int main(int argc, const char *argv[]) else if (strcmp(argv[argc_pos], "--no-daemon" ) == 0) { set_debug_level(LOG_LEVEL_FATAL | LOG_LEVEL_ERROR | LOG_LEVEL_INFO); - no_daemon = 1; + daemon_mode = 0; } else if (strcmp(argv[argc_pos], "--pidfile" ) == 0) @@ -3709,23 +2970,39 @@ int main(int argc, const char *argv[]) else if (strcmp(argv[argc_pos], "--user" ) == 0) { + char *user_arg; + char *group_name; + if (++argc_pos == argc) usage(argv[argc_pos]); - if ((NULL != (p = strchr(argv[argc_pos], '.'))) && *(p + 1) != '0') + user_arg = strdup(argv[argc_pos]); + if (NULL == user_arg) { - *p++ = '\0'; - if (NULL == (grp = getgrnam(p))) + log_error(LOG_LEVEL_FATAL, + "Out of memory splitting --user argument '%s'.", argv[argc_pos]); + } + group_name = strchr(user_arg, '.'); + if (NULL != group_name) + { + /* Nul-terminate the user name */ + *group_name = '\0'; + + /* Skip the former delimiter to actually reach the group name */ + group_name++; + + grp = getgrnam(group_name); + if (NULL == grp) { - log_error(LOG_LEVEL_FATAL, "Group %s not found.", p); + log_error(LOG_LEVEL_FATAL, "Group '%s' not found.", group_name); } } - - if (NULL == (pw = getpwnam(argv[argc_pos]))) + pw = getpwnam(user_arg); + if (NULL == pw) { - log_error(LOG_LEVEL_FATAL, "User %s not found.", argv[argc_pos]); + log_error(LOG_LEVEL_FATAL, "User '%s' not found.", user_arg); } - if (p != NULL) *--p = '\0'; + freez(user_arg); } else if (strcmp(argv[argc_pos], "--pre-chroot-nslookup" ) == 0) @@ -3765,7 +3042,7 @@ int main(int argc, const char *argv[]) { char cwd[BUFFER_SIZE]; char *abs_file; - size_t abs_file_size; + size_t abs_file_size; /* make config-filename absolute here */ if (NULL == getcwd(cwd, sizeof(cwd))) @@ -3819,12 +3096,11 @@ int main(int argc, const char *argv[]) #if !defined(_WIN32) && !defined(__OS2__) && !defined(AMIGA) { int idx; - const int catched_signals[] = { SIGTERM, SIGINT, SIGHUP, 0 }; - const int ignored_signals[] = { SIGPIPE, 0 }; + const int catched_signals[] = { SIGTERM, SIGINT, SIGHUP }; - for (idx = 0; catched_signals[idx] != 0; idx++) + for (idx = 0; idx < SZ(catched_signals); idx++) { -#ifdef sun /* FIXME: Is it safe to check for HAVE_SIGSET instead? */ +#ifdef sun /* FIXME: Is it safe to check for HAVE_SIGSET instead? */ if (sigset(catched_signals[idx], sig_handler) == SIG_ERR) #else if (signal(catched_signals[idx], sig_handler) == SIG_ERR) @@ -3834,12 +3110,9 @@ int main(int argc, const char *argv[]) } } - for (idx = 0; ignored_signals[idx] != 0; idx++) + if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - if (signal(ignored_signals[idx], SIG_IGN) == SIG_ERR) - { - log_error(LOG_LEVEL_FATAL, "Can't set ignore-handler for signal %d: %E", ignored_signals[idx]); - } + log_error(LOG_LEVEL_FATAL, "Can't set ignore-handler for SIGPIPE: %E"); } } @@ -3864,14 +3137,10 @@ int main(int argc, const char *argv[]) */ #if defined(unix) { - pid_t pid = 0; -#if 0 - int fd; -#endif - - if (!no_daemon) + if (daemon_mode) { - pid = fork(); + int fd; + pid_t pid = fork(); if ( pid < 0 ) /* error */ { @@ -3895,33 +3164,50 @@ int main(int argc, const char *argv[]) exit( 0 ); } /* child */ -#if 1 - /* Should be more portable, but not as well tested */ + setsid(); -#else /* !1 */ -#ifdef __FreeBSD__ - setpgrp(0,0); -#else /* ndef __FreeBSD__ */ - setpgrp(); -#endif /* ndef __FreeBSD__ */ - fd = open("/dev/tty", O_RDONLY); - if ( fd ) - { - /* no error check here */ - ioctl( fd, TIOCNOTTY,0 ); - close ( fd ); - } -#endif /* 1 */ + /* * stderr (fd 2) will be closed later on, * when the config file has been parsed. */ + close(0); + close(1); + + /* + * Reserve fd 0 and 1 to prevent abort() and friends + * from sending stuff to the clients or servers. + */ + fd = open("/dev/null", O_RDONLY); + if (fd == -1) + { + log_error(LOG_LEVEL_FATAL, "Failed to open /dev/null: %E"); + } + else if (fd != 0) + { + if (dup2(fd, 0) == -1) + { + log_error(LOG_LEVEL_FATAL, "Failed to reserve fd 0: %E"); + } + close(fd); + } + fd = open("/dev/null", O_WRONLY); + if (fd == -1) + { + log_error(LOG_LEVEL_FATAL, "Failed to open /dev/null: %E"); + } + else if (fd != 1) + { + if (dup2(fd, 1) == -1) + { + log_error(LOG_LEVEL_FATAL, "Failed to reserve fd 1: %E"); + } + close(fd); + } - close( 0 ); - close( 1 ); chdir("/"); - } /* -END- if (!no_daemon) */ + } /* -END- if (daemon_mode) */ /* * As soon as we have written the PID file, we can switch @@ -3981,7 +3267,7 @@ int main(int argc, const char *argv[]) if (putenv(putenv_dummy) != 0) { log_error(LOG_LEVEL_FATAL, "Cannot putenv(): HOME"); - } + } snprintf(putenv_dummy, sizeof(putenv_dummy), "USER=%s", pw->pw_name); if (putenv(putenv_dummy) != 0) @@ -4002,7 +3288,7 @@ int main(int argc, const char *argv[]) */ if (bRunAsService) { - /* Yup, so now we must attempt to establish a connection + /* Yup, so now we must attempt to establish a connection * with the service dispatcher. This will only work if this * process was launched by the service control manager to * actually run as a service. If this isn't the case, i've @@ -4044,61 +3330,127 @@ int main(int argc, const char *argv[]) * on failure. * * Parameters : - * 1 : config = Privoxy configuration. Specifies port - * to bind to. + * 1 : haddr = Host addres to bind to. Use NULL to bind to + * INADDR_ANY. + * 2 : hport = Specifies port to bind to. * * Returns : Port that was opened. * *********************************************************************/ -static jb_socket bind_port_helper(struct configuration_spec * config) +static jb_socket bind_port_helper(const char *haddr, int hport) { int result; jb_socket bfd; - if (config->haddr == NULL) - { - log_error(LOG_LEVEL_INFO, "Listening on port %d on all IP addresses", - config->hport); - } - else - { - log_error(LOG_LEVEL_INFO, "Listening on port %d on IP address %s", - config->hport, config->haddr); - } - - result = bind_port(config->haddr, config->hport, &bfd); + result = bind_port(haddr, hport, &bfd); if (result < 0) { + const char *bind_address = (NULL != haddr) ? haddr : "INADDR_ANY"; switch(result) { - case -3 : - log_error(LOG_LEVEL_FATAL, "can't bind to %s:%d: " - "There may be another Privoxy or some other " - "proxy running on port %d", - (NULL != config->haddr) ? config->haddr : "INADDR_ANY", - config->hport, config->hport); + case -3: + log_error(LOG_LEVEL_FATAL, + "can't bind to %s:%d: There may be another Privoxy " + "or some other proxy running on port %d", + bind_address, hport, hport); - case -2 : - log_error(LOG_LEVEL_FATAL, "can't bind to %s:%d: " - "The hostname is not resolvable", - (NULL != config->haddr) ? config->haddr : "INADDR_ANY", config->hport); + case -2: + log_error(LOG_LEVEL_FATAL, + "can't bind to %s:%d: The hostname is not resolvable", + bind_address, hport); - default : - log_error(LOG_LEVEL_FATAL, "can't bind to %s:%d: because %E", - (NULL != config->haddr) ? config->haddr : "INADDR_ANY", config->hport); + default: + log_error(LOG_LEVEL_FATAL, "can't bind to %s:%d: %E", + bind_address, hport); } /* shouldn't get here */ return JB_INVALID_SOCKET; } - config->need_bind = 0; + if (haddr == NULL) + { + log_error(LOG_LEVEL_INFO, "Listening on port %d on all IP addresses", + hport); + } + else + { + log_error(LOG_LEVEL_INFO, "Listening on port %d on IP address %s", + hport, haddr); + } return bfd; } +/********************************************************************* + * + * Function : bind_ports_helper + * + * Description : Bind the listen ports. Handles logging, and aborts + * on failure. + * + * Parameters : + * 1 : config = Privoxy configuration. Specifies ports + * to bind to. + * 2 : sockets = Preallocated array of opened sockets + * corresponding to specification in config. + * All non-opened sockets will be set to + * JB_INVALID_SOCKET. + * + * Returns : Nothing. Inspect sockets argument. + * + *********************************************************************/ +static void bind_ports_helper(struct configuration_spec * config, + jb_socket sockets[]) +{ + int i; + + for (i = 0; i < MAX_LISTENING_SOCKETS; i++) + { + if (config->hport[i]) + { + sockets[i] = bind_port_helper(config->haddr[i], config->hport[i]); + } + else + { + sockets[i] = JB_INVALID_SOCKET; + } + } + config->need_bind = 0; +} + + +/********************************************************************* + * + * Function : close_ports_helper + * + * Description : Close listenings ports. + * + * Parameters : + * 1 : sockets = Array of opened and non-opened sockets to + * close. All sockets will be set to + * JB_INVALID_SOCKET. + * + * Returns : Nothing. + * + *********************************************************************/ +static void close_ports_helper(jb_socket sockets[]) +{ + int i; + + for (i = 0; i < MAX_LISTENING_SOCKETS; i++) + { + if (JB_INVALID_SOCKET != sockets[i]) + { + close_socket(sockets[i]); + } + sockets[i] = JB_INVALID_SOCKET; + } +} + + #ifdef _WIN32 /* Without this simple workaround we get this compiler warning from _beginthread * warning C4028: formal parameter 1 different from declaration @@ -4123,21 +3475,23 @@ void w32_service_listen_loop(void *p) *********************************************************************/ static void listen_loop(void) { + struct client_states *csp_list = NULL; struct client_state *csp = NULL; - jb_socket bfd; - struct configuration_spec * config; + jb_socket bfds[MAX_LISTENING_SOCKETS]; + struct configuration_spec *config; + unsigned int active_threads = 0; config = load_config(); -#ifdef FEATURE_CONNECTION_KEEP_ALIVE +#ifdef FEATURE_CONNECTION_SHARING /* * XXX: Should be relocated once it no * longer needs to emit log messages. */ initialize_reusable_connections(); -#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ +#endif /* def FEATURE_CONNECTION_SHARING */ - bfd = bind_port_helper(config); + bind_ports_helper(config, bfds); #ifdef FEATURE_GRACEFUL_TERMINATION while (!g_terminate) @@ -4155,7 +3509,7 @@ static void listen_loop(void) /* * Free data that was used by died threads */ - sweep(); + active_threads = sweep(); #if defined(unix) /* @@ -4171,22 +3525,47 @@ static void listen_loop(void) } #endif - if ( NULL == (csp = (struct client_state *) zalloc(sizeof(*csp))) ) + csp_list = (struct client_states *)zalloc(sizeof(*csp_list)); + if (NULL == csp_list) { - log_error(LOG_LEVEL_FATAL, "malloc(%d) for csp failed: %E", sizeof(*csp)); + log_error(LOG_LEVEL_FATAL, + "malloc(%d) for csp_list failed: %E", sizeof(*csp_list)); continue; } + csp = &csp_list->csp; + + log_error(LOG_LEVEL_CONNECT, "Listening for new connections ... "); + + if (!accept_connection(csp, bfds)) + { + log_error(LOG_LEVEL_CONNECT, "accept failed: %E"); + +#ifdef AMIGA + if(!childs) + { + exit(1); + } +#endif + freez(csp_list); + continue; + } + else + { + log_error(LOG_LEVEL_CONNECT, + "accepted connection from %s on socket %d", + csp->ip_addr_str, csp->cfd); + } csp->flags |= CSP_FLAG_ACTIVE; - csp->sfd = JB_INVALID_SOCKET; + csp->server_connection.sfd = JB_INVALID_SOCKET; csp->config = config = load_config(); - if ( config->need_bind ) + if (config->need_bind) { /* * Since we were listening to the "old port", we will not see - * a "listen" param change until the next IJB request. So, at + * a "listen" param change until the next request. So, at * least 1 more request must be made for us to find the new * setting. I am simply closing the old socket and binding the * new one. @@ -4197,29 +3576,9 @@ static void listen_loop(void) * that this will hurt people's feelings. */ - close_socket(bfd); + close_ports_helper(bfds); - bfd = bind_port_helper(config); - } - - log_error(LOG_LEVEL_CONNECT, "Listening for new connections ... "); - - if (!accept_connection(csp, bfd)) - { - log_error(LOG_LEVEL_CONNECT, "accept failed: %E"); - -#ifdef AMIGA - if(!childs) - { - exit(1); - } -#endif - freez(csp); - continue; - } - else - { - log_error(LOG_LEVEL_CONNECT, "accepted connection from %s", csp->ip_addr_str); + bind_ports_helper(config, bfds); } #ifdef FEATURE_TOGGLE @@ -4238,22 +3597,38 @@ static void listen_loop(void) #ifdef FEATURE_ACL if (block_acl(NULL,csp)) { - log_error(LOG_LEVEL_CONNECT, "Connection from %s dropped due to ACL", csp->ip_addr_str); + log_error(LOG_LEVEL_CONNECT, + "Connection from %s on socket %d dropped due to ACL", csp->ip_addr_str, csp->cfd); close_socket(csp->cfd); - freez(csp); + freez(csp->ip_addr_str); + freez(csp_list); continue; } #endif /* def FEATURE_ACL */ + if ((0 != config->max_client_connections) + && (active_threads >= config->max_client_connections)) + { + log_error(LOG_LEVEL_CONNECT, + "Rejecting connection from %s. Maximum number of connections reached.", + csp->ip_addr_str); + write_socket(csp->cfd, TOO_MANY_CONNECTIONS_RESPONSE, + strlen(TOO_MANY_CONNECTIONS_RESPONSE)); + close_socket(csp->cfd); + freez(csp->ip_addr_str); + freez(csp_list); + continue; + } + /* add it to the list of clients */ - csp->next = clients->next; - clients->next = csp; + csp_list->next = clients->next; + clients->next = csp_list; if (config->multi_threaded) { int child_id; -/* this is a switch () statment in the C preprocessor - ugh */ +/* this is a switch () statement in the C preprocessor - ugh */ #undef SELECTED_ONE_OPTION /* Use Pthreads in preference to native code */ @@ -4309,7 +3684,7 @@ static void listen_loop(void) #if defined(AMIGA) && !defined(SELECTED_ONE_OPTION) #define SELECTED_ONE_OPTION csp->cfd = ReleaseSocket(csp->cfd, -1); - + #ifdef __amigaos4__ child_id = (int)CreateNewProcTags(NP_Entry, (ULONG)server_thread, NP_Output, Output(), @@ -4350,7 +3725,7 @@ static void listen_loop(void) serve(csp); - /* + /* * If we've been toggled or we've blocked the request, tell Mom */ @@ -4361,7 +3736,7 @@ static void listen_loop(void) } #endif /* def FEATURE_TOGGLE */ -#ifdef FEATURE_STATISTICS +#ifdef FEATURE_STATISTICS if (csp->flags & CSP_FLAG_REJECTED) { rc |= RC_FLAG_BLOCKED; @@ -4381,7 +3756,7 @@ static void listen_loop(void) wait( &child_status ); - /* + /* * Evaluate child's return code: If the child has * - been toggled, toggle ourselves * - blocked its request, bump up the stats counter @@ -4400,7 +3775,7 @@ static void listen_loop(void) { urls_rejected++; } -#endif /* def FEATURE_STATISTICS */ +#endif /* def FEATURE_STATISTICS */ #endif /* !defined(_WIN32) && defined(__CYGWIN__) */ close_socket(csp->cfd); @@ -4411,19 +3786,19 @@ static void listen_loop(void) #undef SELECTED_ONE_OPTION /* end of cpp switch () */ - if (child_id < 0) /* failed */ + if (child_id < 0) { - char buf[BUFFER_SIZE]; - - log_error(LOG_LEVEL_ERROR, "can't fork: %E"); - - snprintf(buf , sizeof(buf), "Privoxy: can't fork: errno = %d", errno); - - write_socket(csp->cfd, buf, strlen(buf)); + /* + * Spawning the child failed, assume it's because + * there are too many children running already. + * XXX: If you assume ... + */ + log_error(LOG_LEVEL_ERROR, + "Unable to take any additional connections: %E"); + write_socket(csp->cfd, TOO_MANY_CONNECTIONS_RESPONSE, + strlen(TOO_MANY_CONNECTIONS_RESPONSE)); close_socket(csp->cfd); csp->flags &= ~CSP_FLAG_ACTIVE; - sleep(5); - continue; } } else @@ -4466,7 +3841,6 @@ static void listen_loop(void) #if defined(unix) freez(basedir); #endif - freez(configfile); #if defined(_WIN32) && !defined(_WIN_CONSOLE) /* Cleanup - remove taskbar icon etc. */ diff --git a/external/privoxy/jcc.c.rej b/external/privoxy/jcc.c.rej deleted file mode 100644 index 7a1bbdc3..00000000 --- a/external/privoxy/jcc.c.rej +++ /dev/null @@ -1,20 +0,0 @@ -*************** -*** 3110,3118 **** - } - continue; - } -- log_error(LOG_LEVEL_INFO, -- "Shouldn't get here but did."); -- return; - } - - if (csp->content_length == 0) ---- 3120,3127 ---- - } - continue; - } -+ mark_server_socket_tainted(csp); -+ return; /* huh? we should never get here */ - } - - if (csp->content_length == 0) diff --git a/external/privoxy/jcc.h b/external/privoxy/jcc.h index add854c0..3e23661f 100644 --- a/external/privoxy/jcc.h +++ b/external/privoxy/jcc.h @@ -1,21 +1,21 @@ #ifndef JCC_H_INCLUDED #define JCC_H_INCLUDED -#define JCC_H_VERSION "$Id: jcc.h,v 1.25 2008/10/09 18:21:41 fabiankeil Exp $" +#define JCC_H_VERSION "$Id: jcc.h,v 1.32 2011/11/06 11:48:23 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.h,v $ * - * Purpose : Main file. Contains main() method, main loop, and + * Purpose : Main file. Contains main() method, main loop, and * the main connection-handling function. * * Copyright : Written by and Copyright (C) 2001-2006 the SourceForge * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -33,143 +33,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: jcc.h,v $ - * Revision 1.25 2008/10/09 18:21:41 fabiankeil - * Flush work-in-progress changes to keep outgoing connections - * alive where possible. Incomplete and mostly #ifdef'd out. - * - * Revision 1.24 2008/09/07 12:35:05 fabiankeil - * Add mutex lock support for _WIN32. - * - * Revision 1.23 2008/09/04 08:13:58 fabiankeil - * Prepare for critical sections on Windows by adding a - * layer of indirection before the pthread mutex functions. - * - * Revision 1.22 2007/06/01 18:16:36 fabiankeil - * Use the same mutex for gethostbyname() and gethostbyaddr() to prevent - * deadlocks and crashes on OpenBSD and possibly other OS with neither - * gethostbyname_r() nor gethostaddr_r(). Closes BR#1729174. - * Thanks to Ralf Horstmann for report and solution. - * - * Revision 1.21 2007/04/22 13:18:06 fabiankeil - * Keep the HTTP snippets local. - * - * Revision 1.20 2006/12/26 17:31:41 fabiankeil - * Mutex protect rand() if POSIX threading - * is used, warn the user if that's not possible - * and stop using it on _WIN32 where it could - * cause crashes. - * - * Revision 1.19 2006/12/06 19:41:39 fabiankeil - * Privoxy is now able to run as intercepting - * proxy in combination with any packet filter - * that does the port redirection. The destination - * is extracted from the "Host:" header which - * should be available for nearly all requests. - * - * Moved HTTP snipplets into jcc.c. - * Added error message for gopher proxy requests. - * - * Revision 1.18 2006/11/13 19:05:51 fabiankeil - * Make pthread mutex locking more generic. Instead of - * checking for OSX and OpenBSD, check for FEATURE_PTHREAD - * and use mutex locking unless there is an _r function - * available. Better safe than sorry. - * - * Fixes "./configure --disable-pthread" and should result - * in less threading-related problems on pthread-using platforms, - * but it still doesn't fix BR#1122404. - * - * Revision 1.17 2006/11/06 19:58:23 fabiankeil - * Move pthread.h inclusion from jcc.c to jcc.h. - * Fixes build on x86-freebsd1 (FreeBSD 5.4-RELEASE). - * - * Revision 1.16 2006/09/02 15:36:42 fabiankeil - * Follow the OpenBSD port's lead and protect the resolve - * functions on OpenBSD as well. - * - * Revision 1.15 2006/09/02 10:24:30 fabiankeil - * Include pthread.h for OpenBSD to make Privoxy build again. - * - * Tested shortly on OpenBSD 3.9 without problems, but the OpenBSD - * port has additional patches to use the mutexes OSX_DARWIN needs, - * and it should be investigated if they are still required for - * reliable operation. - * - * Revision 1.14 2006/07/18 14:48:46 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.12.2.3 2006/01/21 16:16:08 david__schmidt - * Thanks to Edward Carrel for his patch to modernize OSX's pthreads support. See bug #1409623. - * - * Revision 1.12.2.2 2005/04/03 20:10:50 david__schmidt - * Thanks to Jindrich Makovicka for a race condition fix for the log - * file. The race condition remains for non-pthread implementations. - * Reference patch #1175720. - * - * Revision 1.12.2.1 2003/03/07 03:41:05 david__schmidt - * Wrapping all *_r functions (the non-_r versions of them) with mutex - * semaphores for OSX. Hopefully this will take care of all of those pesky - * crash reports. - * - * Revision 1.12 2002/03/26 22:29:55 swa - * we have a new homepage! - * - * Revision 1.11 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.10 2002/03/16 23:54:06 jongfoster - * Adding graceful termination feature, to help look for memory leaks. - * If you enable this (which, by design, has to be done by hand - * editing config.h) and then go to http://i.j.b/die, then the program - * will exit cleanly after the *next* request. It should free all the - * memory that was used. - * - * Revision 1.9 2002/03/07 03:52:44 oes - * Set logging to tty for --no-daemon mode - * - * Revision 1.8 2002/03/04 18:19:49 oes - * Added extern const char *pidfile - * - * Revision 1.7 2001/11/05 21:41:43 steudten - * Add changes to be a real daemon just for unix os. - * (change cwd to /, detach from controlling tty, set - * process group and session leader to the own process. - * Add DBG() Macro. - * Add some fatal-error log message for failed malloc(). - * Add '-d' if compiled with 'configure --with-debug' to - * enable debug output. - * - * Revision 1.6 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.5 2001/07/29 19:32:00 jongfoster - * Renaming _main() [mingw32 only] to real_main(), for ANSI compliance. - * - * Revision 1.4 2001/07/29 18:58:15 jongfoster - * Removing nested #includes, adding forward declarations for needed - * structures, and changing the #define _FILENAME_H to FILENAME_H_INCLUDED. - * - * Revision 1.3 2001/07/18 12:31:58 oes - * moved #define freez from jcc.h to project.h - * - * Revision 1.2 2001/05/31 21:24:47 jongfoster - * Changed "permission" to "action" throughout. - * Removed DEFAULT_USER_AGENT - it must now be specified manually. - * Moved vanilla wafer check into chat(), since we must now - * decide whether or not to add it based on the URL. - * - * Revision 1.1.1.1 2001/05/15 13:58:56 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #ifdef __cplusplus extern "C" { @@ -185,13 +50,13 @@ extern int urls_read; extern int urls_rejected; #endif /*def FEATURE_STATISTICS*/ -extern struct client_state clients[1]; +extern struct client_states clients[1]; extern struct file_list files[1]; #ifdef unix extern const char *pidfile; #endif -extern int no_daemon; +extern int daemon_mode; #ifdef FEATURE_GRACEFUL_TERMINATION extern int g_terminate; @@ -239,9 +104,9 @@ extern privoxy_mutex_t rand_mutex; /* Functions */ #ifdef __MINGW32__ -int real_main(int argc, const char *argv[]); +int real_main(int argc, char **argv); #else -int main(int argc, const char *argv[]); +int main(int argc, char **argv); #endif /* Revision control strings from this header and associated .c file */ diff --git a/external/privoxy/list.c b/external/privoxy/list.c index c158129d..487431ad 100644 --- a/external/privoxy/list.c +++ b/external/privoxy/list.c @@ -1,4 +1,4 @@ -const char list_rcs[] = "$Id: list.c,v 1.20 2007/05/14 16:56:07 fabiankeil Exp $"; +const char list_rcs[] = "$Id: list.c,v 1.25 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/list.c,v $ @@ -32,110 +32,8 @@ const char list_rcs[] = "$Id: list.c,v 1.20 2007/05/14 16:56:07 fabiankeil Exp $ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: list.c,v $ - * Revision 1.20 2007/05/14 16:56:07 fabiankeil - * - Stop using strcpy(). - * - enlist_unique_header() now behaves as advertised - * and checks for existing headers with the same name - * but ignores the values. - * - * Revision 1.19 2007/04/17 18:14:06 fabiankeil - * Add list_contains_item(). - * - * Revision 1.18 2006/12/28 19:21:23 fabiankeil - * Fixed gcc43 warning and enabled list_is_valid()'s loop - * detection again. It was ineffective since the removal of - * the arbitrary list length limit two years ago. - * - * Revision 1.17 2006/07/18 14:48:46 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.15.2.2 2004/05/25 02:04:23 david__schmidt - * Removed the "arbitrary" 1000 filter limit in file.c. See tracker #911950. - * - * Revision 1.15.2.1 2002/11/28 18:14:54 oes - * Added unmap function that removes all items with a given - * name from a map. - * - * Revision 1.15 2002/03/26 22:29:55 swa - * we have a new homepage! - * - * Revision 1.14 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.13 2002/03/07 03:46:17 oes - * Fixed compiler warnings - * - * Revision 1.12 2001/10/25 03:40:48 david__schmidt - * Change in porting tactics: OS/2's EMX porting layer doesn't allow multiple - * threads to call select() simultaneously. So, it's time to do a real, live, - * native OS/2 port. See defines for __EMX__ (the porting layer) vs. __OS2__ - * (native). Both versions will work, but using __OS2__ offers multi-threading. - * - * Revision 1.11 2001/10/23 21:21:03 jongfoster - * New error handling - error codes are now jb_errs, not ints. - * Changed the way map() handles out-of-memory, to dramatically - * reduce the amount of error-checking clutter needed. - * - * Revision 1.10 2001/09/16 17:30:24 jongfoster - * Fixing a compiler warning. - * - * Revision 1.9 2001/09/16 13:20:29 jongfoster - * Rewrite of list library. Now has seperate header and list_entry - * structures. Also added a large sprinking of assert()s to the list - * code. - * - * Revision 1.8 2001/08/07 14:00:20 oes - * Fixed comment - * - * Revision 1.7 2001/08/05 16:06:20 jongfoster - * Modifiying "struct map" so that there are now separate header and - * "map_entry" structures. This means that functions which modify a - * map no longer need to return a pointer to the modified map. - * Also, it no longer reverses the order of the entries (which may be - * important with some advanced template substitutions). - * - * Revision 1.6 2001/07/31 14:44:51 oes - * list_to_text() now appends empty line at end - * - * Revision 1.5 2001/06/29 21:45:41 oes - * Indentation, CRLF->LF, Tab-> Space - * - * Revision 1.4 2001/06/29 13:30:22 oes - * - Added Convenience function enlist_unique_header(), - * which takes the Header name and value as separate - * arguments and thus saves the pain of sprintf()ing - * and determining the Header name length to enlist_unique - * - Improved comments - * - Removed logentry from cancelled commit - * - * Revision 1.3 2001/06/03 19:12:24 oes - * functions for new struct map, extended enlist_unique - * - * Revision 1.2 2001/06/01 18:49:17 jongfoster - * Replaced "list_share" with "list" - the tiny memory gain was not - * worth the extra complexity. - * - * Revision 1.1 2001/05/31 21:11:53 jongfoster - * - Moved linked list support to new "list.c" file. - * Structure definitions are still in project.h, - * function prototypes are now in "list.h". - * - Added support for "struct list_share", which is identical - * to "struct list" except it saves memory by not duplicating - * the strings. Obviously, this only works if there is some - * other way of managing the memory used by the strings. - * (These list_share lists are used for lists which last - * for only 1 request, and where all the list entries are - * just coming directly from entries in the actionsfile.) - * Note that you still need to destroy list_share lists - * properly to free the nodes - it's only the strings - * which are shared. - * - * *********************************************************************/ - + #include "config.h" @@ -287,13 +185,13 @@ static int list_is_valid (const struct list *the_list) * Note that the 1000 limit was hit by a real user in tracker 911950; * removing it for now. Real circular references should eventually * be caught by the check above, anyway. - */ + */ /* if (entry > 1000) - { + { return 0; - } - */ + } + */ /* * Check this isn't marked as the last entry, unless of course it's @@ -598,7 +496,7 @@ char *list_to_text(const struct list *the_list) assert(list_is_valid(the_list)); /* - * Calculate the lenght of the final text. + * Calculate the length of the final text. * '2' because of the '\r\n' at the end of * each string and at the end of the text. */ @@ -941,7 +839,7 @@ int list_contains_item(const struct list *the_list, const char *str) if (entry->str == NULL) { /* - * NULL pointers are allowed in some lists. + * NULL pointers are allowed in some lists. * For example for csp->headers in case a * header was removed. */ @@ -1023,7 +921,7 @@ void free_map(struct map *the_map) * * Note: Since all strings will be free()d in free_map() * later, set the copy flags for constants or - * strings that will be independantly free()d. + * strings that will be independently free()d. * * Note2: This function allows NULL parameters - it * returns JB_ERR_MEMORY in that case. @@ -1142,7 +1040,7 @@ jb_err unmap(struct map *the_map, const char *name) assert(the_map); assert(name); - + last_entry = the_map->first; for (cur_entry = the_map->first; cur_entry != NULL; cur_entry = cur_entry->next) @@ -1162,13 +1060,13 @@ jb_err unmap(struct map *the_map, const char *name) } /* - * Update the map's last pointer + * Update the map's last pointer */ if (cur_entry == the_map->last) { the_map->last = last_entry; } - + /* * Free the map_entry */ diff --git a/external/privoxy/list.h b/external/privoxy/list.h index b1162379..631145af 100644 --- a/external/privoxy/list.h +++ b/external/privoxy/list.h @@ -1,6 +1,6 @@ #ifndef LIST_H_INCLUDED #define LIST_H_INCLUDED -#define LIST_H_VERSION "$Id: list.h,v 1.15 2007/04/17 18:14:06 fabiankeil Exp $" +#define LIST_H_VERSION "$Id: list.h,v 1.18 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/list.h,v $ @@ -13,10 +13,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -34,82 +34,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: list.h,v $ - * Revision 1.15 2007/04/17 18:14:06 fabiankeil - * Add list_contains_item(). - * - * Revision 1.14 2006/07/18 14:48:46 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.12.2.1 2002/11/28 18:14:54 oes - * Added unmap function that removes all items with a given - * name from a map. - * - * Revision 1.12 2002/03/26 22:29:55 swa - * we have a new homepage! - * - * Revision 1.11 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.10 2002/03/07 03:46:17 oes - * Fixed compiler warnings - * - * Revision 1.9 2001/10/23 21:21:03 jongfoster - * New error handling - error codes are now jb_errs, not ints. - * Changed the way map() handles out-of-memory, to dramatically - * reduce the amount of error-checking clutter needed. - * - * Revision 1.8 2001/09/16 17:30:24 jongfoster - * Fixing a compiler warning. - * - * Revision 1.7 2001/09/16 13:20:29 jongfoster - * Rewrite of list library. Now has seperate header and list_entry - * structures. Also added a large sprinking of assert()s to the list - * code. - * - * Revision 1.6 2001/08/05 16:06:20 jongfoster - * Modifiying "struct map" so that there are now separate header and - * "map_entry" structures. This means that functions which modify a - * map no longer need to return a pointer to the modified map. - * Also, it no longer reverses the order of the entries (which may be - * important with some advanced template substitutions). - * - * Revision 1.5 2001/07/29 18:43:08 jongfoster - * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to - * ANSI C rules. - * - * Revision 1.4 2001/06/29 13:30:37 oes - * - Introduced enlist_unique_header() - * - Removed logentry from cancelled commit - * - * Revision 1.3 2001/06/03 11:03:48 oes - * introduced functions for new list type "map": map(), lookup(), - * free_map(), and extended enlist_unique - * - * Revision 1.2 2001/06/01 18:49:17 jongfoster - * Replaced "list_share" with "list" - the tiny memory gain was not - * worth the extra complexity. - * - * Revision 1.1 2001/05/31 21:11:53 jongfoster - * - Moved linked list support to new "list.c" file. - * Structure definitions are still in project.h, - * function prototypes are now in "list.h". - * - Added support for "struct list_share", which is identical - * to "struct list" except it saves memory by not duplicating - * the strings. Obviously, this only works if there is some - * other way of managing the memory used by the strings. - * (These list_share lists are used for lists which last - * for only 1 request, and where all the list entries are - * just coming directly from entries in the actionsfile.) - * Note that you still need to destroy list_share lists - * properly to free the nodes - it's only the strings - * which are shared. - * - * *********************************************************************/ - + #include "project.h" diff --git a/external/privoxy/loadcfg.c b/external/privoxy/loadcfg.c index c2e3bd1a..2082f178 100644 --- a/external/privoxy/loadcfg.c +++ b/external/privoxy/loadcfg.c @@ -1,4 +1,4 @@ -const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.93 2009/03/18 21:46:26 fabiankeil Exp $"; +const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.121 2011/07/30 15:05:23 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $ @@ -33,491 +33,8 @@ const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.93 2009/03/18 21:46:26 fabiankeil * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: loadcfg.c,v $ - * Revision 1.93 2009/03/18 21:46:26 fabiankeil - * Revert the last commit as there's a better way. - * - * Revision 1.92 2009/03/18 20:43:19 fabiankeil - * Don't enable LOG_LEVEL_INFO by default and don't apply the user's - * debug settings until the logfile has been opened (if there is one). - * Patch submitted by Roland in #2624120. - * - * Revision 1.91 2009/03/09 17:29:08 fabiankeil - * As of r1.88, the show-status page can use a single line for - * warnings about ignored directives and the names of the ignored - * directives themselves. Reminded by Lee, finally closes #1856559. - * - * Revision 1.90 2009/03/07 17:58:02 fabiankeil - * Fix two mingw32-only buffer overflows. Note that triggering - * them requires control over the configuration file in which - * case all bets are off anyway. - * - * Revision 1.89 2009/03/01 18:46:33 fabiankeil - * - Help clang understand that we aren't - * dereferencing NULL pointers here. - * - Some style fixes in the modified region. - * - * Revision 1.88 2009/02/28 10:57:10 fabiankeil - * Gimme a break or two. Don't let the show-status page - * link to the website documentation for the user-manual - * directive itself. - * - * Revision 1.87 2009/02/15 07:56:13 fabiankeil - * Increase default socket timeout to 300 seconds. - * - * Revision 1.86 2009/02/08 19:18:57 fabiankeil - * Now that we have the match-all.action file, the other action - * files changed their position in config->actions_file[] back - * to the way it was before standard.action got removed and the - * changes from revision 1.84 have to be reverted. - * - * Revision 1.85 2009/01/22 12:06:26 fabiankeil - * Don't keep connections alive when running single-threaded. - * - * Revision 1.84 2009/01/14 16:14:36 fabiankeil - * Due to the standard.action file removal, the other action - * files changed their position in config->actions_file[]. - * Update mingw32 kludge accordingly. - * - * Revision 1.83 2008/12/20 14:53:55 fabiankeil - * Add config option socket-timeout to control the time - * Privoxy waits for data to arrive on a socket. Useful - * in case of stale ssh tunnels or when fuzz-testing. - * - * Revision 1.82 2008/11/16 12:43:49 fabiankeil - * Turn keep-alive support into a runtime feature - * that is disabled by setting keep-alive-timeout - * to a negative value. - * - * Revision 1.81 2008/11/13 09:08:42 fabiankeil - * Add new config option: keep-alive-timeout. - * - * Revision 1.80 2008/08/31 15:59:03 fabiankeil - * There's no reason to let remote toggling support depend - * on FEATURE_CGI_EDIT_ACTIONS, so make sure it doesn't. - * - * Revision 1.79 2008/08/30 12:03:07 fabiankeil - * Remove FEATURE_COOKIE_JAR. - * - * Revision 1.78 2008/08/02 08:23:22 fabiankeil - * If the enforce-blocks directive is used with FEATURE_FORCE_LOAD - * disabled, log a message that blocks will always be enforced - * instead of complaining about an unrecognized directive. - * Reported by Pietro Leone. - * - * Revision 1.77 2008/05/26 16:13:22 fabiankeil - * Reuse directive_hash and don't hash the same directive twice. - * - * Revision 1.76 2008/05/10 09:03:16 fabiankeil - * - Merge three string_append() calls. - * - Remove useless assertion. - * - * Revision 1.75 2008/03/30 14:52:05 fabiankeil - * Rename load_actions_file() and load_re_filterfile() - * as they load multiple files "now". - * - * Revision 1.74 2008/03/26 18:07:07 fabiankeil - * Add hostname directive. Closes PR#1918189. - * - * Revision 1.73 2008/02/16 16:54:51 fabiankeil - * Fix typo. - * - * Revision 1.72 2008/02/03 13:46:15 fabiankeil - * Add SOCKS5 support. Patch #1862863 by Eric M. Hopper with minor changes. - * - * Revision 1.71 2007/12/23 15:24:56 fabiankeil - * Reword "unrecognized directive" warning, use better - * mark up and add a
. Fixes parts of #1856559. - * - * Revision 1.70 2007/12/15 14:24:05 fabiankeil - * Plug memory leak if listen-address only specifies the port. - * - * Revision 1.69 2007/10/27 13:02:27 fabiankeil - * Relocate daemon-mode-related log messages to make sure - * they aren't shown again in case of configuration reloads. - * - * Revision 1.68 2007/10/19 16:32:34 fabiankeil - * Plug memory leak introduced with my last commit. - * - * Revision 1.67 2007/10/14 14:12:41 fabiankeil - * When in daemon mode, close stderr after the configuration file has been - * parsed the first time. If logfile isn't set, stop logging. Fixes BR#897436. - * - * Revision 1.66 2007/08/05 14:02:09 fabiankeil - * #1763173 from Stefan Huehner: declare unload_configfile() static. - * - * Revision 1.65 2007/07/21 11:51:36 fabiankeil - * As Hal noticed, checking dispatch_cgi() as the last cruncher - * looks like a bug if CGI requests are blocked unintentionally, - * so don't do it unless the user enabled the new config option - * "allow-cgi-request-crunching". - * - * Revision 1.64 2007/05/21 10:44:08 fabiankeil - * - Use strlcpy() instead of strcpy(). - * - Stop treating actions files special. Expect a complete file name - * (with or without path) like it's done for the rest of the files. - * Closes FR#588084. - * - Remove an unnecessary temporary memory allocation. - * - Don't log anything to the console when running as - * daemon and no errors occurred. - * - * Revision 1.63 2007/04/09 18:11:36 fabiankeil - * Don't mistake VC++'s _snprintf() for a snprintf() replacement. - * - * Revision 1.62 2007/03/17 15:20:05 fabiankeil - * New config option: enforce-blocks. - * - * Revision 1.61 2007/03/16 16:47:35 fabiankeil - * - Mention other reasons why acl directive loading might have failed. - * - Don't log the acl source if the acl destination is to blame. - * - * Revision 1.60 2007/01/27 13:09:16 fabiankeil - * Add new config option "templdir" to - * change the templates directory. - * - * Revision 1.59 2006/12/31 17:56:38 fabiankeil - * Added config option accept-intercepted-requests - * and disabled it by default. - * - * Revision 1.58 2006/12/31 14:24:29 fabiankeil - * Fix gcc43 compiler warnings. - * - * Revision 1.57 2006/12/21 12:57:48 fabiankeil - * Add config option "split-large-forms" - * to work around the browser bug reported - * in BR #1570678. - * - * Revision 1.56 2006/12/17 17:04:51 fabiankeil - * Move the
in the generated HTML for the config - * options from the beginning of the string to its end. - * Keeps the white space in balance. - * - * Revision 1.55 2006/11/28 15:31:52 fabiankeil - * Fix memory leak in case of config file reloads. - * - * Revision 1.54 2006/10/21 16:04:22 fabiankeil - * Modified kludge for win32 to make ming32 menu - * "Options/Edit Filters" (sort of) work again. - * Same limitations as for the action files apply. - * Fixes BR 1567373. - * - * Revision 1.53 2006/09/06 18:45:03 fabiankeil - * Incorporate modified version of Roland Rosenfeld's patch to - * optionally access the user-manual via Privoxy. Closes patch 679075. - * - * Formatting changed to Privoxy style, added call to - * cgi_error_no_template if the requested file doesn't - * exist and modified check whether or not Privoxy itself - * should serve the manual. Should work cross-platform now. - * - * Revision 1.52 2006/09/06 10:43:32 fabiankeil - * Added config option enable-remote-http-toggle - * to specify if Privoxy should recognize special - * headers (currently only X-Filter) to change its - * behaviour. Disabled by default. - * - * Revision 1.51 2006/09/06 09:23:37 fabiankeil - * Make number of retries in case of forwarded-connect problems - * a config file option (forwarded-connect-retries) and use 0 as - * default. - * - * Revision 1.50 2006/07/18 14:48:46 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.48.2.7 2006/02/02 17:29:16 david__schmidt - * Don't forget to malloc space for the null terminator... - * - * Revision 1.48.2.6 2006/01/29 23:10:56 david__schmidt - * Multiple filter file support - * - * Revision 1.48.2.5 2003/05/08 15:17:25 oes - * Closed two memory leaks; hopefully the last remaining ones - * (in the main execution paths, anyway). - * - * Revision 1.48.2.4 2003/04/11 12:06:14 oes - * Addressed bug #719435 - * - Extraneous filterfile directives now logged as errors - * - This and unrecnonised directives now really obvious on status page - * - * Revision 1.48.2.3 2003/03/11 11:53:59 oes - * Cosmetic: Renamed cryptic variable - * - * Revision 1.48.2.2 2002/11/12 16:28:20 oes - * Move unrelated variable declaration out of #ifdef FEATURE_ACL; fixes bug #636655 - * - * Revision 1.48.2.1 2002/08/21 17:58:05 oes - * Temp kludge to let user and default action file be edited through win32 GUI (FR 592080) - * - * Revision 1.48 2002/05/14 21:30:38 oes - * savearg now uses own linking code instead of (now special-cased) add_help_link - * - * Revision 1.47 2002/05/12 21:36:29 jongfoster - * Correcting function comments - * - * Revision 1.46 2002/04/26 12:55:14 oes - * - New option "user-manual", defaults to our site - * via project.h #define - * - savearg now embeds option names in help links - * - * Revision 1.45 2002/04/24 02:11:54 oes - * Jon's multiple AF patch: Allow up to MAX_AF_FILES actionsfile options - * - * Revision 1.44 2002/04/08 20:37:13 swa - * fixed JB spelling - * - * Revision 1.43 2002/04/08 20:36:50 swa - * fixed JB spelling - * - * Revision 1.42 2002/04/05 15:50:15 oes - * fix for invalid HTML proxy_args - * - * Revision 1.41 2002/03/31 17:19:00 jongfoster - * Win32 only: Enabling STRICT to fix a VC++ compile warning. - * - * Revision 1.40 2002/03/26 22:29:55 swa - * we have a new homepage! - * - * Revision 1.39 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.38 2002/03/24 13:05:48 jongfoster - * Renaming re_filterfile to filterfile - * - * Revision 1.37 2002/03/16 23:54:06 jongfoster - * Adding graceful termination feature, to help look for memory leaks. - * If you enable this (which, by design, has to be done by hand - * editing config.h) and then go to http://i.j.b/die, then the program - * will exit cleanly after the *next* request. It should free all the - * memory that was used. - * - * Revision 1.36 2002/03/13 00:27:05 jongfoster - * Killing warnings - * - * Revision 1.35 2002/03/07 03:52:44 oes - * Set logging to tty for --no-daemon mode - * - * Revision 1.34 2002/03/06 23:14:35 jongfoster - * Trivial cosmetic changes to make function comments easier to find. - * - * Revision 1.33 2002/03/05 04:52:42 oes - * Deleted non-errlog debugging code - * - * Revision 1.32 2002/03/04 18:24:53 oes - * Re-enabled output of unknown config directive hash - * - * Revision 1.31 2002/03/03 15:07:20 oes - * Re-enabled automatic config reloading - * - * Revision 1.30 2002/01/22 23:31:43 jongfoster - * Replacing strsav() with string_append() - * - * Revision 1.29 2002/01/17 21:02:30 jongfoster - * Moving all our URL and URL pattern parsing code to urlmatch.c. - * - * Renaming free_url to free_url_spec, since it frees a struct url_spec. - * - * Revision 1.28 2001/12/30 14:07:32 steudten - * - Add signal handling (unix) - * - Add SIGHUP handler (unix) - * - Add creation of pidfile (unix) - * - Add action 'top' in rc file (RH) - * - Add entry 'SIGNALS' to manpage - * - Add exit message to logfile (unix) - * - * Revision 1.27 2001/11/07 00:02:13 steudten - * Add line number in error output for lineparsing for - * actionsfile and configfile. - * Special handling for CLF added. - * - * Revision 1.26 2001/11/05 21:41:43 steudten - * Add changes to be a real daemon just for unix os. - * (change cwd to /, detach from controlling tty, set - * process group and session leader to the own process. - * Add DBG() Macro. - * Add some fatal-error log message for failed malloc(). - * Add '-d' if compiled with 'configure --with-debug' to - * enable debug output. - * - * Revision 1.25 2001/10/25 03:40:48 david__schmidt - * Change in porting tactics: OS/2's EMX porting layer doesn't allow multiple - * threads to call select() simultaneously. So, it's time to do a real, live, - * native OS/2 port. See defines for __EMX__ (the porting layer) vs. __OS2__ - * (native). Both versions will work, but using __OS2__ offers multi-threading. - * - * Revision 1.24 2001/10/23 21:40:30 jongfoster - * Added support for enable-edit-actions and enable-remote-toggle config - * file options. - * - * Revision 1.23 2001/10/07 15:36:00 oes - * Introduced new config option "buffer-limit" - * - * Revision 1.22 2001/09/22 16:36:59 jongfoster - * Removing unused parameter fs from read_config_line() - * - * Revision 1.21 2001/09/16 17:10:43 jongfoster - * Moving function savearg() here, since it was the only thing left in - * showargs.c. - * - * Revision 1.20 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.19 2001/07/15 17:45:16 jongfoster - * Removing some unused #includes - * - * Revision 1.18 2001/07/13 14:01:14 oes - * - Removed all #ifdef PCRS - * - Removed vim-settings - * - * Revision 1.17 2001/06/29 13:31:03 oes - * - Improved comments - * - Fixed (actionsfile) and sorted hashes - * - Introduced admin_address and proxy-info-url - * as config parameters - * - Renamed config->proxy_args_invocation (which didn't have - * the invocation but the options!) to config->proxy_args - * - Various adaptions - * - Removed logentry from cancelled commit - * - * Revision 1.16 2001/06/09 10:55:28 jongfoster - * Changing BUFSIZ ==> BUFFER_SIZE - * - * Revision 1.15 2001/06/07 23:13:40 jongfoster - * Merging ACL and forward files into config file. - * Cosmetic: Sorting config file options alphabetically. - * Cosmetic: Adding brief syntax comments to config file options. - * - * Revision 1.14 2001/06/07 14:46:25 joergs - * Missing make_path() added for re_filterfile. - * - * Revision 1.13 2001/06/05 22:33:54 jongfoster - * - * Fixed minor memory leak. - * Also now uses make_path to prepend the pathnames. - * - * Revision 1.12 2001/06/05 20:04:09 jongfoster - * Now uses _snprintf() in place of snprintf() under Win32. - * - * Revision 1.11 2001/06/04 18:31:58 swa - * files are now prefixed with either `confdir' or `logdir'. - * `make redhat-dist' replaces both entries confdir and logdir - * with redhat values - * - * Revision 1.10 2001/06/03 19:11:54 oes - * introduced confdir option - * - * Revision 1.9 2001/06/01 20:06:24 jongfoster - * Removed support for "tinygif" option - moved to actions file. - * - * Revision 1.8 2001/05/31 21:27:13 jongfoster - * Removed many options from the config file and into the - * "actions" file: add_forwarded, suppress_vanilla_wafer, - * wafer, add_header, user_agent, referer, from - * Also globally replaced "permission" with "action". - * - * Revision 1.7 2001/05/29 09:50:24 jongfoster - * Unified blocklist/imagelist/permissionslist. - * File format is still under discussion, but the internal changes - * are (mostly) done. - * - * Also modified interceptor behaviour: - * - We now intercept all URLs beginning with one of the following - * prefixes (and *only* these prefixes): - * * http://i.j.b/ - * * http://ijbswa.sf.net/config/ - * * http://ijbswa.sourceforge.net/config/ - * - New interceptors "home page" - go to http://i.j.b/ to see it. - * - Internal changes so that intercepted and fast redirect pages - * are not replaced with an image. - * - Interceptors now have the option to send a binary page direct - * to the client. (i.e. ijb-send-banner uses this) - * - Implemented show-url-info interceptor. (Which is why I needed - * the above interceptors changes - a typical URL is - * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". - * The previous mechanism would not have intercepted that, and - * if it had been intercepted then it then it would have replaced - * it with an image.) - * - * Revision 1.6 2001/05/26 00:28:36 jongfoster - * Automatic reloading of config file. - * Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32). - * Most of the global variables have been moved to a new - * struct configuration_spec, accessed through csp->config->globalname - * Most of the globals remaining are used by the Win32 GUI. - * - * Revision 1.5 2001/05/25 22:34:30 jongfoster - * Hard tabs->Spaces - * - * Revision 1.4 2001/05/22 18:46:04 oes - * - * - Enabled filtering banners by size rather than URL - * by adding patterns that replace all standard banner - * sizes with the "Junkbuster" gif to the re_filterfile - * - * - Enabled filtering WebBugs by providing a pattern - * which kills all 1x1 images - * - * - Added support for PCRE_UNGREEDY behaviour to pcrs, - * which is selected by the (nonstandard and therefore - * capital) letter 'U' in the option string. - * It causes the quantifiers to be ungreedy by default. - * Appending a ? turns back to greedy (!). - * - * - Added a new interceptor ijb-send-banner, which - * sends back the "Junkbuster" gif. Without imagelist or - * MSIE detection support, or if tinygif = 1, or the - * URL isn't recognized as an imageurl, a lame HTML - * explanation is sent instead. - * - * - Added new feature, which permits blocking remote - * script redirects and firing back a local redirect - * to the browser. - * The feature is conditionally compiled, i.e. it - * can be disabled with --disable-fast-redirects, - * plus it must be activated by a "fast-redirects" - * line in the config file, has its own log level - * and of course wants to be displayed by show-proxy-args - * Note: Boy, all the #ifdefs in 1001 locations and - * all the fumbling with configure.in and acconfig.h - * were *way* more work than the feature itself :-( - * - * - Because a generic redirect template was needed for - * this, tinygif = 3 now uses the same. - * - * - Moved GIFs, and other static HTTP response templates - * to project.h - * - * - Some minor fixes - * - * - Removed some >400 CRs again (Jon, you really worked - * a lot! ;-) - * - * Revision 1.3 2001/05/20 01:21:20 jongfoster - * Version 2.9.4 checkin. - * - Merged popupfile and cookiefile, and added control over PCRS - * filtering, in new "permissionsfile". - * - Implemented LOG_LEVEL_FATAL, so that if there is a configuration - * file error you now get a message box (in the Win32 GUI) rather - * than the program exiting with no explanation. - * - Made killpopup use the PCRS MIME-type checking and HTTP-header - * skipping. - * - Removed tabs from "config" - * - Moved duplicated url parsing code in "loaders.c" to a new funcition. - * - Bumped up version number. - * - * Revision 1.2 2001/05/17 23:01:01 oes - * - Cleaned CRLF's from the sources and related files - * - * Revision 1.1.1.1 2001/05/15 13:58:58 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include "config.h" @@ -594,7 +111,7 @@ const char *configfile = NULL; * so we will make argc and argv global. */ int Argc = 0; -const char **Argv = NULL; +char * const * Argv = NULL; static struct file_list *current_configfile = NULL; @@ -616,10 +133,14 @@ static struct file_list *current_configfile = NULL; #define hash_admin_address 4112573064ul /* "admin-address" */ #define hash_allow_cgi_request_crunching 258915987ul /* "allow-cgi-request-crunching" */ #define hash_buffer_limit 1881726070ul /* "buffer-limit */ +#define hash_compression_level 2464423563ul /* "compression-level" */ #define hash_confdir 1978389ul /* "confdir" */ +#define hash_connection_sharing 1348841265ul /* "connection-sharing" */ #define hash_debug 78263ul /* "debug" */ +#define hash_default_server_timeout 2530089913ul /* "default-server-timeout" */ #define hash_deny_access 1227333715ul /* "deny-access" */ #define hash_enable_edit_actions 2517097536ul /* "enable-edit-actions" */ +#define hash_enable_compression 3943696946ul /* "enable-compression" */ #define hash_enable_remote_toggle 2979744683ul /* "enable-remote-toggle" */ #define hash_enable_remote_http_toggle 110543988ul /* "enable-remote-http-toggle" */ #define hash_enforce_blocks 1862427469ul /* "enforce-blocks" */ @@ -629,11 +150,13 @@ static struct file_list *current_configfile = NULL; #define hash_forward_socks4a 2639958518ul /* "forward-socks4a" */ #define hash_forward_socks5 3963965522ul /* "forward-socks5" */ #define hash_forwarded_connect_retries 101465292ul /* "forwarded-connect-retries" */ +#define hash_handle_as_empty_returns_ok 1444873247ul /* "handle-as-empty-doc-returns-ok" */ #define hash_hostname 10308071ul /* "hostname" */ #define hash_keep_alive_timeout 3878599515ul /* "keep-alive-timeout" */ #define hash_listen_address 1255650842ul /* "listen-address" */ #define hash_logdir 422889ul /* "logdir" */ #define hash_logfile 2114766ul /* "logfile" */ +#define hash_max_client_connections 3595884446ul /* "max-client-connections" */ #define hash_permit_access 3587953268ul /* "permit-access" */ #define hash_proxy_info_url 3903079059ul /* "proxy-info-url" */ #define hash_single_threaded 4250084780ul /* "single-threaded" */ @@ -706,7 +229,10 @@ static void unload_configfile (void * data) freez(config->templdir); freez(config->hostname); - freez(config->haddr); + for (i = 0; i < MAX_LISTENING_SOCKETS; i++) + { + freez(config->haddr[i]); + } freez(config->logfile); for (i = 0; i < MAX_AF_FILES; i++) @@ -727,11 +253,6 @@ static void unload_configfile (void * data) list_remove_all(config->trust_info); #endif /* def FEATURE_TRUST */ - for (i = 0; i < MAX_AF_FILES; i++) - { - freez(config->re_filterfile[i]); - } - freez(config); } @@ -760,6 +281,51 @@ void unload_current_config_file(void) #endif +/********************************************************************* + * + * Function : parse_toggle_value + * + * Description : Parse the value of a directive that can only be + * enabled or disabled. Terminates with a fatal error + * if the value is NULL or something other than 0 or 1. + * + * Parameters : + * 1 : name: The name of the directive. Used for log messages. + * 2 : value: The value to parse + * + * + * Returns : The numerical toggle state + * + *********************************************************************/ +static int parse_toggle_state(const char *name, const char *value) +{ + int toggle_state; + assert(name != NULL); + assert(value != NULL); + + if ((value == NULL) || (*value == '\0')) + { + log_error(LOG_LEVEL_FATAL, "Directive %s used without argument", name); + } + + toggle_state = atoi(value); + + /* + * Also check the length as atoi() doesn't mind + * garbage after a valid integer, but we do. + */ + if (((toggle_state != 0) && (toggle_state != 1)) || (strlen(value) != 1)) + { + log_error(LOG_LEVEL_FATAL, + "Directive %s used with invalid argument '%s'. Use either '0' or '1'.", + name, value); + } + + return toggle_state; + +} + + /********************************************************************* * * Function : load_config @@ -776,7 +342,7 @@ void unload_current_config_file(void) *********************************************************************/ struct configuration_spec * load_config(void) { - char buf[BUFFER_SIZE]; + char *buf = NULL; char *p, *q; FILE *configfp = NULL; struct configuration_spec * config = NULL; @@ -785,9 +351,6 @@ struct configuration_spec * load_config(void) unsigned long linenum = 0; int i; char *logfile = NULL; -#ifdef FEATURE_CONNECTION_KEEP_ALIVE - int keep_alive_timeout = DEFAULT_KEEP_ALIVE_TIMEOUT; -#endif if (!check_file_changed(current_configfile, configfile, &fs)) { @@ -835,15 +398,29 @@ struct configuration_spec * load_config(void) * Set to defaults */ config->multi_threaded = 1; - config->hport = HADDR_PORT; config->buffer_limit = 4096 * 1024; config->usermanual = strdup(USER_MANUAL_URL); config->proxy_args = strdup(""); config->forwarded_connect_retries = 0; + config->max_client_connections = 0; config->socket_timeout = 300; /* XXX: Should be a macro. */ +#ifdef FEATURE_CONNECTION_KEEP_ALIVE + config->default_server_timeout = 0; + config->keep_alive_timeout = DEFAULT_KEEP_ALIVE_TIMEOUT; + config->feature_flags &= ~RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE; + config->feature_flags &= ~RUNTIME_FEATURE_CONNECTION_SHARING; +#endif config->feature_flags &= ~RUNTIME_FEATURE_CGI_TOGGLE; config->feature_flags &= ~RUNTIME_FEATURE_SPLIT_LARGE_FORMS; config->feature_flags &= ~RUNTIME_FEATURE_ACCEPT_INTERCEPTED_REQUESTS; + config->feature_flags &= ~RUNTIME_FEATURE_EMPTY_DOC_RETURNS_OK; +#ifdef FEATURE_COMPRESSION + config->feature_flags &= ~RUNTIME_FEATURE_COMPRESSION; + /* + * XXX: Run some benchmarks to see if there are better default values. + */ + config->compression_level = 1; +#endif configfp = fopen(configfile, "r"); if (NULL == configfp) @@ -853,7 +430,7 @@ struct configuration_spec * load_config(void) /* Never get here - LOG_LEVEL_FATAL causes program exit */ } - while (read_config_line(buf, sizeof(buf), configfp, &linenum) != NULL) + while (read_config_line(configfp, &linenum, &buf) != NULL) { char cmd[BUFFER_SIZE]; char arg[BUFFER_SIZE]; @@ -884,11 +461,15 @@ struct configuration_spec * load_config(void) } /* Copy the argument into arg */ - strlcpy(arg, p, sizeof(arg)); + if (strlcpy(arg, p, sizeof(arg)) >= sizeof(arg)) + { + log_error(LOG_LEVEL_FATAL, "Config line too long: %s", buf); + } /* Should never happen, but check this anyway */ if (*cmd == '\0') { + freez(buf); continue; } @@ -929,7 +510,7 @@ struct configuration_spec * load_config(void) * accept-intercepted-requests * *************************************************************************/ case hash_accept_intercepted_requests: - if ((*arg != '\0') && (0 != atoi(arg))) + if (parse_toggle_state(cmd, arg) == 1) { config->feature_flags |= RUNTIME_FEATURE_ACCEPT_INTERCEPTED_REQUESTS; } @@ -951,7 +532,7 @@ struct configuration_spec * load_config(void) * allow-cgi-request-crunching * *************************************************************************/ case hash_allow_cgi_request_crunching: - if ((*arg != '\0') && (0 != atoi(arg))) + if (parse_toggle_state(cmd, arg) == 1) { config->feature_flags |= RUNTIME_FEATURE_CGI_CRUNCHING; } @@ -976,6 +557,48 @@ struct configuration_spec * load_config(void) config->confdir = make_path( NULL, arg); break; +/* ************************************************************************* + * compression-level 0-9 + * *************************************************************************/ +#ifdef FEATURE_COMPRESSION + case hash_compression_level : + if (*arg != '\0') + { + int compression_level = atoi(arg); + if (-1 <= compression_level && compression_level <= 9) + { + config->compression_level = compression_level;; + } + else + { + log_error(LOG_LEVEL_FATAL, + "Invalid compression-level value: %s", arg); + } + } + else + { + log_error(LOG_LEVEL_FATAL, + "Invalid compression-level directive. Compression value missing"); + } + break; +#endif + +/* ************************************************************************* + * connection-sharing (0|1) + * *************************************************************************/ +#ifdef FEATURE_CONNECTION_SHARING + case hash_connection_sharing : + if (parse_toggle_state(cmd, arg) == 1) + { + config->feature_flags |= RUNTIME_FEATURE_CONNECTION_SHARING; + } + else + { + config->feature_flags &= ~RUNTIME_FEATURE_CONNECTION_SHARING; + } + break; +#endif + /* ************************************************************************* * debug n * Specifies debug level, multiple values are ORed together. @@ -984,6 +607,27 @@ struct configuration_spec * load_config(void) config->debug |= atoi(arg); break; +/* ************************************************************************* + * default-server-timeout timeout + * *************************************************************************/ +#ifdef FEATURE_CONNECTION_KEEP_ALIVE + case hash_default_server_timeout : + if (*arg != '\0') + { + int timeout = atoi(arg); + if (0 < timeout) + { + config->default_server_timeout = (unsigned int)timeout; + } + else + { + log_error(LOG_LEVEL_FATAL, + "Invalid default-server-timeout value: %s", arg); + } + } + break; +#endif + /* ************************************************************************* * deny-access source-ip[/significant-bits] [dest-ip[/significant-bits]] * *************************************************************************/ @@ -1044,6 +688,12 @@ struct configuration_spec * load_config(void) break; } } +#ifdef HAVE_RFC2553 + else + { + cur_acl->wildcard_dst = 1; + } +#endif /* def HAVE_RFC2553 */ /* * Add it to the list. Note we reverse the list to get the @@ -1065,7 +715,7 @@ struct configuration_spec * load_config(void) * *************************************************************************/ #ifdef FEATURE_CGI_EDIT_ACTIONS case hash_enable_edit_actions: - if ((*arg != '\0') && (0 != atoi(arg))) + if (parse_toggle_state(cmd, arg) == 1) { config->feature_flags |= RUNTIME_FEATURE_CGI_EDIT_ACTIONS; } @@ -1076,12 +726,29 @@ struct configuration_spec * load_config(void) break; #endif /* def FEATURE_CGI_EDIT_ACTIONS */ +/* ************************************************************************* + * enable-compression 0|1 + * *************************************************************************/ +#ifdef FEATURE_COMPRESSION + case hash_enable_compression: + if (parse_toggle_state(cmd, arg) == 1) + { + config->feature_flags |= RUNTIME_FEATURE_COMPRESSION; + } + else + { + config->feature_flags &= ~RUNTIME_FEATURE_COMPRESSION; + } + break; +#endif /* def FEATURE_COMPRESSION */ + + /* ************************************************************************* * enable-remote-toggle 0|1 * *************************************************************************/ #ifdef FEATURE_TOGGLE case hash_enable_remote_toggle: - if ((*arg != '\0') && (0 != atoi(arg))) + if (parse_toggle_state(cmd, arg) == 1) { config->feature_flags |= RUNTIME_FEATURE_CGI_TOGGLE; } @@ -1096,7 +763,7 @@ struct configuration_spec * load_config(void) * enable-remote-http-toggle 0|1 * *************************************************************************/ case hash_enable_remote_http_toggle: - if ((*arg != '\0') && (0 != atoi(arg))) + if (parse_toggle_state(cmd, arg) == 1) { config->feature_flags |= RUNTIME_FEATURE_HTTP_TOGGLE; } @@ -1111,7 +778,7 @@ struct configuration_spec * load_config(void) * *************************************************************************/ case hash_enforce_blocks: #ifdef FEATURE_FORCE_LOAD - if ((*arg != '\0') && (0 != atoi(arg))) + if (parse_toggle_state(cmd, arg) == 1) { config->feature_flags |= RUNTIME_FEATURE_ENFORCE_BLOCKS; } @@ -1191,18 +858,9 @@ struct configuration_spec * load_config(void) if (strcmp(p, ".") != 0) { - cur_fwd->forward_host = strdup(p); - - if (NULL != (p = strchr(cur_fwd->forward_host, ':'))) - { - *p++ = '\0'; - cur_fwd->forward_port = atoi(p); - } - - if (cur_fwd->forward_port <= 0) - { - cur_fwd->forward_port = 8000; - } + cur_fwd->forward_port = 8000; + parse_forwarder_address(p, &cur_fwd->forward_host, + &cur_fwd->forward_port); } /* Add to list. */ @@ -1253,19 +911,12 @@ struct configuration_spec * load_config(void) /* Parse the SOCKS proxy host[:port] */ p = vec[1]; + /* XXX: This check looks like a bug. */ if (strcmp(p, ".") != 0) { - cur_fwd->gateway_host = strdup(p); - - if (NULL != (p = strchr(cur_fwd->gateway_host, ':'))) - { - *p++ = '\0'; - cur_fwd->gateway_port = atoi(p); - } - if (cur_fwd->gateway_port <= 0) - { - cur_fwd->gateway_port = 1080; - } + cur_fwd->gateway_port = 1080; + parse_forwarder_address(p, &cur_fwd->gateway_host, + &cur_fwd->gateway_port); } /* Parse the parent HTTP proxy host[:port] */ @@ -1273,18 +924,9 @@ struct configuration_spec * load_config(void) if (strcmp(p, ".") != 0) { - cur_fwd->forward_host = strdup(p); - - if (NULL != (p = strchr(cur_fwd->forward_host, ':'))) - { - *p++ = '\0'; - cur_fwd->forward_port = atoi(p); - } - - if (cur_fwd->forward_port <= 0) - { - cur_fwd->forward_port = 8000; - } + cur_fwd->forward_port = 8000; + parse_forwarder_address(p, &cur_fwd->forward_host, + &cur_fwd->forward_port); } /* Add to list. */ @@ -1343,35 +985,18 @@ struct configuration_spec * load_config(void) /* Parse the SOCKS proxy host[:port] */ p = vec[1]; - cur_fwd->gateway_host = strdup(p); - - if (NULL != (p = strchr(cur_fwd->gateway_host, ':'))) - { - *p++ = '\0'; - cur_fwd->gateway_port = atoi(p); - } - if (cur_fwd->gateway_port <= 0) - { - cur_fwd->gateway_port = 1080; - } + cur_fwd->gateway_port = 1080; + parse_forwarder_address(p, &cur_fwd->gateway_host, + &cur_fwd->gateway_port); /* Parse the parent HTTP proxy host[:port] */ p = vec[2]; if (strcmp(p, ".") != 0) { - cur_fwd->forward_host = strdup(p); - - if (NULL != (p = strchr(cur_fwd->forward_host, ':'))) - { - *p++ = '\0'; - cur_fwd->forward_port = atoi(p); - } - - if (cur_fwd->forward_port <= 0) - { - cur_fwd->forward_port = 8000; - } + cur_fwd->forward_port = 8000; + parse_forwarder_address(p, &cur_fwd->forward_host, + &cur_fwd->forward_port); } /* Add to list. */ @@ -1387,6 +1012,26 @@ struct configuration_spec * load_config(void) config->forwarded_connect_retries = atoi(arg); break; +/* ************************************************************************* + * handle-as-empty-doc-returns-ok 0|1 + * + * Workaround for firefox hanging on blocked javascript pages. + * Block with the "+handle-as-empty-document" flag and set the + * "handle-as-empty-doc-returns-ok" run-time config flag so that + * Privoxy returns a 200/OK status instead of a 403/Forbidden status + * to the browser for blocked pages. + ***************************************************************************/ + case hash_handle_as_empty_returns_ok: + if (parse_toggle_state(cmd, arg) == 1) + { + config->feature_flags |= RUNTIME_FEATURE_EMPTY_DOC_RETURNS_OK; + } + else + { + config->feature_flags &= ~RUNTIME_FEATURE_EMPTY_DOC_RETURNS_OK; + } + break; + /* ************************************************************************* * hostname hostname-to-show-on-cgi-pages * *************************************************************************/ @@ -1407,10 +1052,10 @@ struct configuration_spec * load_config(void) if (*arg != '\0') { int timeout = atoi(arg); - if (0 <= timeout) + if (0 < timeout) { config->feature_flags |= RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE; - keep_alive_timeout = timeout; + config->keep_alive_timeout = (unsigned int)timeout; } else { @@ -1424,8 +1069,23 @@ struct configuration_spec * load_config(void) * listen-address [ip][:port] * *************************************************************************/ case hash_listen_address : - freez(config->haddr); - config->haddr = strdup(arg); + i = 0; + while ((i < MAX_LISTENING_SOCKETS) && (NULL != config->haddr[i])) + { + i++; + } + + if (i >= MAX_LISTENING_SOCKETS) + { + log_error(LOG_LEVEL_FATAL, "Too many 'listen-address' directives in config file - limit is %d.\n" + "(You can increase this limit by changing MAX_LISTENING_SOCKETS in project.h and recompiling).", + MAX_LISTENING_SOCKETS); + } + config->haddr[i] = strdup(arg); + if (NULL == config->haddr[i]) + { + log_error(LOG_LEVEL_FATAL, "Out of memory while copying listening address"); + } break; /* ************************************************************************* @@ -1441,7 +1101,7 @@ struct configuration_spec * load_config(void) * In logdir by default * *************************************************************************/ case hash_logfile : - if (!no_daemon) + if (daemon_mode) { logfile = make_path(config->logdir, arg); if (NULL == logfile) @@ -1451,6 +1111,20 @@ struct configuration_spec * load_config(void) } break; +/* ************************************************************************* + * max-client-connections number + * *************************************************************************/ + case hash_max_client_connections : + if (*arg != '\0') + { + int max_client_connections = atoi(arg); + if (0 <= max_client_connections) + { + config->max_client_connections = max_client_connections; + } + } + break; + /* ************************************************************************* * permit-access source-ip[/significant-bits] [dest-ip[/significant-bits]] * *************************************************************************/ @@ -1512,6 +1186,12 @@ struct configuration_spec * load_config(void) break; } } +#ifdef HAVE_RFC2553 + else + { + cur_acl->wildcard_dst = 1; + } +#endif /* def HAVE_RFC2553 */ /* * Add it to the list. Note we reverse the list to get the @@ -1566,7 +1246,7 @@ struct configuration_spec * load_config(void) * split-large-cgi-forms * *************************************************************************/ case hash_split_large_cgi_forms : - if ((*arg != '\0') && (0 != atoi(arg))) + if (parse_toggle_state(cmd, arg) == 1) { config->feature_flags |= RUNTIME_FEATURE_SPLIT_LARGE_FORMS; } @@ -1778,7 +1458,7 @@ struct configuration_spec * load_config(void) /* Save the argument for the show-status page. */ savearg(cmd, arg, config); - + freez(buf); } /* end while ( read_config_line(...) ) */ fclose(configfp); @@ -1787,7 +1467,7 @@ struct configuration_spec * load_config(void) freez(config->logfile); - if (!no_daemon) + if (daemon_mode) { if (NULL != logfile) { @@ -1801,11 +1481,21 @@ struct configuration_spec * load_config(void) } #ifdef FEATURE_CONNECTION_KEEP_ALIVE + if (config->default_server_timeout > config->keep_alive_timeout) + { + log_error(LOG_LEVEL_ERROR, + "Reducing the default-server-timeout from %d to the keep-alive-timeout %d.", + config->default_server_timeout, config->keep_alive_timeout); + config->default_server_timeout = config->keep_alive_timeout; + } +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ + +#ifdef FEATURE_CONNECTION_SHARING if (config->feature_flags & RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE) { if (config->multi_threaded) { - set_keep_alive_timeout(keep_alive_timeout); + set_keep_alive_timeout(config->keep_alive_timeout); } else { @@ -1814,29 +1504,37 @@ struct configuration_spec * load_config(void) * if we didn't bother with enforcing the connection timeout, * that might make Tor users sad, even though they shouldn't * enable the single-threaded option anyway. + * + * XXX: We could still use Proxy-Connection: keep-alive. */ config->feature_flags &= ~RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE; log_error(LOG_LEVEL_ERROR, "Config option single-threaded disables connection keep-alive."); } } -#endif + else if ((config->feature_flags & RUNTIME_FEATURE_CONNECTION_SHARING)) + { + log_error(LOG_LEVEL_ERROR, "Config option connection-sharing " + "has no effect if keep-alive-timeout isn't set."); + config->feature_flags &= ~RUNTIME_FEATURE_CONNECTION_SHARING; + } +#endif /* def FEATURE_CONNECTION_SHARING */ if (NULL == config->proxy_args) { log_error(LOG_LEVEL_FATAL, "Out of memory loading config - insufficient memory for config->proxy_args"); } - if (config->actions_file[0]) - { - add_loader(load_action_files, config); - } - if (config->re_filterfile[0]) { add_loader(load_re_filterfiles, config); } + if (config->actions_file[0]) + { + add_loader(load_action_files, config); + } + #ifdef FEATURE_TRUST if (config->trustfile) { @@ -1844,35 +1542,45 @@ struct configuration_spec * load_config(void) } #endif /* def FEATURE_TRUST */ - if ( NULL == config->haddr ) + if ( NULL == config->haddr[0] ) { - config->haddr = strdup( HADDR_DEFAULT ); + config->haddr[0] = strdup( HADDR_DEFAULT ); + if (NULL == config->haddr[0]) + { + log_error(LOG_LEVEL_FATAL, "Out of memory while copying default listening address"); + } } - if ( NULL != config->haddr ) + for (i = 0; i < MAX_LISTENING_SOCKETS && NULL != config->haddr[i]; i++) { - if (NULL != (p = strchr(config->haddr, ':'))) + if ((*config->haddr[i] == '[') + && (NULL != (p = strchr(config->haddr[i], ']'))) + && (p[1] == ':') + && (0 < (config->hport[i] = atoi(p + 2)))) { - *p++ = '\0'; - if (*p) - { - config->hport = atoi(p); - } + *p = '\0'; + memmove((void *)config->haddr[i], config->haddr[i] + 1, + (size_t)(p - config->haddr[i])); } - - if (config->hport <= 0) + else if (NULL != (p = strchr(config->haddr[i], ':')) + && (0 < (config->hport[i] = atoi(p + 1)))) { - *--p = ':'; - log_error(LOG_LEVEL_FATAL, "invalid bind port spec %s", config->haddr); + *p = '\0'; + } + else + { + log_error(LOG_LEVEL_FATAL, "invalid bind port spec %s", config->haddr[i]); /* Never get here - LOG_LEVEL_FATAL causes program exit */ } - if (*config->haddr == '\0') + if (*config->haddr[i] == '\0') { /* - * Only the port specified. We stored it in config->hport + * Only the port specified. We stored it in config->hport[i] * and don't need its text representation anymore. + * Use config->hport[i] == 0 to iterate listening addresses since + * now. */ - freez(config->haddr); + freez(config->haddr[i]); } } @@ -1896,8 +1604,9 @@ struct configuration_spec * load_config(void) #if defined(_WIN32) && !defined (_WIN_CONSOLE) g_default_actions_file = config->actions_file[1]; /* FIXME Hope this is default.action */ - g_user_actions_file = config->actions_file[2]; /* FIXME Hope this is user.action */ - g_re_filterfile = config->re_filterfile[0]; /* FIXME Hope this is default.filter */ + g_user_actions_file = config->actions_file[2]; /* FIXME Hope this is user.action */ + g_default_filterfile = config->re_filterfile[0]; /* FIXME Hope this is default.filter */ + g_user_filterfile = config->re_filterfile[1]; /* FIXME Hope this is user.filter */ #ifdef FEATURE_TRUST g_trustfile = config->trustfile; @@ -1915,30 +1624,34 @@ struct configuration_spec * load_config(void) struct configuration_spec * oldcfg = (struct configuration_spec *) current_configfile->f; /* - * Check if config->haddr,hport == oldcfg->haddr,hport + * Check if config->haddr[i],hport[i] == oldcfg->haddr[i],hport[i] * * The following could be written more compactly as a single, * (unreadably long) if statement. */ config->need_bind = 0; - if (config->hport != oldcfg->hport) + + for (i = 0; i < MAX_LISTENING_SOCKETS; i++) { - config->need_bind = 1; - } - else if (config->haddr == NULL) - { - if (oldcfg->haddr != NULL) + if (config->hport[i] != oldcfg->hport[i]) + { + config->need_bind = 1; + } + else if (config->haddr[i] == NULL) + { + if (oldcfg->haddr[i] != NULL) + { + config->need_bind = 1; + } + } + else if (oldcfg->haddr[i] == NULL) + { + config->need_bind = 1; + } + else if (0 != strcmp(config->haddr[i], oldcfg->haddr[i])) { config->need_bind = 1; } - } - else if (oldcfg->haddr == NULL) - { - config->need_bind = 1; - } - else if (0 != strcmp(config->haddr, oldcfg->haddr)) - { - config->need_bind = 1; } current_configfile->unloader = unload_configfile; diff --git a/external/privoxy/loadcfg.h b/external/privoxy/loadcfg.h index 80fc184f..6154bff4 100644 --- a/external/privoxy/loadcfg.h +++ b/external/privoxy/loadcfg.h @@ -1,12 +1,12 @@ #ifndef LOADCFG_H_INCLUDED #define LOADCFG_H_INCLUDED -#define LOADCFG_H_VERSION "$Id: loadcfg.h,v 1.13 2006/07/18 14:48:46 david__schmidt Exp $" +#define LOADCFG_H_VERSION "$Id: loadcfg.h,v 1.16 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/loadcfg.h,v $ * * Purpose : Loads settings from the configuration file into - * global variables. This file contains both the + * global variables. This file contains both the * routine to load the configuration and the global * variables it writes to. * @@ -14,10 +14,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -35,119 +35,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: loadcfg.h,v $ - * Revision 1.13 2006/07/18 14:48:46 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.11.2.1 2003/03/11 11:53:59 oes - * Cosmetic: Renamed cryptic variable - * - * Revision 1.11 2002/03/26 22:29:55 swa - * we have a new homepage! - * - * Revision 1.10 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.9 2002/03/16 23:54:06 jongfoster - * Adding graceful termination feature, to help look for memory leaks. - * If you enable this (which, by design, has to be done by hand - * editing config.h) and then go to http://i.j.b/die, then the program - * will exit cleanly after the *next* request. It should free all the - * memory that was used. - * - * Revision 1.8 2001/12/30 14:07:32 steudten - * - Add signal handling (unix) - * - Add SIGHUP handler (unix) - * - Add creation of pidfile (unix) - * - Add action 'top' in rc file (RH) - * - Add entry 'SIGNALS' to manpage - * - Add exit message to logfile (unix) - * - * Revision 1.7 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.6 2001/07/29 18:58:15 jongfoster - * Removing nested #includes, adding forward declarations for needed - * structures, and changing the #define _FILENAME_H to FILENAME_H_INCLUDED. - * - * Revision 1.5 2001/05/26 00:28:36 jongfoster - * Automatic reloading of config file. - * Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32). - * Most of the global variables have been moved to a new - * struct configuration_spec, accessed through csp->config->globalname - * Most of the globals remaining are used by the Win32 GUI. - * - * Revision 1.4 2001/05/22 18:46:04 oes - * - * - Enabled filtering banners by size rather than URL - * by adding patterns that replace all standard banner - * sizes with the "Junkbuster" gif to the re_filterfile - * - * - Enabled filtering WebBugs by providing a pattern - * which kills all 1x1 images - * - * - Added support for PCRE_UNGREEDY behaviour to pcrs, - * which is selected by the (nonstandard and therefore - * capital) letter 'U' in the option string. - * It causes the quantifiers to be ungreedy by default. - * Appending a ? turns back to greedy (!). - * - * - Added a new interceptor ijb-send-banner, which - * sends back the "Junkbuster" gif. Without imagelist or - * MSIE detection support, or if tinygif = 1, or the - * URL isn't recognized as an imageurl, a lame HTML - * explanation is sent instead. - * - * - Added new feature, which permits blocking remote - * script redirects and firing back a local redirect - * to the browser. - * The feature is conditionally compiled, i.e. it - * can be disabled with --disable-fast-redirects, - * plus it must be activated by a "fast-redirects" - * line in the config file, has its own log level - * and of course wants to be displayed by show-proxy-args - * Note: Boy, all the #ifdefs in 1001 locations and - * all the fumbling with configure.in and acconfig.h - * were *way* more work than the feature itself :-( - * - * - Because a generic redirect template was needed for - * this, tinygif = 3 now uses the same. - * - * - Moved GIFs, and other static HTTP response templates - * to project.h - * - * - Some minor fixes - * - * - Removed some >400 CRs again (Jon, you really worked - * a lot! ;-) - * - * Revision 1.3 2001/05/20 01:21:20 jongfoster - * Version 2.9.4 checkin. - * - Merged popupfile and cookiefile, and added control over PCRS - * filtering, in new "permissionsfile". - * - Implemented LOG_LEVEL_FATAL, so that if there is a configuration - * file error you now get a message box (in the Win32 GUI) rather - * than the program exiting with no explanation. - * - Made killpopup use the PCRS MIME-type checking and HTTP-header - * skipping. - * - Removed tabs from "config" - * - Moved duplicated url parsing code in "loaders.c" to a new funcition. - * - Bumped up version number. - * - * Revision 1.2 2001/05/17 23:01:01 oes - * - Cleaned CRLF's from the sources and related files - * - * Revision 1.1.1.1 2001/05/15 13:58:58 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #ifdef __cplusplus extern "C" { @@ -172,7 +61,7 @@ extern const char *configfile; * we need to have these globally available. */ extern int Argc; -extern const char **Argv; +extern char * const * Argv; extern short int MustReload; diff --git a/external/privoxy/loaders.c b/external/privoxy/loaders.c index b7966343..f672e5b2 100644 --- a/external/privoxy/loaders.c +++ b/external/privoxy/loaders.c @@ -1,4 +1,4 @@ -const char loaders_rcs[] = "$Id: loaders.c,v 1.71 2009/03/04 18:24:47 fabiankeil Exp $"; +const char loaders_rcs[] = "$Id: loaders.c,v 1.87 2011/11/06 11:53:15 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/loaders.c,v $ @@ -8,7 +8,7 @@ const char loaders_rcs[] = "$Id: loaders.c,v 1.71 2009/03/04 18:24:47 fabiankeil * the list of active loaders, and to automatically * unload files that are no longer in use. * - * Copyright : Written by and Copyright (C) 2001-2009 the + * Copyright : Written by and Copyright (C) 2001-2010 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written @@ -33,353 +33,8 @@ const char loaders_rcs[] = "$Id: loaders.c,v 1.71 2009/03/04 18:24:47 fabiankeil * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: loaders.c,v $ - * Revision 1.71 2009/03/04 18:24:47 fabiankeil - * No need to create empty strings manually, strdup("") FTW. - * - * Revision 1.70 2009/03/01 18:34:24 fabiankeil - * Help clang understand that we aren't dereferencing - * NULL pointers here. - * - * Revision 1.69 2008/09/21 13:36:52 fabiankeil - * If change-x-forwarded-for{add} is used and the client - * sends multiple X-Forwarded-For headers, append the client's - * IP address to each one of them. "Traditionally" we would - * lose all but the last one. - * - * Revision 1.68 2008/09/19 15:26:28 fabiankeil - * Add change-x-forwarded-for{} action to block or add - * X-Forwarded-For headers. Mostly based on code removed - * before 3.0.7. - * - * Revision 1.67 2008/03/30 14:52:08 fabiankeil - * Rename load_actions_file() and load_re_filterfile() - * as they load multiple files "now". - * - * Revision 1.66 2008/03/21 11:16:30 fabiankeil - * Garbage-collect csp->my_ip_addr_str and csp->my_hostname. - * - * Revision 1.65 2007/12/07 18:29:23 fabiankeil - * Remove now-obsolete csp member x_forwarded. - * - * Revision 1.64 2007/06/01 14:12:38 fabiankeil - * Add unload_forward_spec() in preparation for forward-override{}. - * - * Revision 1.63 2007/05/14 10:41:15 fabiankeil - * Ditch the csp member cookie_list[] which isn't used anymore. - * - * Revision 1.62 2007/04/30 15:02:18 fabiankeil - * Introduce dynamic pcrs jobs that can resolve variables. - * - * Revision 1.61 2007/04/15 16:39:21 fabiankeil - * Introduce tags as alternative way to specify which - * actions apply to a request. At the moment tags can be - * created based on client and server headers. - * - * Revision 1.60 2007/03/20 15:16:34 fabiankeil - * Use dedicated header filter actions instead of abusing "filter". - * Replace "filter-client-headers" and "filter-client-headers" - * with "server-header-filter" and "client-header-filter". - * - * Revision 1.59 2007/01/25 13:38:20 fabiankeil - * Freez csp->error_message in sweep(). - * - * Revision 1.58 2006/12/31 14:25:20 fabiankeil - * Fix gcc43 compiler warnings. - * - * Revision 1.57 2006/12/21 12:22:22 fabiankeil - * html_encode filter descriptions. - * - * Have "Ignoring job ..." error messages - * print the filter file name correctly. - * - * Revision 1.56 2006/09/07 10:40:30 fabiankeil - * Turns out trusted referrers above our arbitrary - * limit are downgraded too ordinary trusted URLs. - * Adjusted error message. - * - * Revision 1.55 2006/09/07 10:25:39 fabiankeil - * Fix typo. - * - * Revision 1.54 2006/09/07 10:22:20 fabiankeil - * If too many trusted referrers are used, - * print only one error message instead of logging - * every single trusted referrer above the arbitrary - * limit. - * - * Revision 1.53 2006/08/31 16:25:06 fabiankeil - * Work around a buffer overflow that caused Privoxy to - * segfault if too many trusted referrers were used. Good - * enough for now, but should be replaced with a real - * solution after the next release. - * - * Revision 1.52 2006/07/18 14:48:46 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.50.2.8 2006/01/30 15:16:25 david__schmidt - * Remove a little residual debugging info - * - * Revision 1.50.2.7 2006/01/29 23:10:56 david__schmidt - * Multiple filter file support - * - * Revision 1.50.2.6 2003/10/24 10:17:54 oes - * Nit: Allowed tabs as separators in filter headings - * - * Revision 1.50.2.5 2003/05/08 15:19:15 oes - * sweep: Made loop structure of sweep step mirror that of mark step - * - * Revision 1.50.2.4 2003/05/06 15:57:12 oes - * Bugfix: Update last_active pointer in sweep() before - * leaving an active client. Closes bugs #724395, #727882 - * - * Revision 1.50.2.3 2002/11/20 17:12:30 oes - * Ooops, forgot one change. - * - * Revision 1.50.2.2 2002/11/20 14:38:15 oes - * Fixed delayed/incomplete freeing of client resources and - * simplified loop structure in sweep. - * Thanks to Oliver Stoeneberg for the hint. - * - * Revision 1.50.2.1 2002/07/26 15:19:24 oes - * - PCRS jobs now chained in order of appearance. Previous - * reverse chaining was counter-intuitive. - * - Changed loglevel of PCRS job compile errors to - * LOG_LEVEL_ERROR - * - * Revision 1.50 2002/04/24 02:12:16 oes - * Jon's multiple AF patch: Sweep now takes care of all AFs - * - * Revision 1.49 2002/04/19 16:53:25 jongfoster - * Optimize away a function call by using an equivalent macro - * - * Revision 1.48 2002/04/05 00:56:09 gliptak - * Correcting typo to clean up on realloc failure - * - * Revision 1.47 2002/03/26 22:29:55 swa - * we have a new homepage! - * - * Revision 1.46 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.45 2002/03/16 23:54:06 jongfoster - * Adding graceful termination feature, to help look for memory leaks. - * If you enable this (which, by design, has to be done by hand - * editing config.h) and then go to http://i.j.b/die, then the program - * will exit cleanly after the *next* request. It should free all the - * memory that was used. - * - * Revision 1.44 2002/03/16 21:51:00 jongfoster - * Fixing free(NULL). - * - * Revision 1.43 2002/03/16 20:28:34 oes - * Added descriptions to the filters so users will know what they select in the cgi editor - * - * Revision 1.42 2002/03/13 00:27:05 jongfoster - * Killing warnings - * - * Revision 1.41 2002/03/12 01:42:50 oes - * Introduced modular filters - * - * Revision 1.40 2002/03/08 17:46:04 jongfoster - * Fixing int/size_t warnings - * - * Revision 1.39 2002/03/07 03:46:17 oes - * Fixed compiler warnings - * - * Revision 1.38 2002/03/06 22:54:35 jongfoster - * Automated function-comment nitpicking. - * - * Revision 1.37 2002/03/03 15:07:49 oes - * Re-enabled automatic config reloading - * - * Revision 1.36 2002/01/22 23:46:18 jongfoster - * Moving edit_read_line() and simple_read_line() to loaders.c, and - * extending them to support reading MS-DOS, Mac and UNIX style files - * on all platforms. - * - * Modifying read_config_line() (without changing it's prototype) to - * be a trivial wrapper for edit_read_line(). This means that we have - * one function to read a line and handle comments, which is common - * between the initialization code and the edit interface. - * - * Revision 1.35 2002/01/17 21:03:08 jongfoster - * Moving all our URL and URL pattern parsing code to urlmatch.c. - * - * Renaming free_url to free_url_spec, since it frees a struct url_spec. - * - * Revision 1.34 2001/12/30 14:07:32 steudten - * - Add signal handling (unix) - * - Add SIGHUP handler (unix) - * - Add creation of pidfile (unix) - * - Add action 'top' in rc file (RH) - * - Add entry 'SIGNALS' to manpage - * - Add exit message to logfile (unix) - * - * Revision 1.33 2001/11/13 00:16:38 jongfoster - * Replacing references to malloc.h with the standard stdlib.h - * (See ANSI or K&R 2nd Ed) - * - * Revision 1.32 2001/11/07 00:02:13 steudten - * Add line number in error output for lineparsing for - * actionsfile and configfile. - * Special handling for CLF added. - * - * Revision 1.31 2001/10/26 17:39:01 oes - * Removed csp->referrer - * Moved ijb_isspace and ijb_tolower to project.h - * - * Revision 1.30 2001/10/25 03:40:48 david__schmidt - * Change in porting tactics: OS/2's EMX porting layer doesn't allow multiple - * threads to call select() simultaneously. So, it's time to do a real, live, - * native OS/2 port. See defines for __EMX__ (the porting layer) vs. __OS2__ - * (native). Both versions will work, but using __OS2__ offers multi-threading. - * - * Revision 1.29 2001/10/23 21:38:53 jongfoster - * Adding error-checking to create_url_spec() - * - * Revision 1.28 2001/10/07 15:40:39 oes - * Replaced 6 boolean members of csp with one bitmap (csp->flags) - * - * Revision 1.27 2001/09/22 16:36:59 jongfoster - * Removing unused parameter fs from read_config_line() - * - * Revision 1.26 2001/09/22 14:05:22 jongfoster - * Bugfix: Multiple escaped "#" characters in a configuration - * file are now permitted. - * Also removing 3 unused headers. - * - * Revision 1.25 2001/09/13 22:44:03 jongfoster - * Adding {} to an if statement - * - * Revision 1.24 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.23 2001/07/20 15:51:54 oes - * Fixed indentation of prepocessor commands - * - * Revision 1.22 2001/07/20 15:16:17 haroon - * - per Guy's suggestion, added a while loop in sweep() to catch not just - * the last inactive CSP but all other consecutive inactive CSPs after that - * as well - * - * Revision 1.21 2001/07/18 17:26:24 oes - * Changed to conform to new pcrs interface - * - * Revision 1.20 2001/07/17 13:07:01 oes - * Fixed segv when last line in config files - * lacked a terminating (\r)\n - * - * Revision 1.19 2001/07/13 14:01:54 oes - * Removed all #ifdef PCRS - * - * Revision 1.18 2001/06/29 21:45:41 oes - * Indentation, CRLF->LF, Tab-> Space - * - * Revision 1.17 2001/06/29 13:31:51 oes - * Various adaptions - * - * Revision 1.16 2001/06/09 10:55:28 jongfoster - * Changing BUFSIZ ==> BUFFER_SIZE - * - * Revision 1.15 2001/06/07 23:14:14 jongfoster - * Removing ACL and forward file loaders - these - * files have been merged into the config file. - * Cosmetic: Moving unloader funcs next to their - * respective loader funcs - * - * Revision 1.14 2001/06/01 03:27:04 oes - * Fixed line continuation problem - * - * Revision 1.13 2001/05/31 21:28:49 jongfoster - * Removed all permissionsfile code - it's now called the actions - * file, and (almost) all the code is in actions.c - * - * Revision 1.12 2001/05/31 17:32:31 oes - * - * - Enhanced domain part globbing with infix and prefix asterisk - * matching and optional unanchored operation - * - * Revision 1.11 2001/05/29 23:25:24 oes - * - * - load_config_line() and load_permissions_file() now use chomp() - * - * Revision 1.10 2001/05/29 09:50:24 jongfoster - * Unified blocklist/imagelist/permissionslist. - * File format is still under discussion, but the internal changes - * are (mostly) done. - * - * Also modified interceptor behaviour: - * - We now intercept all URLs beginning with one of the following - * prefixes (and *only* these prefixes): - * * http://i.j.b/ - * * http://ijbswa.sf.net/config/ - * * http://ijbswa.sourceforge.net/config/ - * - New interceptors "home page" - go to http://i.j.b/ to see it. - * - Internal changes so that intercepted and fast redirect pages - * are not replaced with an image. - * - Interceptors now have the option to send a binary page direct - * to the client. (i.e. ijb-send-banner uses this) - * - Implemented show-url-info interceptor. (Which is why I needed - * the above interceptors changes - a typical URL is - * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". - * The previous mechanism would not have intercepted that, and - * if it had been intercepted then it then it would have replaced - * it with an image.) - * - * Revision 1.9 2001/05/26 17:12:07 jongfoster - * Fatal errors loading configuration files now give better error messages. - * - * Revision 1.8 2001/05/26 00:55:20 jongfoster - * Removing duplicated code. load_forwardfile() now uses create_url_spec() - * - * Revision 1.7 2001/05/26 00:28:36 jongfoster - * Automatic reloading of config file. - * Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32). - * Most of the global variables have been moved to a new - * struct configuration_spec, accessed through csp->config->globalname - * Most of the globals remaining are used by the Win32 GUI. - * - * Revision 1.6 2001/05/23 12:27:33 oes - * - * Fixed ugly indentation of my last changes - * - * Revision 1.5 2001/05/23 10:39:05 oes - * - Added support for escaping the comment character - * in config files by a backslash - * - Added support for line continuation in config - * files - * - Fixed a buffer overflow bug with long config lines - * - * Revision 1.4 2001/05/22 18:56:28 oes - * CRLF -> LF - * - * Revision 1.3 2001/05/20 01:21:20 jongfoster - * Version 2.9.4 checkin. - * - Merged popupfile and cookiefile, and added control over PCRS - * filtering, in new "permissionsfile". - * - Implemented LOG_LEVEL_FATAL, so that if there is a configuration - * file error you now get a message box (in the Win32 GUI) rather - * than the program exiting with no explanation. - * - Made killpopup use the PCRS MIME-type checking and HTTP-header - * skipping. - * - Removed tabs from "config" - * - Moved duplicated url parsing code in "loaders.c" to a new funcition. - * - Bumped up version number. - * - * Revision 1.2 2001/05/17 23:01:01 oes - * - Cleaned CRLF's from the sources and related files - * - * Revision 1.1.1.1 2001/05/15 13:58:59 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include "config.h" @@ -453,14 +108,16 @@ static struct file_list *current_re_filterfile[MAX_AF_FILES] = { * * Parameters : None * - * Returns : N/A + * Returns : The number of threads that are still active. * *********************************************************************/ -void sweep(void) +unsigned int sweep(void) { struct file_list *fl, *nfl; - struct client_state *csp, *last_active; + struct client_state *csp; + struct client_states *last_active, *client_list; int i; + unsigned int active_threads = 0; /* clear all of the file's active flags */ for ( fl = files->next; NULL != fl; fl = fl->next ) @@ -469,10 +126,11 @@ void sweep(void) } last_active = clients; - csp = clients->next; + client_list = clients->next; - while (NULL != csp) + while (NULL != client_list) { + csp = &client_list->csp; if (csp->flags & CSP_FLAG_ACTIVE) { /* Mark this client's files as active */ @@ -484,12 +142,12 @@ void sweep(void) */ csp->config->config_file_list->active = 1; - /* + /* * Actions files */ for (i = 0; i < MAX_AF_FILES; i++) { - if (csp->actions_list[i]) + if (csp->actions_list[i]) { csp->actions_list[i]->active = 1; } @@ -500,7 +158,7 @@ void sweep(void) */ for (i = 0; i < MAX_AF_FILES; i++) { - if (csp->rlist[i]) + if (csp->rlist[i]) { csp->rlist[i]->active = 1; } @@ -515,17 +173,18 @@ void sweep(void) csp->tlist->active = 1; } #endif /* def FEATURE_TRUST */ - - last_active = csp; - csp = csp->next; + active_threads++; + + last_active = client_list; + client_list = client_list->next; } - else + else /* * This client is not active. Free its resources. */ { - last_active->next = csp->next; + last_active->next = client_list->next; freez(csp->ip_addr_str); freez(csp->iob->buf); @@ -551,9 +210,9 @@ void sweep(void) } #endif /* def FEATURE_STATISTICS */ - freez(csp); - - csp = last_active->next; + freez(client_list); + + client_list = last_active->next; } } @@ -580,6 +239,8 @@ void sweep(void) } } + return active_threads; + } @@ -698,7 +359,7 @@ jb_err simple_read_line(FILE *fp, char **dest, int *newline) p = buf; /* - * Character codes. If you have a wierd compiler and the following are + * Character codes. If you have a weird compiler and the following are * incorrect, you also need to fix NEWLINE() in loaders.h */ #define CHAR_CR '\r' /* ASCII 13 */ @@ -1076,37 +737,27 @@ jb_err edit_read_line(FILE *fp, * and respects escaping of newline and comment char. * * Parameters : - * 1 : buf = Buffer to use. - * 2 : buflen = Size of buffer in bytes. - * 3 : fp = File to read from - * 4 : linenum = linenumber in file + * 1 : fp = File to read from + * 2 : linenum = linenumber in file + * 3 : buf = Pointer to a pointer to set to the data buffer. * * Returns : NULL on EOF or error * Otherwise, returns buf. * *********************************************************************/ -char *read_config_line(char *buf, size_t buflen, FILE *fp, unsigned long *linenum) +char *read_config_line(FILE *fp, unsigned long *linenum, char **buf) { jb_err err; - char *buf2 = NULL; - err = edit_read_line(fp, NULL, NULL, &buf2, NULL, linenum); + err = edit_read_line(fp, NULL, NULL, buf, NULL, linenum); if (err) { if (err == JB_ERR_MEMORY) { log_error(LOG_LEVEL_FATAL, "Out of memory loading a config file"); } - return NULL; - } - else - { - assert(buf2); - assert(strlen(buf2) + 1U < buflen); - strncpy(buf, buf2, buflen - 1); - free(buf2); - buf[buflen - 1] = '\0'; - return buf; + *buf = NULL; } + return *buf; } @@ -1184,7 +835,7 @@ int load_trustfile(struct client_state *csp) struct block_spec *b, *bl; struct url_spec **tl; - char buf[BUFFER_SIZE], *p, *q; + char *buf = NULL; int reject, trusted; struct file_list *fs; unsigned long linenum = 0; @@ -1193,10 +844,7 @@ int load_trustfile(struct client_state *csp) if (!check_file_changed(current_trustfile, csp->config->trustfile, &fs)) { /* No need to load */ - if (csp) - { - csp->tlist = current_trustfile; - } + csp->tlist = current_trustfile; return(0); } if (!fs) @@ -1214,10 +862,11 @@ int load_trustfile(struct client_state *csp) { goto load_trustfile_error; } + log_error(LOG_LEVEL_INFO, "Loading trust file: %s", csp->config->trustfile); tl = csp->config->trust_list; - while (read_config_line(buf, sizeof(buf), fp, &linenum) != NULL) + while (read_config_line(fp, &linenum, &buf) != NULL) { trusted = 0; reject = 1; @@ -1230,6 +879,9 @@ int load_trustfile(struct client_state *csp) if (*buf == '~') { + char *p; + char *q; + reject = 0; p = buf; q = p+1; @@ -1242,6 +894,7 @@ int load_trustfile(struct client_state *csp) /* skip blank lines */ if (*buf == '\0') { + freez(buf); continue; } @@ -1275,9 +928,10 @@ int load_trustfile(struct client_state *csp) *tl++ = b->url; } } + freez(buf); } - if(trusted_referrers >= MAX_TRUSTED_REFERRERS) + if(trusted_referrers >= MAX_TRUSTED_REFERRERS) { /* * FIXME: ... after Privoxy 3.0.4 is out. @@ -1301,17 +955,14 @@ int load_trustfile(struct client_state *csp) fs->next = files->next; files->next = fs; current_trustfile = fs; - - if (csp) - { - csp->tlist = fs; - } + csp->tlist = fs; return(0); load_trustfile_error: log_error(LOG_LEVEL_FATAL, "can't load trustfile '%s': %E", - csp->config->trustfile); + csp->config->trustfile); + freez(buf); return(-1); } @@ -1355,7 +1006,7 @@ static void unload_re_filterfile(void *f) * * Function : unload_forward_spec * - * Description : Unload the forward spec settings by freeing all + * Description : Unload the forward spec settings by freeing all * memory referenced by members and the memory for * the spec itself. * @@ -1409,7 +1060,7 @@ void unload_current_re_filterfile(void) * * Function : load_re_filterfiles * - * Description : Loads all the filterfiles. + * Description : Loads all the filterfiles. * Generate a chained list of re_filterfile_spec's from * the "FILTER: " blocks, compiling all their substitutions * into chained lists of pcrs_job structs. @@ -1450,7 +1101,7 @@ int load_re_filterfiles(struct client_state *csp) * * Function : load_one_re_filterfile * - * Description : Load a re_filterfile. + * Description : Load a re_filterfile. * Generate a chained list of re_filterfile_spec's from * the "FILTER: " blocks, compiling all their substitutions * into chained lists of pcrs_job structs. @@ -1468,7 +1119,7 @@ int load_one_re_filterfile(struct client_state *csp, int fileid) struct re_filterfile_spec *new_bl, *bl = NULL; struct file_list *fs; - char buf[BUFFER_SIZE]; + char *buf = NULL; int error; unsigned long linenum = 0; pcrs_job *dummy, *lastjob = NULL; @@ -1478,10 +1129,7 @@ int load_one_re_filterfile(struct client_state *csp, int fileid) */ if (!check_file_changed(current_re_filterfile[fileid], csp->config->re_filterfile[fileid], &fs)) { - if (csp) - { - csp->rlist[fileid] = current_re_filterfile[fileid]; - } + csp->rlist[fileid] = current_re_filterfile[fileid]; return(0); } if (!fs) @@ -1489,7 +1137,7 @@ int load_one_re_filterfile(struct client_state *csp, int fileid) goto load_re_filterfile_error; } - /* + /* * Open the file or fail */ if ((fp = fopen(csp->config->re_filterfile[fileid], "r")) == NULL) @@ -1497,10 +1145,12 @@ int load_one_re_filterfile(struct client_state *csp, int fileid) goto load_re_filterfile_error; } - /* + log_error(LOG_LEVEL_INFO, "Loading filter file: %s", csp->config->re_filterfile[fileid]); + + /* * Read line by line */ - while (read_config_line(buf, sizeof(buf), fp, &linenum) != NULL) + while (read_config_line(fp, &linenum, &buf) != NULL) { int new_filter = NO_NEW_FILTER; @@ -1565,7 +1215,7 @@ int load_one_re_filterfile(struct client_state *csp, int fileid) } new_bl->name = strdup(chomp(new_bl->name)); - + /* * If this is the first filter block, chain it * to the file_list rather than its (nonexistant) @@ -1584,12 +1234,13 @@ int load_one_re_filterfile(struct client_state *csp, int fileid) log_error(LOG_LEVEL_RE_FILTER, "Reading in filter \"%s\" (\"%s\")", bl->name, bl->description); + freez(buf); continue; } - /* + /* * Else, save the expression, make it a pcrs_job - * and chain it into the current filter's joblist + * and chain it into the current filter's joblist */ if (bl != NULL) { @@ -1615,7 +1266,8 @@ int load_one_re_filterfile(struct client_state *csp, int fileid) bl->dynamic = 1; log_error(LOG_LEVEL_RE_FILTER, "Adding dynamic re_filter job \'%s\' to filter %s succeeded.", buf, bl->name); - continue; + freez(buf); + continue; } else if (bl->dynamic) { @@ -1626,6 +1278,7 @@ int load_one_re_filterfile(struct client_state *csp, int fileid) */ log_error(LOG_LEVEL_RE_FILTER, "Adding static re_filter job \'%s\' to dynamic filter %s succeeded.", buf, bl->name); + freez(buf); continue; } @@ -1633,6 +1286,7 @@ int load_one_re_filterfile(struct client_state *csp, int fileid) { log_error(LOG_LEVEL_ERROR, "Adding re_filter job \'%s\' to filter %s failed with error %d.", buf, bl->name, error); + freez(buf); continue; } else @@ -1654,11 +1308,12 @@ int load_one_re_filterfile(struct client_state *csp, int fileid) log_error(LOG_LEVEL_ERROR, "Ignoring job %s outside filter block in %s, line %d", buf, csp->config->re_filterfile[fileid], linenum); } + freez(buf); } fclose(fp); - /* + /* * Schedule the now-obsolete old data for unloading */ if ( NULL != current_re_filterfile[fileid] ) @@ -1672,11 +1327,7 @@ int load_one_re_filterfile(struct client_state *csp, int fileid) fs->next = files->next; files->next = fs; current_re_filterfile[fileid] = fs; - - if (csp) - { - csp->rlist[fileid] = fs; - } + csp->rlist[fileid] = fs; return( 0 ); @@ -1708,7 +1359,7 @@ void add_loader(int (*loader)(struct client_state *), { int i; - for (i=0; i < NLOADERS; i++) + for (i = 0; i < NLOADERS; i++) { if (config->loaders[i] == NULL) { @@ -1742,7 +1393,7 @@ int run_loader(struct client_state *csp) int ret = 0; int i; - for (i=0; i < NLOADERS; i++) + for (i = 0; i < NLOADERS; i++) { if (csp->config->loaders[i] == NULL) { @@ -1754,6 +1405,66 @@ int run_loader(struct client_state *csp) } +/********************************************************************* + * + * Function : file_has_been_modified + * + * Description : Helper function to check if a file has been changed + * + * Parameters : + * 1 : filename = The name of the file to check + * 2 : last_known_modification = The time of the last known + * modification + * + * Returns : TRUE if the file has been changed, + * FALSE otherwise. + * + *********************************************************************/ +static int file_has_been_modified(const char *filename, time_t last_know_modification) +{ + struct stat statbuf[1]; + + if (stat(filename, statbuf) < 0) + { + /* Error, probably file not found which counts as change. */ + return 1; + } + + return (last_know_modification != statbuf->st_mtime); +} + + +/********************************************************************* + * + * Function : any_loaded_file_changed + * + * Description : Helper function to check if any loaded file has been + * changed since the time it has been loaded. + * + * XXX: Should we cache the return value for x seconds? + * + * Parameters : + * 1 : files_to_check = List of files to check + * + * Returns : TRUE if any file has been changed, + * FALSE otherwise. + * + *********************************************************************/ +int any_loaded_file_changed(const struct file_list *files_to_check) +{ + const struct file_list *file_to_check = files_to_check; + + while (file_to_check != NULL) + { + if (file_has_been_modified(file_to_check->filename, file_to_check->lastmodified)) + { + return TRUE; + } + file_to_check = file_to_check->next; + } + return FALSE; +} + /* Local Variables: diff --git a/external/privoxy/loaders.h b/external/privoxy/loaders.h index ded18e3b..ae1b6fea 100644 --- a/external/privoxy/loaders.h +++ b/external/privoxy/loaders.h @@ -1,23 +1,23 @@ #ifndef LOADERS_H_INCLUDED #define LOADERS_H_INCLUDED -#define LOADERS_H_VERSION "$Id: loaders.h,v 1.23 2008/03/30 14:52:10 fabiankeil Exp $" +#define LOADERS_H_VERSION "$Id: loaders.h,v 1.29 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/loaders.h,v $ * * Purpose : Functions to load and unload the various * configuration files. Also contains code to manage - * the list of active loaders, and to automatically + * the list of active loaders, and to automatically * unload files that are no longer in use. * - * Copyright : Written by and Copyright (C) 2001 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2010 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -35,139 +35,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: loaders.h,v $ - * Revision 1.23 2008/03/30 14:52:10 fabiankeil - * Rename load_actions_file() and load_re_filterfile() - * as they load multiple files "now". - * - * Revision 1.22 2007/06/01 14:12:38 fabiankeil - * Add unload_forward_spec() in preparation for forward-override{}. - * - * Revision 1.21 2006/07/18 14:48:46 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.19 2002/03/26 22:29:55 swa - * we have a new homepage! - * - * Revision 1.18 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.17 2002/03/16 23:54:06 jongfoster - * Adding graceful termination feature, to help look for memory leaks. - * If you enable this (which, by design, has to be done by hand - * editing config.h) and then go to http://i.j.b/die, then the program - * will exit cleanly after the *next* request. It should free all the - * memory that was used. - * - * Revision 1.16 2002/03/07 03:46:17 oes - * Fixed compiler warnings - * - * Revision 1.15 2002/01/22 23:46:18 jongfoster - * Moving edit_read_line() and simple_read_line() to loaders.c, and - * extending them to support reading MS-DOS, Mac and UNIX style files - * on all platforms. - * - * Modifying read_config_line() (without changing it's prototype) to - * be a trivial wrapper for edit_read_line(). This means that we have - * one function to read a line and handle comments, which is common - * between the initialization code and the edit interface. - * - * Revision 1.14 2002/01/17 21:03:08 jongfoster - * Moving all our URL and URL pattern parsing code to urlmatch.c. - * - * Renaming free_url to free_url_spec, since it frees a struct url_spec. - * - * Revision 1.13 2001/12/30 14:07:32 steudten - * - Add signal handling (unix) - * - Add SIGHUP handler (unix) - * - Add creation of pidfile (unix) - * - Add action 'top' in rc file (RH) - * - Add entry 'SIGNALS' to manpage - * - Add exit message to logfile (unix) - * - * Revision 1.12 2001/11/07 00:02:13 steudten - * Add line number in error output for lineparsing for - * actionsfile and configfile. - * Special handling for CLF added. - * - * Revision 1.11 2001/10/23 21:38:53 jongfoster - * Adding error-checking to create_url_spec() - * - * Revision 1.10 2001/09/22 16:36:59 jongfoster - * Removing unused parameter fs from read_config_line() - * - * Revision 1.9 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.8 2001/07/29 18:58:15 jongfoster - * Removing nested #includes, adding forward declarations for needed - * structures, and changing the #define _FILENAME_H to FILENAME_H_INCLUDED. - * - * Revision 1.7 2001/07/13 14:01:54 oes - * Removed all #ifdef PCRS - * - * Revision 1.6 2001/06/07 23:14:38 jongfoster - * Removing ACL and forward file loaders - these files have - * been merged into the config file. - * - * Revision 1.5 2001/05/31 21:28:49 jongfoster - * Removed all permissionsfile code - it's now called the actions - * file, and (almost) all the code is in actions.c - * - * Revision 1.4 2001/05/29 09:50:24 jongfoster - * Unified blocklist/imagelist/permissionslist. - * File format is still under discussion, but the internal changes - * are (mostly) done. - * - * Also modified interceptor behaviour: - * - We now intercept all URLs beginning with one of the following - * prefixes (and *only* these prefixes): - * * http://i.j.b/ - * * http://ijbswa.sf.net/config/ - * * http://ijbswa.sourceforge.net/config/ - * - New interceptors "home page" - go to http://i.j.b/ to see it. - * - Internal changes so that intercepted and fast redirect pages - * are not replaced with an image. - * - Interceptors now have the option to send a binary page direct - * to the client. (i.e. ijb-send-banner uses this) - * - Implemented show-url-info interceptor. (Which is why I needed - * the above interceptors changes - a typical URL is - * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". - * The previous mechanism would not have intercepted that, and - * if it had been intercepted then it then it would have replaced - * it with an image.) - * - * Revision 1.3 2001/05/26 00:28:36 jongfoster - * Automatic reloading of config file. - * Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32). - * Most of the global variables have been moved to a new - * struct configuration_spec, accessed through csp->config->globalname - * Most of the globals remaining are used by the Win32 GUI. - * - * Revision 1.2 2001/05/20 01:21:20 jongfoster - * Version 2.9.4 checkin. - * - Merged popupfile and cookiefile, and added control over PCRS - * filtering, in new "permissionsfile". - * - Implemented LOG_LEVEL_FATAL, so that if there is a configuration - * file error you now get a message box (in the Win32 GUI) rather - * than the program exiting with no explanation. - * - Made killpopup use the PCRS MIME-type checking and HTTP-header - * skipping. - * - Removed tabs from "config" - * - Moved duplicated url parsing code in "loaders.c" to a new funcition. - * - Bumped up version number. - * - * Revision 1.1.1.1 2001/05/15 13:59:00 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #ifdef __cplusplus extern "C" { @@ -179,8 +48,8 @@ struct file_list; struct configuration_spec; struct url_spec; -extern void sweep(void); -extern char *read_config_line(char *buf, size_t buflen, FILE *fp, unsigned long *linenum); +extern unsigned int sweep(void); +extern char *read_config_line(FILE *fp, unsigned long *linenum, char **buf); extern int check_file_changed(const struct file_list * current, const char * filename, struct file_list ** newfl); @@ -204,7 +73,7 @@ extern jb_err simple_read_line(FILE *fp, char **dest, int *newline); /* * Types of newlines that a file may contain, as strings. If you have an - * extremely wierd compiler that does not have '\r' == CR == ASCII 13 and + * extremely weird compiler that does not have '\r' == CR == ASCII 13 and * '\n' == LF == ASCII 10), then fix CHAR_CR and CHAR_LF in loaders.c as * well as these definitions. */ @@ -229,10 +98,12 @@ void unload_current_re_filterfile(void); void unload_forward_spec(struct forward_spec *fwd); -extern void add_loader(int (*loader)(struct client_state *), +extern void add_loader(int (*loader)(struct client_state *), struct configuration_spec * config); extern int run_loader(struct client_state *csp); +extern int any_loaded_file_changed(const struct file_list *files_to_check); + /* Revision control strings from this header and associated .c file */ extern const char loaders_rcs[]; extern const char loaders_h_rcs[]; diff --git a/external/privoxy/match-all.action b/external/privoxy/match-all.action index 904d85b0..826eb396 100644 --- a/external/privoxy/match-all.action +++ b/external/privoxy/match-all.action @@ -1,5 +1,5 @@ ############################################################################# -# $Id: match-all.action,v 1.2 2009/02/14 10:41:07 fabiankeil Exp $ +# $Id: match-all.action,v 1.3 2010/03/27 18:48:38 fabiankeil Exp $ # # This file contains the actions that are applied to all requests and # may be overruled later on by other actions files. Less experienced @@ -8,6 +8,8 @@ ############################################################################# { \ +change-x-forwarded-for{block} \ ++client-header-tagger{css-requests} \ ++client-header-tagger{image-requests} \ +hide-from-header{block} \ +set-image-blocker{pattern} \ } diff --git a/external/privoxy/miscutil.c b/external/privoxy/miscutil.c index 74aa32e2..dc972d6f 100644 --- a/external/privoxy/miscutil.c +++ b/external/privoxy/miscutil.c @@ -1,19 +1,18 @@ -const char miscutil_rcs[] = "$Id: miscutil.c,v 1.62 2008/12/04 18:16:41 fabiankeil Exp $"; +const char miscutil_rcs[] = "$Id: miscutil.c,v 1.68 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/miscutil.c,v $ * - * Purpose : zalloc, hash_string, safe_strerror, strcmpic, - * strncmpic, chomp, and MinGW32 strdup - * functions. - * These are each too small to deserve their own file - * but don't really fit in any other file. + * Purpose : zalloc, hash_string, strcmpic, strncmpic, and + * MinGW32 strdup functions. These are each too small + * to deserve their own file but don't really fit in + * any other file. * - * Copyright : Written by and Copyright (C) 2001-2007 - * the SourceForge Privoxy team. http://www.privoxy.org/ + * Copyright : Written by and Copyright (C) 2001-2011 the + * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * * The timegm replacement function was taken from GnuPG, @@ -24,7 +23,7 @@ const char miscutil_rcs[] = "$Id: miscutil.c,v 1.62 2008/12/04 18:16:41 fabianke * used under the terms of the GPL or the terms of the * "Frontier Artistic License". * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -42,294 +41,8 @@ const char miscutil_rcs[] = "$Id: miscutil.c,v 1.62 2008/12/04 18:16:41 fabianke * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: miscutil.c,v $ - * Revision 1.62 2008/12/04 18:16:41 fabiankeil - * Fix some cparser warnings. - * - * Revision 1.61 2008/10/18 11:09:23 fabiankeil - * Improve seed used by pick_from_range() on mingw32. - * - * Revision 1.60 2008/09/07 12:35:05 fabiankeil - * Add mutex lock support for _WIN32. - * - * Revision 1.59 2008/09/04 08:13:58 fabiankeil - * Prepare for critical sections on Windows by adding a - * layer of indirection before the pthread mutex functions. - * - * Revision 1.58 2008/04/17 14:53:30 fabiankeil - * Move simplematch() into urlmatch.c as it's only - * used to match (old-school) domain patterns. - * - * Revision 1.57 2008/03/24 15:29:51 fabiankeil - * Pet gcc43. - * - * Revision 1.56 2007/12/01 12:59:05 fabiankeil - * Some sanity checks for pick_from_range(). - * - * Revision 1.55 2007/11/03 17:34:49 fabiankeil - * Log the "weak randomization factor" warning only - * once for mingw32 and provide some more details. - * - * Revision 1.54 2007/09/19 20:28:37 fabiankeil - * If privoxy_strlcpy() is called with a "buffer" size - * of 0, don't touch whatever destination points to. - * - * Revision 1.53 2007/09/09 18:20:20 fabiankeil - * Turn privoxy_strlcpy() into a function and try to work with - * b0rked snprintf() implementations too. Reported by icmp30. - * - * Revision 1.52 2007/08/19 12:32:34 fabiankeil - * Fix a conversion warning. - * - * Revision 1.51 2007/06/17 16:12:22 fabiankeil - * #ifdef _WIN32 the last commit. According to David Shaw, - * one of the gnupg developers, the changes are mingw32-specific. - * - * Revision 1.50 2007/06/10 14:59:59 fabiankeil - * Change replacement timegm() to better match our style, plug a small - * but guaranteed memory leak and fix "time zone breathing" on mingw32. - * - * Revision 1.49 2007/05/11 11:48:15 fabiankeil - * - Delete strsav() which was replaced - * by string_append() years ago. - * - Add a strlcat() look-alike. - * - Use strlcat() and strlcpy() in those parts - * of the code that are run on unixes. - * - * Revision 1.48 2007/04/09 17:48:51 fabiankeil - * Check for HAVE_SNPRINTF instead of __OS2__ - * before including the portable snprintf() code. - * - * Revision 1.47 2007/03/17 11:52:15 fabiankeil - * - Use snprintf instead of sprintf. - * - Mention copyright for the replacement - * functions in the copyright header. - * - * Revision 1.46 2007/01/18 15:03:20 fabiankeil - * Don't include replacement timegm() if - * putenv() or tzset() isn't available. - * - * Revision 1.45 2006/12/26 17:31:41 fabiankeil - * Mutex protect rand() if POSIX threading - * is used, warn the user if that's not possible - * and stop using it on _WIN32 where it could - * cause crashes. - * - * Revision 1.44 2006/11/07 12:46:43 fabiankeil - * Silence compiler warning on NetBSD 3.1. - * - * Revision 1.43 2006/09/23 13:26:38 roro - * Replace TABs by spaces in source code. - * - * Revision 1.42 2006/09/09 14:01:45 fabiankeil - * Integrated Oliver Yeoh's domain pattern fix - * to make sure *x matches xx. Closes Patch 1217393 - * and Bug 1170767. - * - * Revision 1.41 2006/08/18 16:03:17 david__schmidt - * Tweak for OS/2 build happiness. - * - * Revision 1.40 2006/08/17 17:15:10 fabiankeil - * - Back to timegm() using GnuPG's replacement if necessary. - * Using mktime() and localtime() could add a on hour offset if - * the randomize factor was big enough to lead to a summer/wintertime - * switch. - * - * - Removed now-useless Privoxy 3.0.3 compatibility glue. - * - * - Moved randomization code into pick_from_range(). - * - * - Changed parse_header_time definition. - * time_t isn't guaranteed to be signed and - * if it isn't, -1 isn't available as error code. - * Changed some variable types in client_if_modified_since() - * because of the same reason. - * - * Revision 1.39 2006/07/18 14:48:46 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.37.2.4 2003/12/01 14:45:14 oes - * Fixed two more problems with wildcarding in simplematch() - * - * Revision 1.37.2.3 2003/11/20 11:39:24 oes - * Bugfix: The "?" wildcard for domain names had never been implemented. Ooops\! - * - * Revision 1.37.2.2 2002/11/12 14:28:18 oes - * Proper backtracking in simplematch; fixes bug #632888 - * - * Revision 1.37.2.1 2002/09/25 12:58:51 oes - * Made strcmpic and strncmpic safe against NULL arguments - * (which are now treated as empty strings). - * - * Revision 1.37 2002/04/26 18:29:43 jongfoster - * Fixing this Visual C++ warning: - * miscutil.c(710) : warning C4090: '=' : different 'const' qualifiers - * - * Revision 1.36 2002/04/26 12:55:38 oes - * New function string_toupper - * - * Revision 1.35 2002/03/26 22:29:55 swa - * we have a new homepage! - * - * Revision 1.34 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.33 2002/03/07 03:46:53 oes - * Fixed compiler warnings etc - * - * Revision 1.32 2002/03/06 23:02:57 jongfoster - * Removing tabs - * - * Revision 1.31 2002/03/05 04:52:42 oes - * Deleted non-errlog debugging code - * - * Revision 1.30 2002/03/04 18:27:42 oes - * - Deleted deletePidFile - * - Made write_pid_file use the --pidfile option value - * (or no PID file, if the option was absent) - * - Played styleguide police - * - * Revision 1.29 2002/03/04 02:08:02 david__schmidt - * Enable web editing of actions file on OS/2 (it had been broken all this time!) - * - * Revision 1.28 2002/03/03 09:18:03 joergs - * Made jumbjuster work on AmigaOS again. - * - * Revision 1.27 2002/01/21 00:52:32 jongfoster - * Adding string_join() - * - * Revision 1.26 2001/12/30 14:07:32 steudten - * - Add signal handling (unix) - * - Add SIGHUP handler (unix) - * - Add creation of pidfile (unix) - * - Add action 'top' in rc file (RH) - * - Add entry 'SIGNALS' to manpage - * - Add exit message to logfile (unix) - * - * Revision 1.25 2001/11/13 00:16:38 jongfoster - * Replacing references to malloc.h with the standard stdlib.h - * (See ANSI or K&R 2nd Ed) - * - * Revision 1.24 2001/11/05 21:41:43 steudten - * Add changes to be a real daemon just for unix os. - * (change cwd to /, detach from controlling tty, set - * process group and session leader to the own process. - * Add DBG() Macro. - * Add some fatal-error log message for failed malloc(). - * Add '-d' if compiled with 'configure --with-debug' to - * enable debug output. - * - * Revision 1.23 2001/10/29 03:48:10 david__schmidt - * OS/2 native needed a snprintf() routine. Added one to miscutil, brackedted - * by and __OS2__ ifdef. - * - * Revision 1.22 2001/10/26 17:39:38 oes - * Moved ijb_isspace and ijb_tolower to project.h - * - * Revision 1.21 2001/10/23 21:27:50 jongfoster - * Standardising error codes in string_append - * make_path() no longer adds '\\' if the dir already ends in '\\' (this - * is just copying a UNIX-specific fix to the Windows-specific part) - * - * Revision 1.20 2001/10/22 15:33:56 david__schmidt - * Special-cased OS/2 out of the Netscape-abort-on-404-in-js problem in - * filters.c. Added a FIXME in front of the offending code. I'll gladly - * put in a better/more robust fix for all parties if one is presented... - * It seems that just returning 200 instead of 404 would pretty much fix - * it for everyone, but I don't know all the history of the problem. - * - * Revision 1.19 2001/10/14 22:02:57 jongfoster - * New function string_append() which is like strsav(), but running - * out of memory isn't automatically FATAL. - * - * Revision 1.18 2001/09/20 13:33:43 steudten - * - * change long to int as return value in hash_string(). Remember the wraparound - * for int = long = sizeof(4) - thats maybe not what we want. - * - * Revision 1.17 2001/09/13 20:51:29 jongfoster - * Fixing potential problems with characters >=128 in simplematch() - * This was also a compiler warning. - * - * Revision 1.16 2001/09/10 10:56:59 oes - * Silenced compiler warnings - * - * Revision 1.15 2001/07/13 14:02:24 oes - * Removed vim-settings - * - * Revision 1.14 2001/06/29 21:45:41 oes - * Indentation, CRLF->LF, Tab-> Space - * - * Revision 1.13 2001/06/29 13:32:14 oes - * Removed logentry from cancelled commit - * - * Revision 1.12 2001/06/09 10:55:28 jongfoster - * Changing BUFSIZ ==> BUFFER_SIZE - * - * Revision 1.11 2001/06/07 23:09:19 jongfoster - * Cosmetic indentation changes. - * - * Revision 1.10 2001/06/07 14:51:38 joergs - * make_path() no longer adds '/' if the dir already ends in '/'. - * - * Revision 1.9 2001/06/07 14:43:17 swa - * slight mistake in make_path, unix path style is /. - * - * Revision 1.8 2001/06/05 22:32:01 jongfoster - * New function make_path() to splice directory and file names together. - * - * Revision 1.7 2001/06/03 19:12:30 oes - * introduced bindup() - * - * Revision 1.6 2001/06/01 18:14:49 jongfoster - * Changing the calls to strerr() to check HAVE_STRERR (which is defined - * in config.h if appropriate) rather than the NO_STRERR macro. - * - * Revision 1.5 2001/06/01 10:31:51 oes - * Added character class matching to trivimatch; renamed to simplematch - * - * Revision 1.4 2001/05/31 17:32:31 oes - * - * - Enhanced domain part globbing with infix and prefix asterisk - * matching and optional unanchored operation - * - * Revision 1.3 2001/05/29 23:10:09 oes - * - * - * - Introduced chomp() - * - Moved strsav() from showargs to miscutil - * - * Revision 1.2 2001/05/29 09:50:24 jongfoster - * Unified blocklist/imagelist/permissionslist. - * File format is still under discussion, but the internal changes - * are (mostly) done. - * - * Also modified interceptor behaviour: - * - We now intercept all URLs beginning with one of the following - * prefixes (and *only* these prefixes): - * * http://i.j.b/ - * * http://ijbswa.sf.net/config/ - * * http://ijbswa.sourceforge.net/config/ - * - New interceptors "home page" - go to http://i.j.b/ to see it. - * - Internal changes so that intercepted and fast redirect pages - * are not replaced with an image. - * - Interceptors now have the option to send a binary page direct - * to the client. (i.e. ijb-send-banner uses this) - * - Implemented show-url-info interceptor. (Which is why I needed - * the above interceptors changes - a typical URL is - * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". - * The previous mechanism would not have intercepted that, and - * if it had been intercepted then it then it would have replaced - * it with an image.) - * - * Revision 1.1.1.1 2001/05/15 13:59:00 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include "config.h" @@ -384,19 +97,19 @@ void *zalloc(size_t size) #if defined(unix) /********************************************************************* * - * Function : write_pid_file + * Function : write_pid_file * - * Description : Writes a pid file with the pid of the main process + * Description : Writes a pid file with the pid of the main process * * Parameters : None * - * Returns : N/A + * Returns : N/A * *********************************************************************/ void write_pid_file(void) { FILE *fp; - + /* * If no --pidfile option was given, * we can live without one. @@ -434,7 +147,7 @@ void write_pid_file(void) *********************************************************************/ unsigned int hash_string( const char* s ) { - unsigned int h = 0; + unsigned int h = 0; for ( ; *s; ++s ) { @@ -446,75 +159,6 @@ unsigned int hash_string( const char* s ) } -#ifdef __MINGW32__ -/********************************************************************* - * - * Function : strdup - * - * Description : For some reason (which is beyond me), gcc and WIN32 - * don't like strdup. When a "free" is executed on a - * strdup'd ptr, it can at times freez up! So I just - * replaced it and problem was solved. - * - * Parameters : - * 1 : s = string to duplicate - * - * Returns : Pointer to newly malloc'ed copy of the string. - * - *********************************************************************/ -char *strdup( const char *s ) -{ - char * result = (char *)malloc( strlen(s)+1 ); - - if (result != NULL) - { - strcpy( result, s ); - } - - return( result ); -} - -#endif /* def __MINGW32__ */ - - - -/********************************************************************* - * - * Function : safe_strerror - * - * Description : Variant of the library routine strerror() which will - * work on systems without the library routine, and - * which should never return NULL. - * - * Parameters : - * 1 : err = the `errno' of the last operation. - * - * Returns : An "English" string of the last `errno'. Allocated - * with strdup(), so caller frees. May be NULL if the - * system is out of memory. - * - *********************************************************************/ -char *safe_strerror(int err) -{ - char *s = NULL; - char buf[BUFFER_SIZE]; - - -#ifdef HAVE_STRERROR - s = strerror(err); -#endif /* HAVE_STRERROR */ - - if (s == NULL) - { - snprintf(buf, sizeof(buf), "(errno = %d)", err); - s = buf; - } - - return(strdup(s)); - -} - - /********************************************************************* * * Function : strcmpic @@ -550,7 +194,7 @@ int strcmpic(const char *s1, const char *s2) * * Function : strncmpic * - * Description : Case insensitive string comparison (upto n characters) + * Description : Case insensitive string comparison (up to n characters) * * Parameters : * 1 : s1 = string 1 to compare @@ -565,7 +209,7 @@ int strncmpic(const char *s1, const char *s2, size_t n) if (n <= (size_t)0) return(0); if (!s1) s1 = ""; if (!s2) s2 = ""; - + while (*s1 && *s2) { if ( ( *s1 != *s2 ) && ( ijb_tolower(*s1) != ijb_tolower(*s2) ) ) @@ -599,7 +243,7 @@ char *chomp(char *string) { char *p, *q, *r; - /* + /* * strip trailing whitespace */ p = string + strlen(string); @@ -609,8 +253,8 @@ char *chomp(char *string) } *p = '\0'; - /* - * find end of leading whitespace + /* + * find end of leading whitespace */ q = r = string; while (*q && ijb_isspace(*q)) @@ -638,7 +282,7 @@ char *chomp(char *string) * * Function : string_append * - * Description : Reallocate target_string and append text to it. + * Description : Reallocate target_string and append text to it. * This makes it easier to append to malloc'd strings. * This is similar to the (removed) strsav(), but * running out of memory isn't catastrophic. @@ -783,7 +427,7 @@ jb_err string_join(char **target_string, char *text_to_append) * Parameters : * 1 : string = string to convert * - * Returns : Uppercase copy of string if possible, + * Returns : Uppercase copy of string if possible, * NULL on out-of-memory or if string was NULL. * *********************************************************************/ @@ -796,7 +440,7 @@ char *string_toupper(const char *string) { return NULL; } - + q = string; p = result; @@ -846,11 +490,11 @@ char *bindup(const char *string, size_t len) * * Function : make_path * - * Description : Takes a directory name and a file name, returns + * Description : Takes a directory name and a file name, returns * the complete path. Handles windows/unix differences. * If the file name is already an absolute path, or if - * the directory name is NULL or empty, it returns - * the filename. + * the directory name is NULL or empty, it returns + * the filename. * * Parameters : * 1 : dir: Name of directory or NULL for none. @@ -859,7 +503,7 @@ char *bindup(const char *string, size_t len) * Returns : "dir/file" (Or on windows, "dir\file"). * It allocates the string on the heap. Caller frees. * Returns NULL in error (i.e. NULL file or out of - * memory) + * memory) * *********************************************************************/ char * make_path(const char * dir, const char * file) @@ -941,6 +585,7 @@ char * make_path(const char * dir, const char * file) strlcpy(path, dir, path_size); } + assert(NULL != path); #if defined(_WIN32) || defined(__OS2__) if(path[strlen(path)-1] != '\\') { @@ -971,7 +616,7 @@ char * make_path(const char * dir, const char * file) * Parameters : * 1 : range: Highest possible number to pick. * - * Returns : Picked number. + * Returns : Picked number. * *********************************************************************/ long int pick_from_range(long int range) @@ -987,7 +632,7 @@ long int pick_from_range(long int range) if (range <= 0) return 0; #ifdef HAVE_RANDOM - number = random() % range + 1; + number = random() % range + 1; #elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&rand_mutex); #ifdef _WIN32 @@ -1091,7 +736,7 @@ size_t privoxy_strlcat(char *destination, const char *source, const size_t size) * Parameters : * 1 : tm: Broken-down time struct. * - * Returns : tm converted into time_t seconds. + * Returns : tm converted into time_t seconds. * *********************************************************************/ time_t timegm(struct tm *tm) @@ -1143,7 +788,7 @@ time_t timegm(struct tm *tm) snprintf.c - a portable implementation of snprintf, including vsnprintf.c, asnprintf, vasnprintf, asprintf, vasprintf - + snprintf is a routine to convert numeric and string arguments to formatted strings. It is similar to sprintf(3) provided in a system's C library, yet it requires an additional argument - the buffer size - @@ -1785,7 +1430,7 @@ int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) { } } /* zero padding to specified precision? */ - if (num_of_digits < precision) + if (num_of_digits < precision) number_of_zeros_to_pad = precision - num_of_digits; } /* zero padding to specified minimal field width? */ @@ -1803,7 +1448,7 @@ int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) { #if defined(PERL_COMPATIBLE) || defined(LINUX_COMPATIBLE) /* keep the entire format string unchanged */ str_arg = starting_p; str_arg_l = p - starting_p; - /* well, not exactly so for Linux, which does something inbetween, + /* well, not exactly so for Linux, which does something between, * and I don't feel an urge to imitate it: "%+++++hy" -> "%+y" */ #else /* discard the unrecognized conversion, just keep * diff --git a/external/privoxy/miscutil.h b/external/privoxy/miscutil.h index a0498aca..d66ebacb 100644 --- a/external/privoxy/miscutil.h +++ b/external/privoxy/miscutil.h @@ -1,23 +1,23 @@ #ifndef MISCUTIL_H_INCLUDED #define MISCUTIL_H_INCLUDED -#define MISCUTIL_H_VERSION "$Id: miscutil.h,v 1.30 2008/04/17 14:53:31 fabiankeil Exp $" +#define MISCUTIL_H_VERSION "$Id: miscutil.h,v 1.34 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/miscutil.h,v $ * - * Purpose : zalloc, hash_string, safe_strerror, strcmpic, - * strncmpic, and MinGW32 strdup functions. These are - * each too small to deserve their own file but don't - * really fit in any other file. + * Purpose : zalloc, hash_string, strcmpic, strncmpic, and + * MinGW32 strdup functions. These are each too small + * to deserve their own file but don't really fit in + * any other file. * - * Copyright : Written by and Copyright (C) 2001-2007 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2011 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -35,156 +35,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: miscutil.h,v $ - * Revision 1.30 2008/04/17 14:53:31 fabiankeil - * Move simplematch() into urlmatch.c as it's only - * used to match (old-school) domain patterns. - * - * Revision 1.29 2007/09/09 18:20:20 fabiankeil - * Turn privoxy_strlcpy() into a function and try to work with - * b0rked snprintf() implementations too. Reported by icmp30. - * - * Revision 1.28 2007/05/11 11:48:16 fabiankeil - * - Delete strsav() which was replaced - * by string_append() years ago. - * - Add a strlcat() look-alike. - * - Use strlcat() and strlcpy() in those parts - * of the code that are run on unixes. - * - * Revision 1.27 2007/04/09 17:48:51 fabiankeil - * Check for HAVE_SNPRINTF instead of __OS2__ - * before including the portable snprintf() code. - * - * Revision 1.26 2007/04/08 17:04:51 fabiankeil - * Add macro for strlcpy() in case the libc lacks it. - * - * Revision 1.25 2007/01/18 15:03:20 fabiankeil - * Don't include replacement timegm() if - * putenv() or tzset() isn't available. - * - * Revision 1.24 2006/08/17 17:15:10 fabiankeil - * - Back to timegm() using GnuPG's replacement if necessary. - * Using mktime() and localtime() could add a on hour offset if - * the randomize factor was big enough to lead to a summer/wintertime - * switch. - * - * - Removed now-useless Privoxy 3.0.3 compatibility glue. - * - * - Moved randomization code into pick_from_range(). - * - * - Changed parse_header_time definition. - * time_t isn't guaranteed to be signed and - * if it isn't, -1 isn't available as error code. - * Changed some variable types in client_if_modified_since() - * because of the same reason. - * - * Revision 1.23 2006/07/18 14:48:47 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.21 2002/04/26 12:55:38 oes - * New function string_toupper - * - * Revision 1.20 2002/03/26 22:29:55 swa - * we have a new homepage! - * - * Revision 1.19 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.18 2002/03/07 03:46:17 oes - * Fixed compiler warnings - * - * Revision 1.17 2002/03/04 18:28:32 oes - * Deleted deletePidFile, played syleguide police - * - * Revision 1.16 2002/01/21 00:53:36 jongfoster - * Adding string_join() - * - * Revision 1.15 2001/12/30 14:07:32 steudten - * - Add signal handling (unix) - * - Add SIGHUP handler (unix) - * - Add creation of pidfile (unix) - * - Add action 'top' in rc file (RH) - * - Add entry 'SIGNALS' to manpage - * - Add exit message to logfile (unix) - * - * Revision 1.14 2001/11/05 21:43:48 steudten - * Add global var 'basedir' for unix os. - * - * Revision 1.13 2001/10/29 03:48:10 david__schmidt - * OS/2 native needed a snprintf() routine. Added one to miscutil, brackedted - * by and __OS2__ ifdef. - * - * Revision 1.12 2001/10/23 21:27:50 jongfoster - * Standardising error codes in string_append - * make_path() no longer adds '\\' if the dir already ends in '\\' (this - * is just copying a UNIX-specific fix to the Windows-specific part) - * - * Revision 1.11 2001/10/14 22:02:57 jongfoster - * New function string_append() which is like strsav(), but running - * out of memory isn't automatically FATAL. - * - * Revision 1.10 2001/09/20 13:34:09 steudten - * - * change long to int for prototype hash_string() - * - * Revision 1.9 2001/07/29 18:43:08 jongfoster - * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to - * ANSI C rules. - * - * Revision 1.8 2001/06/29 13:32:14 oes - * Removed logentry from cancelled commit - * - * Revision 1.7 2001/06/05 22:32:01 jongfoster - * New function make_path() to splice directory and file names together. - * - * Revision 1.6 2001/06/03 19:12:30 oes - * introduced bindup() - * - * Revision 1.5 2001/06/01 10:31:51 oes - * Added character class matching to trivimatch; renamed to simplematch - * - * Revision 1.4 2001/05/31 17:32:31 oes - * - * - Enhanced domain part globbing with infix and prefix asterisk - * matching and optional unanchored operation - * - * Revision 1.3 2001/05/29 23:10:09 oes - * - * - * - Introduced chomp() - * - Moved strsav() from showargs to miscutil - * - * Revision 1.2 2001/05/29 09:50:24 jongfoster - * Unified blocklist/imagelist/permissionslist. - * File format is still under discussion, but the internal changes - * are (mostly) done. - * - * Also modified interceptor behaviour: - * - We now intercept all URLs beginning with one of the following - * prefixes (and *only* these prefixes): - * * http://i.j.b/ - * * http://ijbswa.sf.net/config/ - * * http://ijbswa.sourceforge.net/config/ - * - New interceptors "home page" - go to http://i.j.b/ to see it. - * - Internal changes so that intercepted and fast redirect pages - * are not replaced with an image. - * - Interceptors now have the option to send a binary page direct - * to the client. (i.e. ijb-send-banner uses this) - * - Implemented show-url-info interceptor. (Which is why I needed - * the above interceptors changes - a typical URL is - * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". - * The previous mechanism would not have intercepted that, and - * if it had been intercepted then it then it would have replaced - * it with an image.) - * - * Revision 1.1.1.1 2001/05/15 13:59:00 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include "project.h" @@ -201,8 +53,6 @@ extern void write_pid_file(void); extern unsigned int hash_string(const char* s); -extern char *safe_strerror(int err); - extern int strcmpic(const char *s1, const char *s2); extern int strncmpic(const char *s1, const char *s2, size_t n); @@ -217,10 +67,6 @@ extern char *make_path(const char * dir, const char * file); long int pick_from_range(long int range); -#ifdef __MINGW32__ -extern char *strdup(const char *s); -#endif /* def __MINGW32__ */ - #ifndef HAVE_SNPRINTF extern int snprintf(char *, size_t, const char *, /*args*/ ...); #endif /* ndef HAVE_SNPRINTF */ diff --git a/external/privoxy/mkinstalldirs b/external/privoxy/mkinstalldirs old mode 100755 new mode 100644 diff --git a/external/privoxy/parsers.c b/external/privoxy/parsers.c index 021762e9..0cdee766 100644 --- a/external/privoxy/parsers.c +++ b/external/privoxy/parsers.c @@ -1,4 +1,4 @@ -const char parsers_rcs[] = "$Id: parsers.c,v 1.154 2009/03/13 14:10:07 fabiankeil Exp $"; +const char parsers_rcs[] = "$Id: parsers.c,v 1.237 2011/11/06 11:36:27 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.c,v $ @@ -42,848 +42,8 @@ const char parsers_rcs[] = "$Id: parsers.c,v 1.154 2009/03/13 14:10:07 fabiankei * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: parsers.c,v $ - * Revision 1.154 2009/03/13 14:10:07 fabiankeil - * Fix some more harmless warnings on amd64. - * - * Revision 1.153 2009/03/07 13:09:17 fabiankeil - * Change csp->expected_content and_csp->expected_content_length from - * size_t to unsigned long long to reduce the likelihood of integer - * overflows that would let us close the connection prematurely. - * Bug found while investigating #2669131, reported by cyberpatrol. - * - * Revision 1.152 2009/03/01 18:43:48 fabiankeil - * Help clang understand that we aren't dereferencing - * NULL pointers here. - * - * Revision 1.151 2009/02/15 14:46:35 fabiankeil - * Don't let hide-referrer{conditional-*}} pass - * Referer headers without http URLs. - * - * Revision 1.150 2008/12/04 18:12:19 fabiankeil - * Fix some cparser warnings. - * - * Revision 1.149 2008/11/21 18:39:53 fabiankeil - * In case of CONNECT requests there's no point - * in trying to keep the connection alive. - * - * Revision 1.148 2008/11/16 12:43:49 fabiankeil - * Turn keep-alive support into a runtime feature - * that is disabled by setting keep-alive-timeout - * to a negative value. - * - * Revision 1.147 2008/11/04 17:20:31 fabiankeil - * HTTP/1.1 responses without Connection - * header imply keep-alive. Act accordingly. - * - * Revision 1.146 2008/10/12 16:46:35 fabiankeil - * Remove obsolete warning about delayed delivery with chunked - * transfer encoding and FEATURE_CONNECTION_KEEP_ALIVE enabled. - * - * Revision 1.145 2008/10/09 18:21:41 fabiankeil - * Flush work-in-progress changes to keep outgoing connections - * alive where possible. Incomplete and mostly #ifdef'd out. - * - * Revision 1.144 2008/09/21 13:59:33 fabiankeil - * Treat unknown change-x-forwarded-for parameters as fatal errors. - * - * Revision 1.143 2008/09/21 13:36:52 fabiankeil - * If change-x-forwarded-for{add} is used and the client - * sends multiple X-Forwarded-For headers, append the client's - * IP address to each one of them. "Traditionally" we would - * lose all but the last one. - * - * Revision 1.142 2008/09/20 10:04:33 fabiankeil - * Remove hide-forwarded-for-headers action which has - * been obsoleted by change-x-forwarded-for{block}. - * - * Revision 1.141 2008/09/19 15:26:28 fabiankeil - * Add change-x-forwarded-for{} action to block or add - * X-Forwarded-For headers. Mostly based on code removed - * before 3.0.7. - * - * Revision 1.140 2008/09/12 17:51:43 fabiankeil - * - A few style fixes. - * - Remove a pointless cast. - * - * Revision 1.139 2008/09/04 08:13:58 fabiankeil - * Prepare for critical sections on Windows by adding a - * layer of indirection before the pthread mutex functions. - * - * Revision 1.138 2008/08/30 12:03:07 fabiankeil - * Remove FEATURE_COOKIE_JAR. - * - * Revision 1.137 2008/05/30 15:50:08 fabiankeil - * Remove questionable micro-optimizations - * whose usefulness has never been measured. - * - * Revision 1.136 2008/05/26 16:02:24 fabiankeil - * s@Insufficent@Insufficient@ - * - * Revision 1.135 2008/05/21 20:12:10 fabiankeil - * The whole point of strclean() is to modify the - * first parameter, so don't mark it immutable, - * even though the compiler lets us get away with it. - * - * Revision 1.134 2008/05/21 19:27:25 fabiankeil - * As the wafer actions are gone, we can stop including encode.h. - * - * Revision 1.133 2008/05/21 15:50:47 fabiankeil - * Ditch cast from (char **) to (char **). - * - * Revision 1.132 2008/05/21 15:47:14 fabiankeil - * Streamline sed()'s prototype and declare - * the header parse and add structures static. - * - * Revision 1.131 2008/05/20 20:13:30 fabiankeil - * Factor update_server_headers() out of sed(), ditch the - * first_run hack and make server_patterns_light static. - * - * Revision 1.130 2008/05/19 17:18:04 fabiankeil - * Wrap memmove() calls in string_move() - * to document the purpose in one place. - * - * Revision 1.129 2008/05/17 14:02:07 fabiankeil - * Normalize linear header white space. - * - * Revision 1.128 2008/05/16 16:39:03 fabiankeil - * If a header is split across multiple lines, - * merge them to a single line before parsing them. - * - * Revision 1.127 2008/05/10 13:23:38 fabiankeil - * Don't provide get_header() with the whole client state - * structure when it only needs access to csp->iob. - * - * Revision 1.126 2008/05/03 16:40:45 fabiankeil - * Change content_filters_enabled()'s parameter from - * csp->action to action so it can be also used in the - * CGI code. Don't bother checking if there are filters - * loaded, as that's somewhat besides the point. - * - * Revision 1.125 2008/04/17 14:40:49 fabiankeil - * Provide get_http_time() with the buffer size so it doesn't - * have to blindly assume that the buffer is big enough. - * - * Revision 1.124 2008/04/16 16:38:21 fabiankeil - * Don't pass the whole csp structure to flush_socket() - * when it only needs a file descriptor and a buffer. - * - * Revision 1.123 2008/03/29 12:13:46 fabiankeil - * Remove send-wafer and send-vanilla-wafer actions. - * - * Revision 1.122 2008/03/28 15:13:39 fabiankeil - * Remove inspect-jpegs action. - * - * Revision 1.121 2008/01/05 21:37:03 fabiankeil - * Let client_range() also handle Request-Range headers - * which apparently are still supported by many servers. - * - * Revision 1.120 2008/01/04 17:43:45 fabiankeil - * Improve the warning messages that get logged if the action files - * "enable" filters but no filters of that type have been loaded. - * - * Revision 1.119 2007/12/28 18:32:51 fabiankeil - * In server_content_type(): - * - Don't require leading white space when detecting image content types. - * - Change '... not replaced ...' message to sound less crazy if the text - * type actually is 'text/plain'. - * - Mark the 'text/plain == binary data' assumption for removal. - * - Remove a bunch of trailing white space. - * - * Revision 1.118 2007/12/28 16:56:35 fabiankeil - * Minor server_content_disposition() changes: - * - Don't regenerate the header name all lower-case. - * - Some white space fixes. - * - Remove useless log message in case of ENOMEM. - * - * 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. - * - * Revision 1.115 2007/11/02 16:52:50 fabiankeil - * Remove a "can't happen" error block which, over - * time, mutated into a "guaranteed to happen" block. - * - * Revision 1.114 2007/10/19 16:56:26 fabiankeil - * - Downgrade "Buffer limit reached" message to LOG_LEVEL_INFO. - * - Use shiny new content_filters_enabled() in client_range(). - * - * Revision 1.113 2007/10/10 17:29:57 fabiankeil - * I forgot about Poland. - * - * Revision 1.112 2007/10/09 16:38:40 fabiankeil - * Remove Range and If-Range headers if content filtering is enabled. - * - * Revision 1.111 2007/10/04 18:07:00 fabiankeil - * Move ACTION_VANILLA_WAFER handling from jcc's chat() into - * client_cookie_adder() to make sure send-vanilla-wafer can be - * controlled through tags (and thus regression-tested). - * - * Revision 1.110 2007/09/29 10:42:37 fabiankeil - * - Remove "scanning headers for" log message again. - * - Some more whitespace fixes. - * - * Revision 1.109 2007/09/08 14:25:48 fabiankeil - * Refactor client_referrer() and add conditional-forge parameter. - * - * Revision 1.108 2007/08/28 18:21:03 fabiankeil - * A bunch of whitespace fixes, pointy hat to me. - * - * Revision 1.107 2007/08/28 18:16:32 fabiankeil - * Fix possible memory corruption in server_http, make sure it's not - * executed for ordinary server headers and mark some problems for later. - * - * Revision 1.106 2007/08/18 14:30:32 fabiankeil - * Let content-type-overwrite{} honour force-text-mode again. - * - * Revision 1.105 2007/08/11 14:49:49 fabiankeil - * - Add prototpyes for the header parsers and make them static. - * - Comment out client_accept_encoding_adder() which isn't used right now. - * - * Revision 1.104 2007/07/14 07:38:19 fabiankeil - * Move the ACTION_FORCE_TEXT_MODE check out of - * server_content_type(). Signal other functions - * whether or not a content type has been declared. - * Part of the fix for BR#1750917. - * - * Revision 1.103 2007/06/01 16:31:54 fabiankeil - * Change sed() to return a jb_err in preparation for forward-override{}. - * - * Revision 1.102 2007/05/27 12:39:32 fabiankeil - * Adjust "X-Filter: No" to disable dedicated header filters. - * - * Revision 1.101 2007/05/14 10:16:41 fabiankeil - * Streamline client_cookie_adder(). - * - * Revision 1.100 2007/04/30 15:53:11 fabiankeil - * Make sure filters with dynamic jobs actually use them. - * - * Revision 1.99 2007/04/30 15:06:26 fabiankeil - * - Introduce dynamic pcrs jobs that can resolve variables. - * - Remove unnecessary update_action_bits_for_all_tags() call. - * - * Revision 1.98 2007/04/17 18:32:10 fabiankeil - * - Make tagging based on tags set by earlier taggers - * of the same kind possible. - * - Log whether or not new tags cause action bits updates - * (in which case a matching tag-pattern section exists). - * - Log if the user tries to set a tag that is already set. - * - * Revision 1.97 2007/04/15 16:39:21 fabiankeil - * Introduce tags as alternative way to specify which - * actions apply to a request. At the moment tags can be - * created based on client and server headers. - * - * Revision 1.96 2007/04/12 12:53:58 fabiankeil - * Log a warning if the content is compressed, filtering is - * enabled and Privoxy was compiled without zlib support. - * Closes FR#1673938. - * - * Revision 1.95 2007/03/25 14:26:40 fabiankeil - * - Fix warnings when compiled with glibc. - * - Don't use crumble() for cookie crunching. - * - Move cookie time parsing into parse_header_time(). - * - Let parse_header_time() return a jb_err code - * instead of a pointer that can only be used to - * check for NULL anyway. - * - * Revision 1.94 2007/03/21 12:23:53 fabiankeil - * - Add better protection against malicious gzip headers. - * - Stop logging the first hundred bytes of decompressed content. - * It looks like it's working and there is always debug 16. - * - Log the content size after decompression in decompress_iob() - * instead of pcrs_filter_response(). - * - * Revision 1.93 2007/03/20 15:21:44 fabiankeil - * - Use dedicated header filter actions instead of abusing "filter". - * Replace "filter-client-headers" and "filter-client-headers" - * with "server-header-filter" and "client-header-filter". - * - Remove filter_client_header() and filter_client_header(), - * filter_header() now checks the shiny new - * CSP_FLAG_CLIENT_HEADER_PARSING_DONE flag instead. - * - * Revision 1.92 2007/03/05 13:25:32 fabiankeil - * - Cosmetical changes for LOG_LEVEL_RE_FILTER messages. - * - Handle "Cookie:" and "Connection:" headers a bit smarter - * (don't crunch them just to recreate them later on). - * - Add another non-standard time format for the cookie - * expiration date detection. - * - Fix a valgrind warning. - * - * Revision 1.91 2007/02/24 12:27:32 fabiankeil - * Improve cookie expiration date detection. - * - * Revision 1.90 2007/02/08 19:12:35 fabiankeil - * Don't run server_content_length() the first time - * sed() parses server headers; only adjust the - * Content-Length header if the page was modified. - * - * Revision 1.89 2007/02/07 16:52:11 fabiankeil - * Fix log messages regarding the cookie time format - * (cookie and request URL were mixed up). - * - * Revision 1.88 2007/02/07 11:27:12 fabiankeil - * - Let decompress_iob() - * - not corrupt the content if decompression fails - * early. (the first byte(s) were lost). - * - use pointer arithmetics with defined outcome for - * a change. - * - Use a different kludge to remember a failed decompression. - * - * Revision 1.87 2007/01/31 16:21:38 fabiankeil - * Search for Max-Forwards headers case-insensitive, - * don't generate the "501 unsupported" message for invalid - * Max-Forwards values and don't increase negative ones. - * - * Revision 1.86 2007/01/30 13:05:26 fabiankeil - * - Let server_set_cookie() check the expiration date - * of cookies and don't touch the ones that are already - * expired. Fixes problems with low quality web applications - * as described in BR 932612. - * - * - Adjust comment in client_max_forwards to reality; - * remove invalid Max-Forwards headers. - * - * Revision 1.85 2007/01/26 15:33:46 fabiankeil - * Stop filter_header() from unintentionally removing - * empty header lines that were enlisted by the continue - * hack. - * - * Revision 1.84 2007/01/24 12:56:52 fabiankeil - * - Repeat the request URL before logging any headers. - * Makes reading the log easier in case of simultaneous requests. - * - If there are more than one Content-Type headers in one request, - * use the first one and remove the others. - * - Remove "newval" variable in server_content_type(). - * It's only used once. - * - * Revision 1.83 2007/01/12 15:03:02 fabiankeil - * Correct a cast, check inflateEnd() exit code - * to see if we have to, replace sprintf calls - * with snprintf. - * - * Revision 1.82 2007/01/01 19:36:37 fabiankeil - * Integrate a modified version of Wil Mahan's - * zlib patch (PR #895531). - * - * Revision 1.81 2006/12/31 22:21:33 fabiankeil - * Skip empty filter files in filter_header() - * but don't ignore the ones that come afterwards. - * Fixes BR 1619208, this time for real. - * - * Revision 1.80 2006/12/29 19:08:22 fabiankeil - * Reverted parts of my last commit - * to keep error handling working. - * - * Revision 1.79 2006/12/29 18:04:40 fabiankeil - * Fixed gcc43 conversion warnings. - * - * Revision 1.78 2006/12/26 17:19:20 fabiankeil - * Bringing back the "useless" localtime() call - * I removed in revision 1.67. On some platforms - * it's necessary to prevent time zone offsets. - * - * Revision 1.77 2006/12/07 18:44:26 fabiankeil - * Rebuild request URL in get_destination_from_headers() - * to make sure redirect{pcrs command} works as expected - * for intercepted requests. - * - * Revision 1.76 2006/12/06 19:52:25 fabiankeil - * Added get_destination_from_headers(). - * - * Revision 1.75 2006/11/13 19:05:51 fabiankeil - * Make pthread mutex locking more generic. Instead of - * checking for OSX and OpenBSD, check for FEATURE_PTHREAD - * and use mutex locking unless there is an _r function - * available. Better safe than sorry. - * - * Fixes "./configure --disable-pthread" and should result - * in less threading-related problems on pthread-using platforms, - * but it still doesn't fix BR#1122404. - * - * Revision 1.74 2006/10/02 16:59:12 fabiankeil - * The special header "X-Filter: No" now disables - * header filtering as well. - * - * Revision 1.73 2006/09/23 13:26:38 roro - * Replace TABs by spaces in source code. - * - * Revision 1.72 2006/09/23 12:37:21 fabiankeil - * Don't print a log message every time filter_headers is - * entered or left. It only creates noise without any real - * information. - * - * Revision 1.71 2006/09/21 19:55:17 fabiankeil - * Fix +hide-if-modified-since{-n}. - * - * Revision 1.70 2006/09/08 12:06:34 fabiankeil - * Have hide-if-modified-since interpret the random - * range value as minutes instead of hours. Allows - * more fine-grained configuration. - * - * Revision 1.69 2006/09/06 16:25:51 fabiankeil - * Always have parse_header_time return a pointer - * that actual makes sense, even though we currently - * only need it to detect problems. - * - * Revision 1.68 2006/09/06 10:43:32 fabiankeil - * Added config option enable-remote-http-toggle - * to specify if Privoxy should recognize special - * headers (currently only X-Filter) to change its - * behaviour. Disabled by default. - * - * Revision 1.67 2006/09/04 11:01:26 fabiankeil - * After filtering de-chunked instances, remove - * "Transfer-Encoding" header entirely instead of changing - * it to "Transfer-Encoding: identity", which is invalid. - * Thanks Michael Shields . Fixes PR 1318658. - * - * Don't use localtime in parse_header_time. An empty time struct - * is good enough, it gets overwritten by strptime anyway. - * - * Revision 1.66 2006/09/03 19:38:28 fabiankeil - * Use gmtime_r if available, fallback to gmtime with mutex - * protection for MacOSX and use vanilla gmtime for the rest. - * - * Revision 1.65 2006/08/22 10:55:56 fabiankeil - * Changed client_referrer to use the right type (size_t) for - * hostlenght and to shorten the temporary referrer string with - * '\0' instead of adding a useless line break. - * - * Revision 1.64 2006/08/17 17:15:10 fabiankeil - * - Back to timegm() using GnuPG's replacement if necessary. - * Using mktime() and localtime() could add a on hour offset if - * the randomize factor was big enough to lead to a summer/wintertime - * switch. - * - * - Removed now-useless Privoxy 3.0.3 compatibility glue. - * - * - Moved randomization code into pick_from_range(). - * - * - Changed parse_header_time definition. - * time_t isn't guaranteed to be signed and - * if it isn't, -1 isn't available as error code. - * Changed some variable types in client_if_modified_since() - * because of the same reason. - * - * Revision 1.63 2006/08/14 13:18:08 david__schmidt - * OS/2 compilation compatibility fixups - * - * Revision 1.62 2006/08/14 08:58:42 fabiankeil - * Changed include from strptime.c to strptime.h - * - * Revision 1.61 2006/08/14 08:25:19 fabiankeil - * Split filter-headers{} into filter-client-headers{} - * and filter-server-headers{}. - * Added parse_header_time() to share some code. - * Replaced timegm() with mktime(). - * - * Revision 1.60 2006/08/12 03:54:37 david__schmidt - * Windows service integration - * - * Revision 1.59 2006/08/03 02:46:41 david__schmidt - * Incorporate Fabian Keil's patch work: http://www.fabiankeil.de/sourcecode/privoxy/ - * - * Revision 1.58 2006/07/18 14:48:47 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.56.2.10 2006/01/21 16:16:08 david__schmidt - * Thanks to Edward Carrel for his patch to modernize OSX's pthreads support. See bug #1409623. - * - * Revision 1.56.2.9 2004/10/03 12:53:45 david__schmidt - * Add the ability to check jpeg images for invalid - * lengths of comment blocks. Defensive strategy - * against the exploit: - * Microsoft Security Bulletin MS04-028 - * Buffer Overrun in JPEG Processing (GDI+) Could - * Allow Code Execution (833987) - * Enabled with +inspect-jpegs in actions files. - * - * Revision 1.56.2.8 2003/07/11 13:21:25 oes - * Excluded text/plain objects from filtering. This fixes a - * couple of client-crashing, download corruption and - * Privoxy performance issues, whose root cause lies in - * web servers labelling content of unknown type as text/plain. - * - * Revision 1.56.2.7 2003/05/06 12:07:26 oes - * Fixed bug #729900: Suspicious HOST: headers are now killed and regenerated if necessary - * - * Revision 1.56.2.6 2003/04/14 21:28:30 oes - * Completing the previous change - * - * Revision 1.56.2.5 2003/04/14 12:08:16 oes - * Added temporary workaround for bug in PHP < 4.2.3 - * - * Revision 1.56.2.4 2003/03/07 03:41:05 david__schmidt - * Wrapping all *_r functions (the non-_r versions of them) with mutex semaphores for OSX. Hopefully this will take care of all of those pesky crash reports. - * - * Revision 1.56.2.3 2002/11/10 04:20:02 hal9 - * Fix typo: supressed -> suppressed - * - * Revision 1.56.2.2 2002/09/25 14:59:53 oes - * Improved cookie logging - * - * Revision 1.56.2.1 2002/09/25 14:52:45 oes - * Added basic support for OPTIONS and TRACE HTTP methods: - * - New parser function client_max_forwards which decrements - * the Max-Forwards HTTP header field of OPTIONS and TRACE - * requests by one before forwarding - * - New parser function client_host which extracts the host - * and port information from the HTTP header field if the - * request URI was not absolute - * - Don't crumble and re-add the Host: header, but only generate - * and append if missing - * - * Revision 1.56 2002/05/12 15:34:22 jongfoster - * Fixing typo in a comment - * - * Revision 1.55 2002/05/08 16:01:07 oes - * Optimized add_to_iob: - * - Use realloc instead of malloc(), memcpy(), free() - * - Expand to powers of two if possible, to get - * O(log n) reallocs instead of O(n). - * - Moved check for buffer limit here from chat - * - Report failure via returncode - * - * Revision 1.54 2002/04/02 15:03:16 oes - * Tiny code cosmetics - * - * Revision 1.53 2002/03/26 22:29:55 swa - * we have a new homepage! - * - * Revision 1.52 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.51 2002/03/13 00:27:05 jongfoster - * Killing warnings - * - * Revision 1.50 2002/03/12 01:45:35 oes - * More verbose logging - * - * Revision 1.49 2002/03/09 20:03:52 jongfoster - * - Making various functions return int rather than size_t. - * (Undoing a recent change). Since size_t is unsigned on - * Windows, functions like read_socket that return -1 on - * error cannot return a size_t. - * - * THIS WAS A MAJOR BUG - it caused frequent, unpredictable - * crashes, and also frequently caused JB to jump to 100% - * CPU and stay there. (Because it thought it had just - * read ((unsigned)-1) == 4Gb of data...) - * - * - The signature of write_socket has changed, it now simply - * returns success=0/failure=nonzero. - * - * - Trying to get rid of a few warnings --with-debug on - * Windows, I've introduced a new type "jb_socket". This is - * used for the socket file descriptors. On Windows, this - * is SOCKET (a typedef for unsigned). Everywhere else, it's - * an int. The error value can't be -1 any more, so it's - * now JB_INVALID_SOCKET (which is -1 on UNIX, and in - * Windows it maps to the #define INVALID_SOCKET.) - * - * - The signature of bind_port has changed. - * - * Revision 1.48 2002/03/07 03:46:53 oes - * Fixed compiler warnings etc - * - * Revision 1.47 2002/02/20 23:15:13 jongfoster - * Parsing functions now handle out-of-memory gracefully by returning - * an error code. - * - * Revision 1.46 2002/01/17 21:03:47 jongfoster - * Moving all our URL and URL pattern parsing code to urlmatch.c. - * - * Revision 1.45 2002/01/09 14:33:03 oes - * Added support for localtime_r. - * - * Revision 1.44 2001/12/14 01:22:54 steudten - * Remove 'user:pass@' from 'proto://user:pass@host' for the - * new added header 'Host: ..'. (See Req ID 491818) - * - * Revision 1.43 2001/11/23 00:26:38 jongfoster - * Fixing two really stupid errors in my previous commit - * - * Revision 1.42 2001/11/22 21:59:30 jongfoster - * Adding code to handle +no-cookies-keep - * - * Revision 1.41 2001/11/05 23:43:05 steudten - * Add time+date to log files. - * - * Revision 1.40 2001/10/26 20:13:09 jongfoster - * ctype.h is needed in Windows, too. - * - * Revision 1.39 2001/10/26 17:40:04 oes - * Introduced get_header_value() - * Removed http->user_agent, csp->referrer and csp->accept_types - * Removed client_accept() - * - * Revision 1.38 2001/10/25 03:40:48 david__schmidt - * Change in porting tactics: OS/2's EMX porting layer doesn't allow multiple - * threads to call select() simultaneously. So, it's time to do a real, live, - * native OS/2 port. See defines for __EMX__ (the porting layer) vs. __OS2__ - * (native). Both versions will work, but using __OS2__ offers multi-threading. - * - * Revision 1.37 2001/10/23 21:36:02 jongfoster - * Documenting sed()'s error behaviou (doc change only) - * - * Revision 1.36 2001/10/13 12:51:51 joergs - * Removed client_host, (was only required for the old 2.0.2-11 http://noijb. - * force-load), instead crumble Host: and add it (again) in client_host_adder - * (in case we get a HTTP/1.0 request without Host: header and forward it to - * a HTTP/1.1 server/proxy). - * - * Revision 1.35 2001/10/09 22:39:21 jongfoster - * assert.h is also required under Win32, so moving out of #ifndef _WIN32 - * block. - * - * Revision 1.34 2001/10/07 18:50:55 oes - * Added server_content_encoding, renamed server_transfer_encoding - * - * Revision 1.33 2001/10/07 18:04:49 oes - * Changed server_http11 to server_http and its pattern to "HTTP". - * Additional functionality: it now saves the HTTP status into - * csp->http->status and sets CT_TABOO for Status 206 (partial range) - * - * Revision 1.32 2001/10/07 15:43:28 oes - * Removed FEATURE_DENY_GZIP and replaced it with client_accept_encoding, - * client_te and client_accept_encoding_adder, triggered by the new - * +no-compression action. For HTTP/1.1 the Accept-Encoding header is - * changed to allow only identity and chunked, and the TE header is - * crunched. For HTTP/1.0, Accept-Encoding is crunched. - * - * parse_http_request no longer does anything than parsing. The rewriting - * of http->cmd and version mangling are gone. It now also recognizes - * the put and delete methods and saves the url in http->url. Removed - * unused variable. - * - * renamed content_type and content_length to have the server_ prefix - * - * server_content_type now only works if csp->content_type != CT_TABOO - * - * added server_transfer_encoding, which - * - Sets CT_TABOO to prohibit filtering if encoding compresses - * - Raises the CSP_FLAG_CHUNKED flag if Encoding is "chunked" - * - Change from "chunked" to "identity" if body was chunked - * but has been de-chunked for filtering. - * - * added server_content_md5 which crunches any Content-MD5 headers - * if the body was modified. - * - * made server_http11 conditional on +downgrade action - * - * Replaced 6 boolean members of csp with one bitmap (csp->flags) - * - * Revision 1.31 2001/10/05 14:25:02 oes - * Crumble Keep-Alive from Server - * - * Revision 1.30 2001/09/29 12:56:03 joergs - * IJB now changes HTTP/1.1 to HTTP/1.0 in requests and answers. - * - * Revision 1.29 2001/09/24 21:09:24 jongfoster - * Fixing 2 memory leaks that Guy spotted, where the paramater to - * enlist() was not being free()d. - * - * Revision 1.28 2001/09/22 16:32:28 jongfoster - * Removing unused #includes. - * - * Revision 1.27 2001/09/20 15:45:25 steudten - * - * add casting from size_t to int for printf() - * remove local variable shadow s2 - * - * Revision 1.26 2001/09/16 17:05:14 jongfoster - * Removing unused #include showarg.h - * - * Revision 1.25 2001/09/16 13:21:27 jongfoster - * Changes to use new list functions. - * - * Revision 1.24 2001/09/13 23:05:50 jongfoster - * Changing the string paramater to the header parsers a "const". - * - * Revision 1.23 2001/09/12 18:08:19 steudten - * - * In parse_http_request() header rewriting miss the host value, so - * from http://www.mydomain.com the result was just " / " not - * http://www.mydomain.com/ in case we forward. - * - * Revision 1.22 2001/09/10 10:58:53 oes - * Silenced compiler warnings - * - * Revision 1.21 2001/07/31 14:46:00 oes - * - Persistant connections now suppressed - * - sed() no longer appends empty header to csp->headers - * - * Revision 1.20 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.19 2001/07/25 17:21:54 oes - * client_uagent now saves copy of User-Agent: header value - * - * Revision 1.18 2001/07/13 14:02:46 oes - * - Included fix to repair broken HTTP requests that - * don't contain a path, not even '/'. - * - Removed all #ifdef PCRS - * - content_type now always inspected and classified as - * text, gif or other. - * - formatting / comments - * - * Revision 1.17 2001/06/29 21:45:41 oes - * Indentation, CRLF->LF, Tab-> Space - * - * Revision 1.16 2001/06/29 13:32:42 oes - * - Fixed a comment - * - Adapted free_http_request - * - Removed logentry from cancelled commit - * - * Revision 1.15 2001/06/03 19:12:38 oes - * deleted const struct interceptors - * - * Revision 1.14 2001/06/01 18:49:17 jongfoster - * Replaced "list_share" with "list" - the tiny memory gain was not - * worth the extra complexity. - * - * Revision 1.13 2001/05/31 21:30:33 jongfoster - * Removed list code - it's now in list.[ch] - * Renamed "permission" to "action", and changed many features - * to use the actions file rather than the global config. - * - * Revision 1.12 2001/05/31 17:33:13 oes - * - * CRLF -> LF - * - * Revision 1.11 2001/05/29 20:11:19 joergs - * '/ * inside comment' warning removed. - * - * Revision 1.10 2001/05/29 09:50:24 jongfoster - * Unified blocklist/imagelist/permissionslist. - * File format is still under discussion, but the internal changes - * are (mostly) done. - * - * Also modified interceptor behaviour: - * - We now intercept all URLs beginning with one of the following - * prefixes (and *only* these prefixes): - * * http://i.j.b/ - * * http://ijbswa.sf.net/config/ - * * http://ijbswa.sourceforge.net/config/ - * - New interceptors "home page" - go to http://i.j.b/ to see it. - * - Internal changes so that intercepted and fast redirect pages - * are not replaced with an image. - * - Interceptors now have the option to send a binary page direct - * to the client. (i.e. ijb-send-banner uses this) - * - Implemented show-url-info interceptor. (Which is why I needed - * the above interceptors changes - a typical URL is - * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". - * The previous mechanism would not have intercepted that, and - * if it had been intercepted then it then it would have replaced - * it with an image.) - * - * Revision 1.9 2001/05/28 17:26:33 jongfoster - * Fixing segfault if last header was crunched. - * Fixing Windows build (snprintf() is _snprintf() under Win32, but we - * can use the cross-platform sprintf() instead.) - * - * Revision 1.8 2001/05/27 22:17:04 oes - * - * - re_process_buffer no longer writes the modified buffer - * to the client, which was very ugly. It now returns the - * buffer, which it is then written by chat. - * - * - content_length now adjusts the Content-Length: header - * for modified documents rather than crunch()ing it. - * (Length info in csp->content_length, which is 0 for - * unmodified documents) - * - * - For this to work, sed() is called twice when filtering. - * - * Revision 1.7 2001/05/27 13:19:06 oes - * Patched Joergs solution for the content-length in. - * - * Revision 1.6 2001/05/26 13:39:32 jongfoster - * Only crunches Content-Length header if applying RE filtering. - * Without this fix, Microsoft Windows Update wouldn't work. - * - * Revision 1.5 2001/05/26 00:28:36 jongfoster - * Automatic reloading of config file. - * Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32). - * Most of the global variables have been moved to a new - * struct configuration_spec, accessed through csp->config->globalname - * Most of the globals remaining are used by the Win32 GUI. - * - * Revision 1.4 2001/05/22 18:46:04 oes - * - * - Enabled filtering banners by size rather than URL - * by adding patterns that replace all standard banner - * sizes with the "Junkbuster" gif to the re_filterfile - * - * - Enabled filtering WebBugs by providing a pattern - * which kills all 1x1 images - * - * - Added support for PCRE_UNGREEDY behaviour to pcrs, - * which is selected by the (nonstandard and therefore - * capital) letter 'U' in the option string. - * It causes the quantifiers to be ungreedy by default. - * Appending a ? turns back to greedy (!). - * - * - Added a new interceptor ijb-send-banner, which - * sends back the "Junkbuster" gif. Without imagelist or - * MSIE detection support, or if tinygif = 1, or the - * URL isn't recognized as an imageurl, a lame HTML - * explanation is sent instead. - * - * - Added new feature, which permits blocking remote - * script redirects and firing back a local redirect - * to the browser. - * The feature is conditionally compiled, i.e. it - * can be disabled with --disable-fast-redirects, - * plus it must be activated by a "fast-redirects" - * line in the config file, has its own log level - * and of course wants to be displayed by show-proxy-args - * Note: Boy, all the #ifdefs in 1001 locations and - * all the fumbling with configure.in and acconfig.h - * were *way* more work than the feature itself :-( - * - * - Because a generic redirect template was needed for - * this, tinygif = 3 now uses the same. - * - * - Moved GIFs, and other static HTTP response templates - * to project.h - * - * - Some minor fixes - * - * - Removed some >400 CRs again (Jon, you really worked - * a lot! ;-) - * - * Revision 1.3 2001/05/20 01:21:20 jongfoster - * Version 2.9.4 checkin. - * - Merged popupfile and cookiefile, and added control over PCRS - * filtering, in new "permissionsfile". - * - Implemented LOG_LEVEL_FATAL, so that if there is a configuration - * file error you now get a message box (in the Win32 GUI) rather - * than the program exiting with no explanation. - * - Made killpopup use the PCRS MIME-type checking and HTTP-header - * skipping. - * - Removed tabs from "config" - * - Moved duplicated url parsing code in "loaders.c" to a new funcition. - * - Bumped up version number. - * - * Revision 1.2 2001/05/17 23:02:36 oes - * - Made referrer option accept 'L' as a substitute for '§' - * - * Revision 1.1.1.1 2001/05/15 13:59:01 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include "config.h" @@ -907,6 +67,15 @@ const char parsers_rcs[] = "$Id: parsers.c,v 1.154 2009/03/13 14:10:07 fabiankei #ifdef FEATURE_ZLIB #include + +#define GZIP_IDENTIFIER_1 0x1f +#define GZIP_IDENTIFIER_2 0x8b + +#define GZIP_FLAG_CHECKSUM 0x02 +#define GZIP_FLAG_EXTRA_FIELDS 0x04 +#define GZIP_FLAG_FILE_NAME 0x08 +#define GZIP_FLAG_COMMENT 0x10 +#define GZIP_FLAG_RESERVED_BITS 0xe0 #endif #if !defined(_WIN32) && !defined(__OS2__) @@ -983,22 +152,33 @@ static jb_err server_http (struct client_state *csp, char **header static jb_err crunch_server_header (struct client_state *csp, char **header); static jb_err server_last_modified (struct client_state *csp, char **header); static jb_err server_content_disposition(struct client_state *csp, char **header); +#ifdef FEATURE_ZLIB +static jb_err server_adjust_content_encoding(struct client_state *csp, char **header); +#endif #ifdef FEATURE_CONNECTION_KEEP_ALIVE static jb_err server_save_content_length(struct client_state *csp, char **header); +static jb_err server_keep_alive(struct client_state *csp, char **header); +static jb_err server_proxy_connection(struct client_state *csp, char **header); +static jb_err client_keep_alive(struct client_state *csp, char **header); +static jb_err client_save_content_length(struct client_state *csp, char **header); #endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ static jb_err client_host_adder (struct client_state *csp); static jb_err client_xtra_adder (struct client_state *csp); static jb_err client_x_forwarded_for_adder(struct client_state *csp); static jb_err client_connection_header_adder(struct client_state *csp); -static jb_err server_connection_close_adder(struct client_state *csp); +static jb_err server_connection_adder(struct client_state *csp); +#ifdef FEATURE_CONNECTION_KEEP_ALIVE +static jb_err server_proxy_connection_adder(struct client_state *csp); +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ static jb_err create_forged_referrer(char **header, const char *hostport); static jb_err create_fake_referrer(char **header, const char *fake_referrer); static jb_err handle_conditional_hide_referrer_parameter(char **header, const char *host, const int parameter_conditional_block); -static const char *get_appropiate_connection_header(const struct client_state *csp); +static void create_content_length_header(unsigned long long content_length, + char *header, size_t buffer_length); /* * List of functions to run on a list of headers. @@ -1007,10 +187,10 @@ struct parsers { /** The header prefix to match */ const char *str; - + /** The length of the prefix to match */ const size_t len; - + /** The function to apply to this line */ const parser_func_ptr parser; }; @@ -1026,7 +206,12 @@ static const struct parsers client_patterns[] = { { "TE:", 3, client_te }, { "Host:", 5, client_host }, { "if-modified-since:", 18, client_if_modified_since }, +#ifdef FEATURE_CONNECTION_KEEP_ALIVE + { "Keep-Alive:", 11, client_keep_alive }, + { "Content-Length:", 15, client_save_content_length }, +#else { "Keep-Alive:", 11, crumble }, +#endif { "connection:", 11, client_connection }, { "proxy-connection:", 17, crumble }, { "max-forwards:", 13, client_max_forwards }, @@ -1050,9 +235,12 @@ static const struct parsers server_patterns[] = { { "Content-Encoding:", 17, server_content_encoding }, #ifdef FEATURE_CONNECTION_KEEP_ALIVE { "Content-Length:", 15, server_save_content_length }, + { "Keep-Alive:", 11, server_keep_alive }, + { "Proxy-Connection:", 17, server_proxy_connection }, +#else + { "Keep-Alive:", 11, crumble }, #endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ { "Transfer-Encoding:", 18, server_transfer_coding }, - { "Keep-Alive:", 11, crumble }, { "content-disposition:", 20, server_content_disposition }, { "Last-Modified:", 14, server_last_modified }, { "*", 0, crunch_server_header }, @@ -1064,13 +252,15 @@ static const add_header_func_ptr add_client_headers[] = { client_host_adder, client_x_forwarded_for_adder, client_xtra_adder, - /* Temporarily disabled: client_accept_encoding_adder, */ client_connection_header_adder, NULL }; static const add_header_func_ptr add_server_headers[] = { - server_connection_close_adder, + server_connection_adder, +#ifdef FEATURE_CONNECTION_KEEP_ALIVE + server_proxy_connection_adder, +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ NULL }; @@ -1130,7 +320,7 @@ long flush_socket(jb_socket fd, struct iob *iob) jb_err add_to_iob(struct client_state *csp, char *buf, long n) { struct iob *iob = csp->iob; - size_t used, offset, need, want; + size_t used, offset, need; char *p; if (n <= 0) return JB_ERR_OK; @@ -1153,8 +343,13 @@ jb_err add_to_iob(struct client_state *csp, char *buf, long n) if (need > iob->size) { - for (want = csp->iob->size ? csp->iob->size : 512; want <= need;) want *= 2; - + size_t want = csp->iob->size ? csp->iob->size : 512; + + while (want <= need) + { + want *= 2; + } + if (want <= csp->config->buffer_limit && NULL != (p = (char *)realloc(iob->buf, want))) { iob->size = want; @@ -1210,7 +405,7 @@ jb_err add_to_iob(struct client_state *csp, char *buf, long n) jb_err decompress_iob(struct client_state *csp) { char *buf; /* new, uncompressed buffer */ - char *cur; /* Current iob position (to keep the original + char *cur; /* Current iob position (to keep the original * iob->cur unmodified if we return early) */ size_t bufsize; /* allocated size of the new buffer */ size_t old_size; /* Content size before decompression */ @@ -1252,8 +447,8 @@ jb_err decompress_iob(struct client_state *csp) * Strip off the gzip header. Please see RFC 1952 for more * explanation of the appropriate fields. */ - if ((*cur++ != (char)0x1f) - || (*cur++ != (char)0x8b) + if (((*cur++ & 0xff) != GZIP_IDENTIFIER_1) + || ((*cur++ & 0xff) != GZIP_IDENTIFIER_2) || (*cur++ != Z_DEFLATED)) { log_error(LOG_LEVEL_ERROR, "Invalid gzip header when decompressing"); @@ -1262,47 +457,31 @@ jb_err decompress_iob(struct client_state *csp) else { int flags = *cur++; - /* - * XXX: These magic numbers should be replaced - * with macros to give a better idea what they do. - */ - if (flags & 0xe0) + if (flags & GZIP_FLAG_RESERVED_BITS) { /* The gzip header has reserved bits set; bail out. */ log_error(LOG_LEVEL_ERROR, "Invalid gzip header flags when decompressing"); return JB_ERR_COMPRESS; } + + /* + * Skip mtime (4 bytes), extra flags (1 byte) + * and OS type (1 byte). + */ cur += 6; /* Skip extra fields if necessary. */ - if (flags & 0x04) + if (flags & GZIP_FLAG_EXTRA_FIELDS) { /* * Skip a given number of bytes, specified * as a 16-bit little-endian value. - */ - /* - * XXX: This code used to be: - * - * csp->iob->cur += *csp->iob->cur++ + (*csp->iob->cur++ << 8); * - * which I had to change into: - * - * cur += *cur++ + (*cur++ << 8); - * - * at which point gcc43 finally noticed that the value - * of cur is undefined (it depends on which of the - * summands is evaluated first). - * - * I haven't come across a site where this - * code is actually executed yet, but I hope - * it works anyway. + * XXX: this code is untested and should probably be removed. */ int skip_bytes; skip_bytes = *cur++; - skip_bytes = *cur++ << 8; - - assert(skip_bytes == *csp->iob->cur - 2 + ((*csp->iob->cur - 1) << 8)); + skip_bytes += *cur++ << 8; /* * The number of bytes to skip should be positive @@ -1322,22 +501,21 @@ jb_err decompress_iob(struct client_state *csp) } /* Skip the filename if necessary. */ - if (flags & 0x08) + if (flags & GZIP_FLAG_FILE_NAME) { /* A null-terminated string is supposed to follow. */ while (*cur++ && (cur < csp->iob->eod)); - } /* Skip the comment if necessary. */ - if (flags & 0x10) + if (flags & GZIP_FLAG_COMMENT) { /* A null-terminated string is supposed to follow. */ while (*cur++ && (cur < csp->iob->eod)); } /* Skip the CRC if necessary. */ - if (flags & 0x02) + if (flags & GZIP_FLAG_CHECKSUM) { cur += 2; } @@ -1375,7 +553,7 @@ jb_err decompress_iob(struct client_state *csp) * * Fortunately, add_to_iob() has thoughtfully null-terminated * the buffer; we can just increment the end pointer to include - * the dummy byte. + * the dummy byte. */ csp->iob->eod++; } @@ -1397,7 +575,7 @@ jb_err decompress_iob(struct client_state *csp) * Passing -MAX_WBITS to inflateInit2 tells the library * that there is no zlib header. */ - if (inflateInit2 (&zstr, -MAX_WBITS) != Z_OK) + if (inflateInit2(&zstr, -MAX_WBITS) != Z_OK) { log_error(LOG_LEVEL_ERROR, "Error initializing decompression"); return JB_ERR_COMPRESS; @@ -1417,7 +595,7 @@ jb_err decompress_iob(struct client_state *csp) assert(bufsize >= skip_size); memcpy(buf, csp->iob->buf, skip_size); - zstr.avail_out = bufsize - skip_size; + zstr.avail_out = (uInt)(bufsize - skip_size); zstr.next_out = (Bytef *)buf + skip_size; /* Try to decompress the whole stream in one shot. */ @@ -1428,21 +606,24 @@ jb_err decompress_iob(struct client_state *csp) char *tmpbuf; /* used for realloc'ing the buffer */ size_t oldbufsize = bufsize; /* keep track of the old bufsize */ - /* - * If zlib wants more data then there's a problem, because - * the complete compressed file should have been buffered. - */ if (0 == zstr.avail_in) { - log_error(LOG_LEVEL_ERROR, "Unexpected end of compressed iob"); - return JB_ERR_COMPRESS; + /* + * If zlib wants more data then there's a problem, because + * the complete compressed file should have been buffered. + */ + log_error(LOG_LEVEL_ERROR, + "Unexpected end of compressed iob. Using what we got so far."); + break; } /* - * If we tried the limit and still didn't have enough - * memory, just give up. + * If we reached the buffer limit and still didn't have enough + * memory, just give up. Due to the ceiling enforced by the next + * if block we could actually check for equality here, but as it + * can be easily mistaken for a bug we don't. */ - if (bufsize == csp->config->buffer_limit) + if (bufsize >= csp->config->buffer_limit) { log_error(LOG_LEVEL_ERROR, "Buffer limit reached while decompressing iob"); return JB_ERR_MEMORY; @@ -1456,7 +637,7 @@ jb_err decompress_iob(struct client_state *csp) { bufsize = csp->config->buffer_limit; } - + /* Try to allocate the new buffer. */ tmpbuf = realloc(buf, bufsize); if (NULL == tmpbuf) @@ -1474,7 +655,7 @@ jb_err decompress_iob(struct client_state *csp) * buffer, which may be in a location different from * the old one. */ - zstr.avail_out += bufsize - oldbufsize; + zstr.avail_out += (uInt)(bufsize - oldbufsize); zstr.next_out = (Bytef *)tmpbuf + bufsize - zstr.avail_out; /* @@ -1483,7 +664,6 @@ jb_err decompress_iob(struct client_state *csp) */ assert(zstr.avail_out == tmpbuf + bufsize - (char *)zstr.next_out); assert((char *)zstr.next_out == tmpbuf + ((char *)oldnext_out - buf)); - assert(zstr.avail_out > 0U); buf = tmpbuf; } @@ -1505,11 +685,15 @@ jb_err decompress_iob(struct client_state *csp) */ } - if (status != Z_STREAM_END) + if ((status != Z_STREAM_END) && (0 != zstr.avail_in)) { - /* We failed to decompress the stream. */ + /* + * We failed to decompress the stream and it's + * not simply because of missing data. + */ log_error(LOG_LEVEL_ERROR, - "Error in decompressing to the buffer (iob): %s", zstr.msg); + "Unexpected error while decompressing to the buffer (iob): %s", + zstr.msg); return JB_ERR_COMPRESS; } @@ -1525,7 +709,7 @@ jb_err decompress_iob(struct client_state *csp) csp->iob->cur = csp->iob->buf + skip_size; csp->iob->eod = (char *)zstr.next_out; csp->iob->size = bufsize; - + /* * Make sure the new uncompressed iob obeys some minimal * consistency conditions. @@ -1697,7 +881,7 @@ char *get_header(struct iob *iob) * Header spans multiple lines, append the next one. */ char *continued_header; - + continued_header = get_header_line(iob); if ((continued_header == NULL) || (*continued_header == '\0')) { @@ -1829,7 +1013,7 @@ char *get_header_value(const struct list *header_list, const char *header_name) } } - /* + /* * Not found */ return NULL; @@ -1841,7 +1025,7 @@ char *get_header_value(const struct list *header_list, const char *header_name) * * Function : scan_headers * - * Description : Scans headers, applies tags and updates action bits. + * Description : Scans headers, applies tags and updates action bits. * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) @@ -1957,7 +1141,7 @@ jb_err update_server_headers(struct client_state *csp) { "Content-Length:", 15, server_adjust_content_length }, { "Transfer-Encoding:", 18, server_transfer_coding }, #ifdef FEATURE_ZLIB - { "Content-Encoding:", 17, server_content_encoding }, + { "Content-Encoding:", 17, server_adjust_content_encoding }, #endif /* def FEATURE_ZLIB */ { NULL, 0, NULL } }; @@ -1983,6 +1167,37 @@ jb_err update_server_headers(struct client_state *csp) } } +#ifdef FEATURE_CONNECTION_KEEP_ALIVE + if ((JB_ERR_OK == err) + && (csp->flags & CSP_FLAG_MODIFIED) + && (csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE) + && !(csp->flags & CSP_FLAG_SERVER_CONTENT_LENGTH_SET)) + { + char header[50]; + + create_content_length_header(csp->content_length, header, sizeof(header)); + err = enlist(csp->headers, header); + if (JB_ERR_OK == err) + { + log_error(LOG_LEVEL_HEADER, + "Content modified with no Content-Length header set. " + "Created: %s.", header); + } + } +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ + +#ifdef FEATURE_COMPRESSION + if ((JB_ERR_OK == err) + && (csp->flags & CSP_FLAG_BUFFERED_CONTENT_DEFLATED)) + { + err = enlist_unique_header(csp->headers, "Content-Encoding", "deflate"); + if (JB_ERR_OK == err) + { + log_error(LOG_LEVEL_HEADER, "Added header: Content-Encoding: deflate"); + } + } +#endif + return err; } @@ -2015,7 +1230,6 @@ static jb_err header_tagger(struct client_state *csp, char *header) struct re_filterfile_spec *b; struct list_entry *tag_name; - int found_filters = 0; const size_t header_length = strlen(header); if (csp->flags & CSP_FLAG_CLIENT_HEADER_PARSING_DONE) @@ -2029,21 +1243,7 @@ static jb_err header_tagger(struct client_state *csp, char *header) multi_action_index = ACTION_MULTI_CLIENT_HEADER_TAGGER; } - /* Check if there are any filters */ - for (i = 0; i < MAX_AF_FILES; i++) - { - fl = csp->rlist[i]; - if (NULL != fl) - { - if (NULL != fl->f) - { - found_filters = 1; - break; - } - } - } - - if (0 == found_filters) + if (filters_available(csp) == FALSE) { log_error(LOG_LEVEL_ERROR, "Inconsistent configuration: " "tagging enabled, but no taggers available."); @@ -2143,7 +1343,7 @@ static jb_err header_tagger(struct client_state *csp, char *header) b->name); continue; } - + if (!list_contains_item(csp->tags, tag)) { if (JB_ERR_OK != enlist(csp->tags, tag)) @@ -2226,7 +1426,7 @@ static jb_err filter_header(struct client_state *csp, char **header) struct re_filterfile_spec *b; struct list_entry *filtername; - int i, found_filters = 0; + int i; int wanted_filter_type; int multi_action_index; @@ -2246,23 +1446,7 @@ static jb_err filter_header(struct client_state *csp, char **header) multi_action_index = ACTION_MULTI_CLIENT_HEADER_FILTER; } - /* - * Need to check the set of re_filterfiles... - */ - for (i = 0; i < MAX_AF_FILES; i++) - { - fl = csp->rlist[i]; - if (NULL != fl) - { - if (NULL != fl->f) - { - found_filters = 1; - break; - } - } - } - - if (0 == found_filters) + if (filters_available(csp) == FALSE) { log_error(LOG_LEVEL_ERROR, "Inconsistent configuration: " "header filtering enabled, but no matching filters available."); @@ -2323,7 +1507,7 @@ static jb_err filter_header(struct client_state *csp, char **header) matches = pcrs_execute(job, *header, size, &newheader, &size); if ( 0 < matches ) { - current_hits += matches; + current_hits += matches; log_error(LOG_LEVEL_HEADER, "Transforming \"%s\" to \"%s\"", *header, newheader); freez(*header); *header = newheader; @@ -2374,9 +1558,9 @@ static jb_err filter_header(struct client_state *csp, char **header) * * Function : server_connection * - * Description : Makes sure that the value of the Connection: header - * is "close" and signals server_connection_close_adder - * to do nothing. + * Description : Makes sure a proper "Connection:" header is + * set and signals connection_header_adder to + * do nothing. * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) @@ -2391,42 +1575,253 @@ static jb_err filter_header(struct client_state *csp, char **header) *********************************************************************/ static jb_err server_connection(struct client_state *csp, char **header) { - char *old_header = *header; - - /* Do we have a 'Connection: close' header? */ - if (strcmpic(*header, "Connection: close")) + if (!strcmpic(*header, "Connection: keep-alive") +#ifdef FEATURE_CONNECTION_KEEP_ALIVE + && !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED) +#endif + ) { #ifdef FEATURE_CONNECTION_KEEP_ALIVE - if ((csp->config->feature_flags & - RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE) - && !strcmpic(*header, "Connection: keep-alive")) + if ((csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE)) { - /* Remember to keep the connection alive. */ csp->flags |= CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE; } -#endif /* FEATURE_CONNECTION_KEEP_ALIVE */ - *header = strdup("Connection: close"); - if (header == NULL) - { - return JB_ERR_MEMORY; + if ((csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE)) + { + log_error(LOG_LEVEL_HEADER, + "Keeping the server header '%s' around.", *header); + } + else +#endif /* FEATURE_CONNECTION_KEEP_ALIVE */ + { + char *old_header = *header; + + *header = strdup("Connection: close"); + if (header == NULL) + { + return JB_ERR_MEMORY; + } + log_error(LOG_LEVEL_HEADER, "Replaced: \'%s\' with \'%s\'", old_header, *header); + freez(old_header); } - log_error(LOG_LEVEL_HEADER, "Replaced: \'%s\' with \'%s\'", old_header, *header); - freez(old_header); } - /* Signal server_connection_close_adder() to return early. */ - csp->flags |= CSP_FLAG_SERVER_CONNECTION_CLOSE_SET; + /* Signal server_connection_adder() to return early. */ + csp->flags |= CSP_FLAG_SERVER_CONNECTION_HEADER_SET; return JB_ERR_OK; } + +#ifdef FEATURE_CONNECTION_KEEP_ALIVE +/********************************************************************* + * + * Function : server_keep_alive + * + * Description : Stores the server's keep alive timeout. + * + * Parameters : + * 1 : csp = Current client state (buffers, headers, etc...) + * 2 : header = On input, pointer to header to modify. + * On output, pointer to the modified header, or NULL + * to remove the header. This function frees the + * original string if necessary. + * + * Returns : JB_ERR_OK. + * + *********************************************************************/ +static jb_err server_keep_alive(struct client_state *csp, char **header) +{ + unsigned int keep_alive_timeout; + const char *timeout_position = strstr(*header, "timeout="); + + if ((NULL == timeout_position) + || (1 != sscanf(timeout_position, "timeout=%u", &keep_alive_timeout))) + { + log_error(LOG_LEVEL_ERROR, "Couldn't parse: %s", *header); + } + else + { + if (keep_alive_timeout < csp->server_connection.keep_alive_timeout) + { + log_error(LOG_LEVEL_HEADER, + "Reducing keep-alive timeout from %u to %u.", + csp->server_connection.keep_alive_timeout, keep_alive_timeout); + csp->server_connection.keep_alive_timeout = keep_alive_timeout; + } + else + { + /* XXX: Is this log worthy? */ + log_error(LOG_LEVEL_HEADER, + "Server keep-alive timeout is %u. Sticking with %u.", + keep_alive_timeout, csp->server_connection.keep_alive_timeout); + } + csp->flags |= CSP_FLAG_SERVER_KEEP_ALIVE_TIMEOUT_SET; + } + + return JB_ERR_OK; +} + + +/********************************************************************* + * + * Function : server_proxy_connection + * + * Description : Figures out whether or not we should add a + * Proxy-Connection header. + * + * Parameters : + * 1 : csp = Current client state (buffers, headers, etc...) + * 2 : header = On input, pointer to header to modify. + * On output, pointer to the modified header, or NULL + * to remove the header. This function frees the + * original string if necessary. + * + * Returns : JB_ERR_OK. + * + *********************************************************************/ +static jb_err server_proxy_connection(struct client_state *csp, char **header) +{ + csp->flags |= CSP_FLAG_SERVER_PROXY_CONNECTION_HEADER_SET; + return JB_ERR_OK; +} + + +/********************************************************************* + * + * Function : client_keep_alive + * + * Description : Stores the client's keep alive timeout. + * + * Parameters : + * 1 : csp = Current client state (buffers, headers, etc...) + * 2 : header = On input, pointer to header to modify. + * On output, pointer to the modified header, or NULL + * to remove the header. This function frees the + * original string if necessary. + * + * Returns : JB_ERR_OK. + * + *********************************************************************/ +static jb_err client_keep_alive(struct client_state *csp, char **header) +{ + unsigned int keep_alive_timeout; + const char *timeout_position = strstr(*header, ": "); + + if (!(csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE)) + { + log_error(LOG_LEVEL_HEADER, + "keep-alive support is disabled. Crunching: %s.", *header); + freez(*header); + return JB_ERR_OK; + } + + if ((NULL == timeout_position) + || (1 != sscanf(timeout_position, ": %u", &keep_alive_timeout))) + { + log_error(LOG_LEVEL_ERROR, "Couldn't parse: %s", *header); + } + else + { + if (keep_alive_timeout < csp->config->keep_alive_timeout) + { + log_error(LOG_LEVEL_HEADER, + "Reducing keep-alive timeout from %u to %u.", + csp->config->keep_alive_timeout, keep_alive_timeout); + csp->server_connection.keep_alive_timeout = keep_alive_timeout; + } + else + { + /* XXX: Is this log worthy? */ + log_error(LOG_LEVEL_HEADER, + "Client keep-alive timeout is %u. Sticking with %u.", + keep_alive_timeout, csp->config->keep_alive_timeout); + } + } + + return JB_ERR_OK; +} + + +/********************************************************************* + * + * Function : get_content_length + * + * Description : Gets the content length specified in a + * Content-Length header. + * + * Parameters : + * 1 : header = The Content-Length header. + * 2 : length = Storage to return the value. + * + * Returns : JB_ERR_OK on success, or + * JB_ERR_PARSE if no value is recognized. + * + *********************************************************************/ +static jb_err get_content_length(const char *header, unsigned long long *length) +{ + assert(header[14] == ':'); + +#ifdef _WIN32 + assert(sizeof(unsigned long long) > 4); + if (1 != sscanf(header+14, ": %I64u", length)) +#else + if (1 != sscanf(header+14, ": %llu", length)) +#endif + { + return JB_ERR_PARSE; + } + + return JB_ERR_OK; +} + + +/********************************************************************* + * + * Function : client_save_content_length + * + * Description : Save the Content-Length sent by the client. + * + * Parameters : + * 1 : csp = Current client state (buffers, headers, etc...) + * 2 : header = On input, pointer to header to modify. + * On output, pointer to the modified header, or NULL + * to remove the header. This function frees the + * original string if necessary. + * + * Returns : JB_ERR_OK on success, or + * JB_ERR_MEMORY on out-of-memory error. + * + *********************************************************************/ +static jb_err client_save_content_length(struct client_state *csp, char **header) +{ + unsigned long long content_length = 0; + + assert(*(*header+14) == ':'); + + if (JB_ERR_OK != get_content_length(*header, &content_length)) + { + log_error(LOG_LEVEL_ERROR, "Crunching invalid header: %s", *header); + freez(*header); + } + else + { + csp->expected_client_content_length = content_length; + } + + return JB_ERR_OK; +} +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ + + + /********************************************************************* * * Function : client_connection * * Description : Makes sure a proper "Connection:" header is - * set and signals connection_header_adder + * set and signals connection_header_adder * to do nothing. * * Parameters : @@ -2442,14 +1837,63 @@ static jb_err server_connection(struct client_state *csp, char **header) *********************************************************************/ static jb_err client_connection(struct client_state *csp, char **header) { - char *old_header = *header; - const char *wanted_header = get_appropiate_connection_header(csp); + static const char connection_close[] = "Connection: close"; - if (strcmpic(*header, wanted_header)) + if (!strcmpic(*header, connection_close)) { - *header = strdup(wanted_header); +#ifdef FEATURE_CONNECTION_KEEP_ALIVE + if ((csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_SHARING)) + { + if (!strcmpic(csp->http->ver, "HTTP/1.1")) + { + log_error(LOG_LEVEL_HEADER, + "Removing \'%s\' to imply keep-alive.", *header); + freez(*header); + /* + * While we imply keep-alive to the server, + * we have to remember that the client didn't. + */ + csp->flags &= ~CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE; + } + else + { + char *old_header = *header; + + *header = strdup("Connection: keep-alive"); + if (header == NULL) + { + return JB_ERR_MEMORY; + } + log_error(LOG_LEVEL_HEADER, + "Replaced: \'%s\' with \'%s\'", old_header, *header); + freez(old_header); + } + } + else + { + log_error(LOG_LEVEL_HEADER, + "Keeping the client header '%s' around. " + "The connection will not be kept alive.", + *header); + csp->flags &= ~CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE; + } + } + else if ((csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE)) + { + log_error(LOG_LEVEL_HEADER, + "Keeping the client header '%s' around. " + "The server connection will be kept alive if possible.", + *header); + csp->flags |= CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE; +#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ + } + else + { + char *old_header = *header; + + *header = strdup(connection_close); if (header == NULL) - { + { return JB_ERR_MEMORY; } log_error(LOG_LEVEL_HEADER, @@ -2457,7 +1901,7 @@ static jb_err client_connection(struct client_state *csp, char **header) freez(old_header); } - /* Signal client_connection_close_adder() to return early. */ + /* Signal client_connection_adder() to return early. */ csp->flags |= CSP_FLAG_CLIENT_CONNECTION_HEADER_SET; return JB_ERR_OK; @@ -2519,7 +1963,7 @@ static jb_err crunch_server_header(struct client_state *csp, char **header) /* Is the current header the lucky one? */ if (strstr(*header, crunch_pattern)) { - log_error(LOG_LEVEL_HEADER, "Crunching server header: %s (contains: %s)", *header, crunch_pattern); + log_error(LOG_LEVEL_HEADER, "Crunching server header: %s (contains: %s)", *header, crunch_pattern); freez(*header); } } @@ -2533,7 +1977,7 @@ static jb_err crunch_server_header(struct client_state *csp, char **header) * Function : server_content_type * * Description : Set the content-type for filterable types (text/.*, - * .*xml.*, javascript and image/gif) unless filtering has been + * .*xml.*, .*script.* and image/gif) unless filtering has been * forbidden (CT_TABOO) while parsing earlier headers. * NOTE: Since text/plain is commonly used by web servers * for files whose correct type is unknown, we don't @@ -2583,7 +2027,7 @@ static jb_err server_content_type(struct client_state *csp, char **header) */ if ((strstr(*header, "text/") && !strstr(*header, "plain")) || strstr(*header, "xml") - || strstr(*header, "application/x-javascript")) + || strstr(*header, "script")) { csp->content_type |= CT_TEXT; } @@ -2599,8 +2043,8 @@ static jb_err server_content_type(struct client_state *csp, char **header) if (csp->action->flags & ACTION_CONTENT_TYPE_OVERWRITE) { /* - * Make sure the user doesn't accidently - * change the content type of binary documents. + * Make sure the user doesn't accidentally + * change the content type of binary documents. */ if ((csp->content_type & CT_TEXT) || (csp->action->flags & ACTION_FORCE_TEXT_MODE)) { @@ -2693,16 +2137,16 @@ static jb_err server_transfer_coding(struct client_state *csp, char **header) * * Function : server_content_encoding * - * Description : This function is run twice for each request, - * unless FEATURE_ZLIB and filtering are disabled. + * Description : Used to check if the content is compressed, and if + * FEATURE_ZLIB is disabled, filtering is disabled as + * well. * - * The first run is used to check if the content - * is compressed, if FEATURE_ZLIB is disabled - * filtering is then disabled as well, if FEATURE_ZLIB - * is enabled the content is marked for decompression. - * - * The second run is used to remove the Content-Encoding - * header if the decompression was successful. + * If FEATURE_ZLIB is enabled and the compression type + * supported, the content is marked for decompression. + * + * XXX: Doesn't properly deal with multiple or with + * unsupported but unknown encodings. + * Is case-sensitive but shouldn't be. * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) @@ -2718,19 +2162,25 @@ static jb_err server_transfer_coding(struct client_state *csp, char **header) static jb_err server_content_encoding(struct client_state *csp, char **header) { #ifdef FEATURE_ZLIB - if ((csp->flags & CSP_FLAG_MODIFIED) - && (csp->content_type & (CT_GZIP | CT_DEFLATE))) + if (strstr(*header, "sdch")) { /* - * We successfully decompressed the content, - * and have to clean the header now, so the - * client no longer expects compressed data.. - * - * XXX: There is a difference between cleaning - * and removing it completely. + * Shared Dictionary Compression over HTTP isn't supported, + * filtering it anyway is pretty much guaranteed to mess up + * the encoding. */ - log_error(LOG_LEVEL_HEADER, "Crunching: %s", *header); - freez(*header); + csp->content_type |= CT_TABOO; + + /* + * Log a warning if the user expects the content to be filtered. + */ + if ((csp->rlist != NULL) && + (!list_is_empty(csp->action->multi[ACTION_MULTI_FILTER]))) + { + log_error(LOG_LEVEL_INFO, + "SDCH-compressed content detected, content filtering disabled. " + "Consider suppressing SDCH offers made by the client."); + } } else if (strstr(*header, "gzip")) { @@ -2751,7 +2201,16 @@ static jb_err server_content_encoding(struct client_state *csp, char **header) csp->content_type |= CT_TABOO; } #else /* !defined(FEATURE_ZLIB) */ - if (strstr(*header, "gzip") || strstr(*header, "compress") || strstr(*header, "deflate")) + /* + * XXX: Using a black list here isn't the right approach. + * + * In case of SDCH, building with zlib support isn't + * going to help. + */ + if (strstr(*header, "gzip") || + strstr(*header, "compress") || + strstr(*header, "deflate") || + strstr(*header, "sdch")) { /* * Body is compressed, turn off pcrs and gif filtering. @@ -2777,6 +2236,49 @@ static jb_err server_content_encoding(struct client_state *csp, char **header) } +#ifdef FEATURE_ZLIB +/********************************************************************* + * + * Function : server_adjust_content_encoding + * + * Description : Remove the Content-Encoding header if the + * decompression was successful and the content + * has been modifed. + * + * Parameters : + * 1 : csp = Current client state (buffers, headers, etc...) + * 2 : header = On input, pointer to header to modify. + * On output, pointer to the modified header, or NULL + * to remove the header. This function frees the + * original string if necessary. + * + * Returns : JB_ERR_OK on success, or + * JB_ERR_MEMORY on out-of-memory error. + * + *********************************************************************/ +static jb_err server_adjust_content_encoding(struct client_state *csp, char **header) +{ + if ((csp->flags & CSP_FLAG_MODIFIED) + && (csp->content_type & (CT_GZIP | CT_DEFLATE))) + { + /* + * We successfully decompressed the content, + * and have to clean the header now, so the + * client no longer expects compressed data. + * + * XXX: There is a difference between cleaning + * and removing it completely. + */ + log_error(LOG_LEVEL_HEADER, "Crunching: %s", *header); + freez(*header); + } + + return JB_ERR_OK; + +} +#endif /* defined(FEATURE_ZLIB) */ + + /********************************************************************* * * Function : server_adjust_content_length @@ -2797,22 +2299,19 @@ static jb_err server_content_encoding(struct client_state *csp, char **header) *********************************************************************/ static jb_err server_adjust_content_length(struct client_state *csp, char **header) { - const size_t max_header_length = 80; - /* Regenerate header if the content was modified. */ if (csp->flags & CSP_FLAG_MODIFIED) { + const size_t header_length = 50; freez(*header); - *header = (char *) zalloc(max_header_length); + *header = malloc(header_length); if (*header == NULL) { return JB_ERR_MEMORY; } - - snprintf(*header, max_header_length, "Content-Length: %d", - (int)csp->content_length); - log_error(LOG_LEVEL_HEADER, "Adjusted Content-Length to %d", - (int)csp->content_length); + create_content_length_header(csp->content_length, *header, header_length); + log_error(LOG_LEVEL_HEADER, + "Adjusted Content-Length to %llu", csp->content_length); } return JB_ERR_OK; @@ -2843,7 +2342,7 @@ static jb_err server_save_content_length(struct client_state *csp, char **header assert(*(*header+14) == ':'); - if (1 != sscanf(*header+14, ": %llu", &content_length)) + if (JB_ERR_OK != get_content_length(*header, &content_length)) { log_error(LOG_LEVEL_ERROR, "Crunching invalid header: %s", *header); freez(*header); @@ -2851,6 +2350,7 @@ static jb_err server_save_content_length(struct client_state *csp, char **header else { csp->expected_content_length = content_length; + csp->flags |= CSP_FLAG_SERVER_CONTENT_LENGTH_SET; csp->flags |= CSP_FLAG_CONTENT_LENGTH_SET; } @@ -2932,7 +2432,7 @@ static jb_err server_content_disposition(struct client_state *csp, char **header return JB_ERR_OK; } else - { + { /* * Replacing Content-Disposition header */ @@ -2972,17 +2472,9 @@ static jb_err server_content_disposition(struct client_state *csp, char **header static jb_err server_last_modified(struct client_state *csp, char **header) { const char *newval; - char buf[BUFFER_SIZE]; - + time_t last_modified; char newheader[50]; -#ifdef HAVE_GMTIME_R - struct tm gmt; -#endif - struct tm *timeptr = NULL; - time_t now, last_modified; - long int rtime; - long int days, hours, minutes, seconds; - + /* * Are we messing with the Last-Modified header? */ @@ -3004,18 +2496,19 @@ static jb_err server_last_modified(struct client_state *csp, char **header) return JB_ERR_OK; } else if (0 == strcmpic(newval, "reset-to-request-time")) - { + { /* * Setting Last-Modified Header to now. */ + char buf[30]; get_http_time(0, buf, sizeof(buf)); freez(*header); *header = strdup("Last-Modified: "); - string_append(header, buf); + string_append(header, buf); if (*header == NULL) { - log_error(LOG_LEVEL_HEADER, "Insufficient memory. Last-Modified header got lost, boohoo."); + log_error(LOG_LEVEL_HEADER, "Insufficient memory. Last-Modified header got lost, boohoo."); } else { @@ -3027,16 +2520,7 @@ static jb_err server_last_modified(struct client_state *csp, char **header) const char *header_time = *header + sizeof("Last-Modified:"); log_error(LOG_LEVEL_HEADER, "Randomizing: %s", *header); - now = time(NULL); -#ifdef HAVE_GMTIME_R - timeptr = gmtime_r(&now, &gmt); -#elif FEATURE_PTHREAD - privoxy_mutex_lock(&gmtime_mutex); - timeptr = gmtime(&now); - privoxy_mutex_unlock(&gmtime_mutex); -#else - timeptr = gmtime(&now); -#endif + if (JB_ERR_OK != parse_header_time(header_time, &last_modified)) { log_error(LOG_LEVEL_HEADER, "Couldn't parse: %s in %s (crunching!)", header_time, *header); @@ -3044,30 +2528,49 @@ static jb_err server_last_modified(struct client_state *csp, char **header) } else { + time_t now; + struct tm *timeptr = NULL; + long int rtime; +#ifdef HAVE_GMTIME_R + struct tm gmt; +#endif + now = time(NULL); rtime = (long int)difftime(now, last_modified); if (rtime) { - int negative = 0; + long int days, hours, minutes, seconds; + const int negative_delta = (rtime < 0); - if (rtime < 0) + if (negative_delta) { - rtime *= -1; - negative = 1; + rtime *= -1; log_error(LOG_LEVEL_HEADER, "Server time in the future."); } rtime = pick_from_range(rtime); - if (negative) rtime *= -1; + if (negative_delta) + { + rtime *= -1; + } last_modified += rtime; #ifdef HAVE_GMTIME_R timeptr = gmtime_r(&last_modified, &gmt); -#elif FEATURE_PTHREAD +#elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&gmtime_mutex); timeptr = gmtime(&last_modified); privoxy_mutex_unlock(&gmtime_mutex); #else timeptr = gmtime(&last_modified); #endif - strftime(newheader, sizeof(newheader), "%a, %d %b %Y %H:%M:%S GMT", timeptr); + if ((NULL == timeptr) || !strftime(newheader, + sizeof(newheader), "%a, %d %b %Y %H:%M:%S GMT", timeptr)) + { + log_error(LOG_LEVEL_ERROR, + "Randomizing '%s' failed. Crunching the header without replacement.", + *header); + freez(*header); + return JB_ERR_OK; + } + freez(*header); *header = strdup("Last-Modified: "); string_append(header, newheader); @@ -3075,7 +2578,7 @@ static jb_err server_last_modified(struct client_state *csp, char **header) if (*header == NULL) { log_error(LOG_LEVEL_ERROR, "Insufficient memory, header crunched without replacement."); - return JB_ERR_MEMORY; + return JB_ERR_MEMORY; } days = rtime / (3600 * 24); @@ -3120,25 +2623,17 @@ static jb_err server_last_modified(struct client_state *csp, char **header) *********************************************************************/ static jb_err client_accept_encoding(struct client_state *csp, char **header) { +#ifdef FEATURE_COMPRESSION + if ((csp->config->feature_flags & RUNTIME_FEATURE_COMPRESSION) + && strstr(*header, "deflate")) + { + csp->flags |= CSP_FLAG_CLIENT_SUPPORTS_DEFLATE; + } +#endif if ((csp->action->flags & ACTION_NO_COMPRESSION) != 0) { log_error(LOG_LEVEL_HEADER, "Suppressed offer to compress content"); - freez(*header); - - /* Temporarily disable the correct behaviour to - * work around a PHP bug. - * - * if (!strcmpic(csp->http->ver, "HTTP/1.1")) - * { - * *header = strdup("Accept-Encoding: identity;q=1.0, *;q=0"); - * if (*header == NULL) - * { - * return JB_ERR_MEMORY; - * } - * } - * - */ } return JB_ERR_OK; @@ -3199,7 +2694,7 @@ static jb_err client_referrer(struct client_state *csp, char **header) /* booleans for parameters we have to check multiple times */ int parameter_conditional_block; int parameter_conditional_forge; - + #ifdef FEATURE_FORCE_LOAD /* * Since the referrer can include the prefix even @@ -3297,18 +2792,18 @@ static jb_err client_accept_language(struct client_state *csp, char **header) return JB_ERR_OK; } else - { + { /* * Replacing Accept-Language header */ freez(*header); *header = strdup("Accept-Language: "); - string_append(header, newval); + string_append(header, newval); if (*header == NULL) { log_error(LOG_LEVEL_ERROR, - "Insufficient memory. Accept-Language header crunched without replacement."); + "Insufficient memory. Accept-Language header crunched without replacement."); } else { @@ -3349,7 +2844,7 @@ static jb_err crunch_client_header(struct client_state *csp, char **header) /* Is the current header the lucky one? */ if (strstr(*header, crunch_pattern)) { - log_error(LOG_LEVEL_HEADER, "Crunching client header: %s (contains: %s)", *header, crunch_pattern); + log_error(LOG_LEVEL_HEADER, "Crunching client header: %s (contains: %s)", *header, crunch_pattern); freez(*header); } } @@ -3654,10 +3149,10 @@ static jb_err client_host(struct client_state *csp, char **header) return JB_ERR_OK; } - if (!csp->http->hostport || (*csp->http->hostport == '*') || + if (!csp->http->hostport || (*csp->http->hostport == '*') || *csp->http->hostport == ' ' || *csp->http->hostport == '\0') { - + if (NULL == (p = strdup((*header)+6))) { return JB_ERR_MEMORY; @@ -3720,16 +3215,13 @@ static jb_err client_if_modified_since(struct client_state *csp, char **header) struct tm gmt; #endif struct tm *timeptr = NULL; - time_t tm = 0; + time_t tm = 0; const char *newval; - long int rtime; - long int hours, minutes, seconds; - int negative = 0; char * endptr; - + if ( 0 == strcmpic(*header, "If-Modified-Since: Wed, 08 Jun 1955 12:00:00 GMT")) { - /* + /* * The client got an error message because of a temporary problem, * the problem is gone and the client now tries to revalidate our * error message on the real server. The revalidation would always @@ -3759,15 +3251,17 @@ static jb_err client_if_modified_since(struct client_state *csp, char **header) } else { - rtime = strtol(newval, &endptr, 0); + long int hours, minutes, seconds; + long int rtime = strtol(newval, &endptr, 0); + const int negative_range = (rtime < 0); + if (rtime) { log_error(LOG_LEVEL_HEADER, "Randomizing: %s (random range: %d minut%s)", *header, rtime, (rtime == 1 || rtime == -1) ? "e": "es"); - if (rtime < 0) + if (negative_range) { - rtime *= -1; - negative = 1; + rtime *= -1; } rtime *= 60; rtime = pick_from_range(rtime); @@ -3777,17 +3271,25 @@ static jb_err client_if_modified_since(struct client_state *csp, char **header) log_error(LOG_LEVEL_ERROR, "Random range is 0. Assuming time transformation test.", *header); } - tm += rtime * (negative ? -1 : 1); + tm += rtime * (negative_range ? -1 : 1); #ifdef HAVE_GMTIME_R timeptr = gmtime_r(&tm, &gmt); -#elif FEATURE_PTHREAD +#elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&gmtime_mutex); timeptr = gmtime(&tm); privoxy_mutex_unlock(&gmtime_mutex); #else timeptr = gmtime(&tm); #endif - strftime(newheader, sizeof(newheader), "%a, %d %b %Y %H:%M:%S GMT", timeptr); + if ((NULL == timeptr) || !strftime(newheader, + sizeof(newheader), "%a, %d %b %Y %H:%M:%S GMT", timeptr)) + { + log_error(LOG_LEVEL_ERROR, + "Randomizing '%s' failed. Crunching the header without replacement.", + *header); + freez(*header); + return JB_ERR_OK; + } freez(*header); *header = strdup("If-Modified-Since: "); @@ -3796,7 +3298,7 @@ static jb_err client_if_modified_since(struct client_state *csp, char **header) if (*header == NULL) { log_error(LOG_LEVEL_HEADER, "Insufficient memory, header crunched without replacement."); - return JB_ERR_MEMORY; + return JB_ERR_MEMORY; } hours = rtime / 3600; @@ -3805,7 +3307,7 @@ static jb_err client_if_modified_since(struct client_state *csp, char **header) log_error(LOG_LEVEL_HEADER, "Randomized: %s (%s %d hou%s %d minut%s %d second%s", - *header, (negative) ? "subtracted" : "added", hours, + *header, (negative_range) ? "subtracted" : "added", hours, (hours == 1) ? "r" : "rs", minutes, (minutes == 1) ? "e" : "es", seconds, (seconds == 1) ? ")" : "s)"); } @@ -3836,7 +3338,7 @@ static jb_err client_if_modified_since(struct client_state *csp, char **header) static jb_err client_if_none_match(struct client_state *csp, char **header) { if (csp->action->flags & ACTION_CRUNCH_IF_NONE_MATCH) - { + { log_error(LOG_LEVEL_HEADER, "Crunching %s", *header); freez(*header); } @@ -3878,7 +3380,7 @@ jb_err client_x_filter(struct client_state *csp, char **header) "force-text-mode overruled the client's request to fetch without filtering!"); } else - { + { csp->content_type = CT_TABOO; /* XXX: This hack shouldn't be necessary */ csp->flags |= CSP_FLAG_NO_FILTERING; log_error(LOG_LEVEL_HEADER, "Accepted the client's request to fetch without filtering."); @@ -3887,7 +3389,7 @@ jb_err client_x_filter(struct client_state *csp, char **header) freez(*header); } } - return JB_ERR_OK; + return JB_ERR_OK; } @@ -3921,7 +3423,7 @@ static jb_err client_range(struct client_state *csp, char **header) freez(*header); } - return JB_ERR_OK; + return JB_ERR_OK; } /* the following functions add headers directly to the header list */ @@ -3978,36 +3480,6 @@ static jb_err client_host_adder(struct client_state *csp) } -#if 0 -/********************************************************************* - * - * Function : client_accept_encoding_adder - * - * Description : Add an Accept-Encoding header to the client's request - * that disables compression if the action applies, and - * the header is not already there. Called from `sed'. - * Note: For HTTP/1.0, the absence of the header is enough. - * - * 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_accept_encoding_adder(struct client_state *csp) -{ - if ( ((csp->action->flags & ACTION_NO_COMPRESSION) != 0) - && (!strcmpic(csp->http->ver, "HTTP/1.1")) ) - { - return enlist_unique(csp->headers, "Accept-Encoding: identity;q=1.0, *;q=0", 16); - } - - return JB_ERR_OK; -} -#endif - - /********************************************************************* * * Function : client_xtra_adder @@ -4090,14 +3562,11 @@ static jb_err client_x_forwarded_for_adder(struct client_state *csp) /********************************************************************* * - * Function : server_connection_close_adder + * Function : server_connection_adder * - * Description : "Temporary" fix for the needed but missing HTTP/1.1 - * support. Adds a "Connection: close" header to csp->headers + * Description : Adds an appropriate "Connection:" header to csp->headers * unless the header was already present. Called from `sed'. * - * FIXME: This whole function shouldn't be neccessary! - * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) * @@ -4105,13 +3574,14 @@ static jb_err client_x_forwarded_for_adder(struct client_state *csp) * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ -static jb_err server_connection_close_adder(struct client_state *csp) +static jb_err server_connection_adder(struct client_state *csp) { const unsigned int flags = csp->flags; const char *response_status_line = csp->headers->first->str; + static const char connection_close[] = "Connection: close"; if ((flags & CSP_FLAG_CLIENT_HEADER_PARSING_DONE) - && (flags & CSP_FLAG_SERVER_CONNECTION_CLOSE_SET)) + && (flags & CSP_FLAG_SERVER_CONNECTION_HEADER_SET)) { return JB_ERR_OK; } @@ -4122,19 +3592,58 @@ static jb_err server_connection_close_adder(struct client_state *csp) if ((csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE) && (NULL != response_status_line) - && !strncmpic(response_status_line, "HTTP/1.1", 8)) + && !strncmpic(response_status_line, "HTTP/1.1", 8) +#ifdef FEATURE_CONNECTION_KEEP_ALIVE + && !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED) +#endif + ) { log_error(LOG_LEVEL_HEADER, "A HTTP/1.1 response " "without Connection header implies keep-alive."); csp->flags |= CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE; + return JB_ERR_OK; } - log_error(LOG_LEVEL_HEADER, "Adding: Connection: close"); + log_error(LOG_LEVEL_HEADER, "Adding: %s", connection_close); - return enlist(csp->headers, "Connection: close"); + return enlist(csp->headers, connection_close); } +#ifdef FEATURE_CONNECTION_KEEP_ALIVE +/********************************************************************* + * + * Function : server_proxy_connection_adder + * + * Description : Adds a "Proxy-Connection: keep-alive" header to + * csp->headers if the client asked for keep-alive. + * XXX: We should reuse existent ones. + * + * 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 server_proxy_connection_adder(struct client_state *csp) +{ + static const char proxy_connection_header[] = "Proxy-Connection: keep-alive"; + jb_err err = JB_ERR_OK; + + if ((csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE) + && !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED) + && !(csp->flags & CSP_FLAG_SERVER_PROXY_CONNECTION_HEADER_SET)) + { + log_error(LOG_LEVEL_HEADER, "Adding: %s", proxy_connection_header); + err = enlist(csp->headers, proxy_connection_header); + } + + return err; +} +#endif /* FEATURE_CONNECTION_KEEP_ALIVE */ + + /********************************************************************* * * Function : client_connection_header_adder @@ -4151,18 +3660,27 @@ static jb_err server_connection_close_adder(struct client_state *csp) *********************************************************************/ static jb_err client_connection_header_adder(struct client_state *csp) { - const unsigned int flags = csp->flags; - const char *wanted_header = get_appropiate_connection_header(csp); + static const char connection_close[] = "Connection: close"; - if (!(flags & CSP_FLAG_CLIENT_HEADER_PARSING_DONE) - && (flags & CSP_FLAG_CLIENT_CONNECTION_HEADER_SET)) + if (!(csp->flags & CSP_FLAG_CLIENT_HEADER_PARSING_DONE) + && (csp->flags & CSP_FLAG_CLIENT_CONNECTION_HEADER_SET)) { return JB_ERR_OK; } - log_error(LOG_LEVEL_HEADER, "Adding: %s", wanted_header); +#ifdef FEATURE_CONNECTION_KEEP_ALIVE + if ((csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE) + && (csp->http->ssl == 0) + && !strcmpic(csp->http->ver, "HTTP/1.1")) + { + csp->flags |= CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE; + return JB_ERR_OK; + } +#endif /* FEATURE_CONNECTION_KEEP_ALIVE */ - return enlist(csp->headers, wanted_header); + log_error(LOG_LEVEL_HEADER, "Adding: %s", connection_close); + + return enlist(csp->headers, connection_close); } @@ -4223,8 +3741,7 @@ static jb_err server_http(struct client_state *csp, char **header) * Function : server_set_cookie * * Description : Handle the server "cookie" header properly. - * Log cookie to the jar file. Then "crunch", - * accept or rewrite it to a session cookie. + * Crunch, accept or rewrite it to a session cookie. * Called from `sed'. * * TODO: Allow the user to specify a new expiration @@ -4245,7 +3762,7 @@ static jb_err server_http(struct client_state *csp, char **header) static jb_err server_set_cookie(struct client_state *csp, char **header) { time_t now; - time_t cookie_time; + time_t cookie_time; time(&now); @@ -4302,6 +3819,17 @@ static jb_err server_set_cookie(struct client_state *csp, char **header) { char *expiration_date = cur_tag + 8; /* Skip "[Ee]xpires=" */ + if ((expiration_date[0] == '"') + && (expiration_date[1] != '\0')) + { + /* + * Skip quotation mark. RFC 2109 10.1.2 seems to hint + * that the expiration date isn't supposed to be quoted, + * but some servers do it anyway. + */ + expiration_date++; + } + /* Did we detect the date properly? */ if (JB_ERR_OK != parse_header_time(expiration_date, &cookie_time)) { @@ -4401,7 +3929,7 @@ static jb_err server_set_cookie(struct client_state *csp, char **header) * * Function : strclean * - * Description : In-Situ-Eliminate all occurances of substring in + * Description : In-Situ-Eliminate all occurrences of substring in * string * * Parameters : @@ -4444,7 +3972,7 @@ int strclean(char *string, const char *substring) * to get the numerical respresentation. * * Parameters : - * 1 : header_time = HTTP header time as string. + * 1 : header_time = HTTP header time as string. * 2 : result = storage for header_time in seconds * * Returns : JB_ERR_OK if the time format was recognized, or @@ -4454,34 +3982,49 @@ int strclean(char *string, const char *substring) static jb_err parse_header_time(const char *header_time, time_t *result) { struct tm gmt; - /* - * Zero out gmt to prevent time zone offsets. - * - * While this is only necessary on some platforms - * (mingw32 for example), I don't know how to - * detect these automatically and doing it everywhere - * shouldn't hurt. + * Checking for two-digit years first in an + * attempt to work around GNU libc's strptime() + * reporting negative year values when using %Y. */ - memset(&gmt, 0, sizeof(gmt)); + static const char * const time_formats[] = { + /* Tue, 02-Jun-37 20:00:00 */ + "%a, %d-%b-%y %H:%M:%S", + /* Tue, 02 Jun 2037 20:00:00 */ + "%a, %d %b %Y %H:%M:%S", + /* Tue, 02-Jun-2037 20:00:00 */ + "%a, %d-%b-%Y %H:%M:%S", + /* Tuesday, 02-Jun-2037 20:00:00 */ + "%A, %d-%b-%Y %H:%M:%S", + /* Tuesday Jun 02 20:00:00 2037 */ + "%A %b %d %H:%M:%S %Y" + }; + unsigned int i; - /* Tue, 02 Jun 2037 20:00:00 */ - if ((NULL == strptime(header_time, "%a, %d %b %Y %H:%M:%S", &gmt)) - /* Tue, 02-Jun-2037 20:00:00 */ - && (NULL == strptime(header_time, "%a, %d-%b-%Y %H:%M:%S", &gmt)) - /* Tue, 02-Jun-37 20:00:00 */ - && (NULL == strptime(header_time, "%a, %d-%b-%y %H:%M:%S", &gmt)) - /* Tuesday, 02-Jun-2037 20:00:00 */ - && (NULL == strptime(header_time, "%A, %d-%b-%Y %H:%M:%S", &gmt)) - /* Tuesday Jun 02 20:00:00 2037 */ - && (NULL == strptime(header_time, "%A %b %d %H:%M:%S %Y", &gmt))) + for (i = 0; i < SZ(time_formats); i++) { - return JB_ERR_PARSE; + /* + * Zero out gmt to prevent time zone offsets. + * Documented to be required for GNU libc. + */ + memset(&gmt, 0, sizeof(gmt)); + + if (NULL != strptime(header_time, time_formats[i], &gmt)) + { + /* Sanity check for GNU libc. */ + if (gmt.tm_year < 0) + { + log_error(LOG_LEVEL_HEADER, + "Failed to parse '%s' using '%s'. Moving on.", + header_time, time_formats[i]); + continue; + } + *result = timegm(&gmt); + return JB_ERR_OK; + } } - *result = timegm(&gmt); - - return JB_ERR_OK; + return JB_ERR_PARSE; } @@ -4500,7 +4043,7 @@ static jb_err parse_header_time(const char *header_time, time_t *result) * Parameters : * 1 : headers = List of headers (one of them hopefully being * the "Host:" header) - * 2 : http = storage for the result (host, port and hostport). + * 2 : http = storage for the result (host, port and hostport). * * Returns : JB_ERR_MEMORY in case of memory problems, * JB_ERR_PARSE if the host header couldn't be found, @@ -4521,7 +4064,8 @@ jb_err get_destination_from_headers(const struct list *headers, struct http_requ return JB_ERR_PARSE; } - if (NULL == (p = strdup((host)))) + p = strdup(host); + if (NULL == p) { log_error(LOG_LEVEL_ERROR, "Out of memory while parsing \"Host:\" header"); return JB_ERR_MEMORY; @@ -4574,7 +4118,7 @@ jb_err get_destination_from_headers(const struct list *headers, struct http_requ * * Description : Helper for client_referrer to forge a referer as * 'http://[hostname:port/' to fool stupid - * checks for in-site links + * checks for in-site links * * Parameters : * 1 : header = Pointer to header pointer @@ -4665,7 +4209,7 @@ static jb_err handle_conditional_hide_referrer_parameter(char **header, const char *host, const int parameter_conditional_block) { char *referer = strdup(*header); - const size_t hostlenght = strlen(host); + const size_t hostlength = strlen(host); const char *referer_url = NULL; if (NULL == referer) @@ -4675,14 +4219,14 @@ static jb_err handle_conditional_hide_referrer_parameter(char **header, } /* referer begins with 'Referer: http[s]://' */ - if ((hostlenght+17) < strlen(referer)) + if ((hostlength+17) < strlen(referer)) { /* * Shorten referer to make sure the referer is blocked * if www.example.org/www.example.com-shall-see-the-referer/ * links to www.example.com/ */ - referer[hostlenght+17] = '\0'; + referer[hostlength+17] = '\0'; } referer_url = strstr(referer, "http://"); if ((NULL == referer_url) || (NULL == strstr(referer_url, host))) @@ -4709,30 +4253,25 @@ static jb_err handle_conditional_hide_referrer_parameter(char **header, /********************************************************************* * - * Function : get_appropiate_connection_header + * Function : create_content_length_header * - * Description : Returns an appropiate Connection header - * depending on whether or not we try to keep - * the connection to the server alive. + * Description : Creates a Content-Length header. * * Parameters : - * 1 : csp = Current client state (buffers, headers, etc...) + * 1 : content_length = The content length to be used in the header. + * 2 : header = Allocated space to safe the header. + * 3 : buffer_length = The length of the allocated space. * - * Returns : Pointer to statically allocated header buffer. + * Returns : void * *********************************************************************/ -static const char *get_appropiate_connection_header(const struct client_state *csp) +static void create_content_length_header(unsigned long long content_length, + char *header, size_t buffer_length) { - static const char connection_keep_alive[] = "Connection: keep-alive"; - static const char connection_close[] = "Connection: close"; - - if ((csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE) - && (csp->http->ssl == 0)) - { - return connection_keep_alive; - } - return connection_close; + snprintf(header, buffer_length, "Content-Length: %llu", content_length); } + + /* Local Variables: tab-width: 3 diff --git a/external/privoxy/parsers.c.rej b/external/privoxy/parsers.c.rej deleted file mode 100644 index 84b4ba79..00000000 --- a/external/privoxy/parsers.c.rej +++ /dev/null @@ -1,16 +0,0 @@ -*************** -*** 986,991 **** - const add_header_func_ptr add_client_headers[] = { - client_host_adder, - client_cookie_adder, - client_xtra_adder, - /* Temporarily disabled: client_accept_encoding_adder, */ - connection_close_adder, ---- 983,989 ---- - 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, diff --git a/external/privoxy/parsers.h b/external/privoxy/parsers.h index cf70be46..a864c02a 100644 --- a/external/privoxy/parsers.h +++ b/external/privoxy/parsers.h @@ -1,6 +1,6 @@ #ifndef PARSERS_H_INCLUDED #define PARSERS_H_INCLUDED -#define PARSERS_H_VERSION "$Id: parsers.h,v 1.49 2009/03/13 14:10:07 fabiankeil Exp $" +#define PARSERS_H_VERSION "$Id: parsers.h,v 1.51 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.h,v $ @@ -20,10 +20,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -41,246 +41,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: parsers.h,v $ - * Revision 1.49 2009/03/13 14:10:07 fabiankeil - * Fix some more harmless warnings on amd64. - * - * Revision 1.48 2008/05/30 15:57:23 fabiankeil - * Remove now-useless reference to debug. - * - * Revision 1.47 2008/05/21 20:12:11 fabiankeil - * The whole point of strclean() is to modify the - * first parameter, so don't mark it immutable, - * even though the compiler lets us get away with it. - * - * Revision 1.46 2008/05/21 15:47:14 fabiankeil - * Streamline sed()'s prototype and declare - * the header parse and add structures static. - * - * Revision 1.45 2008/05/20 20:13:30 fabiankeil - * Factor update_server_headers() out of sed(), ditch the - * first_run hack and make server_patterns_light static. - * - * Revision 1.44 2008/05/20 16:05:09 fabiankeil - * Move parsers structure definition from project.h to parsers.h. - * - * Revision 1.43 2008/05/10 13:23:38 fabiankeil - * Don't provide get_header() with the whole client state - * structure when it only needs access to csp->iob. - * - * Revision 1.42 2008/04/17 14:40:49 fabiankeil - * Provide get_http_time() with the buffer size so it doesn't - * have to blindly assume that the buffer is big enough. - * - * Revision 1.41 2008/04/16 16:38:21 fabiankeil - * Don't pass the whole csp structure to flush_socket() - * when it only needs a file descriptor and a buffer. - * - * Revision 1.40 2007/08/11 14:47:26 fabiankeil - * Remove the prototypes for functions that are only - * used in parsers.c and thus should be static. - * - * Revision 1.39 2007/06/01 16:31:55 fabiankeil - * Change sed() to return a jb_err in preparation for forward-override{}. - * - * Revision 1.38 2007/03/25 14:27:11 fabiankeil - * Let parse_header_time() return a jb_err code - * instead of a pointer that can only be used to - * check for NULL anyway. - * - * Revision 1.37 2007/03/20 15:22:17 fabiankeil - * - Remove filter_client_header() and filter_client_header(), - * filter_header() now checks the shiny new - * CSP_FLAG_CLIENT_HEADER_PARSING_DONE flag instead. - * - * Revision 1.36 2007/03/05 13:25:32 fabiankeil - * - Cosmetical changes for LOG_LEVEL_RE_FILTER messages. - * - Handle "Cookie:" and "Connection:" headers a bit smarter - * (don't crunch them just to recreate them later on). - * - Add another non-standard time format for the cookie - * expiration date detection. - * - Fix a valgrind warning. - * - * Revision 1.35 2007/01/01 19:36:37 fabiankeil - * Integrate a modified version of Wil Mahan's - * zlib patch (PR #895531). - * - * Revision 1.34 2006/12/29 19:08:22 fabiankeil - * Reverted parts of my last commit - * to keep error handling working. - * - * Revision 1.33 2006/12/29 18:04:40 fabiankeil - * Fixed gcc43 conversion warnings. - * - * Revision 1.32 2006/12/06 19:14:23 fabiankeil - * Added prototype for get_destination_from_headers(). - * - * Revision 1.31 2006/08/17 17:15:10 fabiankeil - * - Back to timegm() using GnuPG's replacement if necessary. - * Using mktime() and localtime() could add a on hour offset if - * the randomize factor was big enough to lead to a summer/wintertime - * switch. - * - * - Removed now-useless Privoxy 3.0.3 compatibility glue. - * - * - Moved randomization code into pick_from_range(). - * - * - Changed parse_header_time definition. - * time_t isn't guaranteed to be signed and - * if it isn't, -1 isn't available as error code. - * Changed some variable types in client_if_modified_since() - * because of the same reason. - * - * Revision 1.30 2006/08/14 08:25:19 fabiankeil - * Split filter-headers{} into filter-client-headers{} - * and filter-server-headers{}. - * Added parse_header_time() to share some code. - * Replaced timegm() with mktime(). - * - * Revision 1.29 2006/08/03 02:46:41 david__schmidt - * Incorporate Fabian Keil's patch work: http://www.fabiankeil.de/sourcecode/privoxy/ - * - * Revision 1.28 2006/07/18 14:48:47 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.26.2.1 2002/09/25 14:52:46 oes - * Added basic support for OPTIONS and TRACE HTTP methods: - * - New parser function client_max_forwards which decrements - * the Max-Forwards HTTP header field of OPTIONS and TRACE - * requests by one before forwarding - * - New parser function client_host which extracts the host - * and port information from the HTTP header field if the - * request URI was not absolute - * - Don't crumble and re-add the Host: header, but only generate - * and append if missing - * - * Revision 1.26 2002/05/08 15:59:53 oes - * Changed add_to_iob signature (now returns jb_err) - * - * Revision 1.25 2002/03/26 22:29:55 swa - * we have a new homepage! - * - * Revision 1.24 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.23 2002/03/13 00:27:05 jongfoster - * Killing warnings - * - * Revision 1.22 2002/03/09 20:03:52 jongfoster - * - Making various functions return int rather than size_t. - * (Undoing a recent change). Since size_t is unsigned on - * Windows, functions like read_socket that return -1 on - * error cannot return a size_t. - * - * THIS WAS A MAJOR BUG - it caused frequent, unpredictable - * crashes, and also frequently caused JB to jump to 100% - * CPU and stay there. (Because it thought it had just - * read ((unsigned)-1) == 4Gb of data...) - * - * - The signature of write_socket has changed, it now simply - * returns success=0/failure=nonzero. - * - * - Trying to get rid of a few warnings --with-debug on - * Windows, I've introduced a new type "jb_socket". This is - * used for the socket file descriptors. On Windows, this - * is SOCKET (a typedef for unsigned). Everywhere else, it's - * an int. The error value can't be -1 any more, so it's - * now JB_INVALID_SOCKET (which is -1 on UNIX, and in - * Windows it maps to the #define INVALID_SOCKET.) - * - * - The signature of bind_port has changed. - * - * Revision 1.21 2002/03/07 03:46:17 oes - * Fixed compiler warnings - * - * Revision 1.20 2002/02/20 23:15:13 jongfoster - * Parsing functions now handle out-of-memory gracefully by returning - * an error code. - * - * Revision 1.19 2002/01/17 21:03:47 jongfoster - * Moving all our URL and URL pattern parsing code to urlmatch.c. - * - * Revision 1.18 2001/10/26 17:40:23 oes - * Introduced get_header_value() - * Removed client_accept() - * - * Revision 1.17 2001/10/13 12:47:32 joergs - * Removed client_host, added client_host_adder - * - * Revision 1.16 2001/10/07 18:50:16 oes - * Added server_content_encoding, renamed server_transfer_encoding - * - * Revision 1.15 2001/10/07 18:01:55 oes - * Changed server_http11 to server_http - * - * Revision 1.14 2001/10/07 15:45:48 oes - * added client_accept_encoding, client_te, client_accept_encoding_adder - * - * renamed content_type and content_length - * - * fixed client_host and strclean prototypes - * - * Revision 1.13 2001/09/29 12:56:03 joergs - * IJB now changes HTTP/1.1 to HTTP/1.0 in requests and answers. - * - * Revision 1.12 2001/09/13 23:05:50 jongfoster - * Changing the string paramater to the header parsers a "const". - * - * Revision 1.11 2001/07/31 14:46:53 oes - * Added prototype for connection_close_adder - * - * Revision 1.10 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.9 2001/07/29 18:43:08 jongfoster - * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to - * ANSI C rules. - * - * Revision 1.8 2001/07/13 14:01:54 oes - * Removed all #ifdef PCRS - * - * Revision 1.7 2001/06/29 13:32:14 oes - * Removed logentry from cancelled commit - * - * Revision 1.6 2001/06/03 19:12:38 oes - * deleted const struct interceptors - * - * Revision 1.5 2001/05/31 21:30:33 jongfoster - * Removed list code - it's now in list.[ch] - * Renamed "permission" to "action", and changed many features - * to use the actions file rather than the global config. - * - * Revision 1.4 2001/05/27 13:19:06 oes - * Patched Joergs solution for the content-length in. - * - * Revision 1.3 2001/05/26 13:39:32 jongfoster - * Only crunches Content-Length header if applying RE filtering. - * Without this fix, Microsoft Windows Update wouldn't work. - * - * Revision 1.2 2001/05/20 01:21:20 jongfoster - * Version 2.9.4 checkin. - * - Merged popupfile and cookiefile, and added control over PCRS - * filtering, in new "permissionsfile". - * - Implemented LOG_LEVEL_FATAL, so that if there is a configuration - * file error you now get a message box (in the Win32 GUI) rather - * than the program exiting with no explanation. - * - Made killpopup use the PCRS MIME-type checking and HTTP-header - * skipping. - * - Removed tabs from "config" - * - Moved duplicated url parsing code in "loaders.c" to a new funcition. - * - Bumped up version number. - * - * Revision 1.1.1.1 2001/05/15 13:59:01 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include "project.h" diff --git a/external/privoxy/pcrs.c b/external/privoxy/pcrs.c index 1946ca7a..e42dd4c2 100644 --- a/external/privoxy/pcrs.c +++ b/external/privoxy/pcrs.c @@ -1,4 +1,4 @@ -const char pcrs_rcs[] = "$Id: pcrs.c,v 1.29 2007/09/22 16:17:19 fabiankeil Exp $"; +const char pcrs_rcs[] = "$Id: pcrs.c,v 1.38 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/pcrs.c,v $ @@ -16,7 +16,7 @@ const char pcrs_rcs[] = "$Id: pcrs.c,v 1.29 2007/09/22 16:17:19 fabiankeil Exp $ * * Copyright (C) 2006, 2007 Fabian Keil * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser * General Public License (LGPL), version 2.1, which should * be included in this distribution (see LICENSE.txt), with @@ -35,156 +35,8 @@ const char pcrs_rcs[] = "$Id: pcrs.c,v 1.29 2007/09/22 16:17:19 fabiankeil Exp $ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: pcrs.c,v $ - * Revision 1.29 2007/09/22 16:17:19 fabiankeil - * Move our includes below system includes to prevent macro conflicts. - * - * Revision 1.28 2007/08/18 14:37:27 fabiankeil - * Ditch hex_to_byte() in favour of xtoi(). - * - * Revision 1.27 2007/08/05 13:47:04 fabiankeil - * #1763173 from Stefan Huehner: s@const static@static const@. - * - * Revision 1.26 2007/07/01 13:29:54 fabiankeil - * Add limited hex notation support for the PCRS - * substitution text ('\x7e' = '~'). Closes #1627140. - * - * Revision 1.25 2007/04/30 15:02:18 fabiankeil - * Introduce dynamic pcrs jobs that can resolve variables. - * - * Revision 1.24 2007/01/05 15:46:12 fabiankeil - * Don't use strlen() to calculate the length of - * the pcrs substitutes. They don't have to be valid C - * strings and getting their length wrong can result in - * user-controlled memory corruption. - * - * Thanks to Felix Gröbert for reporting the problem - * and providing the fix [#1627140]. - * - * Revision 1.23 2006/12/29 17:53:05 fabiankeil - * Fixed gcc43 conversion warnings. - * - * Revision 1.22 2006/12/24 17:34:20 fabiankeil - * Add pcrs_strerror() message for PCRE_ERROR_MATCHLIMIT - * and give a hint why an error code might be unknown. - * - * Catch NULL subjects early in pcrs_execute(). - * - * Revision 1.21 2006/07/18 14:48:47 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.19.2.4 2005/05/07 21:50:55 david__schmidt - * A few memory leaks plugged (mostly on error paths) - * - * Revision 1.19.2.3 2003/12/04 12:32:45 oes - * Append a trailing nullbyte to result to facilitate string processing - * - * Revision 1.19.2.2 2002/10/08 16:22:28 oes - * Bugfix: Need to check validity of backreferences explicitly, - * because when max_matches are reached and matches is expanded, - * realloc() does not zero the memory. Fixes Bug # 606227 - * - * Revision 1.19.2.1 2002/08/10 11:23:40 oes - * Include prce.h via project.h, where the appropriate - * source will have been selected - * - * Revision 1.19 2002/03/08 14:47:48 oes - * Cosmetics - * - * Revision 1.18 2002/03/08 14:17:14 oes - * Fixing -Wconversion warnings - * - * Revision 1.17 2002/03/08 13:45:48 oes - * Hiding internal functions - * - * Revision 1.16 2001/11/30 21:32:14 jongfoster - * Fixing signed/unsigned comparison (Andreas please check this!) - * One tab->space - * - * Revision 1.15 2001/09/20 16:11:06 steudten - * - * Add casting for some string functions. - * - * Revision 1.14 2001/09/09 21:41:57 oes - * Fixing yet another silly bug - * - * Revision 1.13 2001/09/06 14:05:59 oes - * Fixed silly bug - * - * Revision 1.12 2001/08/18 11:35:00 oes - * - Introduced pcrs_strerror() - * - made some NULL arguments non-fatal - * - added support for \n \r \e \b \t \f \a \0 in substitute - * - made quoting adhere to standard rules - * - added warning for bad backrefs - * - added pcrs_execute_list() - * - fixed comments - * - bugfix & cosmetics - * - * Revision 1.11 2001/08/15 15:32:03 oes - * - Added support for Perl's special variables $+, $' and $` - * - Improved the substitute parser - * - Replaced the hard limit for the maximum number of matches - * by dynamic reallocation - * - * Revision 1.10 2001/08/05 13:13:11 jongfoster - * Making parameters "const" where possible. - * - * Revision 1.9 2001/07/18 17:27:00 oes - * Changed interface; Cosmetics - * - * Revision 1.8 2001/06/29 21:45:41 oes - * Indentation, CRLF->LF, Tab-> Space - * - * Revision 1.7 2001/06/29 13:33:04 oes - * - Cleaned up, renamed and reordered functions, - * improved comments - * - Removed my_strsep - * - Replaced globalflag with a general flags int - * that holds PCRS_GLOBAL, PCRS_SUCCESS, and PCRS_TRIVIAL - * - Introduced trivial option that will prevent pcrs - * from honouring backreferences in the substitute, - * which is useful for large substitutes that are - * red in from somewhere and saves the pain of escaping - * the backrefs - * - Introduced convenience function pcrs_free_joblist() - * - Split pcrs_make_job() into pcrs_compile(), which still - * takes a complete s/// comand as argument and parses it, - * and a new function pcrs_make_job, which takes the - * three separate components. This should make for a - * much friendlier frontend. - * - Removed create_pcrs_job() which was useless - * - Fixed a bug in pcrs_execute - * - Success flag is now handled by pcrs instead of user - * - * Revision 1.6 2001/06/03 19:12:45 oes - * added FIXME - * - * Revision 1.5 2001/05/29 09:50:24 jongfoster - * (Fixed one int -> size_t) - * - * Revision 1.4 2001/05/25 14:12:40 oes - * Fixed bug: Empty substitutes now detected - * - * Revision 1.3 2001/05/25 11:03:55 oes - * Added sanity check for NULL jobs to pcrs_exec_substitution - * - * Revision 1.2 2001/05/22 18:46:04 oes - * - * Added support for PCRE_UNGREEDY behaviour to pcrs, - * which is selected by the (nonstandard and therefore - * capital) letter 'U' in the option string. - * It causes the quantifiers to be ungreedy by default. - * Appending a ? turns back to greedy (!). - * - * Revision 1.1.1.1 2001/05/15 13:59:02 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include #include @@ -219,7 +71,7 @@ static int is_hex_sequence(const char *sequence); * Function : pcrs_strerror * * Description : Return a string describing a given error code. - * + * * Parameters : * 1 : error = the error code * @@ -228,7 +80,7 @@ static int is_hex_sequence(const char *sequence); *********************************************************************/ const char *pcrs_strerror(const int error) { - if (error < 0) + if (error != 0) { switch (error) { @@ -242,7 +94,7 @@ const char *pcrs_strerror(const int error) case PCRE_ERROR_UNKNOWN_NODE: return "(pcre:) Bad node in pattern"; /* Can't happen / not passed: */ - case PCRE_ERROR_NOSUBSTRING: return "(pcre:) Fire in power supply"; + case PCRE_ERROR_NOSUBSTRING: return "(pcre:) Fire in power supply"; case PCRE_ERROR_NOMATCH: return "(pcre:) Water in power supply"; #ifdef PCRE_ERROR_MATCHLIMIT @@ -261,7 +113,7 @@ const char *pcrs_strerror(const int error) case PCRS_WARN_TRUNCATION: return "(pcrs:) At least one variable was too big and has been truncated before compilation"; - /* + /* * XXX: With the exception of PCRE_ERROR_MATCHLIMIT we * only catch PCRE errors that can happen with our internal * version. If Privoxy is linked against a newer @@ -287,12 +139,12 @@ const char *pcrs_strerror(const int error) * 'T' (trivial) options but pcrs needs them, the corresponding * flags are set if 'g'or 'T' is encountered. * Note: The 'T' and 'U' options do not conform to Perl. - * + * * Parameters : * 1 : optstring = string with options in perl syntax * 2 : flags = see description * - * Returns : option integer suitable for pcre + * Returns : option integer suitable for pcre * *********************************************************************/ static int pcrs_parse_perl_options(const char *optstring, int *flags) @@ -384,7 +236,7 @@ static pcrs_substitute *pcrs_compile_replacement(const char *replacement, int tr return NULL; } memset(text, '\0', length + 1); - + /* * In trivial mode, just copy the substitute text @@ -453,7 +305,7 @@ static pcrs_substitute *pcrs_compile_replacement(const char *replacement, int tr assert(ascii_value < 256); text[k++] = (char)ascii_value; i += 4; - } + } else { quoted = 1; @@ -485,7 +337,7 @@ static pcrs_substitute *pcrs_compile_replacement(const char *replacement, int tr /* Symbolic backreferences: */ else if (NULL != (symbol = strchr(symbols, replacement[i + 1]))) { - + if (symbol - symbols == 2) /* $+ */ { r->backref[l] = capturecount; @@ -496,7 +348,7 @@ static pcrs_substitute *pcrs_compile_replacement(const char *replacement, int tr } else /* $' or $` */ { - r->backref[l] = PCRS_MAX_SUBMATCHES + 1 - (symbol - symbols); + r->backref[l] = (int)(PCRS_MAX_SUBMATCHES + 1 - (symbol - symbols)); } i += 2; } @@ -516,10 +368,10 @@ static pcrs_substitute *pcrs_compile_replacement(const char *replacement, int tr else { *errptr = PCRS_WARN_BADREF; - } + } continue; } - + plainchar: /* Plain chars are copied */ text[k++] = replacement[i++]; @@ -545,13 +397,13 @@ plainchar: * Function : pcrs_free_job * * Description : Frees the memory used by a pcrs_job struct and its - * dependant structures. + * dependent structures. * * Parameters : * 1 : job = pointer to the pcrs_job structure to be freed * * Returns : a pointer to the next job, if there was any, or - * NULL otherwise. + * NULL otherwise. * *********************************************************************/ pcrs_job *pcrs_free_job(pcrs_job *job) @@ -606,7 +458,7 @@ void pcrs_free_joblist(pcrs_job *joblist) * * Function : pcrs_compile_command * - * Description : Parses a string with a Perl-style s/// command, + * Description : Parses a string with a Perl-style s/// command, * calls pcrs_compile, and returns a corresponding * pcrs_job, or NULL if parsing or compiling the job * fails. @@ -626,11 +478,11 @@ pcrs_job *pcrs_compile_command(const char *command, int *errptr) int i, k, l, quoted = FALSE; size_t limit; char delimiter; - char *tokens[4]; + char *tokens[4]; pcrs_job *newjob; - - i = k = l = 0; - + + k = l = 0; + /* * Tokenize the perl command */ @@ -649,7 +501,7 @@ pcrs_job *pcrs_compile_command(const char *command, int *errptr) for (i = 0; i <= (int)limit; i++) { - + if (command[i] == delimiter && !quoted) { if (l == 3) @@ -661,7 +513,7 @@ pcrs_job *pcrs_compile_command(const char *command, int *errptr) tokens[++l] = tokens[0] + k; continue; } - + else if (command[i] == '\\' && !quoted) { quoted = TRUE; @@ -683,11 +535,11 @@ pcrs_job *pcrs_compile_command(const char *command, int *errptr) free(tokens[0]); return NULL; } - + newjob = pcrs_compile(tokens[1], tokens[2], tokens[3], errptr); free(tokens[0]); return newjob; - + } @@ -719,14 +571,14 @@ pcrs_job *pcrs_compile(const char *pattern, const char *substitute, const char * *errptr = 0; - /* + /* * Handle NULL arguments */ if (pattern == NULL) pattern = ""; if (substitute == NULL) substitute = ""; - /* + /* * Get and init memory */ if (NULL == (newjob = (pcrs_job *)malloc(sizeof(pcrs_job)))) @@ -766,10 +618,10 @@ pcrs_job *pcrs_compile(const char *pattern, const char *substitute, const char * pcrs_free_job(newjob); return NULL; } - - /* - * Determine the number of capturing subpatterns. + + /* + * Determine the number of capturing subpatterns. * This is needed for handling $+ in the substitute. */ if (0 > (*errptr = pcre_fullinfo(newjob->pattern, newjob->hints, PCRE_INFO_CAPTURECOUNT, &capturecount))) @@ -777,7 +629,7 @@ pcrs_job *pcrs_compile(const char *pattern, const char *substitute, const char * pcrs_free_job(newjob); return NULL; } - + /* * Compile the substitute @@ -787,7 +639,7 @@ pcrs_job *pcrs_compile(const char *pattern, const char *substitute, const char * pcrs_free_job(newjob); return NULL; } - + return newjob; } @@ -802,7 +654,7 @@ pcrs_job *pcrs_compile(const char *pattern, const char *substitute, const char * * the joblist to the subject. * The subject itself is left untouched, memory for the result * is malloc()ed and it is the caller's responsibility to free - * the result when it's no longer needed. + * the result when it's no longer needed. * * Note: For convenient string handling, a null byte is * appended to the result. It does not count towards the @@ -812,8 +664,8 @@ pcrs_job *pcrs_compile(const char *pattern, const char *substitute, const char * * Parameters : * 1 : joblist = the chained list of pcrs_jobs to be executed * 2 : subject = the subject string - * 3 : subject_length = the subject's length - * 4 : result = char** for returning the result + * 3 : subject_length = the subject's length + * 4 : result = char** for returning the result * 5 : result_length = size_t* for returning the result's length * * Returns : On success, the number of substitutions that were made. @@ -827,10 +679,10 @@ int pcrs_execute_list(pcrs_job *joblist, char *subject, size_t subject_length, c pcrs_job *job; char *old, *new = NULL; int hits, total_hits; - + old = subject; *result_length = subject_length; - hits = total_hits = 0; + total_hits = 0; for (job = joblist; job != NULL; job = job->next) { @@ -872,8 +724,8 @@ int pcrs_execute_list(pcrs_job *joblist, char *subject, size_t subject_length, c * Parameters : * 1 : job = the pcrs_job to be executed * 2 : subject = the subject (== original) string - * 3 : subject_length = the subject's length - * 4 : result = char** for returning the result + * 3 : subject_length = the subject's length + * 4 : result = char** for returning the result * 5 : result_length = size_t* for returning the result's length * * Returns : On success, the number of substitutions that were made. @@ -894,9 +746,9 @@ int pcrs_execute(pcrs_job *job, const char *subject, size_t subject_length, char pcrs_match *matches, *dummy; char *result_offset; - offset = i = k = 0; + offset = i = 0; - /* + /* * Sanity check & memory allocation */ if (job == NULL || job->pattern == NULL || job->substitute == NULL || NULL == subject) @@ -929,13 +781,13 @@ int pcrs_execute(pcrs_job *job, const char *subject, size_t subject_length, char matches[i].submatch_offset[k] = offsets[2 * k]; /* Note: Non-found optional submatches have length -1-(-1)==0 */ - matches[i].submatch_length[k] = (size_t)(offsets[2 * k + 1] - offsets[2 * k]); + matches[i].submatch_length[k] = (size_t)(offsets[2 * k + 1] - offsets[2 * k]); /* reserve mem for each submatch as often as it is ref'd */ newsize += matches[i].submatch_length[k] * (size_t)job->substitute->backref_count[k]; } /* plus replacement text size minus match text size */ - newsize += job->substitute->length - matches[i].submatch_length[0]; + newsize += job->substitute->length - matches[i].submatch_length[0]; /* chunk before match */ matches[i].submatch_offset[PCRS_MAX_SUBMATCHES] = 0; @@ -977,12 +829,12 @@ int pcrs_execute(pcrs_job *job, const char *subject, size_t subject_length, char if (submatches < PCRE_ERROR_NOMATCH) { free(matches); - return submatches; + return submatches; } matches_found = i; - /* + /* * Get memory for the result (must be freed by caller!) * and append terminating null byte. */ @@ -997,7 +849,7 @@ int pcrs_execute(pcrs_job *job, const char *subject, size_t subject_length, char } - /* + /* * Replace */ offset = 0; @@ -1006,7 +858,7 @@ int pcrs_execute(pcrs_job *job, const char *subject, size_t subject_length, char for (i = 0; i < matches_found; i++) { /* copy the chunk preceding the match */ - memcpy(result_offset, subject + offset, (size_t)(matches[i].submatch_offset[0] - offset)); + memcpy(result_offset, subject + offset, (size_t)(matches[i].submatch_offset[0] - offset)); result_offset += matches[i].submatch_offset[0] - offset; /* For every segment of the substitute.. */ @@ -1136,7 +988,7 @@ int pcrs_job_is_dynamic (char *job) * Parameters : * 1 : string = The string to search in * - * Returns : A safe delimiter if one was found, otherwise '\0'. + * Returns : A safe delimiter if one was found, otherwise '\0'. * *********************************************************************/ char pcrs_get_delimiter(const char *string) @@ -1169,11 +1021,11 @@ char pcrs_get_delimiter(const char *string) * * Parameters : * 1 : subject = the subject (== original) string - * 2 : pcrs_command = the pcrs command as string (s@foo@bar@) - * 3 : hits = int* for returning the number of modifications + * 2 : pcrs_command = the pcrs command as string (s@foo@bar@) + * 3 : hits = int* for returning the number of modifications * * Returns : NULL in case of errors, otherwise the - * result of the pcrs command. + * result of the pcrs command. * *********************************************************************/ char *pcrs_execute_single_command(const char *subject, const char *pcrs_command, int *hits) @@ -1212,13 +1064,12 @@ static const char warning[] = "... [too long, truncated]"; * values of the variables and compiles it. * * Parameters : - * 1 : csp = Current client state (buffers, headers, etc...) - * 2 : pcrs_command = The dynamic pcrs command to compile - * 3 : v = NULL terminated array of variables and their values. - * 4 : error = pcrs error code + * 1 : pcrs_command = The dynamic pcrs command to compile + * 2 : v = NULL terminated array of variables and their values. + * 3 : error = pcrs error code * * Returns : NULL in case of hard errors, otherwise the - * compiled pcrs job. + * compiled pcrs job. * *********************************************************************/ pcrs_job *pcrs_compile_dynamic_command(char *pcrs_command, const struct pcrs_variable v[], int *error) diff --git a/external/privoxy/pcrs.h b/external/privoxy/pcrs.h index b8939c0d..36b89c0b 100644 --- a/external/privoxy/pcrs.h +++ b/external/privoxy/pcrs.h @@ -9,81 +9,10 @@ * * Copyright : see pcrs.c * - * Revisions : - * $Log: pcrs.h,v $ - * Revision 1.16 2007/04/30 15:02:19 fabiankeil - * Introduce dynamic pcrs jobs that can resolve variables. - * - * Revision 1.15 2007/01/05 15:46:12 fabiankeil - * Don't use strlen() to calculate the length of - * the pcrs substitutes. They don't have to be valid C - * strings and getting their length wrong can result in - * user-controlled memory corruption. - * - * Thanks to Felix Gröbert for reporting the problem - * and providing the fix [#1627140]. - * - * Revision 1.14 2006/12/24 17:27:37 fabiankeil - * Increase pcrs error code offset to prevent overlaps - * with pcre versions newer than our own. - * - * Revision 1.13 2006/07/18 14:48:47 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.11 2002/03/08 14:18:23 oes - * Fixing -Wconversion warnings - * - * Revision 1.10 2002/03/08 13:44:48 oes - * Hiding internal functions, preventing double inclusion of pcre.h - * - * Revision 1.9 2001/08/18 11:35:29 oes - * - Introduced pcrs_strerror() - * - added pcrs_execute_list() - * - * Revision 1.8 2001/08/15 15:32:50 oes - * Replaced the hard limit for the maximum number of matches - * by dynamic reallocation - * - * Revision 1.7 2001/08/05 13:13:11 jongfoster - * Making parameters "const" where possible. - * - * Revision 1.6 2001/07/29 18:52:06 jongfoster - * Renaming _PCRS_H, and adding "extern C {}" - * - * Revision 1.5 2001/07/18 17:27:00 oes - * Changed interface; Cosmetics - * - * Revision 1.4 2001/06/29 13:33:19 oes - * - Cleaned up, commented and adapted to reflect the - * changes in pcrs.c - * - Introduced the PCRS_* flags - * - * Revision 1.3 2001/06/09 10:58:57 jongfoster - * Removing a single unused #define which referenced BUFSIZ - * - * Revision 1.2 2001/05/25 11:03:55 oes - * Added sanity check for NULL jobs to pcrs_exec_substitution - * - * Revision 1.1.1.1 2001/05/15 13:59:02 oes - * Initial import of version 2.9.3 source tree - * - * Revision 1.4 2001/05/11 01:57:02 rodney - * Added new file header standard w/RCS control tags. - * - * revision 1.3 2001/05/08 02:38:13 rodney - * Changed C++ "//" style comment to C style comments. - * - * revision 1.2 2001/04/30 02:39:24 rodney - * Made this pcrs.h file conditionally included. - * - * revision 1.1 2001/04/16 21:10:38 rodney - * Initial checkin - * *********************************************************************/ -#define PCRS_H_VERSION "$Id: pcrs.h,v 1.16 2007/04/30 15:02:19 fabiankeil Exp $" - +#define PCRS_H_VERSION "$Id: pcrs.h,v 1.17 2009/05/16 13:27:20 fabiankeil Exp $" + #ifndef _PCRE_H #include diff --git a/external/privoxy/privoxy-generic.init b/external/privoxy/privoxy-generic.init index 53b4127b..ac512344 100755 --- a/external/privoxy/privoxy-generic.init +++ b/external/privoxy/privoxy-generic.init @@ -36,57 +36,6 @@ # has notable differences from bash. By design, this script does not try to do # too much, so as to be as cross-platform as possible. # -# -# Revisions : -# $Log: privoxy-generic.init,v $ -# Revision 1.8 2007/06/09 12:35:54 fabiankeil -# Add /usr/xpg4/bin to the PATH to make sure the POSIX -# version of id is used on Solaris. Closes BR#1733788. -# Thanks to Brent Chivers for report and fix. -# -# Revision 1.7 2006/10/14 14:12:22 fabiankeil -# Print warnings if the user tries to run Privoxy as root -# or if the script is run without root privileges; -# only use "--user" if run with root privileges and -# don't depend on $USER being set to root. Fixes BR 779781. -# -# Apparently $USER isn't set on all systems, -# but it also didn't work if the user only -# increased her privileges with su or sudo, -# but still had her real uid in $USER. -# -# Thanks to Florian Effenberger for reporting. -# -# Revision 1.6 2006/07/18 14:48:47 david__schmidt -# Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) -# with what was really the latest development (the v_3_0_branch branch) -# -# Revision 1.5.2.1 2002/10/17 17:04:22 hal9 -# Add from main trunk. Will be needed for make install. -# -# Revision 1.5 2002/10/17 17:01:29 hal9 -# Set paths to match the defaults for a root install. Force remove PIDFILE on -# stop. -# -# Revision 1.4 2002/09/11 01:15:02 hal9 -# Fix typo in variable. Now tested on Solaris and Linux, with defaults. -# -# Revision 1.3 2002/09/11 01:09:14 hal9 -# Better handling of pidfile, and process owner. -# -# Revision 1.2 2002/09/08 20:27:58 hal9 -# -Rewrote script config section. -# -Added comments to script. -# -Tried to add logic to use a --user privoxy, if available. -# -Minor script changes due to 'echo -n' does not work on a true -# /bin/sh system. -# -# Revision 1.1 2002/09/06 00:20:26 hal9 -# Creating a generic init script, meant to be used on platforms where don't have -# a custom init script. -# -# Revision 1.0 2002/09/05 17:14:32 hal9 -# ####################################################################### # Is this needed by Solaris? diff --git a/external/privoxy/privoxy-rh.spec b/external/privoxy/privoxy-rh.spec deleted file mode 100644 index 40c82b4a..00000000 --- a/external/privoxy/privoxy-rh.spec +++ /dev/null @@ -1,1196 +0,0 @@ -# $Id: privoxy-rh.spec,v 1.63 2009/03/21 10:46:15 fabiankeil Exp $ -# -# Written by and Copyright (C) 2001-2006 the SourceForge -# Privoxy team. http://www.privoxy.org/ -# -# Based on the Internet Junkbuster originally written -# by and Copyright (C) 1997 Anonymous Coders and -# Junkbusters Corporation. http://www.junkbusters.com -# -# This program is free software; you can redistribute it -# and/or modify it under the terms of the GNU General -# Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will -# be useful, but WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public -# License for more details. -# -# The GNU General Public License should be included with -# this file. If not, you can view it at -# http://www.gnu.org/copyleft/gpl.html -# or write to the Free Software Foundation, Inc., 59 -# Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - -# Defines should happen in the begining of the file -%define veryoldname junkbust -%define oldname junkbuster -%define privoxyconf %{_sysconfdir}/%{name} -%define privoxy_uid 73 -%define privoxy_gid 73 - -Name: privoxy -# ATTENTION -# Version and release should be updated accordingly on configure.in and -# configure. Otherwise, the package can be build with the wrong value -Version: 3.0.12 -Release: 1 -Summary: Privoxy - privacy enhancing proxy -License: GPL -Source0: http://dl.sf.net/ijbswa/%{name}-%{version}-stable-src.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-root -Group: System Environment/Daemons -URL: http://www.privoxy.org/ -Obsoletes: junkbuster-raw junkbuster-blank junkbuster -# Prereq: /usr/sbin/useradd , /sbin/chkconfig , /sbin/service -Prereq: shadow-utils, chkconfig, initscripts, sh-utils -BuildRequires: perl gzip sed libtool autoconf -Conflicts: junkbuster-raw junkbuster-blank junkbuster - -%description -Privoxy is a web proxy with advanced filtering capabilities for -protecting privacy, filtering web page data, managing cookies, -controlling access, and removing ads, banners, pop-ups and other -obnoxious Internet junk. Privoxy has a very flexible configuration and -can be customized to suit individual needs and tastes. Privoxy has application -for both stand-alone systems and multi-user networks. - -Privoxy is based on the Internet Junkbuster. - -%prep -#%setup -q -c -%setup -q -n "%{name}-%{version}-stable" - -%build - -# We check to see if versions match -VERSION_MAJOR=3 -VERSION_MINOR=0 -VERSION_POINT=12 - -# find CVS files and remove it. -find -name CVS | xargs rm -rf - -CONFIG_VERSION=`cat configure.in | sed -n -e 's/^VERSION_MAJOR=\([0-9]*\)/\1./p' -e 's/^VERSION_MINOR=\([0-9]*\)/\1./p' -e 's/^VERSION_POINT=\([0-9]*\)/\1/p' | awk '{printf $1}'` -if [ "%{version}" != "${CONFIG_VERSION}" ]; then - echo "The version declared on the specfile does not match the version" - echo "declared on configure.in. This should not happen. The build will" - echo "be interrupted now, so you can fix it." - exit 1 -fi -autoheader -autoconf -%configure --disable-dynamic-pcre -make -# Docs are in CVS and tarball now. -#%%make dok - -## Explicitily stripping is not recomended. -## This is handled altomaticaly by RPM, and can couse troubles if -## anyone wants to build an unstriped version - morcego -#strip %{name} - -%install -[ "%{buildroot}" != "/" ] && rm -rf %{buildroot} -mkdir -p %{buildroot}%{_sbindir} \ - %{buildroot}%{_mandir}/man1 \ - %{buildroot}%{_localstatedir}/log/%{name} \ - %{buildroot}%{privoxyconf}/templates \ - %{buildroot}%{_sysconfdir}/logrotate.d \ - %{buildroot}%{_sysconfdir}/rc.d/init.d - -## Manual gziping of manpages should not be done, once it can -## break the building on some distributions. Anyway, rpm does it -## automagicaly these days -## Gziping the documentation files is not recomended - morcego -#gzip README AUTHORS ChangeLog %{name}.1 || /bin/true - -install -s -m 744 %{name} %{buildroot}%{_sbindir}/%{name} - -# Using sed to "convert" from DOS format to UNIX -# This is important behaviour, and should not be removed without some -# other assurance that these files don't get packed in the the -# wrong format -for i in `ls *.action` -do - cat $i | sed -e 's/[[:cntrl:]]*$//' > %{buildroot}%{privoxyconf}/$i -done -cat default.filter | sed -e 's/[[:cntrl:]]*$//' > %{buildroot}%{privoxyconf}/default.filter -cat user.filter | sed -e 's/[[:cntrl:]]*$//' > %{buildroot}%{privoxyconf}/user.filter -cat trust | sed -e 's/[[:cntrl:]]*$//' > %{buildroot}%{privoxyconf}/trust -( -cd templates -for i in `ls` -do - cat $i | sed -e 's/[[:cntrl:]]*$//' > %{buildroot}%{privoxyconf}/templates/$i -done -) - -cp -f %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1 -cp -f %{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name} -install -m 755 %{name}.init %{buildroot}%{_sysconfdir}/rc.d/init.d/%{name} -install -m 711 -d %{buildroot}%{_localstatedir}/log/%{name} - -# verify all file locations, etc. in the config file -# don't start with ^ or commented lines are not replaced -## Changing the sed paramter delimiter to @, so we don't have to -## escape the slashes -cat config | \ - sed 's@^confdir.*@confdir %{privoxyconf}@g' | \ -# sed 's/^permissionsfile.*/permissionsfile \/etc\/%{name}\/permissionsfile/g' | \ -# sed 's/^filterfile.*/default.filter \/etc\/%{name}\/default.filter/g' | \ -# sed 's/^logfile.*/logfile \%{_localstatedir}\/log\/%{name}\/logfile/g' | \ -# sed 's/^forward.*/forward \/etc\/%{name}\/forward/g' | \ -# sed 's/^aclfile.*/aclfile \/etc\/%{name}\/aclfile/g' > \ - sed 's@^logdir.*@logdir %{_localstatedir}/log/%{name}@g' | \ - sed 's@#user-manual http://www.privoxy.org/user-manual/@user-manual %{_docdir}/%{name}-%{version}/user-manual/@g' | \ - sed -e 's/[[:cntrl:]]*$//' > \ - %{buildroot}%{privoxyconf}/config -perl -pe 's/{-no-cookies}/{-no-cookies}\n\.redhat.com/' default.action >\ - %{buildroot}%{privoxyconf}/default.action - - -## Macros are expanded even on commentaries. So, we have to use %% -## -- morcego -#%%makeinstall - -%pre -# This is where we handle old usernames (junkbust and junkbuster) -# I'm not sure we should do that, but this is the way we have been -# doing it for some time now -- morcego -# We should do it for the group as well -- morcego -# Doing it by brute force. Much cleaner (no more Mr. Nice Guy) -- morcego - -# Same for username -usermod -u %{privoxy_uid} -g %{privoxy_gid} -l %{name} -d %{_sysconfdir}/%{name} -s "" %{oldname} > /dev/null 2>&1 || : -usermod -u %{privoxy_uid} -g %{privoxy_gid} -l %{name} -d %{_sysconfdir}/%{name} -s "" %{veryoldname} > /dev/null 2>&1 || : -userdel %{oldname} > /dev/null 2>&1 ||: -userdel %{veryoldname} > /dev/null 2>&1 ||: - -# Change the group name. Remove anything left behind. -groupmod -g %{privoxy_gid} -n %{name} %{oldname} > /dev/null 2>&1 ||: -groupmod -g %{privoxy_gid} -n %{name} %{veryoldname} > /dev/null 2>&1 ||: -groupdel %{oldname} > /dev/null 2>&1 ||: -groupdel %{veryoldname} > /dev/null 2>&1 ||: - -# Doublecheck to see if the group exist, and that it has the correct gid -/bin/grep -E '^%{name}:' %{_sysconfdir}/group > /dev/null 2>&1 -if [ $? -eq 1 ]; then - # Looks like it does not exist. Create it - groupadd -g %{privoxy_gid} %{name} > /dev/null 2>&1 -else - /bin/grep -E '^%{name}:[^:]*:%{privoxy_gid}:' %{_sysconfdir}/group > /dev/null 2>&1 - if [ $? -eq 1 ]; then - # The group exists, but does not have the correct gid - groupmod -g %{privoxy_gid} %{name} > /dev/null 2>&1 - fi -fi - -# Check to see if everything is okey. Create user if it still does not -# exist -id %{name} > /dev/null 2>&1 -if [ $? -eq 1 ]; then - %{_sbindir}/useradd -u %{privoxy_uid} -g %{privoxy_gid} -d %{_sysconfdir}/%{name} -r -s "" %{name} > /dev/null 2>&1 -fi - -# Double check that the group has the correct uid -P_UID=`id -u %{name} 2>/dev/null` -if [ $P_UID -ne %{privoxy_uid} ]; then - %{_sbindir}/usermod -u %{privoxy_uid} %{name} -fi - -# The same for the gid -P_GID=`id -g %{name} 2>/dev/null` -if [ $P_GID -ne %{privoxy_gid} ]; then - %{_sbindir}/usermod -g %{privoxy_gid} %{name} -fi - -%post -# for upgrade from 2.0.x -[ -f %{_localstatedir}/log/%{oldname}/logfile ] && { - mv -f %{_localstatedir}/log/%{oldname}/logfile %{_localstatedir}/log/%{name}/logfile ||: ; - chown -R %{name}:%{name} %{_localstatedir}/log/%{name} 2>/dev/null ||: ; -} -[ -f %{_localstatedir}/log/%{name}/%{name} ] && { - mv -f %{_localstatedir}/log/%{name}/%{name} %{_localstatedir}/log/%{name}/logfile ||: ; - chown -R %{name}:%{name} %{_sysconfdir}/%{name} 2>/dev/null ||: ; -} -/sbin/chkconfig --add privoxy -if [ "$1" = "1" ]; then - /sbin/service %{name} condrestart > /dev/null 2>&1 ||: -fi - -%preun -/sbin/service %{veryoldname} stop > /dev/null 2>&1 ||: -/sbin/service %{oldname} stop > /dev/null 2>&1 ||: - -if [ "$1" = "0" ]; then - /sbin/service %{name} stop > /dev/null 2>&1 ||: - /sbin/chkconfig --del privoxy -fi - -%postun -#if [ "$1" -ge "1" ]; then -# /sbin/service %{name} condrestart > /dev/null 2>&1 -#fi -# We only remove it we this is not an upgrade -if [ "$1" = "0" ]; then - id privoxy > /dev/null 2>&1 && %{_sbindir}/userdel privoxy || /bin/true - /bin/grep -E '^%{name}:' %{_sysconfdir}/group > /dev/null && %{_sbindir}/groupdel %{name} || /bin/true -fi - -%clean -[ "%{buildroot}" != "/" ] && rm -rf %{buildroot} - -%files -%defattr(0644,root,root,0755) -%doc README AUTHORS ChangeLog LICENSE -#%doc doc/text/developer-manual.txt doc/text/user-manual.txt doc/text/faq.txt -%doc doc/webserver/developer-manual -%doc doc/webserver/user-manual -%doc doc/webserver/faq -%doc doc/webserver/p_doc.css doc/webserver/privoxy-index.html -%doc doc/webserver/images -%doc doc/webserver/man-page - -# ATTENTION FOR defattr change here ! -%defattr(0644,%{name},%{name},0755) - -%dir %{privoxyconf} -%dir %{privoxyconf}/templates -%dir %{_localstatedir}/log/%{name} - -%attr(0744,%{name},%{name})%{_sbindir}/%{name} - -# WARNING ! WARNING ! WARNING ! WARNING ! WARNING ! WARNING ! WARNING ! -# We should not use wildchars here. This could mask missing files problems -# -- morcego -# WARNING ! WARNING ! WARNING ! WARNING ! WARNING ! WARNING ! WARNING ! -%config(noreplace) %{privoxyconf}/config -%config(noreplace) %{privoxyconf}/user.action -%config %{privoxyconf}/match-all.action -%config %{privoxyconf}/default.action -%config %{privoxyconf}/default.filter -%config %{privoxyconf}/regression-tests.action -%config(noreplace) %{privoxyconf}/user.filter -%config(noreplace) %{privoxyconf}/trust - -# Please keep these alphabetized so its easier to find one that -# is not included. -%config %{privoxyconf}/templates/blocked -%config %{privoxyconf}/templates/cgi-error-404 -%config %{privoxyconf}/templates/cgi-error-bad-param -%config %{privoxyconf}/templates/cgi-error-disabled -%config %{privoxyconf}/templates/cgi-error-file -%config %{privoxyconf}/templates/cgi-error-file-read-only -%config %{privoxyconf}/templates/cgi-error-modified -%config %{privoxyconf}/templates/cgi-error-parse -%config %{privoxyconf}/templates/cgi-style.css -%config %{privoxyconf}/templates/connect-failed -%config %{privoxyconf}/templates/default -%config %{privoxyconf}/templates/forwarding-failed -%config %{privoxyconf}/templates/edit-actions-add-url-form -%config %{privoxyconf}/templates/edit-actions-for-url -%config %{privoxyconf}/templates/edit-actions-for-url-filter -%config %{privoxyconf}/templates/edit-actions-list -%config %{privoxyconf}/templates/edit-actions-list-button -%config %{privoxyconf}/templates/edit-actions-list-section -%config %{privoxyconf}/templates/edit-actions-list-url -%config %{privoxyconf}/templates/edit-actions-remove-url-form -%config %{privoxyconf}/templates/edit-actions-url-form -%config %{privoxyconf}/templates/mod-local-help -%config %{privoxyconf}/templates/mod-support-and-service -%config %{privoxyconf}/templates/mod-title -%config %{privoxyconf}/templates/mod-unstable-warning -%config %{privoxyconf}/templates/no-such-domain -%config %{privoxyconf}/templates/show-request -%config %{privoxyconf}/templates/show-status -%config %{privoxyconf}/templates/show-status-file -%config %{privoxyconf}/templates/show-url-info -%config %{privoxyconf}/templates/show-version -%config %{privoxyconf}/templates/toggle -%config %{privoxyconf}/templates/toggle-mini -%config %{privoxyconf}/templates/untrusted -%config %{privoxyconf}/templates/url-info-osd.xml - -# Attention, new defattr change here ! -%defattr(0644,root,root,0755) - -%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} -%config(noreplace) %attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/%{name} - -%{_mandir}/man1/%{name}.* - -%changelog -* Sat Jun 18 2008 Hal Burgiss -- Remove reference to txt docs. - -* Sat Oct 18 2006 Hal Burgiss -- Bump version to 3.0.6 - -* Sat Sep 23 2006 Jochen Schlick 3.0.5-1 -- let user-manual point to local documentation - -* Thu Sep 21 2006 Hal Burgiss -- Fix user.filter install section and clean up CVS cruft in tarball. - -* Wed Sep 20 2006 Hal Burgiss -- Bump version to 3.0.5 - -* Fri Sep 08 2006 Hal Burgiss -- Bump version to 3.0.4 - -* Sat Sep 02 2006 Hal Burgiss -- Include new file, user.filter. Do not overwrite "trust" file - (does anyone use this?). - -* Wed Mar 26 2003 Andreas Oesterhelt -- Bump version for 3.0.2. - -* Wed Mar 19 2003 Hal Burgiss -- Bump version for 3.0.1. - -* Tue Aug 25 2002 Hal Burgiss -- Bump version for 3.0.0 :) - -* Tue Aug 06 2002 Hal Burgiss -- Reset version for 2.9.20. - -* Tue Jul 30 2002 Hal Burgiss -- Reset version for 2.9.18. - -* Sat Jul 27 2002 Hal Burgiss -- Reset version and release for 2.9.16. - -* Fri Jul 12 2002 Karsten Hopp -- don't use ghost files for rcX.d/*, using chkconfig is the - correct way to do this job (#68619) - -* Fri Jul 05 2002 Rodrigo Barbosa -+ privoxy-2.9.15-8 -- Changing delete order for groups and users (users should be first) - -* Wed Jul 03 2002 Rodrigo Barbosa -+ privoxy-2.9.15-7 -- Changing sed expression that removed CR from the end of the lines. This - new one removes any control caracter, and should work with older versions - of sed - -* Tue Jul 02 2002 Rodrigo Barbosa -+ privoxy-2.9.15-6 -- Fixing defattr values. File and directory modes where swapped - -* Tue Jul 02 2002 Rodrigo Barbosa -+ privoxy-2.9.15-5 -- Bumping Release number (which should be changed every time the specfile - is) - -* Tue Jul 02 2002 Hal Burgiss -+ privoxy-2.9.15-4 -- Fix typo in templates creation. - -* Wed Jun 26 2002 Rodrigo Barbosa -+ privoxy-2.9.15-4 -- Fixing issues created by specfile sync between branches - - Correcting the release number (WARNING) - - Reintroducing text file conversion (dos -> unix) - - Reconverting hardcoded directories to macros - - Refixing ownership of privoxy files (now using multiple defattr - definitions) - -* Thu Jun 20 2002 Karsten Hopp -- fix several .spec file issues to shut up rpmlint - - non-standard-dir-perm /var/log/privoxy 0744 - - invalid-vendor Privoxy.Org (This is ok for binaries compiled by privoxy - members, but not for packages from Red Hat) - - non-standard-group Networking/Utilities - - logrotate and init scripts should be noreplace - -* Mon May 27 2002 Hal Burgiss -+ privoxy-2.9.15-1 -- Index.html is now privoxy-index.html for doc usage. - -* Sat May 25 2002 Hal Burgiss -+ privoxy-2.9.15-1 -- Add html man page so index.html does not 404. - -* Fri May 24 2002 Hal Burgiss -+ privoxy-2.9.15-1 -- Add another template and alphabetize these for easier tracking. -- Add doc/images directory. - -* Wed May 15 2002 Hal Burgiss -+ privoxy-2.9.15-1 -- Add templates/edit-actions-list-button - -* Fri May 03 2002 Rodrigo Barbosa -+ privoxy-2.9.15-1 -- Version bump -- Adding noreplace for %%{privoxyconf}/config -- Included a method to verify if the versions declared on the specfile and - configure.in match. Interrupt the build if they don't. - -* Fri Apr 26 2002 Rodrigo Barbosa -+ privoxy-2.9.14-3 -- Changing Vendor to Privoxy.Org - -* Tue Apr 23 2002 Hal Burgiss -+ privoxy-2.9.14-2 -- Adjust for new *actions files. - -* Mon Apr 22 2002 Rodrigo Barbosa -+ privoxy-2.9.14-2 -- Removed the redhat hack that prevented the user and group from - being dealocated. That was a misundestanding of my part regarding - redhat policy. - -* Mon Apr 22 2002 Rodrigo Barbosa -+ privoxy-2.9.14-2 -- Using macros to define uid and gid values -- Bumping release - -* Mon Apr 22 2002 Rodrigo Barbosa -+ privoxy-2.9.14-1 -- Changes to fixate the uid and gid values as (both) 73. This is a - value we hope to standarize for all distributions. RedHat already - uses it, and Conectiva should start as soon as I find where the heck - I left my cluebat :-) -- Only remove the user and group on uninstall if this is not redhat, once - redhat likes to have the values allocated even if the package is not - installed - -* Tue Apr 16 2002 Hal Burgiss -+ privoxy-2.9.13-6 -- Add --disable-dynamic-pcre to configure. - -* Wed Apr 10 2002 Rodrigo Barbosa -+ privoxy-2.9.13-5 -- Relisting template files on the %%files section - -* Tue Apr 09 2002 Hal Burgiss -+ privoxy-2.9.13-4 -- Removed 'make dok'. Docs are all maintained in CVS (and tarball) now. - -* Mon Apr 08 2002 Hal Burgiss -+ privoxy-2.9.13-4 -- Add templates/cgi-style.css, faq.txt, p_web.css, LICENSE -- Remove templates/blocked-compact. -- Add more docbook stuff to Builderquires. - -* Thu Mar 28 2002 Sarantis Paskalis -+ privoxy-2.9.13-3 -- Include correct documentation file. - -* Tue Mar 26 2002 Hal Burgiss -+ privoxy-2.9.13-3 -- Fix typo in Description. - -* Tue Mar 26 2002 Rodrigo Barbosa -+ privoxy-2.9.13-3 -- Added commentary asking to update the release value on the configure - script - -* Tue Mar 25 2002 Hal Burgiss -+ privoxy-2.9.13-3 -- Added the missing edit-actions-for-url-filter to templates. - -* Mon Mar 25 2002 Rodrigo Barbosa -+ privoxy-2.9.13-2 -- Fixing Release number - -* Sun Mar 24 2002 Hal Burgiss -+ privoxy-2.9.13-2 -- Added faq to docs. - -* Sun Mar 24 2002 Rodrigo Barbosa -+ privoxy-2.9.13-2 -- Fixed the init files entries. Now we use %%ghost -- improved username (and groupname) handling on the %%pre section. By improved - I mean: we do it by brute force now. Much easier to maintain. Yeah, you - got it right. No more Mr. Nice Guy. -- Removed the userdel call on %%post. No need, once it's complety handled on - the %%pre section - -* Sun Mar 24 2002 Hal Burgiss -+ junkbusterng-2.9.13-1 - Added autoheader. Added autoconf to buildrequires. - -* Sun Mar 24 2002 Hal Burgiss -+ junkbusterng-2.9.13-1 -- Fixed build problems re: name conflicts with man page and logrotate. -- Commented out rc?d/* configs for time being, which are causing a build -- failure. /etc/junkbuster is now /etc/privoxy. Stefan did other name -- changes. Fixed typo ';' should be ':' causing 'rpm -e' to fail. - -* Fri Mar 22 2002 Rodrigo Barbosa -+ junkbusterng-2.9.13-1 -- References to the expression ijb where changed where possible -- New package name: junkbusterng (all in lower case, acording to - the LSB recomendation) -- Version changed to: 2.9.13 -- Release: 1 -- Added: junkbuster to obsoletes and conflicts (Not sure this is - right. If it obsoletes, why conflict ? Have to check it later) -- Summary changed: Stefan, please check and aprove it -- Changes description to use the new name -- Sed string was NOT changed. Have to wait to the manpage to - change first -- Keeping the user junkbuster for now. It will require some aditional - changes on the script (scheduled for the next specfile release) -- Added post entry to move the old logfile to the new log directory -- Removing "chkconfig --add" entry (not good to have it automaticaly - added to the startup list). -- Added preun section to stop the service with the old name, as well - as remove it from the startup list -- Removed the chkconfig --del entry from the conditional block on - the preun scriptlet (now handled on the %files section) - -* Thu Mar 21 2002 Hal Burgiss -- added ijb_docs.css to docs. - -* Mon Mar 11 2002 Hal Burgiss -+ junkbuster-2.9.11-8 -- Take out --enable-no-gifs, breaks some browsers. - -* Sun Mar 10 2002 Hal Burgiss -+ junkbuster-2.9.11-8 -- Add --enable-no-gifs to configure. - -* Fri Mar 08 2002 Rodrigo Barbosa -+ junkbuster-2.9.11-7 -- Added BuildRequires to libtool. - -* Tue Mar 06 2002 Rodrigo Barbosa -+ junkbuster-2.9.11-6 -- Changed the routined that handle the junkbust and junkbuster users on - %%pre and %%post to work in a smoother manner -- %%files now uses hardcoded usernames, to avoid problems with package - name changes in the future - -* Tue Mar 05 2002 Rodrigo Barbosa -+ junkbuster-2.9.11-5 -- Added "make redhat-dok" to the build process -- Added docbook-utils to BuildRequires - -* Tue Mar 05 2002 Rodrigo Barbosa -+ junkbuster-2.9.11-4 -- Changing man section in the manpage from 1 to 8 -- We now require packages, not files, to avoid issues with apt - -* Mon Mar 04 2002 Rodrigo Barbosa -+ junkbuster-2.9.11-3 -- Fixing permissions of the init script - -* Mon Mar 04 2002 Rodrigo Barbosa -+ junkbuster-2.9.11-2 -- General specfile fixup, using the best recomended practices, including: - - Adding -q to %%setup - - Using macros whereever possible - - Not using wildchars on %%files section - - Doubling the percentage char on changelog and comments, to - avoid rpm expanding them - -* Sun Mar 03 2002 Hal Burgiss -- /bin/false for shell causes init script to fail. Reverting. - -* Wed Jan 09 2002 Hal Burgiss -- Removed UID 73. Included user-manual and developer-manual in docs. - Include other actions files. Default shell is now /bin/false. - Userdel user=junkbust. ChangeLog was not zipped. Removed - RPM_OPT_FLAGS kludge. - -* Fri Dec 28 2001 Thomas Steudten -- add paranoia check for 'rm -rf %%{buildroot}' -- add gzip to 'BuildRequires' - -* Sat Dec 1 2001 Hal Burgiss -- actionsfile is now ijb.action. - -* Tue Nov 6 2001 Thomas Steudten -- Compress manpage -- Add more documents for installation -- Add version string to name and source - -* Wed Oct 24 2001 Hal Burigss -- Back to user 'junkbuster' and fix configure macro. - -* Wed Oct 10 2001 Hal Burigss -- More changes for user 'junkbust'. Init script had 'junkbuster'. - -* Sun Sep 23 2001 Hal Burgiss -- Change of $RPM_OPT_FLAGS handling. Added new HTML doc files. -- Changed owner of /etc/junkbuster to shut up PAM/xauth log noise. - -* Thu Sep 13 2001 Hal Burgiss -- Added $RPM_OPT_FLAGS support, renaming of old logfile, and -- made sure no default shell exists for user junkbust. - -* Sun Jun 3 2001 Stefan Waldherr -- rework of RPM - -* Mon Sep 25 2000 Stefan Waldherr -- CLF Logging patch by davep@cyw.uklinux.net -- Hal DeVore fix akamaitech in blocklist - -* Sun Sep 17 2000 Stefan Waldherr -- Steve Kemp skx@tardis.ed.ac.uk's javascript popup patch. -- Markus Breitenbach breitenb@rbg.informatik.tu-darmstadt.de supplied - numerous fixes and enhancements for Steve's patch. -- adamlock@netscape.com (Adam Lock) in the windows version: - - Taskbar activity spinner always spins even when logging is - turned off (which is the default) - people who don't - like the spinner can turn it off from a menu option. - - Taskbar popup menu has a options submenu - people can now - open the settings files for cookies, blockers etc. - without opening the JB window. - - Logging functionality works again - - Buffer overflow is fixed - new code uses a bigger buffer - and snprintf so it shouldn't overflow anymore. -- Fixed userid swa, group learning problem while installing. - root must build RPM. -- Added patch by Benjamin Low that prevents JB to - core dump when there is no log file. -- Tweaked SuSE startup with the help of mohataj@gmx.net and Doc.B@gmx.de. -- Fixed man page to include imagefile and popupfile. -- Sanity check for the statistics function added. -- "Patrick D'Cruze" : It seems Microsoft - are transitioning Hotmail from FreeBSD/Apache to Windows 2000/IIS. - With IIS/5, it appears to omit the trailing \r\n from http header - only messages. eg, when I visit http://www.hotmail.com, IIS/5 - responds with a HTTP 302 redirect header. However, this header - message is missing the trailing \r\n. IIS/5 then closes the - connection. Junkbuster, unfortunately, discards the header becomes - it thinks it is incomplete - and it is. MS have transmitted an - incomplete header! -- Added bug reports and patch submission forms in the docs. - -* Mon Mar 20 2000 Stefan Waldherr - Andrew extended the JB: - Display of statistics of the total number of requests and the number - of requests filtered by junkbuster, also the percentage of requests - filtered. Suppression of the listing of files on the proxy-args page. - All stuff optional and configurable. - -* Sun Sep 12 1999 Stefan Waldherr - Jan Willamowius (jan@janhh.shnet.org) fixed a bug in the - code which prevented the JB from handling URLs of the form - user:password@www.foo.com. Fixed. - -* Mon Aug 2 1999 Stefan Waldherr - Blank images are no longer cached, thanks to a hint from Markus - Breitenbach . The user - agent is NO longer set by the Junkbuster. Sadly, many sites depend - on the correct browser version nowadays. Incorporated many - suggestions from Jan "Yenya" Kasprzak for the - spec file. Fixed logging problem and since runlevel 2 does not - use networking, I replaced /etc/rc.d/rc2.d/S84junkbuster with - /etc/rc.d/rc2.d/K09junkbuster thanks to Shaw Walker - . You should now be able to build this RPM as - a non-root user (mathias@weidner.sem.lipsia.de). - -* Sun Jan 31 1999 Stefan Waldherr - %%{_localstatedir}/log/junkbuster set to nobody. Added /etc/junkbuster/imagelist - to allow more sophisticated matching of blocked images. Logrotate - logfile. Added files for auto-updating the blocklist et al. - -* Wed Dec 16 1998 Stefan Waldherr - Configure blank version via config file. No separate blank - version anymore. Added Roland's - patch to show a logo instead of a blank area. Added a suggestion - from Alex : %%{_localstatedir}/lock/subsys/junkbuster. - More regexps in the blocklist. Prepared the forwardfile for - squid. Extended image regexp with help from gabriel - . - -* Thu Nov 19 1998 Stefan Waldherr - All RPMs now identify themselves in the show-proxy-args page. - Released Windoze version. Run junkbuster as nobody instead of - root. - -* Fri Oct 30 1998 Stefan Waldherr - Newest version. First release (hence the little version number - mixture -- 2.0.2-0 instead of 2.0-7). This version tightens - security over 2.0.1; some multi-user sites will need to change - the listen-address in the configuration file. The blank version of - the Internet Junkbuster has a more sophisticated way of replacing - images. All RPMs identify themselves in the show-proxy-args page. - -* Thu Sep 23 1998 Stefan Waldherr - Modified the blocking feature, so that only GIFs and JPEGs are - blocked and replaced but not HTML pages. Thanks to - "Gerd Flender" for this nice - idea. Added numerous stuff to the blocklist. Keep patches in - seperate files and no longer in diffs (easier to maintain). - -* Tue Jun 16 1998 Stefan Waldherr - Moved config files to /etc/junkbuster directory, moved man page, - added BuildRoot directive (Thanks to Alexey Nogin ) - Made new version junkbuster-raw (which is only a stripped version of - the junkuster rpm, i.e. without my blocklist, etc.) - -* Tue Jun 16 1998 (2.0-1) - Uhm, not that much. Just a new junkbuster version that - fixes a couple of bugs ... and of course a bigger - blocklist with the unique Now-less-ads-than-ever(SM) - feature. - Oh, one thing: I changed the default user agent to Linux -- no - need anymore to support Apple. - -* Tue Jun 16 1998 (2.0-0) - Now-less-ads-than-ever (SM) - compiled with gcc instead of cc - compiled with -O3, thus it should be a little faster - show-proxy-args now works - /etc/junkbuster.init wasn't necessary - -* Tue Jun 16 1998 (1.4) - some more config files were put into /etc - The junkbuster-blank rpm returns a 1x1 pixel image, that gets - displayed by Netscape instead of the blocked image. - Read http://www.waldherr.org/junkbuster/ for - further info. - -* Tue Jun 16 1998 (1.3) - The program has been moved to /usr/sbin (from /usr/local/bin) - Init- and stopscripts (/etc/rc.d/rc*) have been added so - that the junkbuster starts automatically during bootup. - The /etc/blocklist file is much more sophisticated. Theoretically - one should e.g. browse all major US and German newspapers without - seeing one annoying ad. - junkbuster.init was modified. It now starts junkbuster with an - additional "-r @" flag. - -# $Log: privoxy-rh.spec,v $ -# Revision 1.63 2009/03/21 10:46:15 fabiankeil -# Bump version to 3.0.12. -# -# Revision 1.62 2009/02/15 17:17:23 fabiankeil -# - Bump version to 3.0.11. -# - List match-all.action as %config file. -# -# Revision 1.61 2009/01/13 16:47:34 fabiankeil -# The standard.action file is gone. -# -# Revision 1.60 2008/08/30 12:46:49 fabiankeil -# The jarfile directive is gone. Update accordingly. -# -# Revision 1.59 2008/08/13 16:57:46 fabiankeil -# Change version to 3.0.10. -# -# Revision 1.58 2008/06/19 01:52:17 hal9 -# Remove txt docs from spec file. -# -# Revision 1.57 2008/05/30 15:06:42 fabiankeil -# - Add %config directive for url-info-osd.xml. -# As usual, this hasn't been tested. -# - Fix comment typo. -# -# Revision 1.56 2008/03/16 14:17:25 fabiankeil -# Add %config lines for regression-tests.action and forwarding-failed. -# This might or might not help with #1915185, reported by Bernardo Bacic. -# -# Revision 1.55 2008/03/02 17:36:43 fabiankeil -# Set version to 3.0.9. -# -# Revision 1.54 2008/01/20 14:30:59 fabiankeil -# Set version to 3.0.8. -# -# Revision 1.53 2006/11/28 11:34:35 hal9 -# Fix the prep section per Support request so it actually builds. -# -# Revision 1.52 2006/11/18 17:36:53 hal9 -# Ooops, bumping version to 3.0.6 -# -# Revision 1.51 2006/11/18 14:37:12 fabiankeil -# Bump version to 3.0.6. -# -# Revision 1.50 2006/09/24 01:19:03 hal9 -# Add changes for user-manual directive by nfopd submitted via SF. -# -# Revision 1.49 2006/09/22 01:02:08 hal9 -# Fix user.filter installation and CVS files cruft per support request. -# -# Revision 1.48 2006/09/20 23:51:26 hal9 -# Bump versions to 3.0.5 -# -# Revision 1.47 2006/09/09 00:35:10 hal9 -# Bumped versions to 3.0.4. Both files should be checked further. -# -# Revision 1.46 2006/09/02 22:22:59 hal9 -# Include user.filter, and do not overwrite trust file on updates. -# -# Revision 1.45 2006/07/18 14:48:47 david__schmidt -# Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) -# with what was really the latest development (the v_3_0_branch branch) -# -# Revision 1.33.2.22 2004/01/30 17:09:29 oes -# Bumped version for 3.0.3 -# -# Revision 1.33.2.21 2003/03/26 00:25:00 oes -# Bump version for 3.0.2 -# -# Revision 1.33.2.20 2003/03/20 03:27:11 hal9 -# Bump version for 3.0.1 pending release. -# -# Revision 1.33.2.19 2002/08/25 23:36:03 hal9 -# Bump version for 3.0.0. -# -# Revision 1.33.2.18 2002/08/10 11:28:50 oes -# Bumped version -# -# Revision 1.33.2.17 2002/08/07 01:08:49 hal9 -# Bumped version to 2.9.18. -# -# Revision 1.33.2.16 2002/08/05 08:42:13 kick_ -# same permissions, same runlevels as all the other initscripts -# -# Revision 1.33.2.15 2002/07/30 21:51:19 hal9 -# Bump version to 2.9.17. -# -# Revision 1.33.2.14 2002/07/27 21:58:16 kick_ -# bump version -# -# Revision 1.33.2.13 2002/07/27 21:39:41 kick_ -# condrestart raised an error during an fresh install when privoxy wasn't already running -# -# Revision 1.33.2.12 2002/07/27 15:47:10 hal9 -# Reset version and release for 2.9.16. -# -# Revision 1.33.2.11 2002/07/25 09:47:57 kick_ -# this caused some errors during a fresh installation. It's unnecessary to call an extra program (/bin/true) to set the error code to 0 -# -# Revision 1.33.2.10 2002/07/12 09:14:26 kick_ -# don't use ghost files for rcX.d/*, chkconfig is available to do this job. Enable translation of error messge -# -# Revision 1.33.2.9 2002/07/05 17:16:19 morcego -# - Changing delete order for groups and users (users should be first) -# -# Revision 1.33.2.8 2002/07/03 20:46:24 morcego -# - Changing sed expression that removed CR from the end of the lines. This -# new one removes any control caracter, and should work with older versions -# of sed -# -# Revision 1.33.2.7 2002/07/02 18:16:48 morcego -# - Fixing defattr values. File and directory modes where swapped -# -# Revision 1.33.2.6 2002/07/02 17:38:10 morcego -# Bumping Release number -# -# Revision 1.33.2.5 2002/07/02 11:43:20 hal9 -# Fix typo in templates creation. -# -# Revision 1.33.2.4 2002/06/26 17:32:45 morcego -# Integrating fixed from the main branch. -# -# Revision 1.33.2.3 2002/06/24 12:13:34 kick_ -# shut up rpmlint. btw: The vendor tag should be set in you .rpmmacros file, not in the spec file! -# -# Revision 1.33.2.2 2002/05/28 02:39:38 hal9 -# Replace index.html with privoxy-index.html for docs. -# -# Revision 1.33.2.1 2002/05/26 17:20:23 hal9 -# Add images to doc dirs. -# -# Revision 1.33 2002/05/25 02:08:23 hal9 -# Add doc/images directory. -# Redhat: alphabetized list of templates (and I think added one in the process) -# -# Revision 1.32 2002/05/16 01:37:29 hal9 -# Add new template file so CGI stuff works :) -# -# Revision 1.31 2002/05/03 17:14:35 morcego -# *.spec: Version bump to 2.9.15 -# -rh.spec: noreplace for %%{privoxyconf}/config -# Will interrupt the build if versions from configure.in and -# specfile do not match -# -# Revision 1.30 2002/04/26 15:51:05 morcego -# Changing Vendor value to Privoxy.Org -# -# Revision 1.29 2002/04/24 03:13:51 hal9 -# New actions files changes. -# -# Revision 1.28 2002/04/22 18:51:33 morcego -# user and group now get removed on rh too. -# -# Revision 1.27 2002/04/22 16:32:31 morcego -# configure.in, *.spec: Bumping release to 2 (2.9.14-2) -# -rh.spec: uid and gid are now macros -# -suse.spec: Changing the header Copyright to License (Copyright is -# deprecable) -# -# Revision 1.26 2002/04/22 16:24:36 morcego -# - Changes to fixate the uid and gid values as (both) 73. This is a -# value we hope to standarize for all distributions. RedHat already -# uses it, and Conectiva should start as soon as I find where the heck -# I left my cluebat :-) -# - Only remove the user and group on uninstall if this is not redhat, once -# redhat likes to have the values allocated even if the package is not -# installed -# -# Revision 1.25 2002/04/17 01:59:12 hal9 -# Add --disable-dynamic-pcre. -# -# Revision 1.24 2002/04/11 10:09:20 oes -# Version 2.9.14 -# -# Revision 1.23 2002/04/10 18:14:45 morcego -# - (privoxy-rh.spec only) Relisting template files on the %%files section -# - (configure.in, privoxy-rh.spec) Bumped package release to 5 -# -# Revision 1.22 2002/04/09 22:06:12 hal9 -# Remove 'make dok'. -# -# Revision 1.21 2002/04/09 02:52:26 hal9 -# - Add templates/cgi-style.css, faq.txt, p_web.css, LICENSE -# - Remove templates/blocked-compact. -# - Add more docbook stuff to Buildrequires. -# -# Revision 1.20 2002/04/08 20:27:45 swa -# fixed JB spelling -# -# Revision 1.19 2002/03/27 22:44:59 sarantis -# Include correct documentation file. -# -# Revision 1.18 2002/03/27 22:10:14 sarantis -# bumped Hal's last commit 1 day to the future to make rpm build again. -# -# Revision 1.17 2002/03/27 00:48:23 hal9 -# Fix up descrition. -# -# Revision 1.16 2002/03/26 22:29:55 swa -# we have a new homepage! -# -# Revision 1.15 2002/03/26 17:39:54 morcego -# Adding comment on the specfile to remember the packager to update -# the release number on the configure script -# -# Revision 1.14 2002/03/26 14:25:15 hal9 -# Added edit-actions-for-url-filter to templates in %%config -# -# Revision 1.13 2002/03/25 13:31:04 morcego -# Bumping Release tag. -# -# Revision 1.12 2002/03/25 03:11:40 hal9 -# Do it right way this time :/ -# -# Revision 1.11 2002/03/25 03:09:51 hal9 -# Added faq to docs. -# -# Revision 1.10 2002/03/24 22:16:14 morcego -# Just removing some old commentaries. -# -# Revision 1.9 2002/03/24 22:03:22 morcego -# Should be working now. See %changelog for details -# -# Revision 1.8 2002/03/24 21:13:01 morcego -# Tis broken. -# -# Revision 1.7 2002/03/24 21:07:18 hal9 -# Add autoheader, etc. -# -# Revision 1.6 2002/03/24 19:56:40 hal9 -# /etc/junkbuster is now /etc/privoxy. Fixed ';' typo. -# -# Revision 1.4 2002/03/24 13:32:42 swa -# name change related issues -# -# Revision 1.3 2002/03/24 12:56:21 swa -# name change related issues. -# -# Revision 1.2 2002/03/24 11:40:14 swa -# name change -# -# Revision 1.1 2002/03/24 11:23:44 swa -# name change -# -# Revision 1.1 2002/03/22 20:53:03 morcego -# - Ongoing process to change name to JunkbusterNG -# - configure/configure.in: no change needed -# - GNUmakefile.in: -# - TAR_ARCH = /tmp/JunkbusterNG-$(RPM_VERSION).tar.gz -# - PROGRAM = jbng@EXEEXT@ -# - rh-spec now references as junkbusterng-rh.spec -# - redhat-upload: references changed to junkbusterng-* (package names) -# - tarball-dist: references changed to JunkbusterNG-distribution-* -# - tarball-src: now JunkbusterNG-* -# - install: initscript now junkbusterng.init and junkbusterng (when -# installed) -# - junkbuster-rh.spec: renamed to junkbusterng-rh.spec -# - junkbusterng.spec: -# - References to the expression ijb where changed where possible -# - New package name: junkbusterng (all in lower case, acording to -# the LSB recomendation) -# - Version changed to: 2.9.13 -# - Release: 1 -# - Added: junkbuster to obsoletes and conflicts (Not sure this is -# right. If it obsoletes, why conflict ? Have to check it later) -# - Summary changed: Stefan, please check and aprove it -# - Changes description to use the new name -# - Sed string was NOT changed. Have to wait to the manpage to -# change first -# - Keeping the user junkbuster for now. It will require some aditional -# changes on the script (scheduled for the next specfile release) -# - Added post entry to move the old logfile to the new log directory -# - Removing "chkconfig --add" entry (not good to have it automaticaly -# added to the startup list). -# - Added preun section to stop the service with the old name, as well -# as remove it from the startup list -# - Removed the chkconfig --del entry from the conditional block on -# the preun scriptlet (now handled on the %files section) -# - junkbuster.init: renamed to junkbusterng.init -# - junkbusterng.init: -# - Changed JB_BIN to jbng -# - Created JB_OBIN with the old value of JB_BIN (junkbuster), to -# be used where necessary (config dir) -# -# Aditional notes: -# - The config directory is /etc/junkbuster yet. Have to change it on the -# specfile, after it is changes on the code -# - The only files that got renamed on the cvs tree were the rh specfile and -# the init file. Some file references got changes on the makefile and on the -# rh-spec (as listed above) -# -# Revision 1.43 2002/03/21 16:04:10 hal9 -# added ijb_docs.css to %doc -# -# Revision 1.42 2002/03/12 13:41:18 sarantis -# remove hard-coded "ijbswa" string in build phase -# -# Revision 1.41 2002/03/11 22:58:32 hal9 -# Remove --enable-no-gifs -# -# Revision 1.39 2002/03/08 18:57:29 swa -# remove user junkbuster after de-installation. -# -# Revision 1.38 2002/03/08 13:45:27 morcego -# Adding libtool to Buildrequires -# -# Revision 1.37 2002/03/07 19:23:49 swa -# i hate to scroll. suse: wrong configdir. -# -# Revision 1.36 2002/03/07 05:06:54 morcego -# Fixed %pre scriptlet. And, as a bonus, you can even understand it now. :-) -# -# Revision 1.34 2002/03/07 00:11:57 morcego -# Few changes on the %pre and %post sections of the rh specfile to handle -# usernames more cleanly -# -# Revision 1.33 2002/03/05 13:13:57 morcego -# - Added "make redhat-dok" to the build phase -# - Added docbook-utils to BuildRequires -# -# Revision 1.32 2002/03/05 12:34:24 morcego -# - Changing section internaly on the manpage from 1 to 8 -# - We now require packages, not files, to avoid issues with apt -# -# Revision 1.31 2002/03/04 18:06:09 morcego -# SPECFILE: fixing permissing of the init script (broken by the last change) -# -# Revision 1.30 2002/03/04 16:18:03 morcego -# General cleanup of the rh specfile. -# -# %changelog -# * Mon Mar 04 2002 Rodrigo Barbosa -# + junkbuster-2.9.11-2 -# - General specfile fixup, using the best recomended practices, including: -# - Adding -q to %%setup -# - Using macros whereever possible -# - Not using wildchars on %%files section -# - Doubling the percentage char on changelog and comments, to -# avoid rpm expanding them -# -# Revision 1.29 2002/03/03 19:21:22 hal9 -# Init script fails if shell is /bin/false. -# -# Revision 1.28 2002/01/09 18:34:03 hal9 -# nit. -# -# Revision 1.27 2002/01/09 18:32:02 hal9 -# Removed RPM_OPT_FLAGS kludge. -# -# Revision 1.26 2002/01/09 18:21:10 hal9 -# A few minor updates. -# -# Revision 1.25 2001/12/28 01:45:36 steudten -# Add paranoia check and BuildReq: gzip -# -# Revision 1.24 2001/12/01 21:43:14 hal9 -# Allowed for new ijb.action file. -# -# Revision 1.23 2001/11/06 12:09:03 steudten -# Compress doc files. Install README and AUTHORS at last as document. -# -# Revision 1.22 2001/11/05 21:37:34 steudten -# Fix to include the actual version for name. -# Let the 'real' packager be included - sorry stefan. -# -# Revision 1.21 2001/10/31 19:27:27 swa -# consistent description. new name for suse since -# we had troubles with rpms of identical names -# on the webserver. -# -# Revision 1.20 2001/10/24 15:45:49 hal9 -# To keep Thomas happy (aka correcting my mistakes) -# -# Revision 1.19 2001/10/15 03:23:59 hal9 -# Nits. -# -# Revision 1.17 2001/10/10 18:59:28 hal9 -# Minor change for init script. -# -# Revision 1.16 2001/09/24 20:56:23 hal9 -# Minor changes. -# -# Revision 1.13 2001/09/10 17:44:43 swa -# integrate three pieces of documentation. needs work. -# will not build cleanly under redhat. -# -# Revision 1.12 2001/09/10 16:25:04 swa -# copy all templates. version updated. -# -# Revision 1.11 2001/07/03 11:00:25 sarantis -# replaced permissionsfile with actionsfile -# -# Revision 1.10 2001/07/03 09:34:44 sarantis -# bumped up version number. -# -# Revision 1.9 2001/06/12 18:15:29 swa -# the %% in front of configure (see tag below) confused -# the rpm build process on 7.1. -# -# Revision 1.8 2001/06/12 17:15:56 swa -# fixes, because a clean build on rh6.1 was impossible. -# GZIP confuses make, %% configure confuses rpm, etc. -# -# Revision 1.7 2001/06/11 12:17:26 sarantis -# fix typo in %%post -# -# Revision 1.6 2001/06/11 11:28:25 sarantis -# Further optimizations and adaptations in the spec file. -# -# Revision 1.5 2001/06/09 09:14:11 swa -# shamelessly adapted RPM stuff from the newest rpm that -# RedHat provided for the JB. -# -# Revision 1.4 2001/06/08 20:54:18 swa -# type with status file. remove forward et. al from file list. -# -# Revision 1.3 2001/06/07 17:28:10 swa -# cosmetics -# -# Revision 1.2 2001/06/04 18:31:58 swa -# files are now prefixed with either `confdir' or `logdir'. -# `make redhat-dist' replaces both entries confdir and logdir -# with redhat values -# -# Revision 1.1 2001/06/04 10:44:57 swa -# `make redhatr-dist' now works. Except for the paths -# in the config file. -# -# -# diff --git a/external/privoxy/privoxy-suse.spec b/external/privoxy/privoxy-suse.spec deleted file mode 100644 index fc399385..00000000 --- a/external/privoxy/privoxy-suse.spec +++ /dev/null @@ -1,556 +0,0 @@ -# $Id: privoxy-suse.spec,v 1.33 2009/03/21 10:46:15 fabiankeil Exp $ -# -# Written by and Copyright (C) 2001-2006 the SourceForge -# Privoxy team. http://www.privoxy.org/ -# -# Based on the Internet Junkbuster originally written -# by and Copyright (C) 1997 Anonymous Coders and -# Junkbusters Corporation. http://www.junkbusters.com -# -# This program is free software; you can redistribute it -# and/or modify it under the terms of the GNU General -# Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will -# be useful, but WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public -# License for more details. -# -# The GNU General Public License should be included with -# this file. If not, you can view it at -# http://www.gnu.org/copyleft/gpl.html -# or write to the Free Software Foundation, Inc., 59 -# Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - -# do not set to %{name} -%define privoxyconf %{_sysconfdir}/privoxy -%define privoxy_uid 73 -%define privoxy_gid 73 - - -Summary: Privoxy - privacy enhancing proxy -Vendor: Privoxy.Org -Name: privoxy-suse -Distribution: defineme -Version: 3.0.12 -Release: 1 -# Needs makefile change: Source: http://prdownloads.sourceforge.net/ijbswa/privoxy-%{version}-%{status}-src.tar.gz -Source: http://prdownloads.sourceforge.net/ijbswa/privoxy-%{version}.tar.gz -# not sure if this works -BuildRoot: %{_tmppath}/%{name}-%{version}-root -Packager: http://www.privoxy.org/ -License: GPL -Group: Networking/Utilities -URL: http://www.privoxy.org/ -Autoreqprov: on -BuildRequires: perl gzip libtool autoconf -Conflicts: junkbuster-raw junkbuster-blank junkbuster-suse junkbuster privoxy - -# -# ----------------------------------------------------------------------------- -# -%description -Privoxy is a web proxy with advanced filtering capabilities for -protecting privacy, modifying web page data, managing cookies, -controlling access, and removing ads, banners, pop-ups and other -obnoxious Internet junk. Privoxy has a very flexible configuration and -can be customized to suit individual needs and tastes. Privoxy has -application for both stand-alone systems and multi-user networks. - -Privoxy is based on the Internet Junkbuster. - -Authors: --------- - http://www.privoxy.org/ - -SuSE series: n - -# -# ----------------------------------------------------------------------------- -# -%prep -%setup -c - -# -# ----------------------------------------------------------------------------- -# -%build -autoheader -autoconf -./configure --disable-dynamic-pcre -make - - -## Explicitily stripping is not recomended. -## This is handled altomaticaly by RPM, and can couse troubles if -## anyone wants to build an unstriped version - morcego -#strip privoxy - -# -# ----------------------------------------------------------------------------- -# -%install -[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT -mkdir -p ${RPM_BUILD_ROOT}%{_sbindir} \ - ${RPM_BUILD_ROOT}%{_mandir}/man8 \ - ${RPM_BUILD_ROOT}/var/log/privoxy \ - ${RPM_BUILD_ROOT}%{privoxyconf}/templates \ - ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d \ - ${RPM_BUILD_ROOT}%{_sysconfdir}/init.d -gzip README AUTHORS ChangeLog privoxy.1 LICENSE || /bin/true -install -s -m 744 privoxy $RPM_BUILD_ROOT%{_sbindir}/privoxy -cp -f privoxy.1.gz $RPM_BUILD_ROOT%{_mandir}/man8/privoxy.8.gz -cp -f *.action $RPM_BUILD_ROOT%{privoxyconf}/ -cp -f default.filter $RPM_BUILD_ROOT%{privoxyconf}/default.filter -cp -f trust $RPM_BUILD_ROOT%{privoxyconf}/trust -cp -f templates/* $RPM_BUILD_ROOT%{privoxyconf}/templates/ -cp -f privoxy.logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/privoxy -install -m 755 privoxy.init.suse $RPM_BUILD_ROOT%{_sysconfdir}/init.d/privoxy -install -m 711 -d $RPM_BUILD_ROOT/var/log/privoxy -ln -sf /etc/init.d/privoxy $RPM_BUILD_ROOT/usr/sbin/rcprivoxy - -# verify all file locations, etc. in the config file -# don't start with ^ or commented lines are not replaced -cat config | \ - sed 's/^confdir.*/confdir \/etc\/privoxy/g' | \ -# sed 's/^permissionsfile.*/permissionsfile \/etc\/privoxy\/permissionsfile/g' | \ -# sed 's/^filterfile.*/default.filter \/etc\/privoxy\/default.filter/g' | \ -# sed 's/^logfile.*/logfile \/var\/log\/privoxy\/logfile/g' | \ -# sed 's/^forward.*/forward \/etc\/privoxy\/forward/g' | \ -# sed 's/^aclfile.*/aclfile \/etc\/privoxy\/aclfile/g' > \ - sed 's/^logdir.*/logdir \/var\/log\/privoxy/g' > \ - $RPM_BUILD_ROOT%{privoxyconf}/config - -# -# ----------------------------------------------------------------------------- -# -%pre -# We check to see if the user privoxy exists. -# If it does, we do nothing -# If we don't, we check to see if the user junkbust exist and, in case it -# does, we change it do privoxy. If it also does not exist, we create the -# privoxy user -- morcego -id privoxy > /dev/null 2>&1 -if [ $? -eq 1 ]; then - id junkbust > /dev/null 2>&1 - if [ $? -eq 0 ]; then - /usr/sbin/usermod -u %{privoxy_uid} -g %{privoxy_gid} -l privoxy -d %{_sysconfdir}/privoxy -s "" junkbust > /dev/null 2>&1 - else -# -r does not work on suse. - /usr/sbin/groupadd -g %{privoxy_gid} privoxy - /usr/sbin/useradd -u %{privoxy_uid} -d %{_sysconfdir}/privoxy -g privoxy -s "" privoxy > /dev/null 2>&1 - fi -fi - -# -# ----------------------------------------------------------------------------- -# -%post -[ -f /var/log/privoxy/privoxy ] &&\ - mv -f /var/log/privoxy/privoxy /var/log/privoxy/logfile || /bin/true -chown -R privoxy:privoxy /var/log/privoxy 2>/dev/null -chown -R privoxy:privoxy /etc/privoxy 2>/dev/null -# not available on suse -#if [ "$1" = "1" ]; then -# /sbin/chkconfig --add privoxy -# /sbin/service privoxy condrestart > /dev/null 2>&1 -#fi -# 01/09/02 HB, getting rid of any user=junkbust -# Changed by morcego to use the id command. -id junkbust > /dev/null 2>&1 && /usr/sbin/userdel junkbust || /bin/true -sbin/insserv etc/init.d/privoxy - -# -# ----------------------------------------------------------------------------- -# -%preun -# need to stop the service on suse. swa. -#if [ "$1" = "0" ]; then -# /sbin/service privoxy stop > /dev/null 2>&1 ||: -#fi - -# -# ----------------------------------------------------------------------------- -# -%postun -sbin/insserv etc/init.d/ -# dont forget to remove user and group privoxy -id privoxy > /dev/null 2>&1 && /usr/sbin/userdel privoxy || /bin/true - -# -# ----------------------------------------------------------------------------- -# -%clean -[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT - -# -# ----------------------------------------------------------------------------- -# -%files -%defattr(-,root,root) -%doc README.gz AUTHORS.gz ChangeLog.gz LICENSE.gz -%doc doc/webserver/developer-manual -%doc doc/webserver/user-manual -%doc doc/webserver/faq -%doc doc/webserver/p_doc.css -%doc doc/webserver/privoxy-index.html -%doc doc/webserver/images -%doc doc/webserver/man-page - -%dir %{privoxyconf} -%config %{privoxyconf}/* -%attr(0740,privoxy,privoxy) %dir /var/log/privoxy -%config %{_sysconfdir}/logrotate.d/privoxy -%attr(0755,root,root)/usr/sbin/privoxy -%{_mandir}/man8/* -%config %{_sysconfdir}/init.d/privoxy -/usr/sbin/rcprivoxy - -# -# ----------------------------------------------------------------------------- -# -%changelog -* Wed Sep 20 2006 Hal Burgiss -- Bump version for 3.0.5. - -* Fri Sep 08 2006 Hal Burgiss -- Bump version for 3.0.4. - -* Wed Mar 26 2003 Andreas Oesterhelt -- Bump version for 3.0.2. - -* Wed Mar 19 2003 Hal Burgiss -- Bump version for 3.0.1. - -* Tue Aug 25 2002 Hal Burgiss -- Bump version for 3.0.0 :) - -* Tue Aug 06 2002 Hal Burgiss -- Reset version for 2.9.18. - -* Wed Jul 30 2002 Hal Burgiss -- Reset version for 2.9.17. - -* Sat Jul 27 2002 Hal Burgiss -- Reset version and release for 2.9.16. - -* Mon May 27 2002 Hal Burgiss -+ privoxy-2.9.15-1 -- Index.html is now privoxy-index.html for doc usage. - -* Mon May 27 2002 Hal Burgiss -+ privoxy-2.9.15-1 -- Index.html is now privoxy-index.html for doc usage. - -* Sat May 25 2002 Hal Burgiss -+ privoxy-2.9.15-1 -- Add html man page so index.html does not 404. - -* Fri May 24 2002 Hal Burgiss -+ privoxy-2.9.15-1 -- Add doc/images directory. - -* Fri May 03 2002 Rodrigo Barbosa -+ privoxy-suse-2.9.15-1 -- Version bump - -* Fri Apr 26 2002 Rodrigo Barbosa -+ privoxy-suse-2.9.14-3 -- Changing Vendor to Privoxy.Org - -* Mon Apr 22 2002 Rodrigo Barbosa -+ privoxy-suse-2.9.14-2 -- Bumping release to reflect the new value on configure.in -- Taking the oportunity to change the header Copyright to License. The - Copyright headers is deprecated, and after all, GPL is a license, not a - Copyright - -* Mon Apr 08 2002 Hal Burgiss -+ privoxy-2.9.13-4 -- Add LICENSE.gz, p_web.css, and index.html. Add autoconf -- to Buildrequires. - -* Wed Mar 27 2002 Hal Burgiss -+ privoxy-2.9.13-3 -- Doc css has changed names. - -* Tue Mar 25 2002 Hal Burgiss -+ privoxy-2.9.13-3 -- Minor fix to description. - -* Sun Mar 24 2002 Hal Burgiss -- added faq to docs. - -* Thu Mar 21 2002 Hal Burgiss -- added ijb_docs.css to docs. - -* Mon Mar 11 2002 Hal Burgiss -- Remove --enable-no-gifs from configure. - -* Sun Mar 03 2002 Hal Burgiss -- /bin/false for shell causes init script to fail. Reverting. - -* Wed Jan 09 2002 Hal Burgiss -- Removed UID 73. Included user-manual and developer-manual in docs. - Include other actions files. Default shell is now /bin/false. - Userdel user=junkbust. ChangeLog was not zipped. Removed - RPM_OPT_FLAGS kludge. - -* Fri Dec 28 2001 Thomas Steudten -- add paranoia check for 'rm -rf $RPM_BUILD_ROOT' -- add gzip to 'BuildRequires' - -* Sat Dec 1 2001 Hal Burgiss -- actionsfile is now ijb.action. - -* Tue Nov 6 2001 Thomas Steudten -- Compress manpage -- Add more documents for installation -- Add version string to name and source - -* Wed Oct 24 2001 Hal Burigss -- Back to user 'junkbuster' and fix configure macro. - -* Wed Oct 10 2001 Hal Burigss -- More changes for user 'junkbust'. Init script had 'junkbuster'. - -* Sun Sep 23 2001 Hal Burgiss -- Change of $RPM_OPT_FLAGS handling. Added new HTML doc files. -- Changed owner of /etc/junkbuster to shut up PAM/xauth log noise. - -* Thu Sep 13 2001 Hal Burgiss -- Added $RPM_OPT_FLAGS support, renaming of old logfile, and -- made sure no default shell exists for user junkbust. - -* Sun Jun 3 2001 Stefan Waldherr -- rework of RPM -* Wed Feb 14 2001 - uli@suse.de -- fixed init script -* Wed Dec 06 2000 - bjacke@suse.de -- renamed package to junkbuster -- fixed copyright tag -* Thu Nov 30 2000 - uli@suse.de -- moved init script to /etc/init.d -* Wed Feb 16 2000 - kukuk@suse.de -- Move /usr/man -> /usr/share/man -- Mark /etc/ijb as "config(noreplace)" -* Mon Sep 20 1999 - uli@suse.de -- fixed init script -* Mon Sep 13 1999 - bs@suse.de -- ran old prepare_spec on spec file to switch to new prepare_spec. -* Thu Apr 01 1999 - daniel@suse.de -- do not start ijb as root (security) -* Tue Mar 30 1999 - daniel@suse.de -- don´t use saclfile.ini -* Tue Mar 30 1999 - daniel@suse.de -- small fix to whitelist-configuration, - version is and was 2.0.2 WITHOUT Stefan Waldherr's patches - (http://www.waldherr.org/junkbuster/) -* Mon Mar 01 1999 - daniel@suse.de -- new package: version 2.0 - -# $Log: privoxy-suse.spec,v $ -# Revision 1.33 2009/03/21 10:46:15 fabiankeil -# Bump version to 3.0.12. -# -# Revision 1.32 2009/02/15 17:18:14 fabiankeil -# - Bump version to 3.0.11. -# -# Revision 1.31 2008/08/30 12:46:49 fabiankeil -# The jarfile directive is gone. Update accordingly. -# -# Revision 1.30 2008/08/13 16:57:46 fabiankeil -# Change version to 3.0.10. -# -# Revision 1.29 2008/03/02 17:36:43 fabiankeil -# Set version to 3.0.9. -# -# Revision 1.28 2008/01/20 14:30:59 fabiankeil -# Set version to 3.0.8. -# -# Revision 1.27 2006/11/18 14:37:12 fabiankeil -# Bump version to 3.0.6. -# -# Revision 1.26 2006/09/20 23:51:26 hal9 -# Bump versions to 3.0.5 -# -# Revision 1.25 2006/09/09 00:35:10 hal9 -# Bumped versions to 3.0.4. Both files should be checked further. -# -# Revision 1.24 2006/07/18 14:48:47 david__schmidt -# Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) -# with what was really the latest development (the v_3_0_branch branch) -# -# Revision 1.20.2.10 2004/01/30 17:09:29 oes -# Bumped version for 3.0.3 -# -# Revision 1.20.2.9 2003/03/26 00:24:58 oes -# Bump version for 3.0.2 -# -# Revision 1.20.2.8 2003/03/20 03:27:11 hal9 -# Bump version for 3.0.1 pending release. -# -# Revision 1.20.2.7 2002/08/25 23:36:03 hal9 -# Bump version for 3.0.0. -# -# Revision 1.20.2.6 2002/08/10 11:28:50 oes -# Bumped version -# -# Revision 1.20.2.5 2002/08/07 01:08:49 hal9 -# Bumped version to 2.9.18. -# -# Revision 1.20.2.4 2002/07/30 21:51:19 hal9 -# Bump version to 2.9.17. -# -# Revision 1.20.2.3 2002/07/27 15:47:10 hal9 -# Reset version and release for 2.9.16. -# -# Revision 1.20.2.2 2002/05/28 02:39:38 hal9 -# Replace index.html with privoxy-index.html for docs. -# -# Revision 1.20.2.1 2002/05/26 17:20:23 hal9 -# Add images to doc dirs. -# -# Revision 1.20 2002/05/25 02:08:23 hal9 -# Add doc/images directory. -# Redhat: alphabetized list of templates (and I think added one in the process) -# -# Revision 1.19 2002/05/03 17:14:36 morcego -# *.spec: Version bump to 2.9.15 -# -rh.spec: noreplace for %%{privoxyconf}/config -# Will interrupt the build if versions from configure.in and -# specfile do not match -# -# Revision 1.18 2002/04/27 20:26:59 swa -# uid, gui 73 incorporated -# -# Revision 1.17 2002/04/26 15:51:05 morcego -# Changing Vendor value to Privoxy.Org -# -# Revision 1.16 2002/04/22 16:32:31 morcego -# configure.in, *.spec: Bumping release to 2 (2.9.14-2) -# -rh.spec: uid and gid are now macros -# -suse.spec: Changing the header Copyright to License (Copyright is -# deprecable) -# -# Revision 1.15 2002/04/16 18:49:07 oes -# Build with static built-in pcre -# -# Revision 1.14 2002/04/11 17:57:40 oes -# Fixed(?) Conflicts: Provides: Obsoletes: -# -# Revision 1.13 2002/04/11 10:09:20 oes -# Version 2.9.14 -# -# Revision 1.12 2002/04/09 13:29:43 swa -# build suse and gen-dist with html docs. do not generate docs while building rpm -# -# Revision 1.11 2002/04/09 03:12:37 hal9 -# Add LICENSE, p_web.css and index.html. Add autoconf to buildrequires. -# -# Revision 1.10 2002/04/08 20:24:13 swa -# fixed JB spelling -# -# Revision 1.9 2002/03/30 09:01:52 swa -# new release -# -# Revision 1.8 2002/03/27 23:46:41 hal9 -# ijb_docs.css to p_doc.css -# -# Revision 1.7 2002/03/27 00:49:39 hal9 -# Minor fix to description. -# -# Revision 1.6 2002/03/26 22:29:55 swa -# we have a new homepage! -# -# Revision 1.5 2002/03/25 03:10:50 hal9 -# Added faq to docs. -# -# Revision 1.4 2002/03/24 12:56:21 swa -# name change related issues. -# -# Revision 1.3 2002/03/24 12:44:31 swa -# new version string -# -# Revision 1.2 2002/03/24 11:40:14 swa -# name change -# -# Revision 1.1 2002/03/24 11:23:44 swa -# name change -# -# Revision 1.21 2002/03/21 16:04:33 hal9 -# added ijb_docs.css to %%doc -# -# Revision 1.20 2002/03/12 13:42:14 sarantis -# remove hardcoded "ijbswa" from build phase -# -# Revision 1.19 2002/03/11 22:59:05 hal9 -# Remove --enable-no-gifs -# -# Revision 1.18 2002/03/11 12:30:31 swa -# be consistent with rh spec file -# -# Revision 1.17 2002/03/08 19:30:23 swa -# remove user junkbuster after de-installation. -# synced suse with rh-specfile. installation -# and de-installation seem to work. -# -# Revision 1.16 2002/03/08 18:40:44 swa -# build requires tools. useradd and del works -# now. -# -# Revision 1.15 2002/03/07 19:23:50 swa -# i hate to scroll. suse: wrong configdir. -# -# Revision 1.14 2002/03/07 19:10:21 swa -# builds cleanly. thanks to kukuk@suse.de -# not yet tested. -# -# Revision 1.13 2002/03/07 18:25:56 swa -# synced redhat and suse build process -# -# Revision 1.12 2002/03/02 15:50:04 swa -# 2.9.11 version. more input for docs. -# -# Revision 1.11 2001/12/02 10:29:26 swa -# New version made these changes necessary. -# -# Revision 1.10 2001/10/31 19:27:27 swa -# consistent description. new name for suse since -# we had troubles with rpms of identical names -# on the webserver. -# -# Revision 1.9 2001/10/26 18:17:23 swa -# new version string -# -# Revision 1.8 2001/09/13 16:22:42 swa -# man page is legacy. suse rpm now contains html -# documentation. -# -# Revision 1.7 2001/09/10 17:44:22 swa -# integrate three pieces of documentation. -# -# Revision 1.6 2001/09/10 16:29:23 swa -# binary contained debug info. -# buildroot definition fucks up the build process under suse. -# program needs to write in varlogjunkbuster -# install all templates -# create varlogjunkbuster -# -# Revision 1.5 2001/06/09 09:13:29 swa -# description shorter -# -# Revision 1.4 2001/06/08 20:53:36 swa -# use buildroot, export init to separate file (better manageability) -# -# Revision 1.3 2001/06/07 17:28:10 swa -# cosmetics -# -# Revision 1.2 2001/06/07 17:18:44 swa -# header fixed -# -# diff --git a/external/privoxy/privoxy.1 b/external/privoxy/privoxy.1 index dca772a5..f64cb9a9 100644 --- a/external/privoxy/privoxy.1 +++ b/external/privoxy/privoxy.1 @@ -3,7 +3,7 @@ .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . -.TH "PRIVOXY" "1" "21 March 2009" "Privoxy 3.0.12" "" +.TH "PRIVOXY" "1" "26 Dezember 2011" "Privoxy 3.0.19" "" .SH NAME privoxy \- Privacy Enhancing Proxy .SH SYNOPSIS @@ -45,7 +45,7 @@ that user's home directory, i.e. make the kernel pretend to the \fBPrivoxy\fR process that the directory tree starts there. If set up carefully, this can limit the impact of possible vulnerabilities in \fBPrivoxy\fR to the files contained in -that hierarchy. +that hierarchy. .TP \fB\-\-pre-chroot-nslookup \fIhostname\fB\fR Initialize the resolver library using \fIhostname\fR @@ -55,7 +55,7 @@ that must be copied into the chroot tree. If the \fIconfigfile\fR is not specified on the command line, \fBPrivoxy\fR will look for a file named \fIconfig\fR in the current directory. If no -\fIconfigfile\fR is found, \fBPrivoxy\fR will +\fIconfigfile\fR is found, \fBPrivoxy\fR will fail to start. .SH "DESCRIPTION" .PP @@ -65,7 +65,17 @@ access, and removing ads and other obnoxious Internet junk. Privoxy has a flexible configuration and can be customized to suit individual needs and tastes. It has application for both stand-alone systems and multi-user networks. .PP -Privoxy is Free Software and licensed under the GPL2. +Privoxy is Free Software and licensed under the GNU GPLv2. +.PP +Privoxy is an associated project of Software in the Public Interest (SPI). +.PP +Helping hands and donations are welcome: +.TP 0.2i +\(bu +http://www.privoxy.org/faq/general.html#PARTICIPATE +.TP 0.2i +\(bu +http://www.privoxy.org/faq/general.html#DONATE .SH "INSTALLATION AND USAGE" .PP Browsers can either be individually configured to use @@ -74,19 +84,19 @@ or \fBPrivoxy\fR can be combined with a packet filter to build an intercepting proxy (see \fIconfig\fR). The default setting is for localhost, on port 8118 (configurable in the main config file). To set the -HTTP proxy in Firefox, go through: \fBTools\fR; +HTTP proxy in Firefox, go through: \fBTools\fR; \fBOptions\fR; \fBGeneral\fR; \fBConnection Settings\fR; -\fBManual Proxy Configuration\fR. +\fBManual Proxy Configuration\fR. .PP -For Internet Explorer, go through: \fBTools\fR; +For Internet Explorer, go through: \fBTools\fR; \fBInternet Properties\fR; \fBConnections\fR; -\fBLAN Settings\fR. +\fBLAN Settings\fR. .PP The Secure (SSL) Proxy should also be set to the same values, otherwise https: URLs will not be proxied. Note: \fBPrivoxy\fR can only proxy HTTP and HTTPS traffic. Do not try it with FTP or other protocols. -HTTPS presents some limitations, and not all features will work with HTTPS +HTTPS presents some limitations, and not all features will work with HTTPS connections. .PP For other browsers, check the documentation. @@ -95,23 +105,23 @@ For other browsers, check the documentation. \fBPrivoxy\fR can be configured with the various configuration files. The default configuration files are: \fIconfig\fR, \fIdefault.filter\fR, \fIdefault.action\fR and -\fIdefault.action\fR. \fIuser.action\fR should +\fIdefault.action\fR. \fIuser.action\fR should be used for locally defined exceptions to the default rules in \fImatch-all.action\fR and \fIdefault.action\fR, and \fIuser.filter\fR for locally defined filters. These are well commented. On Unix and Unix-like systems, these are located in -\fI/etc/privoxy/\fR by default. +\fI/etc/privoxy/\fR by default. .PP -\fBPrivoxy\fR uses the concept of \fBactions\fR +\fBPrivoxy\fR uses the concept of \fBactions\fR in order to manipulate the data stream between the browser and remote sites. -There are various actions available with specific functions for such things +There are various actions available with specific functions for such things as blocking web sites, managing cookies, etc. These actions can be invoked -individually or combined, and used against individual URLs, or groups of URLs +individually or combined, and used against individual URLs, or groups of URLs that can be defined using wildcards and regular expressions. The result is that the user has greatly enhanced control and freedom. .PP The actions list (ad blocks, etc) can also be configured with your -web browser at http://config.privoxy.org/ +web browser at http://config.privoxy.org/ (assuming the configuration allows it). \fBPrivoxy's\fR configuration parameters can also be viewed at the same page. In addition, \fBPrivoxy\fR can be toggled on/off. @@ -123,7 +133,6 @@ features and notes on upgrading. .SH "FILES" .nf - \fI/usr/sbin/privoxy\fR \fI/etc/privoxy/config\fR \fI/etc/privoxy/match-all.action\fR @@ -143,11 +152,11 @@ documentation directory. .PP \fBPrivoxy\fR terminates on the \fBSIGINT\fR, \fBSIGTERM\fR and \fBSIGABRT\fR signals. Log -rotation scripts may cause a re-opening of the logfile by sending a +rotation scripts may cause a re-opening of the logfile by sending a \fBSIGHUP\fR to \fBPrivoxy\fR. Note that unlike other daemons, \fBPrivoxy\fR does not need to be made aware of config file changes by \fBSIGHUP\fR -- it will detect them -automatically. +automatically. .SH "NOTES" .PP Please see the \fIUser Manual\fR on how to contact the @@ -158,17 +167,17 @@ Other references and sites of interest to \fBPrivoxy\fR users: .PP -http://www.privoxy.org/, -the \fBPrivoxy\fR Home page. +http://www.privoxy.org/, +the \fBPrivoxy\fR Home page. -http://www.privoxy.org/faq/, -the \fBPrivoxy\fR FAQ. +http://www.privoxy.org/faq/, +the \fBPrivoxy\fR FAQ. -http://www.privoxy.org/developer-manual/, -the \fBPrivoxy\fR developer manual. +http://www.privoxy.org/developer-manual/, +the \fBPrivoxy\fR developer manual. -https://sourceforge.net/projects/ijbswa/, -the Project Page for \fBPrivoxy\fR on +https://sourceforge.net/projects/ijbswa/, +the Project Page for \fBPrivoxy\fR on SourceForge. http://config.privoxy.org/, @@ -176,7 +185,7 @@ the web-based user interface. \fBPrivoxy\fR must be running for this to work. Shortcut: http://p.p/ https://sourceforge.net/tracker/?group_id=11118&atid=460288, to submit ``misses'' and other -configuration related suggestions to the developers. +configuration related suggestions to the developers. .SH "DEVELOPMENT TEAM" .nf @@ -184,16 +193,13 @@ configuration related suggestions to the developers. David Schmidt, developer Hal Burgiss - Mark Miller - Gerry Murphy Lee Rian Roland Rosenfeld - J\[:o]rg Strohmayer .fi .SH "COPYRIGHT AND LICENSE" .SS "COPYRIGHT" .PP -Copyright (C) 2001-2009 by Privoxy Developers +Copyright (C) 2001-2011 by Privoxy Developers .PP Some source code is based on code Copyright (C) 1997 by Anonymous Coders and Junkbusters, Inc. and licensed under the \fIGNU General Public @@ -201,7 +207,7 @@ License\fR. .SS "LICENSE" .PP \fBPrivoxy\fR is free software; you can -redistribute it and/or modify it under the terms of the +redistribute it and/or modify it under the terms of the \fIGNU General Public License\fR, version 2, as published by the Free Software Foundation. .PP diff --git a/external/privoxy/privoxy.init b/external/privoxy/privoxy.init deleted file mode 100644 index 3b3caf9b..00000000 --- a/external/privoxy/privoxy.init +++ /dev/null @@ -1,276 +0,0 @@ -#!/bin/sh -# -# This is file /etc/rc.d/init.d/privoxy and was put here -# by the privoxy rpm -# -# chkconfig: 2345 84 09 -# -# description: Web proxy with advanced filtering capabilities \ -# such as filtering web page content, managing \ -# cookies and removing ads -# - -# ******************************************************************** -# -# File : $Source: /cvsroot/ijbswa/current/privoxy.init,v $ -# -# Purpose : This shell script takes care of starting and stopping -# privoxy. -# -# Copyright : Written by and Copyright (C) 2001 the SourceForge -# Privoxy team. http://www.privoxy.org/ -# -# Based on the Internet Junkbuster originally written -# by and Copyright (C) 1997 Anonymous Coders and -# Junkbusters Corporation. http://www.junkbusters.com -# -# This program is free software; you can redistribute it -# and/or modify it under the terms of the GNU General -# Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will -# be useful, but WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public -# License for more details. -# -# The GNU General Public License should be included with -# this file. If not, you can view it at -# http://www.gnu.org/copyleft/gpl.html -# or write to the Free Software Foundation, Inc., 59 -# Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# Revisions : -# $Log: privoxy.init,v $ -# Revision 1.11 2006/07/18 14:48:47 david__schmidt -# Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) -# with what was really the latest development (the v_3_0_branch branch) -# -# Revision 1.8.2.3 2002/12/10 20:52:16 kick_ -# better service description. This text will be shown when the user configures the services -# -# Revision 1.8.2.2 2002/08/05 08:42:13 kick_ -# same permissions, same runlevels as all the other initscripts -# -# Revision 1.8.2.1 2002/07/12 09:14:26 kick_ -# don't use ghost files for rcX.d/*, chkconfig is available to do this job. Enable translation of error messge -# -# Revision 1.8 2002/04/09 02:51:31 hal9 -# Changed $JB to $PRIVOXY. -# -# Revision 1.7 2002/04/08 14:54:51 morcego -# Moved the chkconfig comments to the begining of the file, couse Linuxconf -# was getting confused with it where it was. -# -# Revision 1.6 2002/03/26 22:29:55 swa -# we have a new homepage! -# -# Revision 1.5 2002/03/25 06:14:18 morcego -# Removing the OPRG definition (no longer needed) -# -# Revision 1.4 2002/03/25 04:16:48 hal9 -# Fix proper config file location. -# -# Revision 1.3 2002/03/24 19:12:15 hal9 -# Fixed some naming conflicts. -# -# Revision 1.2 2002/03/24 11:40:14 swa -# name change -# -# Revision 1.1 2002/03/24 11:23:44 swa -# name change -# -# Revision 1.1 2002/03/22 20:53:03 morcego -# - Ongoing process to change name to JunkbusterNG -# - configure/configure.in: no change needed -# - GNUmakefile.in: -# - TAR_ARCH = /tmp/JunkbusterNG-$(RPM_VERSION).tar.gz -# - PROGRAM = jbng@EXEEXT@ -# - rh-spec now references as junkbusterng-rh.spec -# - redhat-upload: references changed to junkbusterng-* (package names) -# - tarball-dist: references changed to JunkbusterNG-distribution-* -# - tarball-src: now JunkbusterNG-* -# - install: initscript now junkbusterng.init and junkbusterng (when -# installed) -# - junkbuster-rh.spec: renamed to junkbusterng-rh.spec -# - junkbusterng.spec: -# - References to the expression ijb where changed where possible -# - New package name: junkbusterng (all in lower case, acording to -# the LSB recomendation) -# - Version changed to: 2.9.13 -# - Release: 1 -# - Added: junkbuster to obsoletes and conflicts (Not sure this is -# right. If it obsoletes, why conflict ? Have to check it later) -# - Summary changed: Stefan, please check and aprove it -# - Changes description to use the new name -# - Sed string was NOT changed. Have to wait to the manpage to -# change first -# - Keeping the user junkbuster for now. It will require some aditional -# changes on the script (scheduled for the next specfile release) -# - Added post entry to move the old logfile to the new log directory -# - Removing "chkconfig --add" entry (not good to have it automaticaly -# added to the startup list). -# - Added preun section to stop the service with the old name, as well -# as remove it from the startup list -# - Removed the chkconfig --del entry from the conditional block on -# the preun scriptlet (now handled on the %files section) -# - junkbuster.init: renamed to junkbusterng.init -# - junkbusterng.init: -# - Changed JB_BIN to jbng -# - Created JB_OBIN with the old value of JB_BIN (junkbuster), to -# be used where necessary (config dir) -# -# Aditional notes: -# - The config directory is /etc/junkbuster yet. Have to change it on the -# specfile, after it is changes on the code -# - The only files that got renamed on the cvs tree were the rh specfile and -# the init file. Some file references got changes on the makefile and on the -# rh-spec (as listed above) -# -# Revision 1.15 2002/03/09 15:05:58 swa -# wrong user.group -# -# Revision 1.14 2002/03/06 06:13:40 hal9 -# Adapted for Andreas' changes for --user and --pidfile. -# -# Revision 1.13 2002/03/05 05:10:10 oes -# Changed pidfile path to conform with FHS -# -# Revision 1.12 2002/03/04 20:44:36 oes -# Changed to new cmdline syntax -# -# Revision 1.11 2001/12/30 14:07:32 steudten -# - Add signal handling (unix) -# - Add SIGHUP handler (unix) -# - Add creation of pidfile (unix) -# - Add action 'top' in rc file (RH) -# - Add entry 'SIGNALS' to manpage -# - Add exit message to logfile (unix) -# -# Revision 1.10 2001/11/05 21:30:23 steudten -# Make JB startup without & due to be a 'real' daemon right now. -# Make the script easy to change. -# -# Revision 1.9 2001/09/15 01:53:12 steudten -# -# Remove test for subsys flag in start. Some minor changes. -# -# Revision 1.8 2001/06/28 13:50:36 sarantis -# swap ?$ with $?; remove bogus ";;" -# -# Revision 1.7 2001/06/28 13:40:26 sarantis -# remove single quotes from $JB; it was not expanded. -# -# Revision 1.6 2001/06/28 13:38:42 sarantis -# formatting changes; individual return values are returned from the init script. -# -# Revision 1.5 2001/06/11 11:37:40 sarantis -# Minor editing changes. -# -# Revision 1.4 2001/06/09 09:14:11 swa -# shamelessly adapted RPM stuff from the newest rpm that -# RedHat provided for the JB. -# -# Revision 1.3 2001/05/25 10:12:44 oes -# Fixed default case in switch statement (# -> *) -# -# Revision 1.2 2001/05/24 07:52:24 swa -# added header. removed ^M. -# -# -# ********************************************************************/ - - -# Source function library. -. /etc/rc.d/init.d/functions - -. /etc/sysconfig/network - -# Check that networking is up. -[ ${NETWORKING} = "no" ] && exit 0 - -PRIVOXY_PRG="privoxy" -PRIVOXY_BIN="/usr/sbin/$PRIVOXY_PRG" -PRIVOXY_CONF="/etc/$PRIVOXY_PRG/config" -PRIVOXY_USER="privoxy" -PRIVOXY_PID=/var/run/$PRIVOXY_PRG.pid -PRIVOXY_LOCK=/var/lock/subsys/$PRIVOXY_PRG -PRIVOXY="$PRIVOXY_BIN --user $PRIVOXY_USER.$PRIVOXY_USER --pidfile $PRIVOXY_PID $PRIVOXY_CONF" - -# some checks for us -! [ -x $PRIVOXY_BIN ] && echo $"Can't find $PRIVOXY_BIN, exit." && exit 0 -! [ -f $PRIVOXY_CONF ] && echo $"Can't find $PRIVOXY_CONF, exit." && exit 0 - -# See how we were called. - -start () { - # start daemon - echo -n $"Starting $PRIVOXY_PRG: " - if [ -f $PRIVOXY_PID ]; then - killproc $PRIVOXY_PRG && rm -f $PRIVOXY_LOCK $PRIVOXY_PID - RETVAL=$? - [ $RETVAL != 0 ] && return $RETVAL - fi - daemon $PRIVOXY - RETVAL=$? - echo - [ $RETVAL = 0 ] && touch $PRIVOXY_LOCK - return $RETVAL -} - -stop () { - # stop daemon - echo -n $"Stopping $PRIVOXY_PRG: " - killproc $PRIVOXY_PRG && rm -f $PRIVOXY_LOCK $PRIVOXY_PID - RETVAL=$? - echo - return $RETVAL -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - reload) - if [ -f $PRIVOXY_PID ] ; then - kill -HUP `cat $PRIVOXY_PID` - RETVAL=$? - fi - ;; - restart) - stop - start - RETVAL=$? - ;; - condrestart) - # restart only if already running - if [ -f $PRIVOXY_PID ] ; then - stop - start - RETVAL=$? - fi - ;; - status) - status $PRIVOXY_PRG - RETVAL=$? - ;; - top) - if [ -f $PRIVOXY_PID ]; then - a="" - for i in `pidof $PRIVOXY_PRG` ; do - a="$a -p $i" - done - top $a - fi - ;; - *) - echo $"Usage: $PRIVOXY_PRG {start|stop|reload|restart|condrestart|status|top}" - exit 1 -esac - -exit $RETVAL diff --git a/external/privoxy/privoxy.init.suse b/external/privoxy/privoxy.init.suse deleted file mode 100644 index fee872ad..00000000 --- a/external/privoxy/privoxy.init.suse +++ /dev/null @@ -1,127 +0,0 @@ -#! /bin/sh -# ******************************************************************** -# -# File : $Source: /cvsroot/ijbswa/current/privoxy.init.suse,v $ -# -# Purpose : This shell script takes care of starting and stopping -# privoxy. -# -# Copyright : Written by and Copyright (C) 2001 the SourceForge -# Privoxy team. http://www.privoxy.org/ -# -# Based on the Internet Junkbuster originally written -# by and Copyright (C) 1997 Anonymous Coders and -# Junkbusters Corporation. http://www.junkbusters.com -# -# This program is free software; you can redistribute it -# and/or modify it under the terms of the GNU General -# Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will -# be useful, but WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public -# License for more details. -# -# The GNU General Public License should be included with -# this file. If not, you can view it at -# http://www.gnu.org/copyleft/gpl.html -# or write to the Free Software Foundation, Inc., 59 -# Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# Revisions : -# $Log: privoxy.init.suse,v $ -# Revision 1.4 2006/07/18 14:48:47 david__schmidt -# Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) -# with what was really the latest development (the v_3_0_branch branch) -# -# Revision 1.3.2.1 2003/03/17 14:04:16 oes -# No longer use obsolete rc.config -# -# Revision 1.3 2002/03/26 22:29:55 swa -# we have a new homepage! -# -# Revision 1.2 2002/03/24 11:40:14 swa -# name change -# -# Revision 1.1 2002/03/24 11:23:44 swa -# name change -# -# Revision 1.7 2002/03/11 11:44:46 oes -# Working in suggestions by Thorsten Kukuk -# -# Revision 1.6 2002/03/09 14:56:34 swa -# wrong user.group -# -# Revision 1.5 2002/03/08 21:39:59 oes -# setgid to nogroup -# -# Revision 1.4 2002/03/05 19:54:37 oes -# Preliminary version of SuSE 8.0-certified init script ,-) -# -# Revision 1.3 2002/03/05 05:28:05 oes -# Added pidfile creation -# -# Revision 1.2 2001/09/10 16:25:46 swa -# jb did not start. none of the arguments worked. fixed. -# -# Revision 1.1 2001/06/08 20:53:36 swa -# use buildroot, export init to separate file (better manageability) -# -# -# -# ********************************************************************/ -### BEGIN INIT INFO -# Provides: privoxy -# Required-Start: $network $syslog $remote_fs -# Required-Stop: -# Default-Start: 3 5 -# Default-Stop: 0 1 2 6 -# Description: Starts Privoxy -### END INIT INFO - -. /etc/rc.status -rc_reset - -case "$1" in - start) - echo -n "Starting Privoxy" - if [ ! -f /var/run/privoxy.pid ] || ! kill -0 `cat /var/run/privoxy.pid` 2> /dev/null; then - /usr/sbin/privoxy --user privoxy.privoxy --pidfile /var/run/privoxy.pid /etc/privoxy/config 2> /dev/null - else - false - fi - rc_status -v - ;; - stop) - echo -n "Shutting down Privoxy" - killproc -TERM /usr/sbin/privoxy && rm -f /var/run/privoxy.pid - rc_status -v - ;; - reload) - echo -n "Reloading Privoxy" - kill -HUP `cat /var/run/privoxy.pid` - rc_status -v - ;; - try-restart) - $0 stop && $0 start - rc_status - ;; - restart) - $0 stop - $0 start - rc_status - ;; - status) - echo -n "Checking for Privoxy" - checkproc /usr/sbin/privoxy - rc_status -v - ;; - *) - echo "Usage: $0 {start|restart|reload|status|stop}" - exit 1 -esac - -rc_exit diff --git a/external/privoxy/privoxy.logrotate b/external/privoxy/privoxy.logrotate deleted file mode 100644 index bbfe652d..00000000 --- a/external/privoxy/privoxy.logrotate +++ /dev/null @@ -1,107 +0,0 @@ -# -# Logrotate file for Privoxy RPM -# -# ******************************************************************** -# -# File : $Source: /cvsroot/ijbswa/current/privoxy.logrotate,v $ -# -# Purpose : Rotates all potential Privoxy logfiles -# -# -# Copyright : Written by and Copyright (C) 2001 the SourceForge -# Privoxy team. http://www.privoxy.org/ -# -# Based on the Internet Junkbuster originally written -# by and Copyright (C) 1997 Anonymous Coders and -# Junkbusters Corporation. http://www.junkbusters.com -# -# This program is free software; you can redistribute it -# and/or modify it under the terms of the GNU General -# Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will -# be useful, but WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public -# License for more details. -# -# The GNU General Public License should be included with -# this file. If not, you can view it at -# http://www.gnu.org/copyleft/gpl.html -# or write to the Free Software Foundation, Inc., 59 -# Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# Revisions : -# $Log: privoxy.logrotate,v $ -# Revision 1.6 2006/07/18 14:48:47 david__schmidt -# Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) -# with what was really the latest development (the v_3_0_branch branch) -# -# Revision 1.4.2.1 2002/06/25 17:33:07 kick_ -# Avoid error messages if privoxy hasn't run at all and there is no logfile yet by adding missingok to the logrotate script -# -# Revision 1.4 2002/03/26 22:29:55 swa -# we have a new homepage! -# -# Revision 1.3 2002/03/24 15:19:57 swa -# name change related issue. -# -# Revision 1.2 2002/03/24 11:40:14 swa -# name change -# -# Revision 1.1 2002/03/24 11:23:44 swa -# name change -# -# Revision 1.7 2001/12/30 14:07:32 steudten -# - Add signal handling (unix) -# - Add SIGHUP handler (unix) -# - Add creation of pidfile (unix) -# - Add action 'top' in rc file (RH) -# - Add entry 'SIGNALS' to manpage -# - Add exit message to logfile (unix) -# -# Revision 1.6 2001/12/13 23:19:43 steudten -# Add 'restart' of junkbuster service after rotate logfiles. -# Better we could use the well known 'kill -HUP', but the handler -# isn't there at this time. -# -# Revision 1.5 2001/11/05 21:31:51 steudten -# Change switch mode from weekly to size 1M -# -# Revision 1.4 2001/06/28 13:30:22 sarantis -# add missingok for the jarfile entry -# -# Revision 1.3 2001/06/04 18:31:58 swa -# files are now prefixed with either `confdir' or `logdir'. -# `make redhat-dist' replaces both entries confdir and logdir -# with redhat values -# -# Revision 1.2 2001/05/24 07:52:24 swa -# added header. removed ^M. -# -# Revision 1.3 2001/05/24 07:41:33 swa -# added header -# -# -# -# ********************************************************************/ - -/var/log/privoxy/logfile { - missingok - compress - size 1M - postrotate - /sbin/service privoxy reload 2> /dev/null || true - endscript -} - -/var/log/privoxy/jarfile { - missingok - compress - size 1M - postrotate - /sbin/service privoxy reload 2> /dev/null || true - endscript -} diff --git a/external/privoxy/project.h b/external/privoxy/project.h index 300d9d69..86237486 100644 --- a/external/privoxy/project.h +++ b/external/privoxy/project.h @@ -1,7 +1,7 @@ #ifndef PROJECT_H_INCLUDED #define PROJECT_H_INCLUDED /** Version string. */ -#define PROJECT_H_VERSION "$Id: project.h,v 1.129 2009/03/08 14:12:51 fabiankeil Exp $" +#define PROJECT_H_VERSION "$Id: project.h,v 1.171 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/project.h,v $ @@ -10,7 +10,7 @@ * project. Does not define any variables or functions * (though it does declare some macros). * - * Copyright : Written by and Copyright (C) 2001-2009 the + * Copyright : Written by and Copyright (C) 2001-2010 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written @@ -35,672 +35,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: project.h,v $ - * Revision 1.129 2009/03/08 14:12:51 fabiankeil - * All the CSP_FLAG_FOO bit masks should be unsigned ints. - * - * Revision 1.128 2009/03/07 13:09:17 fabiankeil - * Change csp->expected_content and_csp->expected_content_length from - * size_t to unsigned long long to reduce the likelihood of integer - * overflows that would let us close the connection prematurely. - * Bug found while investigating #2669131, reported by cyberpatrol. - * - * Revision 1.127 2008/12/20 14:53:55 fabiankeil - * Add config option socket-timeout to control the time - * Privoxy waits for data to arrive on a socket. Useful - * in case of stale ssh tunnels or when fuzz-testing. - * - * Revision 1.126 2008/12/14 17:02:54 fabiankeil - * Fix a cparser warning. - * - * Revision 1.125 2008/11/20 08:22:28 fabiankeil - * Remove an obsolete comment. - * - * Revision 1.124 2008/11/16 12:43:49 fabiankeil - * Turn keep-alive support into a runtime feature - * that is disabled by setting keep-alive-timeout - * to a negative value. - * - * Revision 1.123 2008/11/10 16:55:59 fabiankeil - * Fix a gcc44 warning (in filters.c). - * - * Revision 1.122 2008/10/16 07:11:34 fabiankeil - * Fix a bunch of gcc44 conversion warnings. - * - * Revision 1.121 2008/10/09 18:21:41 fabiankeil - * Flush work-in-progress changes to keep outgoing connections - * alive where possible. Incomplete and mostly #ifdef'd out. - * - * Revision 1.120 2008/09/21 13:36:52 fabiankeil - * If change-x-forwarded-for{add} is used and the client - * sends multiple X-Forwarded-For headers, append the client's - * IP address to each one of them. "Traditionally" we would - * lose all but the last one. - * - * Revision 1.119 2008/09/20 10:04:33 fabiankeil - * Remove hide-forwarded-for-headers action which has - * been obsoleted by change-x-forwarded-for{block}. - * - * Revision 1.118 2008/09/19 15:26:29 fabiankeil - * Add change-x-forwarded-for{} action to block or add - * X-Forwarded-For headers. Mostly based on code removed - * before 3.0.7. - * - * Revision 1.117 2008/08/30 12:03:07 fabiankeil - * Remove FEATURE_COOKIE_JAR. - * - * Revision 1.116 2008/05/20 16:05:02 fabiankeil - * Move parsers structure definition from project.h to parsers.h. - * - * Revision 1.115 2008/05/19 16:57:20 fabiankeil - * Declare all members of the parsers structure immutable. - * - * Revision 1.114 2008/04/11 16:35:39 fabiankeil - * Oops, I forgot to shorten the URL_SPEC_INITIALIZER in my last commit. - * - * Revision 1.113 2008/04/10 14:41:04 fabiankeil - * Ditch url_spec's path member now that it's no longer used. - * - * Revision 1.112 2008/04/06 15:18:34 fabiankeil - * Oh well, rename the --enable-pcre-host-patterns option to - * --enable-extended-host-patterns as it's not really PCRE syntax. - * - * Revision 1.111 2008/04/06 14:54:26 fabiankeil - * Use PCRE syntax in host patterns when configured - * with --enable-pcre-host-patterns. - * - * Revision 1.110 2008/03/29 12:13:46 fabiankeil - * Remove send-wafer and send-vanilla-wafer actions. - * - * Revision 1.109 2008/03/28 15:13:41 fabiankeil - * Remove inspect-jpegs action. - * - * Revision 1.108 2008/03/27 18:27:36 fabiankeil - * Remove kill-popups action. - * - * Revision 1.107 2008/03/26 18:07:08 fabiankeil - * Add hostname directive. Closes PR#1918189. - * - * Revision 1.106 2008/03/24 11:21:03 fabiankeil - * Share the action settings for multiple patterns in the same - * section so we waste less memory for gigantic block lists - * (and load them slightly faster). Reported by Franz Schwartau. - * - * Revision 1.105 2008/03/21 11:16:27 fabiankeil - * Garbage-collect csp->my_ip_addr_str and csp->my_hostname. - * - * Revision 1.104 2008/03/04 18:30:40 fabiankeil - * Remove the treat-forbidden-connects-like-blocks action. We now - * use the "blocked" page for forbidden CONNECT requests by default. - * - * Revision 1.103 2008/03/01 14:00:45 fabiankeil - * Let the block action take the reason for the block - * as argument and show it on the "blocked" page. - * - * Revision 1.102 2008/02/03 13:46:14 fabiankeil - * Add SOCKS5 support. Patch #1862863 by Eric M. Hopper with minor changes. - * - * Revision 1.101 2007/12/07 18:29:23 fabiankeil - * Remove now-obsolete csp member x_forwarded. - * - * Revision 1.100 2007/09/02 13:42:11 fabiankeil - * - Allow port lists in url patterns. - * - Ditch unused url_spec member pathlen. - * - * Revision 1.99 2007/07/21 11:51:36 fabiankeil - * As Hal noticed, checking dispatch_cgi() as the last cruncher - * looks like a bug if CGI requests are blocked unintentionally, - * so don't do it unless the user enabled the new config option - * "allow-cgi-request-crunching". - * - * Revision 1.98 2007/07/14 07:31:26 fabiankeil - * Add new csp->content_type flag (CT_DECLARED). - * - * Revision 1.97 2007/05/27 12:38:08 fabiankeil - * - Remove some left-overs from the switch to dedicated header filters. - * - Adjust "X-Filter: No" to disable dedicated header filters. - * - Prepare for forward-override{} - * - * Revision 1.96 2007/05/14 10:41:15 fabiankeil - * Ditch the csp member cookie_list[] which isn't used anymore. - * - * Revision 1.95 2007/04/30 15:02:19 fabiankeil - * Introduce dynamic pcrs jobs that can resolve variables. - * - * Revision 1.94 2007/04/15 16:39:21 fabiankeil - * Introduce tags as alternative way to specify which - * actions apply to a request. At the moment tags can be - * created based on client and server headers. - * - * Revision 1.93 2007/03/20 15:16:34 fabiankeil - * Use dedicated header filter actions instead of abusing "filter". - * Replace "filter-client-headers" and "filter-client-headers" - * with "server-header-filter" and "client-header-filter". - * - * Revision 1.92 2007/03/17 15:20:05 fabiankeil - * New config option: enforce-blocks. - * - * Revision 1.91 2007/03/05 13:28:03 fabiankeil - * Add some CSP_FLAGs for the header parsers. - * - * Revision 1.90 2007/02/07 10:36:16 fabiankeil - * Add new http_response member to save - * the reason why the response was generated. - * - * Revision 1.89 2007/01/27 13:09:16 fabiankeil - * Add new config option "templdir" to - * change the templates directory. - * - * Revision 1.88 2007/01/25 13:36:59 fabiankeil - * Add csp->error_message for failure reasons - * that should be embedded into the CGI pages. - * - * Revision 1.87 2007/01/01 19:36:37 fabiankeil - * Integrate a modified version of Wil Mahan's - * zlib patch (PR #895531). - * - * Revision 1.86 2006/12/31 17:56:37 fabiankeil - * Added config option accept-intercepted-requests - * and disabled it by default. - * - * Revision 1.85 2006/12/31 15:03:31 fabiankeil - * Fix gcc43 compiler warnings and a comment. - * - * Revision 1.84 2006/12/21 12:57:48 fabiankeil - * Add config option "split-large-forms" - * to work around the browser bug reported - * in BR #1570678. - * - * Revision 1.83 2006/12/06 19:26:29 fabiankeil - * Moved HTTP snipplets into jcc.c. They aren't - * used anywhere else. - * - * Revision 1.82 2006/09/20 15:50:31 fabiankeil - * Doubled size of HOSTENT_BUFFER_SIZE to mask - * problems with gethostbyname_r and some - * /etc/hosts configurations. Only a workaround - * until we get the real fix ready. - * Thanks Félix Rauch for reporting. - * - * Increased value of MAX_TRUSTED_REFERRERS from 64 to 512. - * - * Revision 1.81 2006/09/06 13:03:04 fabiankeil - * Respond with 400 and a short text message - * if the client tries to use Privoxy as FTP proxy. - * - * Revision 1.80 2006/09/06 10:43:32 fabiankeil - * Added config option enable-remote-http-toggle - * to specify if Privoxy should recognize special - * headers (currently only X-Filter) to change its - * behaviour. Disabled by default. - * - * Revision 1.79 2006/09/06 09:23:37 fabiankeil - * Make number of retries in case of forwarded-connect problems - * a config file option (forwarded-connect-retries) and use 0 as - * default. - * - * Revision 1.78 2006/08/31 16:25:06 fabiankeil - * Work around a buffer overflow that caused Privoxy to - * segfault if too many trusted referrers were used. Good - * enough for now, but should be replaced with a real - * solution after the next release. - * - * Revision 1.77 2006/08/21 12:50:51 david__schmidt - * Formatting cleanup - * - * Revision 1.76 2006/08/14 08:25:19 fabiankeil - * Split filter-headers{} into filter-client-headers{} - * and filter-server-headers{}. - * Added parse_header_time() to share some code. - * Replaced timegm() with mktime(). - * - * Revision 1.75 2006/08/03 02:46:41 david__schmidt - * Incorporate Fabian Keil's patch work: * http://www.fabiankeil.de/sourcecode/privoxy/ - * - * Revision 1.74 2006/07/18 14:48:47 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.72.2.7 2006/01/29 23:10:56 david__schmidt - * Multiple filter file support - * - * Revision 1.72.2.6 2004/10/03 12:53:46 david__schmidt - * Add the ability to check jpeg images for invalid - * lengths of comment blocks. Defensive strategy - * against the exploit: - * Microsoft Security Bulletin MS04-028 - * Buffer Overrun in JPEG Processing (GDI+) Could - * Allow Code Execution (833987) - * Enabled with +inspect-jpegs in actions files. - * - * Revision 1.72.2.5 2004/01/30 15:29:29 oes - * Updated the copyright note - * - * Revision 1.72.2.4 2004/01/13 16:12:14 oes - * Fixed double slash in USER_MANUAL_URL. Closes BR #867088. - * - * Revision 1.72.2.3 2003/03/11 11:54:37 oes - * Introduced RC_FLAG_* flags for use in child process return code - * - * Revision 1.72.2.2 2002/11/28 18:15:44 oes - * Added flag to each cgi_dispatcher that allows or denies - * external linking and removed const qualifier from - * struct list_entry.str. - * - * Revision 1.72.2.1 2002/08/10 11:25:18 oes - * - Include config.h for access to config data - * - Include depending on where they are - * - * Revision 1.72 2002/05/14 21:35:49 oes - * Split HELP_LINK_PREFIX into ACTIONS_HELP_PREFIX and CONFIG_HELP_PREFIX - * because of split in user-manual - * - * Revision 1.71 2002/05/12 21:39:36 jongfoster - * - Adding Doxygen-style comments to structures and #defines. - * - * Revision 1.70 2002/05/12 16:05:50 jongfoster - * Fixing ACTION_MASK_ALL to be unsigned long rather than - * just unsigned int. I don't know if anyone is porting - * Privoxy to 16-bit platforms, but if so, +limit-connect - * wouldn't have worked because of this bug. - * - * Revision 1.69 2002/05/08 16:00:16 oes - * Added size member to struct iob, so it can - * be alloced larger than needed. - * - * Revision 1.68 2002/04/26 12:56:00 oes - * Killed REDIRECT_URL, added USER_MANUAL_URL and HELP_LINK_PREFIX - * - * Revision 1.67 2002/04/24 02:12:43 oes - * - Jon's multiple AF patch: - * - Make csp->actions_list an array - * - #define MAX_AF_FILES - * - Moved CGI_PARAM_LEN_MAX (500) here - * - * Revision 1.66 2002/04/15 19:06:43 jongfoster - * Typos - * - * Revision 1.65 2002/04/04 00:36:36 gliptak - * always use pcre for matching - * - * Revision 1.64 2002/04/03 22:28:03 gliptak - * Removed references to gnu_regex - * - * Revision 1.63 2002/03/31 17:19:00 jongfoster - * Win32 only: Enabling STRICT to fix a VC++ compile warning. - * - * Revision 1.62 2002/03/26 22:48:49 swa - * new homepage url - * - * Revision 1.61 2002/03/26 22:29:55 swa - * we have a new homepage! - * - * Revision 1.60 2002/03/24 15:52:17 jongfoster - * Changing CGI URL prefixes for new name - * - * Revision 1.59 2002/03/24 15:23:33 jongfoster - * Name changes - * - * Revision 1.58 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.57 2002/03/16 20:28:34 oes - * Added descriptions to the filters so users will know what they select in the cgi editor - * - * Revision 1.56 2002/03/13 20:27:30 oes - * Fixing bug with CT_TABOO - * - * Revision 1.55 2002/03/12 01:42:50 oes - * Introduced modular filters - * - * Revision 1.54 2002/03/09 20:03:52 jongfoster - * - Making various functions return int rather than size_t. - * (Undoing a recent change). Since size_t is unsigned on - * Windows, functions like read_socket that return -1 on - * error cannot return a size_t. - * - * THIS WAS A MAJOR BUG - it caused frequent, unpredictable - * crashes, and also frequently caused JB to jump to 100% - * CPU and stay there. (Because it thought it had just - * read ((unsigned)-1) == 4Gb of data...) - * - * - The signature of write_socket has changed, it now simply - * returns success=0/failure=nonzero. - * - * - Trying to get rid of a few warnings --with-debug on - * Windows, I've introduced a new type "jb_socket". This is - * used for the socket file descriptors. On Windows, this - * is SOCKET (a typedef for unsigned). Everywhere else, it's - * an int. The error value can't be -1 any more, so it's - * now JB_INVALID_SOCKET (which is -1 on UNIX, and in - * Windows it maps to the #define INVALID_SOCKET.) - * - * - The signature of bind_port has changed. - * - * Revision 1.53 2002/03/08 16:48:55 oes - * Added FEATURE_NO_GIFS and BUILTIN_IMAGE_MIMETYPE - * - * Revision 1.52 2002/03/07 03:46:17 oes - * Fixed compiler warnings - * - * Revision 1.51 2002/03/05 04:52:42 oes - * Deleted non-errlog debugging code - * - * Revision 1.50 2002/03/04 19:32:07 oes - * Changed default port to 8118 - * - * Revision 1.49 2002/03/04 18:28:55 oes - * Deleted PID_FILE_NAME - * - * Revision 1.48 2002/03/03 14:50:40 oes - * Fixed CLF logging: Added ocmd member for client's request to struct http_request - * - * Revision 1.47 2002/02/20 23:15:13 jongfoster - * Parsing functions now handle out-of-memory gracefully by returning - * an error code. - * - * Revision 1.46 2002/01/17 21:06:09 jongfoster - * Now #defining the URLs of the config interface - * - * Minor changes to struct http_request and struct url_spec due to - * standardizing that struct http_request is used to represent a URL, and - * struct url_spec is used to represent a URL pattern. (Before, URLs were - * represented as seperate variables and a partially-filled-in url_spec). - * - * Revision 1.45 2002/01/09 14:33:27 oes - * Added HOSTENT_BUFFER_SIZE - * - * Revision 1.44 2001/12/30 14:07:32 steudten - * - Add signal handling (unix) - * - Add SIGHUP handler (unix) - * - Add creation of pidfile (unix) - * - Add action 'top' in rc file (RH) - * - Add entry 'SIGNALS' to manpage - * - Add exit message to logfile (unix) - * - * Revision 1.43 2001/11/22 21:57:51 jongfoster - * Making action_spec->flags into an unsigned long rather than just an - * unsigned int. - * Adding ACTION_NO_COOKIE_KEEP - * - * Revision 1.42 2001/11/05 21:42:41 steudten - * Include DBG() macro. - * - * Revision 1.41 2001/10/28 19:12:06 jongfoster - * Adding ijb_toupper() - * - * Revision 1.40 2001/10/26 17:40:47 oes - * Moved ijb_isspace and ijb_tolower to project.h - * Removed http->user_agent, csp->referrer and csp->accept_types - * - * Revision 1.39 2001/10/25 03:45:02 david__schmidt - * Adding a (void*) cast to freez() because Visual Age C++ won't expand the - * macro when called with a cast; so moving the cast to the macro def'n - * seems to both eliminate compiler warnings (on darwin and OS/2, anyway) and - * doesn't make macro expansion complain. Hope this works for everyone else - * too... - * - * Revision 1.38 2001/10/23 21:19:04 jongfoster - * New error-handling support: jb_err type and JB_ERR_xxx constants - * CGI functions now return a jb_err, and their parameters map is const. - * Support for RUNTIME_FEATUREs to enable/disable config editor - * Adding a few comments - * - * Revision 1.37 2001/10/14 22:14:01 jongfoster - * Removing name_length field from struct cgi_dispatcher, as this is - * now calculated at runtime from the "name" field. - * - * Revision 1.36 2001/10/10 16:45:15 oes - * Added LIMIT_CONNECT action and string - * Fixed HTTP message line termination - * Added CFORBIDDEN HTTP message - * - * Revision 1.35 2001/10/07 18:06:43 oes - * Added status member to struct http_request - * - * Revision 1.34 2001/10/07 15:45:25 oes - * Added url member to struct http_request and commented all - * members - * - * Added CT_TABOO - * - * Added ACTION_DOWNGRADE and ACTION_NO_COMPRESSION - * - * Replaced struct client_state members rejected, - * force, active and toggled_on with "flags" bitmap. - * - * Added CSP_FLAG_MODIFIED and CSP_FLAG_CHUNKED - * - * Added buffer_limit to struct configuration_spec - * - * Revision 1.33 2001/09/20 13:30:08 steudten - * - * Make freez() more secure in case of: if (exp) { free(z) ; a=*z } - * Last case will set z to NULL in free(z) and thats bad.. - * - * Revision 1.32 2001/09/16 23:02:51 jongfoster - * Fixing warning - * - * Revision 1.31 2001/09/16 13:20:29 jongfoster - * Rewrite of list library. Now has seperate header and list_entry - * structures. Also added a large sprinking of assert()s to the list - * code. - * - * Revision 1.30 2001/09/13 23:52:00 jongfoster - * Support for both static and dynamically generated CGI pages - * - * Revision 1.29 2001/09/13 23:29:43 jongfoster - * Defining FORWARD_SPEC_INITIALIZER - * - * Revision 1.28 2001/09/13 23:05:50 jongfoster - * Changing the string paramater to the header parsers a "const". - * - * Revision 1.27 2001/08/05 16:06:20 jongfoster - * Modifiying "struct map" so that there are now separate header and - * "map_entry" structures. This means that functions which modify a - * map no longer need to return a pointer to the modified map. - * Also, it no longer reverses the order of the entries (which may be - * important with some advanced template substitutions). - * - * Revision 1.26 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.25 2001/07/29 18:43:08 jongfoster - * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to - * ANSI C rules. - * - * Revision 1.24 2001/07/25 17:20:27 oes - * Introduced http->user_agent - * - * Revision 1.23 2001/07/18 12:32:23 oes - * - Added ACTION_STRING_DEANIMATE - * - moved #define freez from jcc.h to project.h - * - * Revision 1.22 2001/07/15 17:51:41 jongfoster - * Renaming #define STATIC to STATIC_PCRE - * - * Revision 1.21 2001/07/13 14:03:19 oes - * - Reorganized regex header inclusion and #defines to - * comply to the scheme in configure.in - * - Added csp->content_type and its CT_* keys - * - Added ACTION_DEANIMATE - * - Removed all #ifdef PCRS - * - * Revision 1.20 2001/06/29 21:45:41 oes - * Indentation, CRLF->LF, Tab-> Space - * - * Revision 1.19 2001/06/29 13:33:36 oes - * - Improved comments - * - Introduced http_request.host_ip_addr_str - * - Introduced http_response.head_length - * - Introduced config.my_ip_addr_str, config.my_hostname, - * config.admin_address and config.proxy_info_url - * - Removed config.proxy_args_header and config.proxy_args_trailer, - * renamed config.proxy_args_invocation to config.proxy_args - * - Removed HTML snipplets and GIFs - * - Removed logentry from cancelled commit - * - * Revision 1.18 2001/06/09 10:57:39 jongfoster - * Adding definition of BUFFER_SIZE. - * Changing struct cgi_dispatcher to use "const" strings. - * - * Revision 1.17 2001/06/07 23:15:09 jongfoster - * Merging ACL and forward files into config file. - * Moving struct gateway members into struct forward_spec - * Removing config->proxy_args_gateways - * Cosmetic: Adding a few comments - * - * Revision 1.16 2001/06/04 18:31:58 swa - * files are now prefixed with either `confdir' or `logdir'. - * `make redhat-dist' replaces both entries confdir and logdir - * with redhat values - * - * Revision 1.15 2001/06/04 11:28:53 swa - * redirect did not work due to missing / - * - * Revision 1.14 2001/06/03 11:03:48 oes - * Added struct map, - * added struct http_response, - * changed struct interceptors to struct cgi_dispatcher, - * moved HTML stuff to cgi.h - * - * Revision 1.13 2001/06/01 20:05:36 jongfoster - * Support for +image-blocker{}: added ACTION_IMAGE_BLOCKER - * constant, and removed csp->tinygif. - * - * Revision 1.12 2001/06/01 18:49:17 jongfoster - * Replaced "list_share" with "list" - the tiny memory gain was not - * worth the extra complexity. - * - * Revision 1.11 2001/06/01 10:32:47 oes - * Added constants for anchoring selection bitmap - * - * Revision 1.10 2001/05/31 21:33:53 jongfoster - * Changes for new actions file, replacing permissionsfile - * and parts of the config file. Also added support for - * list_shared. - * - * Revision 1.9 2001/05/31 17:32:31 oes - * - * - Enhanced domain part globbing with infix and prefix asterisk - * matching and optional unanchored operation - * - * Revision 1.8 2001/05/29 20:09:15 joergs - * HTTP_REDIRECT_TEMPLATE fixed. - * - * Revision 1.7 2001/05/29 09:50:24 jongfoster - * Unified blocklist/imagelist/actionslist. - * File format is still under discussion, but the internal changes - * are (mostly) done. - * - * Also modified interceptor behaviour: - * - We now intercept all URLs beginning with one of the following - * prefixes (and *only* these prefixes): - * * http://i.j.b/ - * * http://ijbswa.sf.net/config/ - * * http://ijbswa.sourceforge.net/config/ - * - New interceptors "home page" - go to http://i.j.b/ to see it. - * - Internal changes so that intercepted and fast redirect pages - * are not replaced with an image. - * - Interceptors now have the option to send a binary page direct - * to the client. (i.e. ijb-send-banner uses this) - * - Implemented show-url-info interceptor. (Which is why I needed - * the above interceptors changes - a typical URL is - * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". - * The previous mechanism would not have intercepted that, and - * if it had been intercepted then it then it would have replaced - * it with an image.) - * - * Revision 1.6 2001/05/27 22:17:04 oes - * - * - re_process_buffer no longer writes the modified buffer - * to the client, which was very ugly. It now returns the - * buffer, which it is then written by chat. - * - * - content_length now adjusts the Content-Length: header - * for modified documents rather than crunch()ing it. - * (Length info in csp->content_length, which is 0 for - * unmodified documents) - * - * - For this to work, sed() is called twice when filtering. - * - * Revision 1.5 2001/05/26 00:28:36 jongfoster - * Automatic reloading of config file. - * Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32). - * Most of the global variables have been moved to a new - * struct configuration_spec, accessed through csp->config->globalname - * Most of the globals remaining are used by the Win32 GUI. - * - * Revision 1.4 2001/05/22 18:46:04 oes - * - * - Enabled filtering banners by size rather than URL - * by adding patterns that replace all standard banner - * sizes with the "Junkbuster" gif to the re_filterfile - * - * - Enabled filtering WebBugs by providing a pattern - * which kills all 1x1 images - * - * - Added support for PCRE_UNGREEDY behaviour to pcrs, - * which is selected by the (nonstandard and therefore - * capital) letter 'U' in the option string. - * It causes the quantifiers to be ungreedy by default. - * Appending a ? turns back to greedy (!). - * - * - Added a new interceptor ijb-send-banner, which - * sends back the "Junkbuster" gif. Without imagelist or - * MSIE detection support, or if tinygif = 1, or the - * URL isn't recognized as an imageurl, a lame HTML - * explanation is sent instead. - * - * - Added new feature, which permits blocking remote - * script redirects and firing back a local redirect - * to the browser. - * The feature is conditionally compiled, i.e. it - * can be disabled with --disable-fast-redirects, - * plus it must be activated by a "fast-redirects" - * line in the config file, has its own log level - * and of course wants to be displayed by show-proxy-args - * Note: Boy, all the #ifdefs in 1001 locations and - * all the fumbling with configure.in and acconfig.h - * were *way* more work than the feature itself :-( - * - * - Because a generic redirect template was needed for - * this, tinygif = 3 now uses the same. - * - * - Moved GIFs, and other static HTTP response templates - * to project.h - * - * - Some minor fixes - * - * - Removed some >400 CRs again (Jon, you really worked - * a lot! ;-) - * - * Revision 1.3 2001/05/20 01:21:20 jongfoster - * Version 2.9.4 checkin. - * - Merged popupfile and cookiefile, and added control over PCRS - * filtering, in new "actionsfile". - * - Implemented LOG_LEVEL_FATAL, so that if there is a configuration - * file error you now get a message box (in the Win32 GUI) rather - * than the program exiting with no explanation. - * - Made killpopup use the PCRS MIME-type checking and HTTP-header - * skipping. - * - Removed tabs from "config" - * - Moved duplicated url parsing code in "loaders.c" to a new funcition. - * - Bumped up version number. - * - * Revision 1.2 2001/05/17 23:01:01 oes - * - Cleaned CRLF's from the sources and related files - * - * Revision 1.1.1.1 2001/05/15 13:59:03 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + /* Declare struct FILE for vars and funcs. */ #include @@ -710,6 +46,20 @@ /* Needed for pcre choice */ #include "config.h" +/* Need for struct sockaddr_storage */ +#ifdef HAVE_RFC2553 +# ifndef _WIN32 +# include +# include +# else +# include +# include +# include + typedef unsigned short in_port_t; +# endif +#endif + + /* * Include appropriate regular expression libraries. * Note that pcrs and pcre (native) are needed for cgi @@ -798,7 +148,7 @@ typedef int jb_err; #define JB_ERR_CGI_PARAMS 2 /**< Missing or corrupt CGI parameters */ #define JB_ERR_FILE 3 /**< Error opening, reading or writing a file */ #define JB_ERR_PARSE 4 /**< Error parsing file */ -#define JB_ERR_MODIFIED 5 /**< File has been modified outside of the +#define JB_ERR_MODIFIED 5 /**< File has been modified outside of the CGI actions editor. */ #define JB_ERR_COMPRESS 6 /**< Error on decompression */ @@ -823,7 +173,7 @@ typedef int jb_err; */ #define ijb_toupper(__X) toupper((int)(unsigned char)(__X)) #define ijb_tolower(__X) tolower((int)(unsigned char)(__X)) -#define ijb_isspace(__X) isspace((int)(unsigned char)(__X)) +#define ijb_isspace(__X) isspace((int)(unsigned char)(__X)) /** * Use for statically allocated buffers if you have no other choice. @@ -841,7 +191,7 @@ typedef int jb_err; * Buffer size for capturing struct hostent data in the * gethostby(name|addr)_r library calls. Since we don't * loop over gethostbyname_r, the buffer must be sufficient - * to accomodate multiple IN A RRs, as used in DNS round robin + * to accommodate multiple IN A RRs, as used in DNS round robin * load balancing. W3C's wwwlib uses 1K, so that should be * good enough for us, too. */ @@ -861,16 +211,10 @@ typedef int jb_err; #define FOREVER 1 /** - * Default IP address to listen on, as a string. - * Set to "127.0.0.1". + * Default TCP/IP address to listen on, as a string. + * Set to "127.0.0.1:8118". */ -#define HADDR_DEFAULT "127.0.0.1" - -/** - * Default port to listen on, as a number. - * Set to 8118. - */ -#define HADDR_PORT 8118 +#define HADDR_DEFAULT "127.0.0.1:8118" /* Forward def for struct client_state */ @@ -889,7 +233,7 @@ struct list_entry * your own code. */ char *str; - + /** Next entry in the linked list, or NULL if no more. */ struct list_entry *next; }; @@ -960,9 +304,11 @@ struct http_request char *host_ip_addr_str; /**< String with dotted decimal representation of host's IP. NULL before connect_to() */ +#ifndef FEATURE_EXTENDED_HOST_PATTERNS char *dbuffer; /**< Buffer with '\0'-delimited domain name. */ char **dvec; /**< List of pointers to the strings in dbuffer. */ int dcount; /**< How many parts to this domain? (length of dvec) */ +#endif /* ndef FEATURE_EXTENDED_HOST_PATTERNS */ }; /** @@ -970,31 +316,36 @@ struct http_request * the requested resource. Mostly ordered the way they are checked * for in chat(). */ -#define RSP_REASON_UNSUPPORTED 1 -#define RSP_REASON_BLOCKED 2 -#define RSP_REASON_UNTRUSTED 3 -#define RSP_REASON_REDIRECTED 4 -#define RSP_REASON_CGI_CALL 5 -#define RSP_REASON_NO_SUCH_DOMAIN 6 -#define RSP_REASON_FORWARDING_FAILED 7 -#define RSP_REASON_CONNECT_FAILED 8 -#define RSP_REASON_OUT_OF_MEMORY 9 -#define RSP_REASON_INTERNAL_ERROR 10 +enum crunch_reason +{ + UNSUPPORTED, + BLOCKED, + UNTRUSTED, + REDIRECTED, + CGI_CALL, + NO_SUCH_DOMAIN, + FORWARDING_FAILED, + CONNECT_FAILED, + OUT_OF_MEMORY, + INTERNAL_ERROR, + CONNECTION_TIMEOUT, + NO_SERVER_DATA +}; /** * Response generated by CGI, blocker, or error handler */ struct http_response { - char *status; /**< HTTP status (string). */ - struct list headers[1]; /**< List of header lines. */ - char *head; /**< Formatted http response head. */ - size_t head_length; /**< Length of http response head. */ - char *body; /**< HTTP document body. */ - size_t content_length; /**< Length of body, REQUIRED if binary body. */ - int is_static; /**< Nonzero if the content will never change and - should be cached by the browser (e.g. images). */ - int reason; /**< Why the response was generated in the first place. */ + enum crunch_reason crunch_reason; /**< Why the response was generated in the first place. */ + char *status; /**< HTTP status (string). */ + struct list headers[1]; /**< List of header lines. */ + char *head; /**< Formatted http response head. */ + size_t head_length; /**< Length of http response head. */ + char *body; /**< HTTP document body. */ + size_t content_length; /**< Length of body, REQUIRED if binary body. */ + int is_static; /**< Nonzero if the content will never change and + should be cached by the browser (e.g. images). */ }; /** @@ -1152,7 +503,7 @@ struct iob #define ACTION_FORCE_TEXT_MODE 0x00400000UL /** Action bitmap: Enable text mode by force */ #define ACTION_CRUNCH_IF_NONE_MATCH 0x00800000UL -/** Action bitmap: Enable content-dispostion crunching */ +/** Action bitmap: Enable content-disposition crunching */ #define ACTION_HIDE_CONTENT_DISPOSITION 0x01000000UL /** Action bitmap: Replace or block Last-Modified header */ #define ACTION_OVERWRITE_LAST_MODIFIED 0x02000000UL @@ -1180,7 +531,7 @@ struct iob #define ACTION_STRING_LANGUAGE 8 /** Action string index: Replacement for the "Content-Type:" header*/ #define ACTION_STRING_CONTENT_TYPE 9 -/** Action string index: Replacement for the "content-dispostion:" header*/ +/** Action string index: Replacement for the "content-disposition:" header*/ #define ACTION_STRING_CONTENT_DISPOSITION 10 /** Action string index: Replacement for the "If-Modified-Since:" header*/ #define ACTION_STRING_IF_MODIFIED_SINCE 11 @@ -1291,10 +642,40 @@ struct url_actions }; +/* + * Structure to hold the server socket and the information + * required to make sure we only reuse the connection if + * the host and forwarding settings are the same. + */ +struct reusable_connection +{ + jb_socket sfd; + int in_use; + time_t timestamp; /* XXX: rename? */ + + time_t request_sent; + time_t response_received; + + /* + * Number of seconds after which this + * connection will no longer be reused. + */ + unsigned int keep_alive_timeout; + + char *host; + int port; + int forwarder_type; + char *gateway_host; + int gateway_port; + char *forward_host; + int forward_port; +}; + + /* * Flags for use in csp->flags */ - + /** * Flag for csp->flags: Set if this client is processing data. * Cleared when the thread associated with this structure dies. @@ -1328,17 +709,22 @@ struct url_actions */ #define CSP_FLAG_TOGGLED_ON 0x20U +/** + * Flag for csp->flags: Set if we answered the request ourselve. + */ +#define CSP_FLAG_CRUNCHED 0x40U + /** * Flag for csp->flags: Set if an acceptable Connection header - * is already set. + * has already been set by the client. */ #define CSP_FLAG_CLIENT_CONNECTION_HEADER_SET 0x00000040U /** - * Flag for csp->flags: Set if adding the 'Connection: close' header - * for the server isn't necessary. + * Flag for csp->flags: Set if an acceptable Connection header + * has already been set by the server. */ -#define CSP_FLAG_SERVER_CONNECTION_CLOSE_SET 0x00000080U +#define CSP_FLAG_SERVER_CONNECTION_HEADER_SET 0x00000080U /** * Flag for csp->flags: Signals header parsers whether they @@ -1376,9 +762,65 @@ struct url_actions * Flag for csp->flags: Set if the server specified the * content length. */ -#define CSP_FLAG_CONTENT_LENGTH_SET 0x00002000U +#define CSP_FLAG_SERVER_CONTENT_LENGTH_SET 0x00002000U + +/** + * Flag for csp->flags: Set if we know the content length, + * either because the server set it, or we figured it out + * on our own. + */ +#define CSP_FLAG_CONTENT_LENGTH_SET 0x00004000U + +/** + * Flag for csp->flags: Set if the client wants to keep + * the connection alive. + */ +#define CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE 0x00008000U + +/** + * Flag for csp->flags: Set if we think we got the whole + * client request and shouldn't read any additional data + * coming from the client until the current request has + * been dealt with. + */ +#define CSP_FLAG_CLIENT_REQUEST_COMPLETELY_READ 0x00010000U + +/** + * Flag for csp->flags: Set if the server promised us to + * keep the connection open for a known number of seconds. + */ +#define CSP_FLAG_SERVER_KEEP_ALIVE_TIMEOUT_SET 0x00020000U + #endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ +/** + * Flag for csp->flags: Set if we think we can't reuse + * the server socket. + */ +#define CSP_FLAG_SERVER_SOCKET_TAINTED 0x00040000U + +/** + * Flag for csp->flags: Set if the Proxy-Connection header + * is among the server headers. + */ +#define CSP_FLAG_SERVER_PROXY_CONNECTION_HEADER_SET 0x00080000U + +/** + * Flag for csp->flags: Set if the client reused its connection. + */ +#define CSP_FLAG_REUSED_CLIENT_CONNECTION 0x00100000U + +/** + * Flag for csp->flags: Set if the supports deflate compression. + */ +#define CSP_FLAG_CLIENT_SUPPORTS_DEFLATE 0x00200000U + +/** + * Flag for csp->flags: Set if the content has been deflated by Privoxy + */ +#define CSP_FLAG_BUFFERED_CONTENT_DEFLATED 0x00400000U + + /* * Flags for use in return codes of child processes */ @@ -1401,6 +843,12 @@ struct url_actions */ #define MAX_AF_FILES 10 +/** + * Maximum number of sockets to listen to. This limit is arbitrary - it's just used + * to size an array. + */ +#define MAX_LISTENING_SOCKETS 10 + /** * The state of a Privoxy processing thread. */ @@ -1415,8 +863,8 @@ struct client_state /** socket to talk to client (web browser) */ jb_socket cfd; - /** socket to talk to server (web server or proxy) */ - jb_socket sfd; + /** current connection to the server (may go through a proxy) */ + struct reusable_connection server_connection; /** Multi-purpose flag container, see CSP_FLAG_* above */ unsigned int flags; @@ -1424,9 +872,15 @@ struct client_state /** Client PC's IP address, as reported by the accept() function. As a string. */ char *ip_addr_str; +#ifdef HAVE_RFC2553 + /** Client PC's TCP address, as reported by the accept() function. + As a sockaddr. */ + struct sockaddr_storage tcp_addr; +#else /** Client PC's IP address, as reported by the accept() function. As a number. */ unsigned long ip_addr_long; +#endif /* def HAVE_RFC2553 */ /** The URL that was requested */ struct http_request http[1]; @@ -1460,11 +914,17 @@ struct client_state unsigned long long content_length; #ifdef FEATURE_CONNECTION_KEEP_ALIVE + /* XXX: is this the right location? */ + /** Expected length of content after which we * should stop reading from the server socket. */ - /* XXX: is this the right location? */ unsigned long long expected_content_length; + + /** Expected length of content after which we + * should stop reading from the client socket. + */ + unsigned long long expected_client_content_length; #endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ #ifdef FEATURE_TRUST @@ -1479,11 +939,17 @@ struct client_state * or NULL. Currently only used for socks errors. */ char *error_message; - - /** Next thread in linked list. Only read or modify from the main thread! */ - struct client_state *next; }; +/** + * List of client states so the main thread can keep + * track of them and garbage collect their resources. + */ +struct client_states +{ + struct client_states *next; + struct client_state csp; +}; /** * A function to add a header @@ -1546,7 +1012,7 @@ struct file_list * Read-only once the structure has been created. */ time_t lastmodified; - + /** * The full filename. */ @@ -1582,12 +1048,16 @@ struct block_spec #endif /* def FEATURE_TRUST */ - -#define SOCKS_NONE 0 /**< Don't use a SOCKS server */ -#define SOCKS_4 40 /**< original SOCKS 4 protocol */ -#define SOCKS_4A 41 /**< as modified for hosts w/o external DNS */ -#define SOCKS_5 50 /**< as modified for hosts w/o external DNS */ - +enum forwarder_type { + /**< Don't use a SOCKS server */ + SOCKS_NONE = 0, + /**< original SOCKS 4 protocol */ + SOCKS_4 = 40, + /**< SOCKS 4A, DNS resolution is done by the SOCKS server */ + SOCKS_4A = 41, + /**< SOCKS 5 with hostnames, DNS resolution is done by the SOCKS server */ + SOCKS_5 = 50, +}; /** * How to forward a connection to a parent proxy. @@ -1598,7 +1068,7 @@ struct forward_spec struct url_spec url[1]; /** Connection type. Must be SOCKS_NONE, SOCKS_4, SOCKS_4A or SOCKS_5. */ - int type; + enum forwarder_type type; /** SOCKS server hostname. Only valid if "type" is SOCKS_4 or SOCKS_4A. */ char *gateway_host; @@ -1623,12 +1093,14 @@ struct forward_spec #define FORWARD_SPEC_INITIALIZER { { URL_SPEC_INITIALIZER }, 0, NULL, 0, NULL, 0, NULL } /* Supported filter types */ -#define FT_CONTENT_FILTER 0 -#define FT_CLIENT_HEADER_FILTER 1 -#define FT_SERVER_HEADER_FILTER 2 -#define FT_CLIENT_HEADER_TAGGER 3 -#define FT_SERVER_HEADER_TAGGER 4 - +enum filter_type +{ + FT_CONTENT_FILTER = 0, + FT_CLIENT_HEADER_FILTER = 1, + FT_SERVER_HEADER_FILTER = 2, + FT_CLIENT_HEADER_TAGGER = 3, + FT_SERVER_HEADER_TAGGER = 4, +}; #define MAX_FILTER_TYPES 5 /** @@ -1643,7 +1115,7 @@ struct re_filterfile_spec char *description; /**< Description from FILTER: statement in re_filterfile. */ struct list patterns[1]; /**< The patterns from the re_filterfile. */ pcrs_job *joblist; /**< The resulting compiled pcrs_jobs. */ - int type; /**< Filter type (content, client-header, server-header). */ + enum filter_type type; /**< Filter type (content, client-header, server-header). */ int dynamic; /**< Set to one if the pattern might contain variables and has to be recompiled for every request. */ struct re_filterfile_spec *next; /**< The pointer for chaining. */ @@ -1660,9 +1132,14 @@ struct re_filterfile_spec */ struct access_control_addr { +#ifdef HAVE_RFC2553 + struct sockaddr_storage addr; /* +# Copyright (c) 2007-2011 Fabian Keil # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -26,15 +26,26 @@ # ############################################################################# +# While the syntax used is understood by Privoxy 3.0.14 and later, +# some of the +fast-redirects{} tests require at least 3.0.18 to work. {{settings}} -for-privoxy-version=3.0.11 +for-privoxy-version=3.0.18 # Some dependencies Privoxy-Regression-Test should know about: # # Level 9 needs = config line user-manual\s+(\.?\.?/|[A-Za-z]:) # Level 12 needs = config line enable-edit-actions\s+1 # Level 13 needs = feature status FEATURE_CONNECTION_KEEP_ALIVE Yes +# Level 13 needs = config line keep-alive-timeout\s+[1-9]+ # Level 14 needs = feature status FEATURE_CONNECTION_KEEP_ALIVE No +# Level 15 needs = config line connection-sharing\s+0 +# Level 16 needs = feature status FEATURE_CONNECTION_KEEP_ALIVE Yes +# Level 16 needs = config line connection-sharing\s+1 +# Level 17 needs = feature status FEATURE_PTHREAD Yes +# Level 18 needs = feature status FEATURE_GRACEFUL_TERMINATION No +# Level 19 needs = feature status FEATURE_GRACEFUL_TERMINATION Yes +# Level 20 needs = feature status FEATURE_TOGGLE Yes +# Level 21 needs = feature status FEATURE_TOGGLE No ####################################################### # Enable taggers to activate the tests on demand @@ -74,11 +85,11 @@ TAG:^hide-accept-language\{block\}$ # 2) conditional-forge # 3) forge # 4) block -# 5) a parameter that looks like a valid fake referrer +# 5) a parameter that looks like a valid fake referrer # 6) a parameter that looks like an invalid fake referrer ####################################################### -# Set Header = Referer: http://www.example.org/foo +# Set Header = Referer: http://www.example.org/foo # Expect Header = REMOVAL # # Set Header = Referer: http://p.p/foo @@ -98,7 +109,7 @@ TAG:^hide-accept-language\{block\}$ {+hide-referrer{conditional-block}} TAG:^hide-referrer\{conditional-block\}$ -# Set Header = Referer: http://www.example.org/foo +# Set Header = Referer: http://www.example.org/foo # Expect Header = Referer: http://p.p/ # # Set Header = Referer: http://p.p/foo @@ -118,17 +129,17 @@ TAG:^hide-referrer\{conditional-block\}$ {+hide-referrer{conditional-forge}} TAG:^hide-referrer\{conditional-forge\}$ -# Set Header = Referer: http://www.example.org/foo +# Set Header = Referer: http://www.example.org/foo # Expect Header = Referer: http://p.p/ {+hide-referrer{forge}} TAG:^hide-referrer\{forge\}$ -# Set Header = Referer: http://www.example.org/foo +# Set Header = Referer: http://www.example.org/foo # Expect Header = REMOVAL {+hide-referrer{block}} TAG:^hide-referrer\{block\}$ -# Set Header = Referer: http://www.example.org/foo +# Set Header = Referer: http://www.example.org/foo # Expect Header = Referer: invalid {+hide-referrer{invalid}} TAG:^hide-referrer\{invalid\}$ @@ -250,6 +261,16 @@ TAG:^hide-if-modified-since\{block\}$ # Expect Header = REMOVAL # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT # Expect Header = SOME CHANGE +# Set Header = If-Modified-Since: Thu, 1 Jan 1970 00:00:00 GMT +# Expect Header = SOME CHANGE +# Level = 17 +# Set Header = If-Modified-Since: Thu, 1 Jan 123456789 00:00:00 GMT +# Expect Header = REMOVAL +# Set Header = If-Modified-Since: Mon, 1 Jan 2525 00:00:00 GMT +# Expect Header = SOME CHANGE +# Level = 17 +# Set Header = If-Modified-Since: Thu, 1 Jan 1970 02:00:00 GMT +# Expect Header = SOME CHANGE {+hide-if-modified-since{-60} -crunch-if-none-match} TAG:^hide-if-modified-since\{-60\}$ @@ -258,6 +279,8 @@ TAG:^hide-if-modified-since\{-60\}$ # Expect Header = REMOVAL # Set Header = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT # Expect Header = SOME CHANGE +# Set Header = If-Modified-Since: Wed, 31 Dec 1969 23:59:59 GMT +# Expect Header = SOME CHANGE {+hide-if-modified-since{+60} -crunch-if-none-match} TAG:^hide-if-modified-since\{\+60\}$ @@ -412,6 +435,7 @@ TAG:^prevent-compression$ # Set Header = Request-Range: bytes=1234-5678 # Expect Header = REMOVAL {\ + -client-header-tagger{range-requests} \ +deanimate-gifs{last} \ -filter \ } @@ -424,6 +448,7 @@ TAG:^deanimate-gifs\{last\}$ # Set Header = Request-Range: bytes=1234-5678 # Expect Header = REMOVAL {\ + -client-header-tagger{range-requests} \ -deanimate-gifs \ +filter{banners-by-size} \ } @@ -436,19 +461,17 @@ TAG:^filter\{banners-by-size\}$ # Set Header = Request-Range: bytes=1234-5678 # Expect Header = NO CHANGE {\ + -client-header-tagger{range-requests} \ -deanimate-gifs \ -filter \ } TAG:^no-content-filter$ -# Set Header = Connection: close -# Expect Header = Connection: keep-alive -# Level = 13 # Set Header = Connection: keep-alive # Expect Header = NO CHANGE # Level = 13 # Set Header = Connection: -# Expect Header = Connection: keep-alive +# Expect Header = REMOVAL # Level = 13 {} TAG:^Connection: keep-alive$ @@ -462,6 +485,21 @@ TAG:^Connection: keep-alive$ {} TAG:^Connection: close$ +# Set Header = Connection: close +# Expect Header = NO CHANGE +# Level = 15 +{} +TAG:^connection-sharing disabled$ + +# Set Header = Connection: close +# Expect Header = REMOVAL +# Level = 16 +# Set Header = Connection: keep-alive +# Expect Header = NO CHANGE +# Level = 16 +{} +TAG:^connection-sharing enabled$ + # XXX: Removing a header by not specifying a value is # an inherited curl feature and could be viewed as a # bug as far as Privoxy-Regression-Test is concerned. @@ -476,9 +514,15 @@ TAG:^No Host header$ {} TAG:^Host header other than the target host$ -# XXX: check the RFC to use a real value -# Set Header = Keep-Alive: Yes +# Set Header = Keep-Alive: 20 +# Expect Header = NO CHANGE +# Level = 13 +{} +TAG:^Pass Keep-Alive header$ + +# Set Header = Keep-Alive: 20 # Expect Header = REMOVAL +# Level = 14 {} TAG:^Keep-Alive header removal$ @@ -521,9 +565,12 @@ TAG:^Max-Forwards header without TRACE method$ ################################################################ # Fetch Test = http://p.p/ -# Will fail if compiled with FEATURE_GRACEFUL_TERMINATION # Fetch Test = http://p.p/die # Expect Status Code = 404 +# Level = 18 +# Fetch Test = http://p.p/die +# Expect Status Code = 200 +# Level = 19 # Fetch Test = http://p.p/show-status # Fetch Test = http://config.privoxy.org/show-status?file=actions&index=0 # Fetch Test = http://config.privoxy.org/show-status?file=filter&index=0 @@ -548,7 +595,12 @@ TAG:^Max-Forwards header without TRACE method$ # Fetch Test = http://p.p/show-url-info?url=FTp:%2F%2Fwww.privoxy.org%2F # Fetch Test = http://p.p/show-url-info?url= # Fetch Test = http://p.p/show-url-info?url=%2F +# Depends on FEATURE_TOGGLE # Fetch Test = http://p.p/toggle +# Level = 20 +# Fetch Test = http://p.p/toggle +# Expect Status Code = 404 +# Level = 21 # Fetch Test = http://p.p/edit-actions # Fetch Test = http://p.p/eaa # Fetch Test = http://p.p/eau @@ -650,8 +702,6 @@ TAG:^Max-Forwards header without TRACE method$ # Level = 9 # Fetch Test = http://p.p/user-manual/templates.html # Level = 9 -# Fetch Test = http://p.p/user-manual/upgradersnote.html -# Level = 9 # Fetch Test = http://p.p/user-manual/whatsnew.html # Level = 9 @@ -710,10 +760,20 @@ p.p:3,22,79-81/ {+forward-override{forward-socks5 127.0.0.1:12345 .}} oh-dear-this-hostname-is-so-very-long-that-it-can-not-possibly-be-forwarded-through-socks5-as-a-result-we-therefore-expect-privoxy-to-return-an-error-response-instead-of-forwarding-the-request-because-as-already-mentioned-this-host-is-really-very-long.example/ -# Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks-server-listening.example +# Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks5-server-listening.example # Expect Status Code = 503 {+forward-override{forward-socks5 127.0.0.1:12345 .}} -oh-dear-this-hostname-is-short-enough-but-there-is-no-socks-server-listening.example +oh-dear-this-hostname-is-short-enough-but-there-is-no-socks5-server-listening.example + +# Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4-server-listening.example +# Expect Status Code = 503 +{+forward-override{forward-socks4 127.0.0.1:12345 .}} +oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4-server-listening.example + +# Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4a-server-listening.example +# Expect Status Code = 503 +{+forward-override{forward-socks4a 127.0.0.1:12345 .}} +oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4a-server-listening.example # This one currently triggers the same error condition as the # test above (socks5 server unreachable), but once Privoxy @@ -752,6 +812,11 @@ www.blocked-request.example/blocked-request-with-no-reason-specified # Blocked URL = http://domain-pattern-test.example.org/ domain-pattern-test.example. +{+block{Hostname patterns without trailing dots cover hostnames with trailing dots as well.}} +# Blocked URL = http://trailing-dot.example.org./ +# Blocked URL = http://trailing-dot.example.org./foo +trailing-dot.example.org + # Just in case there is no white-space fuzzer in the house ... # # Set Header = X-LWS-Test: no superfluous white space here @@ -780,3 +845,47 @@ domain-pattern-test.example. # Expect Header = X-LWS-Test: "This is quoted" this is not "this is " but " this again is not {} TAG:^LWS Tests$ + +{+fast-redirects{check-decoded-url}} +# Redirected URL = http://redirect.example.net/blafasel&url=http://redirected1.example.net/ +# Redirect Destination = http://redirected1.example.net/ +# Redirected URL = http://redirect.example.net/blafasel&url=http%3A%2F%2Fredirected2.example.net%2F¶meter=not-part-of-the-redirected-url +# Redirect Destination = http://redirected2.example.net/ +# Redirected URL = http://redirect.example.net/blafasel&url=http%3A%2F%2Fredirected3.example.net%2F¶meter=not-part-of-the-redirected-url +# Redirect Destination = http://redirected3.example.net/ +# Redirected URL = http://redirect.example.net/blafasel&url=http%3A%2F%2Fredirected4.example.net%2F%26parameter=part-of-the-redirected-url +# Redirect Destination = http://redirected4.example.net/¶meter=part-of-the-redirected-url +# Redirected URL = http://redirect.example.net/blafasel&url1=http%3A%2F%2Fredirected5.example.net%2F%26parameter1=part-of-the-redirected-url&url2=http%3A%2F%2Fredirected5.example.net%2F%26parameter2=part-of-the-redirected-url2 +# Redirect Destination = http://redirected5.example.net/¶meter2=part-of-the-redirected-url2 +# Redirected URL = http://redirect.example.net/blafasel&url1=http%3A%2F%2Fredirected6.example.net%2F%26parameter1=part-of-the-redirected-url&url2=http%3A%2F%2Fredirected6.example.net%2F%26parameter2=part-of-the-redirected-url2¶meter3=not-part-of-the-redirected-url2 +# Redirect Destination = http://redirected6.example.net/¶meter2=part-of-the-redirected-url2 +# Redirected URL = http://redirect.example.net/blafasel?x=http%3A%2F%2Fredirected7.example.net%2F%26parameter1=part-of-the-redirected-url1¶meter2=not-part-of-the-redirected-url1 +# Redirect Destination = http://redirected7.example.net/¶meter1=part-of-the-redirected-url1 +# Redirected URL = http://redirect.example.net/blafasel?x=http%3A%2F%2Fredirected8.example.net%2F%26parameter1=part-of-the-redirected-url1¶meter2=not-part-of-the-redirected-url1¶meter3=not-part-of-the-redirected-url1 +# Redirect Destination = http://redirected8.example.net/¶meter1=part-of-the-redirected-url1 +# Redirected URL = http://redirect.example.net/blafasel?a?b?c?d?e?f?g?h?i?j?k?l?m?n?o?p?q?r?s&t&u&v&w&x&y&z&1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16x=http%3A%2F%2Fredirected8.example.net%2F%26parameter1=part-of-the-redirected-url1¶meter2=not-part-of-the-redirected-url1¶meter3=not-part-of-the-redirected-url1 +# Redirect Destination = http://redirected8.example.net/¶meter1=part-of-the-redirected-url1 +# Redirected URL = http://redirect.example.net/blafasel???????????????????????????????=http%3A%2F%2Fredirected8.example.net%2F%26parameter1=part-of-the-redirected-url1¶meter2=not-part-of-the-redirected-url1¶meter3=not-part-of-the-redirected-url1 +# Redirect Destination = http://redirected8.example.net/¶meter1=part-of-the-redirected-url1 +# Redirected URL = http://redirect.example.net/blafasel&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&=http%3A%2F%2Fredirected8.example.net%2F%26parameter1=part-of-the-redirected-url1¶meter2=not-part-of-the-redirected-url1¶meter3=not-part-of-the-redirected-url1 +# Redirect Destination = http://redirected8.example.net/¶meter1=part-of-the-redirected-url1 +redirect.example.net/ +# Redirected URL = http://redirect.example.net/blafaselhttp://redirect1.example.net/http://redirect2.example.net/ +# Redirect Destination = http://redirect2.example.net/ +# Redirected URL = http://redirect.example.net/blafasel%3A%2F%2Fredirect1.example.net/http://redirect2.example.net/ +# Redirect Destination = http://redirect2.example.net/ +# Redirected URL = http://redirect.example.net/blafaselhttp://redirect1.example.net/http%3A%2F%2Fredirect2.example.net/ +# Redirect Destination = http://redirect2.example.net/ +# These tests verify that Privoxy behaves as intended, +# given that the encoded redirect URLs are invalid, +# there are no correct redirect URLs. +# Redirected URL = http://redirect.example.net/%%%%%%%%%%%%%%%%%%%%%%blafaselhttp://redirect1.example.net/http%3A%2F%2Fredirect2.example.net/%%%%%%%%%%%%%% +# Redirect Destination = http://redirect2.example.net/%%%%%%%%%%%%%% +# Redirected URL = http://redirect.example.net/%%%%%%%%%%%%%%%%%%%%%%blafaselhttp://redirect1.example.net/http%3A%2F%2Fredirect2.example.net/%1%2%%3%4%5%6%7%8%9%0%0%% +# Redirect Destination = http://redirect2.example.net/%1%2%%3%4%5%6%7%8%9%0%0%% + +{+fast-redirects{simple-check}} +# Redirected URL = http://redirect2.example.net/blafasel?x=http://redirected.example.net/¶meter1=part-of-the-redirected-url1¶meter2=part-of-the-redirected-url1 +# Redirect Destination = http://redirected.example.net/¶meter1=part-of-the-redirected-url1¶meter2=part-of-the-redirected-url1 +redirect2.example.net/ + diff --git a/external/privoxy/ssplit.c b/external/privoxy/ssplit.c index d9162869..ad5caf40 100644 --- a/external/privoxy/ssplit.c +++ b/external/privoxy/ssplit.c @@ -1,4 +1,4 @@ -const char ssplit_rcs[] = "$Id: ssplit.c,v 1.9 2007/11/03 14:35:45 fabiankeil Exp $"; +const char ssplit_rcs[] = "$Id: ssplit.c,v 1.12 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/ssplit.c,v $ @@ -9,10 +9,10 @@ const char ssplit_rcs[] = "$Id: ssplit.c,v 1.9 2007/11/03 14:35:45 fabiankeil Ex * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -30,39 +30,8 @@ const char ssplit_rcs[] = "$Id: ssplit.c,v 1.9 2007/11/03 14:35:45 fabiankeil Ex * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: ssplit.c,v $ - * Revision 1.9 2007/11/03 14:35:45 fabiankeil - * Fix spelling in Purpose line. Patch submitted by Simon Ruderich. - * - * Revision 1.8 2006/07/18 14:48:47 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.6 2002/03/26 22:29:55 swa - * we have a new homepage! - * - * Revision 1.5 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.4 2001/11/13 00:16:38 jongfoster - * Replacing references to malloc.h with the standard stdlib.h - * (See ANSI or K&R 2nd Ed) - * - * Revision 1.3 2001/05/29 08:54:25 jongfoster - * Rewrote the innards of ssplit() to be easier to understand, - * faster, and to use less memory. Didn't change the interface - * except to give the parameters meaningful names. - * - * Revision 1.2 2001/05/17 23:01:01 oes - * - Cleaned CRLF's from the sources and related files - * - * Revision 1.1.1.1 2001/05/15 13:59:04 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include "config.h" @@ -94,18 +63,18 @@ const char ssplit_h_rcs[] = SSPLIT_H_VERSION; * 3 : vec[] = results vector (aka. array) [out] * 4 : vec_len = number of usable slots in the vector (aka. array size) * 5 : dont_save_empty_fields = zero if consecutive delimiters - * give a null output field(s), nonzero if they are just + * give a null output field(s), nonzero if they are just * to be considered as single delimeter * 6 : ignore_leading = nonzero to ignore leading field * separators. * - * Returns : -1 => Error: vec_len is too small to hold all the + * Returns : -1 => Error: vec_len is too small to hold all the * data, or str == NULL. * >=0 => the number of fields put in `vec'. * On error, vec and str may still have been overwritten. * *********************************************************************/ -int ssplit(char *str, const char *delim, char *vec[], int vec_len, +int ssplit(char *str, const char *delim, char *vec[], size_t vec_len, int dont_save_empty_fields, int ignore_leading) { unsigned char is_delim[256]; @@ -153,7 +122,7 @@ int ssplit(char *str, const char *delim, char *vec[], int vec_len, || (is_delim[(unsigned)(unsigned char)*str] == 0) ) { /* - * We want empty fields, or the first character in this + * We want empty fields, or the first character in this * field is not a delimiter or the end of string. * So save it. */ @@ -161,24 +130,24 @@ int ssplit(char *str, const char *delim, char *vec[], int vec_len, { return(-1); /* overflow */ } - vec[vec_count++] = (char *) str; + vec[vec_count++] = (char *) str; } while ((char_type = is_delim[(unsigned)(unsigned char)*str]) != 2) { - if (char_type == 1) + if (char_type == 1) { /* the char is a separator */ /* null terminate the substring */ - *str++ = '\0'; + *str++ = '\0'; /* Check if we want to save this field */ if ( (!dont_save_empty_fields) || (is_delim[(unsigned)(unsigned char)*str] == 0) ) { /* - * We want empty fields, or the first character in this + * We want empty fields, or the first character in this * field is not a delimiter or the end of string. * So save it. */ @@ -186,7 +155,7 @@ int ssplit(char *str, const char *delim, char *vec[], int vec_len, { return(-1); /* overflow */ } - vec[vec_count++] = (char *) str; + vec[vec_count++] = (char *) str; } } else diff --git a/external/privoxy/ssplit.h b/external/privoxy/ssplit.h index 3e9b991a..04bb288c 100644 --- a/external/privoxy/ssplit.h +++ b/external/privoxy/ssplit.h @@ -1,6 +1,6 @@ #ifndef SSPLIT_H_INCLUDED #define SSPLIT_H_INCLUDED -#define SSPLIT_H_VERSION "$Id: ssplit.h,v 1.7 2006/07/18 14:48:47 david__schmidt Exp $" +#define SSPLIT_H_VERSION "$Id: ssplit.h,v 1.10 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/ssplit.h,v $ @@ -11,10 +11,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -32,39 +32,14 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: ssplit.h,v $ - * Revision 1.7 2006/07/18 14:48:47 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.5 2002/03/26 22:29:55 swa - * we have a new homepage! - * - * Revision 1.4 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.3 2001/07/29 18:43:08 jongfoster - * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to - * ANSI C rules. - * - * Revision 1.2 2001/05/29 08:54:25 jongfoster - * Rewrote the innards of ssplit() to be easier to understand, - * faster, and to use less memory. Didn't change the interface - * except to give the parameters meaningful names. - * - * Revision 1.1.1.1 2001/05/15 13:59:04 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #ifdef __cplusplus extern "C" { #endif -extern int ssplit(char *str, const char *delim, char *vec[], int vec_len, +extern int ssplit(char *str, const char *delim, char *vec[], size_t vec_len, int dont_save_empty_fields, int ignore_leading); /* Revision control strings from this header and associated .c file */ diff --git a/external/privoxy/templates/blocked b/external/privoxy/templates/blocked index 3ebc22ee..3da06f28 100644 --- a/external/privoxy/templates/blocked +++ b/external/privoxy/templates/blocked @@ -13,7 +13,7 @@ # # Template files are written in plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -28,7 +28,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -82,7 +82,7 @@ # force-support: # Privoxy has been compiled with support for forced loading # of blocked content. In that case, the symbol "force-prefix" is -# avaiable, which translates to the FORCE_PREFIX +# avaiable, which translates to the FORCE_PREFIX # @@ -107,20 +107,20 @@ minWidth = 650; minHeight = 330; - /* + /* * Navigator, Mozilla, Opera */ - if (window.innerWidth - && (window.innerWidth >= minWidth) + if (window.innerWidth + && (window.innerWidth >= minWidth) && (window.innerHeight >= minHeight)) { return false; } - - /* + + /* * MSIE */ - else if (document.body && document.body.clientWidth + else if (document.body && document.body.clientWidth && (document.body.clientWidth >= minWidth) && (document.body.clientHeight >= minHeight)) { diff --git a/external/privoxy/templates/cgi-error-404 b/external/privoxy/templates/cgi-error-404 index c12b5648..4e010c0e 100644 --- a/external/privoxy/templates/cgi-error-404 +++ b/external/privoxy/templates/cgi-error-404 @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -84,7 +84,7 @@ 404 - + #include mod-title @@ -142,7 +142,7 @@ - + diff --git a/external/privoxy/templates/cgi-error-bad-param b/external/privoxy/templates/cgi-error-bad-param index a1e3f055..f8e95a98 100644 --- a/external/privoxy/templates/cgi-error-bad-param +++ b/external/privoxy/templates/cgi-error-bad-param @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -149,7 +149,7 @@ - + diff --git a/external/privoxy/templates/cgi-error-disabled b/external/privoxy/templates/cgi-error-disabled index 9faffc6b..b95de2ca 100644 --- a/external/privoxy/templates/cgi-error-disabled +++ b/external/privoxy/templates/cgi-error-disabled @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -162,7 +162,7 @@ - + diff --git a/external/privoxy/templates/cgi-error-file b/external/privoxy/templates/cgi-error-file index 09bf2cb2..0d801fe1 100644 --- a/external/privoxy/templates/cgi-error-file +++ b/external/privoxy/templates/cgi-error-file @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # diff --git a/external/privoxy/templates/cgi-error-file-read-only b/external/privoxy/templates/cgi-error-file-read-only index bfce2779..8137200e 100644 --- a/external/privoxy/templates/cgi-error-file-read-only +++ b/external/privoxy/templates/cgi-error-file-read-only @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # diff --git a/external/privoxy/templates/cgi-error-modified b/external/privoxy/templates/cgi-error-modified index 3b04b4b3..4c386264 100644 --- a/external/privoxy/templates/cgi-error-modified +++ b/external/privoxy/templates/cgi-error-modified @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -109,7 +109,7 @@

Possible causes:

  • If you got here using your browser's "back" button, then - that is deliberately disabled for this page. Please + that is deliberately disabled for this page. Please navigate around the configuration editor using the links provided.
  • Perhaps you've got more than one browser window open, and @@ -117,7 +117,7 @@ only have one editor window open at a time. Your other edit window should continue to function.
  • You may have modified the file some other way - perhaps by - editing it with a text editor. Simply go back in to the + editing it with a text editor. Simply go back in to the configuration interface using the links below.

You can go back into the edit interface using the menu below, @@ -150,7 +150,7 @@ - + diff --git a/external/privoxy/templates/cgi-error-parse b/external/privoxy/templates/cgi-error-parse index 695131c4..7a07bf23 100644 --- a/external/privoxy/templates/cgi-error-parse +++ b/external/privoxy/templates/cgi-error-parse @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -110,7 +110,7 @@ editor. If you managed to take a valid file and break it this badly using the web-based editor, please file a bug report!

When you've fixed the problem, you can go back into the edit - interface using the menu below, or by clicking here.

@@ -169,7 +169,7 @@ - + diff --git a/external/privoxy/templates/cgi-style.css b/external/privoxy/templates/cgi-style.css index b66c5801..8673485e 100644 --- a/external/privoxy/templates/cgi-style.css +++ b/external/privoxy/templates/cgi-style.css @@ -10,7 +10,7 @@ # Original Author: Copyright (C) 2001 Jonathan Foster # http://www.jon-foster.co.uk/ # -# This program is free software; you can redistribute it +# This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General # Public License as published by the Free Software # Foundation; either version 2 of the License, or (at @@ -28,34 +28,12 @@ # or write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# Revisions : -# $Log: cgi-style.css,v $ -# Revision 1.12 2007/12/11 21:20:53 fabiankeil -# Make strong warnings red too. -# -# Revision 1.11 2007/12/08 14:29:06 fabiankeil -# Use CSS to let the URL and pattern input fields scale with -# the browser width and try to prevent vertical scroll bars -# if the width is less than 80 characters. Closes #1843596, -# thanks to Gerry Murphy and Lee. -# -# Revision 1.10 2007/01/22 13:12:43 fabiankeil -# White space cosmetics for #include. -# -# Revision 1.9 2006/12/17 17:50:55 fabiankeil -# Add white space workaround for tables -# in show-status CGI page. -# -# Revision 1.8 2002/05/12 15:53:41 jongfoster -# Adding standard comment header with license and CVS log. -# -# ############################################################################## /* * CSS for Privoxy CGI and script output * - * $Id: cgi-style.css,v 1.12 2007/12/11 21:20:53 fabiankeil Exp $ + * $Id: cgi-style.css,v 1.14 2011/09/04 11:09:40 fabiankeil Exp $ */ /* @@ -168,6 +146,6 @@ em.warning, strong.warning { color: #ff0000 } /* * Let the URL and pattern input fields scale with the browser * width and try to prevent vertical scroll bars if the width - * is less than 80 characters. + * is less than 80 characters. */ input.url, input.pattern { width: 95%; } diff --git a/external/privoxy/templates/connect-failed b/external/privoxy/templates/connect-failed index 3607552a..96b312e3 100644 --- a/external/privoxy/templates/connect-failed +++ b/external/privoxy/templates/connect-failed @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -94,7 +94,7 @@ 503 - + #include mod-title diff --git a/external/privoxy/templates/default b/external/privoxy/templates/default index 065aedc2..a4bb7d04 100644 --- a/external/privoxy/templates/default +++ b/external/privoxy/templates/default @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -124,7 +124,7 @@ - + diff --git a/external/privoxy/templates/edit-actions-add-url-form b/external/privoxy/templates/edit-actions-add-url-form index 32ee64fe..d1d92564 100644 --- a/external/privoxy/templates/edit-actions-add-url-form +++ b/external/privoxy/templates/edit-actions-add-url-form @@ -11,7 +11,7 @@ # Original Author: Copyright (C) 2001 Jonathan Foster # http://www.jon-foster.co.uk/ # -# This program is free software; you can redistribute it +# This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General # Public License as published by the Free Software # Foundation; either version 2 of the License, or (at @@ -29,75 +29,6 @@ # or write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# Revisions : -# $Log: edit-actions-add-url-form,v $ -# Revision 1.18 2007/12/08 14:36:43 fabiankeil -# - Use the shiny new CSS "pattern" class. -# - s@URL Pattern@URL or TAG Pattern@ -# -# Revision 1.17 2007/01/23 16:03:16 fabiankeil -# - Add favicon links. -# - Remove useless W3C validator links. -# -# Revision 1.16 2006/07/18 14:49:13 david__schmidt -# Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) -# with what was really the latest development (the v_3_0_branch branch) -# -# Revision 1.14.2.2 2002/08/23 02:22:53 hal9 -# Fix a perl brain fart with
  • in comments. -# -# Revision 1.14 2002/05/21 19:10:30 oes -# - Added jump target and button style to "cancel" link -# - Fixed title -# -# Revision 1.13 2002/04/10 13:32:53 oes -# Made templates modular -# -# Revision 1.12 2002/04/08 17:08:14 oes -# Cosmetic: make status in title lowercase -# -# Revision 1.11 2002/04/05 16:01:33 oes -# Correct HTML, external Stylesheets, eye candy, some fixes -# -# Revision 1.10 2002/03/26 22:29:56 swa -# we have a new homepage! -# -# Revision 1.9 2002/03/24 15:23:33 jongfoster -# Name changes -# -# Revision 1.8 2002/03/24 11:01:06 swa -# name change -# -# Revision 1.7 2002/03/23 16:18:15 swa -# renamed every reference to the old name with foobar. -# fixed "application foobar application" tag, fixed -# "the foobar" with "foobar". left junkbuster in cvs -# comments and remarks to history untouched. should -# make final rename easier. -# -# Revision 1.6 2002/03/16 15:22:19 jongfoster -# Moving 'alpha' warning to the end of the page -# -# Revision 1.5 2002/03/03 10:29:12 swa -# point users to the right feedback forms, -# not necessarily the developer list. -# -# Revision 1.4 2002/01/23 00:26:45 jongfoster -# Reducing length of URLs -# Where encoded and unencoded versions of a string existed, removing -# the unencoded one. -# -# Revision 1.3 2002/01/17 21:33:00 jongfoster -# Replacing all references to the URL of the config interface -# with @default-cgi@ -# -# Revision 1.2 2002/01/17 21:21:03 jongfoster -# DOS->Unix line endings -# -# Revision 1.1 2001/11/13 00:58:18 jongfoster -# New version of actions file editor templates -# -# ############################################################################## # # Standard support: diff --git a/external/privoxy/templates/edit-actions-for-url b/external/privoxy/templates/edit-actions-for-url index fd673af7..3999b85c 100644 --- a/external/privoxy/templates/edit-actions-for-url +++ b/external/privoxy/templates/edit-actions-for-url @@ -4,7 +4,7 @@ # # Purpose : Template used to edit the actions associated with a # particular section in an actions file. -# +# # # Copyright : Written by and Copyright (C) 2001-2008 the SourceForge # Privoxy team. http://www.privoxy.org/ @@ -12,7 +12,7 @@ # Original Author: Copyright (C) 2001 Jonathan Foster # http://www.jon-foster.co.uk/ # -# This program is free software; you can redistribute it +# This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General # Public License as published by the Free Software # Foundation; either version 2 of the License, or (at @@ -30,242 +30,8 @@ # or write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# Revisions : -# $Log: edit-actions-for-url,v $ -# Revision 1.56 2008/09/20 10:04:33 fabiankeil -# Remove hide-forwarded-for-headers action which has -# been obsoleted by change-x-forwarded-for{block}. -# -# Revision 1.55 2008/09/19 15:26:29 fabiankeil -# Add change-x-forwarded-for{} action to block or add -# X-Forwarded-For headers. Mostly based on code removed -# before 3.0.7. -# -# Revision 1.54 2008/03/29 12:14:27 fabiankeil -# Remove send-wafer and send-vanilla-wafer actions. -# -# Revision 1.53 2008/03/28 15:13:45 fabiankeil -# Remove inspect-jpegs action. -# -# Revision 1.52 2008/03/15 14:52:36 fabiankeil -# Add CGI editor support for the "disable all filters of this type" -# directives "-client-header-filter", "-server-header-filter", -# "-client-header-tagger" and "-server-header-tagger". -# -# Revision 1.51 2008/03/07 16:46:49 fabiankeil -# Reword limit-connect{} entry. -# -# Revision 1.50 2008/03/04 18:30:44 fabiankeil -# Remove the treat-forbidden-connects-like-blocks action. We now -# use the "blocked" page for forbidden CONNECT requests by default. -# -# Revision 1.49 2008/03/01 14:00:47 fabiankeil -# Let the block action take the reason for the block -# as argument and show it on the "blocked" page. -# -# Revision 1.48 2007/12/11 21:18:55 fabiankeil -# Make forward-override accessible through the CGI editor. -# -# Revision 1.47 2007/12/06 18:21:55 fabiankeil -# Update hide-forwarded-for-headers description. -# -# Revision 1.46 2007/11/10 15:06:10 fabiankeil -# - Add support for +hide-referrer{conditional-forge}. -# - Minor rewordings. -# -# Revision 1.45 2007/05/24 13:38:45 fabiankeil -# Two minor fixes. -# -# Revision 1.44 2007/04/15 16:39:21 fabiankeil -# Introduce tags as alternative way to specify which -# actions apply to a request. At the moment tags can be -# created based on client and server headers. -# -# Revision 1.43 2007/03/29 11:40:34 fabiankeil -# Divide @filter-params@ into @client-header-filter-params@ -# @content-filter-params@ and @server-header-filter-params@. -# -# Revision 1.42 2007/03/20 15:40:00 fabiankeil -# Adjust to new world order with dedicated header-filter actions. -# -# Revision 1.41 2007/01/23 16:03:16 fabiankeil -# - Add favicon links. -# - Remove useless W3C validator links. -# -# Revision 1.40 2006/12/21 13:01:03 fabiankeil -# Prepare for "split-large-forms". -# -# Mention that redirect{} now also understands -# a single pcrs job as argument. -# -# Add some table summaries and remove useless validator link. -# -# Revision 1.39 2006/10/04 17:37:54 fabiankeil -# JavaScript fix for bug report #1570678. -# -# Revision 1.38 2006/09/08 12:06:35 fabiankeil -# Have hide-if-modified-since interpret the random -# range value as minutes instead of hours. Allows -# more fine-grained configuration. -# -# Revision 1.37 2006/09/05 18:20:14 fabiankeil -# Sorted alphabetically, fixed spelling mistakes -# and shortened some descriptions. -# -# Revision 1.36 2006/08/14 08:29:17 fabiankeil -# Split filter-headers{} into filter-client-headers{} -# and filter-server-headers{}. -# -# Revision 1.35 2006/08/03 02:46:42 david__schmidt -# Incorporate Fabian Keil's patch work: http://www.fabiankeil.de/sourcecode/privoxy/ -# -# Revision 1.34 2006/07/18 14:49:13 david__schmidt -# Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) -# with what was really the latest development (the v_3_0_branch branch) -# -# Revision 1.29.2.5 2004/10/05 03:17:26 david__schmidt -# Typo: inspect_jpegs, not inspect-jpegs in form -# -# Revision 1.29.2.4 2004/10/03 12:53:46 david__schmidt -# Add the ability to check jpeg images for invalid -# lengths of comment blocks. Defensive strategy -# against the exploit: -# Microsoft Security Bulletin MS04-028 -# Buffer Overrun in JPEG Processing (GDI+) Could -# Allow Code Execution (833987) -# Enabled with +inspect-jpegs in actions files. -# -# Revision 1.29.2.3 2002/08/23 02:22:53 hal9 -# Fix a perl brain fart with
  • in comments. -# -# Revision 1.29.2.1 2002/08/02 12:51:42 oes -# Added top submit button; Consistency with docs: Change default name for action from hide-referer to hide-referrer -# -# Revision 1.29 2002/05/21 19:10:57 oes -# Fixed JavaScript error -# -# Revision 1.28 2002/05/14 21:36:38 oes -# - Renamed prevent-(setting/reading)-cookies to -# crunch-(incoming/outgoing)-cookies -# - Renamed helplink export to actions-help-prefix -# - Restored alphabetical order of actions -# -# Revision 1.27 2002/04/26 22:55:26 jongfoster -# Removing the alternating colors because they've been wrong -# since the actions renames, they're high maintenance, they -# don't look particularly good, and now there are gaps between -# the table cells we don't need them. -# -# Revision 1.26 2002/04/26 21:55:17 jongfoster -# Cosmetic change: Making the +filter UI look the same as -# the other actions. -# -# Revision 1.25 2002/04/26 21:37:50 jongfoster -# Fixing all(?) the substitutions that were broken in the -# recent actions rename. -# -# Revision 1.24 2002/04/26 18:24:28 jongfoster -# Fixing typos in help hyperlinks -# -# Revision 1.23 2002/04/26 12:57:02 oes -# Actions renamed, alphabetically sorted, comments fixed, and names linked to help -# -# Revision 1.22 2002/04/10 13:32:53 oes -# Made templates modular -# -# Revision 1.21 2002/04/08 17:05:18 oes -# Inline a style exception -# -# Revision 1.20 2002/04/05 16:01:30 oes -# Correct HTML, external Stylesheets, eye candy, some fixes -# -# Revision 1.19 2002/03/26 22:29:56 swa -# we have a new homepage! -# -# Revision 1.18 2002/03/24 16:32:08 jongfoster -# Removing logo option -# -# Revision 1.17 2002/03/24 15:23:33 jongfoster -# Name changes -# -# Revision 1.16 2002/03/24 11:01:06 swa -# name change -# -# Revision 1.15 2002/03/23 16:18:15 swa -# renamed every reference to the old name with foobar. -# fixed "application foobar application" tag, fixed -# "the foobar" with "foobar". left junkbuster in cvs -# comments and remarks to history untouched. should -# make final rename easier. -# -# Revision 1.14 2002/03/16 15:22:19 jongfoster -# Moving 'alpha' warning to the end of the page -# -# Revision 1.13 2002/03/16 14:28:38 jongfoster -# First version of modular filters support -# -# Revision 1.12 2002/03/12 01:42:50 oes -# Introduced modular filters -# -# Revision 1.11 2002/03/08 18:19:14 jongfoster -# Adding +image-blocker{pattern} option to edit interface -# -# Revision 1.10 2002/03/03 10:29:12 swa -# point users to the right feedback forms, -# not necessarily the developer list. -# -# Revision 1.9 2002/01/23 00:26:45 jongfoster -# Reducing length of URLs -# Where encoded and unencoded versions of a string existed, removing -# the unencoded one. -# -# Revision 1.8 2002/01/17 21:33:00 jongfoster -# Replacing all references to the URL of the config interface -# with @default-cgi@ -# -# Revision 1.7 2002/01/17 21:21:03 jongfoster -# DOS->Unix line endings -# -# Revision 1.6 2001/11/22 21:58:41 jongfoster -# Adding action +no-cookies-keep -# -# Revision 1.5 2001/11/13 21:12:17 jongfoster -# Added support for the following actions: -# +downgrade, +limit-connect, +no-compression -# -# Revision 1.4 2001/11/13 00:58:18 jongfoster -# New version of actions file editor templates -# -# ############################################################################## # -# Browser support for the JavaScript on this page: -# MS Internet Explorer 5.5 - Tested, Yes -# Netscape 6.0 - Tested, Yes -# Netscape 4.75 - Tested, NO -# Opera 5.12 - Tested, NO -# MS Internet Explorer 4+ - Untested, Yes -# MS IE 3.x, NS3.x - Untested, NO -# Mozilla >=0.6 - Untested, Yes -# -# All browsers should work, you just might not get the pretty DHTML effects. -# -# The effects that only work under the browsers marked "Yes" above are: -# - Text edit boxes that won't have any effect are disabled. -# - Table rows containing additional settings are hidden if the feature in -# question is disabled. -# -# There are major kludges to get around these problems with NS4, but they -# screw up the HTML too much for other browsers. If anyone wants to try, -# here's some descriptions of the kludges: -# http://www.webreference.com/js/tips/991114.html -# http://www.webreference.com/dhtml/column12/outDisplay.html -# -# If you're favorite browser isn't listed, please test and add it. -# -# -############################################################################# -# # Standard support: # # This file currently produces valid HTML 4.01 Strict. @@ -273,7 +39,7 @@ # If you change it, please save the generated page from your web browser # and then upload it to http://validator.w3.org/ for checking. # -############################################################################# +############################################################################## # # Available variables include: # @@ -296,7 +62,7 @@ # image-blocker-param-custom # # -############################################################################# +############################################################################## @@ -585,7 +351,7 @@ function show_limit_connect_opts(tf) id="change_x_forwarded_for_mode_block" @change-x-forwarded-for-param-block@>

  • in comments. -# -# Revision 1.26 2002/05/23 23:37:25 oes -# Nit -# -# Revision 1.25 2002/05/21 21:02:52 oes -# Added more help links -# -# Revision 1.24 2002/05/21 19:11:40 oes -# - Added client-side JavaScript versions of edit and add URL forms -# - Moved jump targets to before container table cell -# - Let earu determine the jump target when removing URLs via JS -# - Fixed broken help link -# -# Revision 1.23 2002/05/12 15:53:10 jongfoster -# Restoring CVS log information accidentally removed in -# my previous commit. -# -# Revision 1.22 2002/05/12 15:45:33 jongfoster -# Applying [Patch 552094] New templates for edit-actions-list -# This cleans up the templates by: -# - Removing the (confusing) alternating color scheme. -# - Making everything left-justified. -# -# Revision 1.21 2002/05/03 22:58:15 jongfoster -# Fixing link target in all URLs section -# -# Revision 1.20 2002/04/26 12:57:18 oes -# - Central "button" link style in cgi-style.css -# - Help links now dynamic -# -# Revision 1.19 2002/04/24 02:19:16 oes -# - Show name of actions file being edited -# - Show context sensitive help -# - Add buttons for easy changing of defaults -# - Cosmetics and clarifications -# -# Revision 1.18 2002/04/18 19:21:09 jongfoster -# Added code to detect "conventional" action files, that start -# with a set of actions for all URLs (the pattern "/"). -# These are special-cased in the "edit-actions-list" CGI, so -# that a special UI can be written for them. -# -# Revision 1.17 2002/04/10 13:32:53 oes -# Made templates modular -# -# Revision 1.16 2002/04/08 17:08:14 oes -# Cosmetic: make status in title lowercase -# -# Revision 1.15 2002/04/05 16:01:32 oes -# Correct HTML, external Stylesheets, eye candy, some fixes -# -# Revision 1.14 2002/03/26 22:29:56 swa -# we have a new homepage! -# -# Revision 1.13 2002/03/24 15:23:33 jongfoster -# Name changes -# -# Revision 1.12 2002/03/24 11:01:06 swa -# name change -# -# Revision 1.11 2002/03/23 16:18:15 swa -# renamed every reference to the old name with foobar. -# fixed "application foobar application" tag, fixed -# "the foobar" with "foobar". left junkbuster in cvs -# comments and remarks to history untouched. should -# make final rename easier. -# -# Revision 1.10 2002/03/16 15:22:19 jongfoster -# Moving 'alpha' warning to the end of the page -# -# Revision 1.9 2002/03/05 00:24:51 jongfoster -# Patch to always edit the current actions file. -# -# Revision 1.8 2002/03/03 10:29:12 swa -# point users to the right feedback forms, -# not necessarily the developer list. -# -# Revision 1.7 2002/01/23 00:26:45 jongfoster -# Reducing length of URLs -# Where encoded and unencoded versions of a string existed, removing -# the unencoded one. -# -# Revision 1.6 2002/01/17 21:33:00 jongfoster -# Replacing all references to the URL of the config interface -# with @default-cgi@ -# -# Revision 1.5 2002/01/17 21:21:05 jongfoster -# DOS->Unix line endings -# -# Revision 1.4 2001/11/13 00:58:18 jongfoster -# New version of actions file editor templates -# -# ############################################################################## # # Browser support for the CSS on this page: @@ -269,7 +136,7 @@ function e_p(link,pattern,curtext) if ((newtext=window.prompt("Edit the pattern to your needs:", unescape(curtext))) != null) { if (newtext != "") - { link.href="edit-actions-url?f=@f@&v=@v@&p="+pattern+"&u="+escape(newtext); } + { link.href="edit-actions-url?f=@f@&v=@v@&p="+pattern+"&u="+encodeURIComponent(newtext); } else { link.href="edit-actions-remove-url?f=@f@&v=@v@&p="+pattern; } return true; @@ -281,7 +148,7 @@ function a_p(link,section) { if (((newtext=window.prompt("Enter the new pattern:", "")) != null ) && (newtext != "")) { - link.href="edit-actions-add-url?f=@f@&v=@v@&s="+section+"&u="+escape(newtext); + link.href="edit-actions-add-url?f=@f@&v=@v@&s="+section+"&u="+encodeURIComponent(newtext); return true; } return false; @@ -316,7 +183,7 @@ function a_p(link,section)

    What is all this?

    - If you haven't already done so, it is strongly recommended that you at + If you haven't already done so, it is strongly recommended that you at least skim the chapter on actions files in the User Manual before making any changes. You will also find a comprehensive list of @@ -334,7 +201,7 @@ function a_p(link,section)

    This is the default action file. Updates for it are available from - Privoxy.org from time to time. + Privoxy.org from time to time. It is therefore not recommended that you add your private rules here, since they will be lost if you install an update in the future. Put your rules in a separate actions file, like user.action instead. diff --git a/external/privoxy/templates/edit-actions-list-button b/external/privoxy/templates/edit-actions-list-button index fd0e8b97..c009f60d 100644 --- a/external/privoxy/templates/edit-actions-list-button +++ b/external/privoxy/templates/edit-actions-list-button @@ -3,7 +3,7 @@ # File : $Source: /cvsroot/ijbswa/current/templates/edit-actions-list-button,v $ # # Purpose : Template which forms part of edit-actions-list -# +# # # Copyright : Written by and Copyright (C) 2001 the SourceForge # Privoxy team. http://www.privoxy.org/ @@ -11,7 +11,7 @@ # Original Author: Copyright (C) 2001 Jonathan Foster # http://www.jon-foster.co.uk/ # -# This program is free software; you can redistribute it +# This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General # Public License as published by the Free Software # Foundation; either version 2 of the License, or (at @@ -29,21 +29,5 @@ # or write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# Revisions : -# $Log: edit-actions-list-button,v $ -# Revision 1.3 2002/05/12 15:53:10 jongfoster -# Restoring CVS log information accidentally removed in -# my previous commit. -# -# Revision 1.2 2002/05/12 15:45:33 jongfoster -# Applying [Patch 552094] New templates for edit-actions-list -# This cleans up the templates by: -# - Removing the (confusing) alternating color scheme. -# - Making everything left-justified. -# -# Revision 1.1 2002/05/03 23:00:38 jongfoster -# Support for templates for "standard actions" buttons. -# See bug #549871 -# #############################################################################   Set to @button-name@ diff --git a/external/privoxy/templates/edit-actions-list-section b/external/privoxy/templates/edit-actions-list-section index c8578ad0..40e30cbf 100644 --- a/external/privoxy/templates/edit-actions-list-section +++ b/external/privoxy/templates/edit-actions-list-section @@ -3,7 +3,7 @@ # File : $Source: /cvsroot/ijbswa/current/templates/edit-actions-list-section,v $ # # Purpose : Template which forms part of edit-actions-list -# +# # # Copyright : Written by and Copyright (C) 2001 the SourceForge # Privoxy team. http://www.privoxy.org/ @@ -11,7 +11,7 @@ # Original Author: Copyright (C) 2001 Jonathan Foster # http://www.jon-foster.co.uk/ # -# This program is free software; you can redistribute it +# This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General # Public License as published by the Free Software # Foundation; either version 2 of the License, or (at @@ -29,64 +29,6 @@ # or write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# Revisions : -# $Log: edit-actions-list-section,v $ -# Revision 1.16 2006/07/18 14:49:13 david__schmidt -# Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) -# with what was really the latest development (the v_3_0_branch branch) -# -# Revision 1.15.2.1 2003/12/17 16:35:17 oes -# Work around new & silly MSIE behaviour where the request resulting from -# changing window.location.href doesn't reveal the referrer anymore -# -# Revision 1.15 2002/05/21 21:02:52 oes -# Added more help links -# -# Revision 1.14 2002/05/21 19:12:43 oes -# - Added client-side JavaScript versions of edit and add URL forms -# - Moved jump targets to before container table cell -# -# Revision 1.13 2002/05/12 15:45:33 jongfoster -# Applying [Patch 552094] New templates for edit-actions-list -# This cleans up the templates by: -# - Removing the (confusing) alternating color scheme. -# - Making everything left-justified. -# -# Revision 1.12 2002/04/26 12:58:11 oes -# Central "button" link style in cgi-style.css -# -# Revision 1.11 2002/04/24 02:14:03 oes -# Changed shortcuts, Cosmetics -# -# Revision 1.10 2002/04/17 21:27:26 jongfoster -# Adding #linenumber to the URLs which affect blocks, to make -# editing in long files easier. -# -# Revision 1.9 2002/04/17 15:51:47 oes -# Args! Restoring CVS history -# -# Revision 1.8 2002/04/17 15:04:16 oes -# Adapted to style change -# -# Revision 1.7 2002/03/26 22:29:56 swa -# we have a new homepage! -# -# Revision 1.6 2002/03/24 11:01:06 swa -# name change -# -# Revision 1.5 2002/01/23 00:26:45 jongfoster -# Reducing length of URLs -# Where encoded and unencoded versions of a string existed, removing -# the unencoded one. -# -# Revision 1.4 2002/01/17 21:33:00 jongfoster -# Replacing all references to the URL of the config interface -# with @default-cgi@ -# -# Revision 1.3 2001/11/13 00:58:18 jongfoster -# New version of actions file editor templates -# -# ############################################################################# # # Available variables include: diff --git a/external/privoxy/templates/edit-actions-list-url b/external/privoxy/templates/edit-actions-list-url index 08c1ea47..ba026b53 100644 --- a/external/privoxy/templates/edit-actions-list-url +++ b/external/privoxy/templates/edit-actions-list-url @@ -3,7 +3,7 @@ # File : $Source: /cvsroot/ijbswa/current/templates/edit-actions-list-url,v $ # # Purpose : Template which forms part of edit-actions-list -# +# # # Copyright : Written by and Copyright (C) 2001 the SourceForge # Privoxy team. http://www.privoxy.org/ @@ -11,7 +11,7 @@ # Original Author: Copyright (C) 2001 Jonathan Foster # http://www.jon-foster.co.uk/ # -# This program is free software; you can redistribute it +# This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General # Public License as published by the Free Software # Foundation; either version 2 of the License, or (at @@ -29,47 +29,6 @@ # or write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# Revisions : -# $Log: edit-actions-list-url,v $ -# Revision 1.11 2006/07/18 14:49:14 david__schmidt -# Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) -# with what was really the latest development (the v_3_0_branch branch) -# -# Revision 1.10.2.1 2003/12/17 16:35:17 oes -# Work around new & silly MSIE behaviour where the request resulting from -# changing window.location.href doesn't reveal the referrer anymore -# -# Revision 1.10 2002/05/21 19:13:14 oes -# Added client-side JavaScript versions of edit and add URL forms -# -# Revision 1.9 2002/05/12 15:45:33 jongfoster -# Applying [Patch 552094] New templates for edit-actions-list -# This cleans up the templates by: -# - Removing the (confusing) alternating color scheme. -# - Making everything left-justified. -# -# Revision 1.8 2002/04/26 12:58:11 oes -# Central "button" link style in cgi-style.css -# -# Revision 1.7 2002/03/26 22:29:56 swa -# we have a new homepage! -# -# Revision 1.6 2002/03/24 11:01:06 swa -# name change -# -# Revision 1.5 2002/01/23 00:26:45 jongfoster -# Reducing length of URLs -# Where encoded and unencoded versions of a string existed, removing -# the unencoded one. -# -# Revision 1.4 2002/01/17 21:33:00 jongfoster -# Replacing all references to the URL of the config interface -# with @default-cgi@ -# -# Revision 1.3 2001/11/13 00:58:18 jongfoster -# New version of actions file editor templates -# -# ############################################################################# # # Available variables include: diff --git a/external/privoxy/templates/edit-actions-remove-url-form b/external/privoxy/templates/edit-actions-remove-url-form index 17b9b22a..f653a060 100644 --- a/external/privoxy/templates/edit-actions-remove-url-form +++ b/external/privoxy/templates/edit-actions-remove-url-form @@ -5,7 +5,7 @@ # Purpose : Template used to confirm removal of a particular URL # pattern from an actions file. Only used on browsers that # don't support JavaScript. -# +# # # Copyright : Written by and Copyright (C) 2001 the SourceForge # Privoxy team. http://www.privoxy.org/ @@ -13,7 +13,7 @@ # Original Author: Copyright (C) 2001 Jonathan Foster # http://www.jon-foster.co.uk/ # -# This program is free software; you can redistribute it +# This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General # Public License as published by the Free Software # Foundation; either version 2 of the License, or (at @@ -31,70 +31,6 @@ # or write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# Revisions : -# $Log: edit-actions-remove-url-form,v $ -# Revision 1.17 2007/01/23 16:03:16 fabiankeil -# - Add favicon links. -# - Remove useless W3C validator links. -# -# Revision 1.16 2006/07/18 14:49:14 david__schmidt -# Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) -# with what was really the latest development (the v_3_0_branch branch) -# -# Revision 1.14.2.2 2002/08/23 02:22:53 hal9 -# Fix a perl brain fart with

  • in comments. -# -# Revision 1.14 2002/05/21 19:13:49 oes -# Added button style and jumptargets to "add" and "cancel" links -# -# Revision 1.13 2002/04/10 13:32:53 oes -# Made templates modular -# -# Revision 1.12 2002/04/08 17:08:14 oes -# Cosmetic: make status in title lowercase -# -# Revision 1.11 2002/04/05 16:01:30 oes -# Correct HTML, external Stylesheets, eye candy, some fixes -# -# Revision 1.10 2002/03/26 22:29:56 swa -# we have a new homepage! -# -# Revision 1.9 2002/03/24 15:23:33 jongfoster -# Name changes -# -# Revision 1.8 2002/03/24 11:01:06 swa -# name change -# -# Revision 1.7 2002/03/23 16:18:15 swa -# renamed every reference to the old name with foobar. -# fixed "application foobar application" tag, fixed -# "the foobar" with "foobar". left junkbuster in cvs -# comments and remarks to history untouched. should -# make final rename easier. -# -# Revision 1.6 2002/03/16 15:22:19 jongfoster -# Moving 'alpha' warning to the end of the page -# -# Revision 1.5 2002/03/03 10:29:12 swa -# point users to the right feedback forms, -# not necessarily the developer list. -# -# Revision 1.4 2002/01/23 00:26:45 jongfoster -# Reducing length of URLs -# Where encoded and unencoded versions of a string existed, removing -# the unencoded one. -# -# Revision 1.3 2002/01/17 21:33:00 jongfoster -# Replacing all references to the URL of the config interface -# with @default-cgi@ -# -# Revision 1.2 2002/01/17 21:21:05 jongfoster -# DOS->Unix line endings -# -# Revision 1.1 2001/11/13 00:58:18 jongfoster -# New version of actions file editor templates -# -# ############################################################################## # # Standard support: diff --git a/external/privoxy/templates/edit-actions-url-form b/external/privoxy/templates/edit-actions-url-form index 0b91035b..c94492dc 100644 --- a/external/privoxy/templates/edit-actions-url-form +++ b/external/privoxy/templates/edit-actions-url-form @@ -11,7 +11,7 @@ # Original Author: Copyright (C) 2001 Jonathan Foster # http://www.jon-foster.co.uk/ # -# This program is free software; you can redistribute it +# This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General # Public License as published by the Free Software # Foundation; either version 2 of the License, or (at @@ -29,75 +29,6 @@ # or write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# Revisions : -# $Log: edit-actions-url-form,v $ -# Revision 1.18 2007/12/08 14:38:55 fabiankeil -# - Use the shiny new CSS "pattern" class. -# - s@URL Pattern@URL or TAG Pattern@ -# - Use the standard favicon as this ain't no error page. -# -# Revision 1.17 2007/01/23 16:03:16 fabiankeil -# - Add favicon links. -# - Remove useless W3C validator links. -# -# Revision 1.16 2006/07/18 14:49:14 david__schmidt -# Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) -# with what was really the latest development (the v_3_0_branch branch) -# -# Revision 1.14.2.2 2002/08/23 02:22:53 hal9 -# Fix a perl brain fart with
  • in comments. -# -# Revision 1.14 2002/05/21 19:14:10 oes -# Added button style and jumptarget "cancel" link -# -# Revision 1.13 2002/04/10 13:32:53 oes -# Made templates modular -# -# Revision 1.12 2002/04/08 17:08:14 oes -# Cosmetic: make status in title lowercase -# -# Revision 1.11 2002/04/05 16:01:32 oes -# Correct HTML, external Stylesheets, eye candy, some fixes -# -# Revision 1.10 2002/03/26 22:29:56 swa -# we have a new homepage! -# -# Revision 1.9 2002/03/24 15:23:33 jongfoster -# Name changes -# -# Revision 1.8 2002/03/24 11:01:06 swa -# name change -# -# Revision 1.7 2002/03/23 16:18:15 swa -# renamed every reference to the old name with foobar. -# fixed "application foobar application" tag, fixed -# "the foobar" with "foobar". left junkbuster in cvs -# comments and remarks to history untouched. should -# make final rename easier. -# -# Revision 1.6 2002/03/16 15:22:19 jongfoster -# Moving 'alpha' warning to the end of the page -# -# Revision 1.5 2002/03/03 10:29:13 swa -# point users to the right feedback forms, -# not necessarily the developer list. -# -# Revision 1.4 2002/01/23 00:26:45 jongfoster -# Reducing length of URLs -# Where encoded and unencoded versions of a string existed, removing -# the unencoded one. -# -# Revision 1.3 2002/01/17 21:33:00 jongfoster -# Replacing all references to the URL of the config interface -# with @default-cgi@ -# -# Revision 1.2 2002/01/17 21:21:05 jongfoster -# DOS->Unix line endings -# -# Revision 1.1 2001/11/13 00:58:18 jongfoster -# New version of actions file editor templates -# -# ############################################################################## # # Standard support: diff --git a/external/privoxy/templates/forwarding-failed b/external/privoxy/templates/forwarding-failed index fca5c8cf..d555470b 100644 --- a/external/privoxy/templates/forwarding-failed +++ b/external/privoxy/templates/forwarding-failed @@ -8,7 +8,7 @@ # # Template files are written in plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -99,7 +99,7 @@ 503 - + #include mod-title diff --git a/external/privoxy/templates/mod-local-help b/external/privoxy/templates/mod-local-help index 21d65963..60b0737a 100644 --- a/external/privoxy/templates/mod-local-help +++ b/external/privoxy/templates/mod-local-help @@ -1,11 +1,11 @@

    Local Privoxy support:

    -

    You can consult the online documentation for more information about this Privoxy installation.

    +

    You can consult the online documentation for more information about this Privoxy installation.

    -

    Address e-mail questions about this service to +

    Address e-mail questions about this Privoxy installation to @admin-address@, who will be glad to help you.

    diff --git a/external/privoxy/templates/mod-support-and-service b/external/privoxy/templates/mod-support-and-service index 9868761b..fde47b12 100644 --- a/external/privoxy/templates/mod-support-and-service +++ b/external/privoxy/templates/mod-support-and-service @@ -4,30 +4,17 @@ # # Purpose : Template that is included from most of Privoxy's CGI pages # to show the user how to get help or report problems. -# # -# Copyright : Written by and Copyright (C) 2002-2007 members of -# the SourceForge Privoxy team. http://www.privoxy.org/ # -# This template is free software; you can redistribute it +# Copyright : Written by and Copyright (C) 2002-2009 members of +# the Privoxy team. http://www.privoxy.org/ +# +# This template is free software; you can redistribute it # and/or modify it under the terms of the GNU General # Public License as published by the Free Software # Foundation; either version 2 of the License, or (at # your option) any later version. # -# Revisions : -# $Log: mod-support-and-service,v $ -# Revision 1.11 2008/01/02 18:06:58 fabiankeil -# Instead of linking to the "Contacting the developers ..." section -# in the FAQ, use the one from the User Manual. The latter can be -# delivered by Privoxy and thus possibly loads faster. -# -# Revision 1.10 2007/03/17 11:31:36 fabiankeil -# - Add revision log and copyright header. -# - Reword instructions and link to the FAQ -# in an attempt to reduce the number of -# incomplete reports. -# ##############################################################################

    Support and Service:

    @@ -59,3 +46,8 @@ to make sure your request contains all the information we need.

  • +

    + If you want to support the Privoxy Team, please have a look at the FAQ to learn how to + participate + or to donate. +

    diff --git a/external/privoxy/templates/no-such-domain b/external/privoxy/templates/no-such-domain index 08cf5dab..cae2c735 100644 --- a/external/privoxy/templates/no-such-domain +++ b/external/privoxy/templates/no-such-domain @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -96,7 +96,7 @@ 404 - + #include mod-title @@ -151,7 +151,7 @@ - + diff --git a/external/privoxy/templates/show-request b/external/privoxy/templates/show-request index 30a25292..be8536aa 100644 --- a/external/privoxy/templates/show-request +++ b/external/privoxy/templates/show-request @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -111,7 +111,7 @@

    Here you see the original headers that your client sent when requesting this page, along with the headers that Privoxy would have sent to the remote server if this request hadn't been - intercepted. + intercepted.

    Original Client Request:

    diff --git a/external/privoxy/templates/show-status b/external/privoxy/templates/show-status index f71e2de1..ece4d11c 100644 --- a/external/privoxy/templates/show-status +++ b/external/privoxy/templates/show-status @@ -7,7 +7,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -22,7 +22,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -47,7 +47,7 @@ # # redirect-url: # The URL to a script that will redirect to the Privoxy -# documentation for a given item +# documentation for a given item # invocation: # The command line with which Privoxy was invoked # options: @@ -60,7 +60,7 @@ # A HTML-formatted list of all conditional #defines used when # Privoxy was compiled # -# +# # CONDITIONAL SYMBOLS FOR THIS TEMPLATE AND THEIR DEPANDANT SYMBOLS: # ------------------------------------------------------------------ # @@ -200,11 +200,17 @@ @requests-blocked@ out of @requests-received@ requests have been blocked, which equals a block rate of @percent-blocked@%. +

    +

    + Note that the statistics currently don't work properly for + reused connections where only the last request gets counted. + You may want to look into Privoxy-Log-Parser's --statistics option, + which doesn't have this limitation. There haven't been any requests so far. -

    +

    @@ -213,9 +219,15 @@

    Conditional #defines:

    - + + + + + + + @@ -229,14 +241,29 @@ @endif-FEATURE_CGI_EDIT_ACTIONS@web-based actions file editor@if-FEATURE_CGI_EDIT_ACTIONS-then@@else-not-FEATURE_CGI_EDIT_ACTIONS@@endif-FEATURE_CGI_EDIT_ACTIONS@. + + + + + + + + + + @@ -258,11 +285,19 @@ + + + + + @@ -299,8 +334,10 @@ - + diff --git a/external/privoxy/templates/show-status-file b/external/privoxy/templates/show-status-file index 4fa9333e..ec03b360 100644 --- a/external/privoxy/templates/show-status-file +++ b/external/privoxy/templates/show-status-file @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -54,7 +54,7 @@ # filepath # The complete filename of the file being shown # -# +# # CONDITIONAL SYMBOLS FOR THIS TEMPLATE AND THEIR DEPANDANT SYMBOLS: # ------------------------------------------------------------------ # @@ -114,7 +114,7 @@
    @contents@
    - + diff --git a/external/privoxy/templates/toggle b/external/privoxy/templates/toggle index 3d63eb11..fa8ea6d0 100644 --- a/external/privoxy/templates/toggle +++ b/external/privoxy/templates/toggle @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -117,7 +117,7 @@ - +
    #define Enabled? Effects when enabled
    FEATURE_ACCEPT_FILTER@if-FEATURE_ACCEPT_FILTER-then@ Yes @else-not-FEATURE_ACCEPT_FILTER@ No @endif-FEATURE_ACCEPT_FILTER@Support for FreeBSD's accf_http(9) which is also available on some other BSDs.
    FEATURE_ACL @if-FEATURE_ACL-then@ Yes @else-not-FEATURE_ACL@ No @endif-FEATURE_ACL@
    FEATURE_COMPRESSION@if-FEATURE_COMPRESSION-then@ Yes @else-not-FEATURE_COMPRESSION@ No @endif-FEATURE_COMPRESSION@ + Allows to compress buffered content before sending it to the client, assuming the client supports it. +
    FEATURE_CONNECTION_KEEP_ALIVE @if-FEATURE_CONNECTION_KEEP_ALIVE-then@ Yes @else-not-FEATURE_CONNECTION_KEEP_ALIVE@ No @endif-FEATURE_CONNECTION_KEEP_ALIVE@ - Allows to reuse outgoing connections if the server supports it. + Allows to send multiple request through the same connections if the server supports it. Requires the keep-alive-timeout config directive to be set.
    FEATURE_CONNECTION_SHARING@if-FEATURE_CONNECTION_SHARING-then@ Yes @else-not-FEATURE_CONNECTION_SHARING@ No @endif-FEATURE_CONNECTION_SHARING@ + Allows to share outgoing connections between incoming connections. + Requires the connection-sharing config directive to be set. +
    FEATURE_FAST_REDIRECTS @if-FEATURE_FAST_REDIRECTS-then@ Yes @else-not-FEATURE_FAST_REDIRECTS@ No @endif-FEATURE_FAST_REDIRECTS@@if-FEATURE_IMAGE_BLOCKING-then@ Yes @else-not-FEATURE_IMAGE_BLOCKING@ No @endif-FEATURE_IMAGE_BLOCKING@ Allows the +handle-as-image action, to send blocked images instead of HTML.
    FEATURE_IPV6_SUPPORT@if-FEATURE_IPV6_SUPPORT-then@ Yes @else-not-FEATURE_IPV6_SUPPORT@ No @endif-FEATURE_IPV6_SUPPORT@ + Allows IPv6 addresses in incoming requests, when resolving domains to + IP addresses and in the configuration files. +
    FEATURE_IMAGE_DETECT_MSIE @if-FEATURE_IMAGE_DETECT_MSIE-then@ Yes @else-not-FEATURE_IMAGE_DETECT_MSIE@ No @endif-FEATURE_IMAGE_DETECT_MSIE@ Enables automatic detection of image and HTML requests from - Microsoft Internet Explorer users, overriding the setting of + Microsoft Internet Explorer users, overriding the setting of +image in the actions file.
    STATIC_PCRE @if-STATIC_PCRE-then@ Yes @else-not-STATIC_PCRE@ No @endif-STATIC_PCRE@Use the supplied statically-linked PCRE library. This is set automatically - by ./configure if you do not have the libpcre installed.Use the supplied statically-linked PCRE library. This is set automatically + by ./configure if you do not have the libpcre installed. + Dynamically linking to an external libpcre is recommended as the internal + one is outdated and lacks various features and bug-fixes you may be interested in.
    STATIC_PCRS

    More Privoxy:

    diff --git a/external/privoxy/templates/show-url-info b/external/privoxy/templates/show-url-info index a5013f5d..ff97c188 100644 --- a/external/privoxy/templates/show-url-info +++ b/external/privoxy/templates/show-url-info @@ -7,7 +7,7 @@ # Copyright : Written by and Copyright (C) 2001-2007 the SourceForge # Privoxy team. http://www.privoxy.org/ # -# This program is free software; you can redistribute it +# This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General # Public License as published by the Free Software # Foundation; either version 2 of the License, or (at @@ -25,61 +25,13 @@ # or write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# Revisions : -# $Log: show-url-info,v $ -# Revision 1.29 2009/01/01 17:36:41 ler762 -# remove non-standard tags -# -# Revision 1.28 2009/01/01 14:51:21 ler762 -# keep the input field and 'go' button on the same line. -# -# Revision 1.27 2008/05/26 17:30:58 fabiankeil -# Provide an OpenSearch Description to access the -# show-url-info page through "search engine plugins". -# -# Revision 1.26 2008/05/05 10:03:06 fabiankeil -# If the provided URL isn't valid, don't show the -# cgi-editor-is-disabled and filters-might-be-ineffective -# sections. -# -# Revision 1.25 2008/04/26 10:34:18 fabiankeil -# If zlib support is unavailable and there are content filters active -# but the prevent-compression action is disabled, include a warning -# on the show-url-info page that compression might prevent filtering. -# -# Revision 1.24 2008/02/10 17:26:52 fabiankeil -# Reduce superfluous white space by not marking -# up the final results list as paragraph. -# -# Revision 1.23 2008/02/01 06:04:31 fabiankeil -# If edit buttons on the show-url-info CGI page are hidden, explain why. -# -# Revision 1.22 2007/12/08 14:29:06 fabiankeil -# Use CSS to let the URL and pattern input fields scale with -# the browser width and try to prevent vertical scroll bars -# if the width is less than 80 characters. Closes #1843596, -# thanks to Gerry Murphy and Lee. -# -# Revision 1.21 2007/11/15 19:11:11 fabiankeil -# Reword HTTPS URL information. -# -# Revision 1.20 2007/07/21 12:19:50 fabiankeil -# If show-url-info is called with an URL that Privoxy -# would reject as invalid, don't show unresolved forwarding -# variables, "final matches" or claim the site's secure. -# -# Revision 1.19 2007/02/10 16:55:22 fabiankeil -# - Show forwarding settings on the show-url-info page -# - Fix some HTML syntax errors. -# -# ######################################################################### # USING HTML TEMPLATES: # --------------------- # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -94,7 +46,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -297,12 +249,12 @@
    -

    Look up the actions for a +

    Look up the actions for a new URL:

    - +

    diff --git a/external/privoxy/templates/show-version b/external/privoxy/templates/show-version index 9bdbbbaa..65efb5a9 100644 --- a/external/privoxy/templates/show-version +++ b/external/privoxy/templates/show-version @@ -7,7 +7,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -22,7 +22,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -48,7 +48,7 @@ # # redirect-url: # The URL to a script that will redirect to the Privoxy -# documentation for a given item +# documentation for a given item # invocation: # The command line with whitch Privoxy was invoked # options: @@ -61,7 +61,7 @@ # A HTML-formatted list of all conditional #defines used when # Privoxy was compiled # -# +# # CONDITIONAL SYMBOLS FOR THIS TEMPLATE AND THEIR DEPANDANT SYMBOLS: # ------------------------------------------------------------------ # @@ -120,8 +120,8 @@

    Source code versions:

    (Note: This information is only relevant if you checked out Privoxy from CVS - and compiled it yourself. If you downloaded a binary, .exe, RPM, or a .tgz file, - then when you ask for support just mention the version number @version@ + and compiled it yourself. If you downloaded a binary, .exe, RPM, or a .tgz file, + then when you ask for support just mention the version number @version@ and the type of download you got.)

    @sourceversions@
    @@ -139,7 +139,7 @@
    #include mod-support-and-service - +

    Bookmarklets

    Here are some bookmarklets to allow you to easily access a - "mini" version of this page. They are known to work with MS + "mini" version of this page. They are known to work with MS Internet Explorer, Netscape and Mozilla, but should work equally well in other browsers which support JavaScript. They are designed to run directly from your bookmarks - not by clicking the @@ -172,7 +172,7 @@

    diff --git a/external/privoxy/templates/toggle-mini b/external/privoxy/templates/toggle-mini index 3b5d5c95..de9ad42d 100644 --- a/external/privoxy/templates/toggle-mini +++ b/external/privoxy/templates/toggle-mini @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -81,7 +81,7 @@

    - Privoxy is + Privoxy is @if-enabled-display-then@enabled@else-not-enabled-display@disabled@endif-enabled-display@.
    @if-enabled-display-then@[Disable]@else-not-enabled-display@[Enable]@endif-enabled-display@ | diff --git a/external/privoxy/templates/untrusted b/external/privoxy/templates/untrusted index bd4015a6..7bde7c57 100644 --- a/external/privoxy/templates/untrusted +++ b/external/privoxy/templates/untrusted @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -78,7 +78,7 @@ # force-support: # Privoxy has been compiled with support for forced loading # of blocked content. In that case, the symbol "force-prefix" is -# avaiable, which translates to the FORCE_PREFIX +# avaiable, which translates to the FORCE_PREFIX # have-trust-info: # There were URLs with info on the trust policy defined in the config # file. In this case the list of URLs is available through the @@ -107,9 +107,9 @@ UNTRUSTED - + #include mod-title - + @@ -184,7 +184,7 @@ - + diff --git a/external/privoxy/tools/privoxy-log-parser.pl b/external/privoxy/tools/privoxy-log-parser.pl index 29839a4a..027c5624 100755 --- a/external/privoxy/tools/privoxy-log-parser.pl +++ b/external/privoxy/tools/privoxy-log-parser.pl @@ -8,7 +8,7 @@ # # http://www.fabiankeil.de/sourcecode/privoxy-log-parser/ # -# $Id: privoxy-log-parser.pl,v 1.23 2009/03/14 15:31:58 fabiankeil Exp $ +# $Id: privoxy-log-parser.pl,v 1.124 2011/11/13 16:54:10 fabiankeil Exp $ # # TODO: # - LOG_LEVEL_CGI, LOG_LEVEL_ERROR, LOG_LEVEL_WRITE content highlighting @@ -23,8 +23,9 @@ # - Handle incomplete input without Perl warning about undefined variables. # - Use generic highlighting function that takes a regex and the # hash key as input. +# - Add --compress and --decompress options. # -# Copyright (c) 2007-2009 Fabian Keil +# Copyright (c) 2007-2010 Fabian Keil # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -44,7 +45,7 @@ use warnings; use Getopt::Long; use constant { - PRIVOXY_LOG_PARSER_VERSION => '0.5', + PRIVOXY_LOG_PARSER_VERSION => '0.7', # Feel free to mess with these ... DEFAULT_BACKGROUND => 'black', # Choose registered colour (like 'black') DEFAULT_TEXT_COLOUR => 'white', # Choose registered colour (like 'black') @@ -56,10 +57,13 @@ use constant { CLI_OPTION_NO_EMBEDDED_CSS => 0, CLI_OPTION_NO_MSECS => 0, CLI_OPTION_NO_SYNTAX_HIGHLIGHTING => 0, - CLI_OPTION_ERROR_LOG_FILE => '/var/log/privoxy-log.log', + CLI_OPTION_SHORTEN_THREAD_IDS => 0, CLI_OPTION_SHOW_INEFFECTIVE_FILTERS => 0, CLI_OPTION_ACCEPT_UNKNOWN_MESSAGES => 0, - CLI_OPTION_STATISTIC => 0, + CLI_OPTION_STATISTICS => 0, + CLI_OPTION_UNBREAK_LINES_ONLY => 0, + CLI_OPTION_URL_STATISTICS_THRESHOLD => 0, + CLI_OPTION_HOST_STATISTICS_THRESHOLD => 0, SUPPRESS_SUCCEEDED_FILTER_ADDITIONS => 1, SHOW_SCAN_INTRO => 0, @@ -80,22 +84,45 @@ use constant { PUNISH_MISSING_HIGHLIGHT_KNOWLEDGE_WITH_DEATH => 1, LOG_UNPARSED_LINES_TO_EXTRA_FILE => 0, + ERROR_LOG_FILE => '/var/log/privoxy-log-parser', # You better leave these alone unless you know what you're doing. COLOUR_RESET => "\033[0;0m", ESCAPE => "\033[", }; +# For performance reasons, these are global. + +my $t; +my %req; # request data from previous lines +my %h; +my %thread_colours; +my @all_colours; +my @time_colours; +my $thread_colour_index = 0; +my $header_colour_index = 0; +my $time_colour_index = 0; +my %header_colours; +my $no_special_header_highlighting; +my %reason_colours; +my %h_colours; +my $header_highlight_regex = ''; + +my $html_output_mode; +my $no_msecs_mode; # XXX: should probably be removed +my $shorten_thread_ids; +my $line_end; + sub prepare_our_stuff () { # Syntax Higlight hash - our @all_colours = ( + @all_colours = ( 'red', 'green', 'brown', 'blue', 'purple', 'cyan', 'light_gray', 'light_red', 'light_green', 'yellow', 'light_blue', 'pink', 'light_cyan', 'white' ); - our %h = ( + %h = ( # LOG_LEVEL Info => 'blue', Header => 'green', @@ -111,6 +138,7 @@ sub prepare_our_stuff () { 'Gif-Deanimate' => 'blue', Force => 'red', Writing => 'light_green', + Received => 'yellow', # ---------------------- URL => 'yellow', path => 'brown', @@ -151,12 +179,13 @@ sub prepare_our_stuff () { 'action-bits-update' => 'light_red', 'configuration-line' => 'red', 'content-type' => 'yellow', + 'HOST' => HEADER_DEFAULT_COLOUR, ); - our %h_colours = %h; + %h_colours = %h; # Header colours need their own hash so the keys can be accessed properly - our %header_colours = ( + %header_colours = ( # Prefilled with headers that should not appear with default header colours Cookie => 'light_red', 'Set-Cookie' => 'light_red', @@ -165,11 +194,11 @@ sub prepare_our_stuff () { ); # Crunch reasons need their own hash as well - our %reason_colours = ( + %reason_colours = ( 'Unsupported HTTP feature' => 'light_red', Blocked => 'light_red', Untrusted => 'light_red', - Redirected => 'green', + Redirected => 'green', 'CGI Call' => 'white', 'DNS failure' => 'red', 'Forwarding failed' => 'light_red', @@ -178,7 +207,7 @@ sub prepare_our_stuff () { 'No reason recorded' => 'light_red', ); - our @time_colours = ('white', 'light_gray'); + @time_colours = ('white', 'light_gray'); # Translate highlight strings into highlight code prepare_highlight_hash(\%header_colours); @@ -187,6 +216,8 @@ sub prepare_our_stuff () { prepare_colour_array(\@all_colours); prepare_colour_array(\@time_colours); init_css_colours(); + + init_stats(); } sub paint_it ($) { @@ -201,13 +232,13 @@ sub paint_it ($) { return "" if cli_option_is_set('no-syntax-highlighting'); my %light = ( - black => 0, - red => 0, - green => 0, - brown => 0, - blue => 0, - purple => 0, - cyan => 0, + black => 0, + red => 0, + green => 0, + brown => 0, + blue => 0, + purple => 0, + cyan => 0, light_gray => 0, gray => 0, dark_gray => 1, @@ -221,13 +252,13 @@ sub paint_it ($) { ); my %text = ( - black => 30, - red => 31, - green => 32, - brown => 33, - blue => 34, - purple => 35, - cyan => 36, + black => 30, + red => 31, + green => 32, + brown => 33, + blue => 34, + purple => 35, + cyan => 36, gray => 37, light_gray => 37, dark_gray => 30, @@ -250,9 +281,9 @@ sub paint_it ($) { $colour_code .= ";"; $colour_code .= $light{$colour} ? "1" : "2"; $colour_code .= ";"; - $colour_code .= $bg_code; + $colour_code .= $bg_code; $colour_code .= "m"; - debug_message $colour . " is \'" . $colour_code . $colour . $default . "\'" if DEBUG_PAINT_IT; + debug_message $colour . " is \'" . $colour_code . $colour . $default . "\'" if DEBUG_PAINT_IT; } elsif ($colour =~ /reset/) { @@ -260,7 +291,7 @@ sub paint_it ($) { } else { - die "What's $colour supposed to mean?\n"; + die "What's $colour supposed to mean?\n"; } return $colour_code; @@ -304,13 +335,13 @@ sub get_html_title () { sub init_css_colours() { our %css_colours = ( - black => "000", - red => "F00", - green => "0F0", - brown => "C90", - blue => "0F0", - purple => "F06", # XXX: wrong - cyan => "F09", # XXX: wrong + black => "000", + red => "F00", + green => "0F0", + brown => "C90", + blue => "0F0", + purple => "F06", # XXX: wrong + cyan => "F09", # XXX: wrong light_gray => "999", gray => "333", dark_gray => "222", @@ -329,38 +360,34 @@ sub get_css_colour ($) { our %css_colours; my $colour = shift; - die "What's $colour supposed to mean?\n" unless defined($css_colours{$colour}); + die "What's $colour supposed to mean?\n" unless defined($css_colours{$colour}); return '#' . $css_colours{$colour}; } sub get_css_line ($) { - our %h_colours; - my $class = shift; my $css_line; $css_line .= '.' . lc($class) . ' {'; # XXX: lc() shouldn't be necessary - die "What's $class supposed to mean?\n" unless defined($h_colours{$class}); + die "What's $class supposed to mean?\n" unless defined($h_colours{$class}); $css_line .= 'color:' . get_css_colour($h_colours{$class}) . ';'; $css_line .= 'background-color:' . get_css_colour(DEFAULT_BACKGROUND) . ';'; - $css_line .= '}' . "\n"; + $css_line .= '}' . "\n"; return $css_line; } sub get_css_line_for_colour ($) { - our %h_colours; - my $colour = shift; my $css_line; $css_line .= '.' . lc($colour) . ' {'; # XXX: lc() shouldn't be necessary $css_line .= 'color:' . get_css_colour($colour) . ';'; $css_line .= 'background-color:' . get_css_colour(DEFAULT_BACKGROUND) . ';'; - $css_line .= '}' . "\n"; + $css_line .= '}' . "\n"; return $css_line; } @@ -370,17 +397,16 @@ sub get_missing_css_lines () { my $css_line; - $css_line .= '.' . 'default' . ' {'; # XXX: lc() shouldn't be necessary + $css_line .= '.' . 'default' . ' {'; $css_line .= 'color:' . HEADER_DEFAULT_COLOUR . ';'; $css_line .= 'background-color:' . get_css_colour(DEFAULT_BACKGROUND) . ';'; - $css_line .= '}' . "\n"; + $css_line .= '}' . "\n"; return $css_line; } sub get_css () { - our %h_colours; our %css_colours; #XXX: Wrong solution my $css = ''; @@ -388,8 +414,8 @@ sub get_css () { $css .= '.privoxy-log {'; $css .= 'color:' . get_css_colour(DEFAULT_TEXT_COLOUR) . ';'; $css .= 'background-color:' . get_css_colour(DEFAULT_BACKGROUND) . ';'; - $css .= '}' . "\n"; - + $css .= '}' . "\n"; + foreach my $key (keys %h_colours) { next if ($h_colours{$key} =~ m/reset/); #XXX: Wrong solution. @@ -439,12 +465,7 @@ sub print_outro () { } sub get_line_end () { - - my $line_end = "\n"; - - $line_end = '
    ' . $line_end if cli_option_is_set('html-output'); - - return $line_end; + return cli_option_is_set('html-output') ? "
    \n" : "\n"; } sub get_colour_html_markup ($) { @@ -485,17 +506,17 @@ sub set_background ($){ my $colour = shift; our $bg_code; my %backgrounds = ( - black => "40", - red => "41", - green => "42", - brown => "43", - blue => "44", - magenta => "45", + black => "40", + red => "41", + green => "42", + brown => "43", + blue => "44", + magenta => "45", cyan => "46", - white => "47", - default => "49", + white => "47", + default => "49", ); - + if (defined($backgrounds{$colour})) { $bg_code = $backgrounds{$colour}; } else { @@ -510,36 +531,20 @@ sub get_background (){ sub prepare_highlight_hash ($) { my $ref = shift; - if (!cli_option_is_set('html-output')) { - - foreach my $key (keys %$ref) { - $$ref{$key} = paint_it($$ref{$key}); - } - - } else { - - foreach my $key (keys %$ref) { - $$ref{$key} = get_semantic_html_markup($key); - } - - } + foreach my $key (keys %$ref) { + $$ref{$key} = $html_output_mode ? + get_semantic_html_markup($key) : + paint_it($$ref{$key}); + } } sub prepare_colour_array ($) { my $ref = shift; - if (!cli_option_is_set('html-output')) { - - foreach my $i (0 ... @$ref - 1) { - $$ref[$i] = paint_it($$ref[$i]); - } - - } else { - - foreach my $i (0 ... @$ref - 1) { - $$ref[$i] = get_colour_html_markup($$ref[$i]); - } - + foreach my $i (0 ... @$ref - 1) { + $$ref[$i] = $html_output_mode ? + get_colour_html_markup($$ref[$i]) : + paint_it($$ref[$i]); } } @@ -548,9 +553,6 @@ sub found_unknown_content ($) { my $unknown = shift; my $message; - our %req; - our $t; - return if cli_option_is_set('accept-unknown-messages'); return if ($unknown =~ /\[too long, truncated\]$/); @@ -570,27 +572,25 @@ sub log_parse_error ($) { my $message = shift; if (LOG_UNPARSED_LINES_TO_EXTRA_FILE) { - open(ERRORLOG, ">>" . ERROR_LOG_FILE) || die "Writing " . ERROR_LOG_FILE . " failed"; - print ERRORLOG $message; - close(ERRORLOG); + open(my $errorlog_fd, ">>" . ERROR_LOG_FILE) || die "Writing " . ERROR_LOG_FILE . " failed"; + print $errorlog_fd $message; + close($errorlog_fd); } } sub debug_message (@) { my @message = @_; - our %h; print $h{'debug'} . "@message" . $h{'Standard'} . "\n"; } ################################################################################ -# highlighter functions that aren't loglevel-specific +# highlighter functions that aren't loglevel-specific ################################################################################ sub h ($) { # Get highlight marker - our %h; my $highlight = shift; # XXX: Stupid name; my $result = ''; my $message; @@ -606,23 +606,20 @@ sub h ($) { log_parser_error($message); die "Unworthy highlighter function" if PUNISH_MISSING_HIGHLIGHT_KNOWLEDGE_WITH_DEATH; } - + return $result; } sub highlight_known_headers ($) { my $content = shift; - our %header_colours; - our %h; - my $headers = join ('|', keys %header_colours); debug_message("Searching $content for things to highlight.") if DEBUG_HEADER_HIGHLIGHTING; - if ($content =~ m/(?<=\s)($headers):/) { + if ($content =~ m/(?<=\s)($header_highlight_regex):/) { my $header = $1; $content =~ s@(?<=[\s|'])($header)(?=:)@$header_colours{$header}$1$h{'Standard'}@ig; - debug_message("Highlighted $content") if DEBUG_HEADER_HIGHLIGHTING; + debug_message("Highlighted '$header' in '$content'") if DEBUG_HEADER_HIGHLIGHTING; } return $content; @@ -642,7 +639,6 @@ sub highlight_request_line ($) { my $rl = shift; my ($method, $url, $http_version); - our %h; #GET http://images.sourceforge.net/sfx/icon_warning.gif HTTP/1.1 if ($rl =~ m/Invalid request/) { @@ -724,11 +720,10 @@ sub highlight_matched_url ($$) { sub highlight_matched_host ($$) { - my $result = shift; # XXX: Stupid name; - my $regex = shift; + my ($result, $regex) = @_; # XXX: result ist stupid name; if ($result =~ m@(.*?)($regex)(.*)@) { - $result = $1 . h('host') . $2 . h('Standard') . $3; + $result = $1 . $h{host} . $2 . $h{Standard} . $3; } return $result; @@ -736,7 +731,6 @@ sub highlight_matched_host ($$) { sub highlight_matched_pattern ($$$) { - our %h; my $result = shift; # XXX: Stupid name; my $key = shift; my $regex = shift; @@ -766,7 +760,7 @@ sub highlight_url ($) { my $url = shift; - if (cli_option_is_set('html-output')) { + if ($html_output_mode) { $url = '' . $url . ''; @@ -779,96 +773,96 @@ sub highlight_url ($) { return $url; } +sub update_header_highlight_regex ($) { + + my $header = shift; + my $headers = join ('|', keys %header_colours); + + $header_highlight_regex = qr/$headers/; + print "Registering '$header'\n" if DEBUG_HEADER_HIGHLIGHTING; +} + ################################################################################ # loglevel-specific highlighter functions ################################################################################ sub handle_loglevel_header ($) { - my $content = shift; - my $c = $content; - our $t; - our %req; - our %h; - our %header_colours; - our @all_colours; - our $header_colour_index; - our $no_special_header_highlighting; + my $c = shift; - # Register new headers - # scan: Accept: image/png,image/*;q=0.8,*/*;q=0.5 - if ($c =~ m/^scan: ((?>[^:]+)):/) { - my $header = $1; - if (!defined($header_colours{$header}) and $header =~ /^[\d\w-]*$/) { - debug_message "Registering previously unknown header $1" if DEBUG_HEADER_REGISTERING; + if ($c =~ /^scan:/) { - if (REGISTER_HEADERS_WITH_THE_SAME_COLOUR) { - $header_colours{$header} = $header_colours{'Default'}; - } else { - $header_colours{$header} = $all_colours[$header_colour_index % @all_colours]; - $header_colour_index++; + if ($c =~ m/^scan: ([^: ]+):/) { + + # Register new headers + # scan: Accept: image/png,image/*;q=0.8,*/*;q=0.5 + my $header = $1; + if (!defined($header_colours{$header}) and $header =~ /^[\d\w-]*$/) { + debug_message "Registering previously unknown header $1" if DEBUG_HEADER_REGISTERING; + + if (REGISTER_HEADERS_WITH_THE_SAME_COLOUR) { + $header_colours{$header} = $header_colours{'Default'}; + } else { + $header_colours{$header} = $all_colours[$header_colour_index % @all_colours]; + $header_colour_index++; + } + update_header_highlight_regex($header); } - } - } - if ($c =~ m/^scan: ((\w*) (.*) (HTTP\/\d\.\d))/) { + } elsif ($c =~ m/^(scan: )(\w+ .+ HTTP\/\d\.\d)/) { - # Client request line - # Save for statistics (XXX: Not implemented yet) - $req{$t}{'method'} = $2; - $req{$t}{'destination'} = $3; - $req{$t}{'http-version'} = $4; + # scan: GET http://p.p/ HTTP/1.1 + $c = $1 . highlight_request_line($2); - $content = highlight_request_line($1); + } elsif ($c =~ m/^(scan: )((?:HTTP\/\d\.\d|ICY) (\d+) (.*))/) { - } elsif ($c =~ m/^(scan: )((?:HTTP\/\d\.\d|ICY) (\d+) (.*))/) { - - # Server response line + # scan: HTTP/1.1 200 OK $req{$t}{'response_line'} = $2; $req{$t}{'status_code'} = $3; $req{$t}{'status_message'} = $4; - $content = $1 . highlight_response_line($req{$t}{'response_line'}); + $c = $1 . highlight_response_line($req{$t}{'response_line'}); + } } elsif ($c =~ m/^Crunching (?:server|client) header: .* \(contains: ([^\)]*)\)/) { # Crunching server header: Set-Cookie: trac_form_token=d5308c34e16d15e9e301a456; (contains: Cookie:) - $content =~ s@(?<=contains: )($1)@$h{'crunch-pattern'}$1$h{'Standard'}@; - $content =~ s@(Crunching)@$h{$1}$1$h{'Standard'}@; + $c =~ s@(?<=contains: )($1)@$h{'crunch-pattern'}$1$h{'Standard'}@; + $c =~ s@(Crunching)@$h{$1}$1$h{'Standard'}@; } elsif ($c =~ m/^New host is: ([^\s]*)\./) { - # New host is: trac.vidalia-project.net. Crunching Referer: http://www.vidalia-project.net/ - $c = highlight_matched_host($c, '(?<=New host is: )[^\s]+'); - $content = highlight_matched_url($c, '(?<=Crunching Referer: )[^\s]+'); + # New host is: trac.vidalia-project.net. Crunching Referer: http://www.vidalia-project.net/! + $c = highlight_matched_host($c, '(?<=New host is: )[^\s]+(?=\.)'); + $c = highlight_matched_url($c, '(?<=Crunching Referer: )[^\s!]+'); } elsif ($c =~ m/^Text mode enabled by force. (Take cover)!/) { # Text mode enabled by force. Take cover! - $content =~ s@($1)@$h{'warning'}$1$h{'Standard'}@; + $c =~ s@($1)@$h{'warning'}$1$h{'Standard'}@; } elsif ($c =~ m/^(New HTTP Request-Line: )(.*)/) { # New HTTP Request-Line: GET http://www.privoxy.org/ HTTP/1.1 - $content = $1 . highlight_request_line($2); + $c = $1 . highlight_request_line($2); } elsif ($c =~ m/^Adjust(ed)? Content-Length to \d+/) { # Adjusted Content-Length to 2132 # Adjust Content-Length to 33533 - $content =~ s@(?<=Content-Length to )(\d+)@$h{'Number'}$1$h{'Standard'}@; - $content = highlight_known_headers($content); + $c =~ s@(?<=Content-Length to )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $c = highlight_known_headers($c); } elsif ($c =~ m/^Destination extracted from "Host:" header. New request URL:/) { # Destination extracted from "Host:" header. New request URL: http://www.cccmz.de/~ridcully/blog/ - $content = highlight_matched_url($content, '(?<=New request URL: ).*'); + $c = highlight_matched_url($c, '(?<=New request URL: ).*'); } elsif ($c =~ m/^Couldn\'t parse:/) { # XXX: These should probable be logged with LOG_LEVEL_ERROR # Couldn't parse: If-Modified-Since: Wed, 21 Mar 2007 16:34:50 GMT (crunching!) # Couldn't parse: at, 24 Mar 2007 13:46:21 GMT in If-Modified-Since: Sat, 24 Mar 2007 13:46:21 GMT (crunching!) - $content =~ s@^(Couldn\'t parse)@$h{'error'}$1$h{'Standard'}@; + $c =~ s@^(Couldn\'t parse)@$h{'error'}$1$h{'Standard'}@; } elsif ($c =~ /^Tagger \'([^\']*)\' added tag \'([^\']*)\'/ or $c =~ m/^Adding tag \'([^\']*)\' created by header tagger \'([^\']*)\'/) { @@ -879,9 +873,9 @@ sub handle_loglevel_header ($) { # XXX: Save tag and tagger - $content =~ s@(?<=^Tagger \')([^\']*)@$h{'tagger'}$1$h{'Standard'}@; - $content =~ s@(?<=added tag \')([^\']*)@$h{'tag'}$1$h{'Standard'}@; - $content =~ s@(?<=Action bits )(updated)@$h{'action-bits-update'}$1$h{'Standard'}@; + $c =~ s@(?<=^Tagger \')([^\']*)@$h{'tagger'}$1$h{'Standard'}@; + $c =~ s@(?<=added tag \')([^\']*)@$h{'tag'}$1$h{'Standard'}@; + $c =~ s@(?<=Action bits )(updated)@$h{'action-bits-update'}$1$h{'Standard'}@; $no_special_header_highlighting = 1; } elsif ($c =~ /^Tagger \'([^\']*)\' didn['']t add tag \'([^\']*)\'/) { @@ -889,8 +883,8 @@ sub handle_loglevel_header ($) { # Tagger 'revalidation' didn't add tag 'REVALIDATION-REQUEST'. Tag already present # XXX: Save tag and tagger - $content =~ s@(?<=^Tagger \')([^\']*)@$h{'tag'}$1$h{'Standard'}@; - $content =~ s@(?<=didn['']t add tag \')([^\']*)@$h{'tagger'}$1$h{'Standard'}@; + $c =~ s@(?<=^Tagger \')([^\']*)@$h{'tag'}$1$h{'Standard'}@; + $c =~ s@(?<=didn['']t add tag \')([^\']*)@$h{'tagger'}$1$h{'Standard'}@; } elsif ($c =~ m/^(?:scan:|Randomiz|addh:|Adding:|Removing:|Referer:|Modified:|Accept-Language header|[Cc]ookie)/ or $c =~ m/^(Text mode is already enabled|Denied request with NULL byte|Replaced:|add-unique:)/ @@ -912,6 +906,14 @@ sub handle_loglevel_header ($) { or $c =~ m/^Converting tab to space in / or $c =~ m/A HTTP\/1\.1 response without/ or $c =~ m/Disabled filter mode on behalf of the client/ + or $c =~ m/Keeping the (?:server|client) header / + or $c =~ m/Content modified with no Content-Length header set/ + or $c =~ m/^Appended client IP address to/ + or $c =~ m/^Removing 'Connection: close' to imply keep-alive./ + or $c =~ m/^keep-alive support is disabled/ + or $c =~ m/^Continue hack in da house/ + or $c =~ m/^Merged multiple header lines to:/ + or $c =~ m/^Added header: / ) { # XXX: Some of these may need highlighting @@ -950,6 +952,16 @@ sub handle_loglevel_header ($) { # this again is not' # A HTTP/1.1 response without Connection header implies keep-alive. # Disabled filter mode on behalf of the client. + # Keeping the server header 'Connection: keep-alive' around. + # Keeping the client header 'Connection: close' around. The connection will not be kept alive. + # Keeping the client header 'Connection: keep-alive' around. The connection will be kept alive if possible. + # Content modified with no Content-Length header set. Creating a fake one for adjustment later on. + # Appended client IP address to X-Forwarded-For: 10.0.0.2, 10.0.0.1 + # Removing 'Connection: close' to imply keep-alive. + # keep-alive support is disabled. Crunching: Keep-Alive: 300. + # Continue hack in da house. + # Merged multiple header lines to: 'X-FORWARDED-PROTO: http X-HOST: 127.0.0.1' + # Added header: Content-Encoding: deflate } elsif ($c =~ m/^scanning headers for:/) { @@ -959,21 +971,21 @@ sub handle_loglevel_header ($) { # crunched User-Agent! # Crunching: Content-Encoding: gzip - $content =~ s@(Crunching|crunched)@$h{$1}$1$h{'Standard'}@; + $c =~ s@(Crunching|crunched)@$h{$1}$1$h{'Standard'}@; } elsif ($c =~ m/^Offending request data with NULL bytes turned into \'°\' characters:/) { - + # Offending request data with NULL bytes turned into '°' characters: °°n°°(°°° - $content = h('warning') . $content . h('Standard'); - + $c = h('warning') . $c . h('Standard'); + } elsif ($c =~ m/^(Transforming \")(.*?)(\" to \")(.*?)(\")/) { # Transforming "Proxy-Authenticate: Basic realm="Correos Proxy Server"" to\ # "Proxy-Authenticate: Basic realm="Correos Proxy Server"" - $content =~ s@(?<=^Transforming \")(.*)(?=\" to)@$h{'Header'}$1$h{'Standard'}@; - $content =~ s@(?<=to \")(.*)(?=\")@$h{'Header'}$1$h{'Standard'}@; + $c =~ s@(?<=^Transforming \")(.*)(?=\" to)@$h{'Header'}$1$h{'Standard'}@; + $c =~ s@(?<=to \")(.*)(?=\")@$h{'Header'}$1$h{'Standard'}@; } elsif ($c =~ m/^Removing empty header/) { @@ -985,19 +997,40 @@ sub handle_loglevel_header ($) { # Content-Type: application/octet-stream not replaced. It doesn't look like text.\ # Enable force-text-mode if you know what you're doing. # XXX: Could highlight more here. - $content =~ s@(?<=^Content-Type: )(.*)(?= not replaced)@$h{'content-type'}$1$h{'Standard'}@; + $c =~ s@(?<=^Content-Type: )(.*)(?= not replaced)@$h{'content-type'}$1$h{'Standard'}@; + + } elsif ($c =~ m/^(Server|Client) keep-alive timeout is/) { + + # Server keep-alive timeout is 5. Sticking with 10. + # Client keep-alive timeout is 20. Sticking with 10. + + $c =~ s@(?<=timeout is )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $c =~ s@(?<=Sticking with )(\d+)@$h{'Number'}$1$h{'Standard'}@; + + } elsif ($c =~ m/^Reducing keep-alive timeout/) { + + # Reducing keep-alive timeout from 60 to 10. + + $c =~ s@(?<= from )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $c =~ s@(?<= to )(\d+)@$h{'Number'}$1$h{'Standard'}@; + + } elsif ($c =~ m/^Killed all-caps Host header line: HOST:/) { + + # Killed all-caps Host header line: HOST: bestproxydb.com + $c = highlight_matched_host($c, '(?<=HOST: )[^\s]+'); + $c = highlight_matched_pattern($c, 'HOST', 'HOST'); } else { - found_unknown_content($content); + found_unknown_content($c); } - # Highlight headers + # Highlight headers unless ($c =~ m/^Transforming/) { - $content = highlight_known_headers($content) unless $no_special_header_highlighting; + $c = highlight_known_headers($c) unless $no_special_header_highlighting; } - return $content; + return $c; } sub handle_loglevel_re_filter ($) { @@ -1005,14 +1038,39 @@ sub handle_loglevel_re_filter ($) { my $content = shift; my $c = $content; my $key; - our $t; - our %req; - our %h; - our %header_colours; - our @all_colours; - our $header_colour_index; - if ($c =~ /\.{3}$/ + if ($c =~ m/^(?:re_)?filtering ([^\s]+) \(size (\d+)\) with (?:filter )?\'?([^\s]+?)\'? produced (\d+) hits \(new size (\d+)\)/) { + + # XXX: only the second version gets highlighted properly. + # re_filtering www.lfk.de/favicon.ico (size 209) with filter untrackable-hulk produced 0 hits (new size 209). + # filtering aci.blogg.de/ (size 37988) with 'blogg.de' produced 3 hits (new size 38057) + $req{$t}{'content_source'} = $1; + $req{$t}{'content_size'} = $2; + $req{$t}{'content_filter'} = $3; + $req{$t}{'content_hits'} = $4; + $req{$t}{'new_content_size'} = $5; + $req{$t}{'content_size_change'} = $req{$t}{'new_content_size'} - $req{$t}{'content_size'}; + #return '' if ($req{$t}{'content_hits'} == 0 && !cli_option_is_set('show-ineffective-filters')); + if ($req{$t}{'content_hits'} == 0 and + not (cli_option_is_set('show-ineffective-filters') + or ($req{$t}{'content_filter'} =~ m/^privoxy-filter-test$/))) { + return ''; + } + + $c =~ s@(?<=\(size )(\d+)\)(?= with)@$h{'Number'}$1$h{'Standard'}@; + $c =~ s@(?<=\(new size )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $c =~ s@(?<=produced )(\d+)(?= hits)@$h{'Number'}$1$h{'Standard'}@; + + $c =~ s@([^\s]+?)(\'? produced)@$h{'filter'}$1$h{'Standard'}$2@; + $c = highlight_matched_host($c, '(?<=filtering )[^\s]+'); + + $c =~ s@\.$@ @; + $c .= "(" . $h{'Number'}; + $c .= "+" if ($req{$t}{'content_size_change'} >= 0); + $c .= $req{$t}{'content_size_change'} . $h{'Standard'} . ")"; + $content = $c; + + } elsif ($c =~ /\.{3}$/ and $c =~ m/^(?:re_)?filtering \'?(.*?)\'? \(size (\d*)\) with (?:filter )?\'?([^\s]*?)\'? ?\.{3}$/) { # Used by Privoxy 3.0.5 and 3.0.6: @@ -1028,7 +1086,7 @@ sub handle_loglevel_re_filter ($) { $req{$t}{'header_filter_name'} =~ m/^privoxy-filter-test$/) { return ''; } - $content =~ s@(?<=\(size )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $content =~ s@(?<=\(size )(\d+)@$h{'Number'}$1$h{'Standard'}@; $content =~ s@($req{$t}{'header_filter_name'})@$h{'filter'}$1$h{'Standard'}@; } elsif ($c =~ m/^ ?\.\.\. ?produced (\d*) hits \(new size (\d*)\)\./) { @@ -1046,7 +1104,7 @@ sub handle_loglevel_re_filter ($) { if ($req{$t}{'header_filter_hits'} == 0 and not (defined($req{$t}{'header_filter_name'}) and $req{$t}{'header_filter_name'} =~ m/^privoxy-filter-test$/)) { - return ''; + return ''; } # Reformat including information from the intro $c = "'" . h('filter') . $req{$t}{'header_filter_name'} . h('Standard') . "'"; @@ -1071,7 +1129,7 @@ sub handle_loglevel_re_filter ($) { } # Highlight from last line (XXX: What?) - # $c =~ s@(?<=produced )(\d+)@$h{'Number'}$1$h{'Standard'}@; + # $c =~ s@(?<=produced )(\d+)@$h{'Number'}$1$h{'Standard'}@; # $c =~ s@($req{$t}{'header_filter_name'})@$h{'filter'}$1$h{'Standard'}@; } else { @@ -1090,37 +1148,6 @@ sub handle_loglevel_re_filter ($) { $content =~ s@(?<=$1 )([^\s]*)@$h{'filter'}$1$h{'Standard'}@; - } elsif ($c =~ m/^(?:re_)?filtering ([^\s]+) \(size (\d+)\) with (?:filter )?\'?([^\s]+?)\'? produced (\d+) hits \(new size (\d+)\)/) { - - # XXX: only the second version gets highlighted properly. - # re_filtering www.lfk.de/favicon.ico (size 209) with filter untrackable-hulk produced 0 hits (new size 209). - # filtering aci.blogg.de/ (size 37988) with 'blogg.de' produced 3 hits (new size 38057) - $req{$t}{'content_source'} = $1; - $req{$t}{'content_size'} = $2; - $req{$t}{'content_filter'} = $3; - $req{$t}{'content_hits'} = $4; - $req{$t}{'new_content_size'} = $5; - $req{$t}{'content_size_change'} = $req{$t}{'new_content_size'} - $req{$t}{'content_size'}; - #return '' if ($req{$t}{'content_hits'} == 0 && !cli_option_is_set('show-ineffective-filters')); - if ($req{$t}{'content_hits'} == 0 and - not (cli_option_is_set('show-ineffective-filters') - or ($req{$t}{'content_filter'} =~ m/^privoxy-filter-test$/))) { - return ''; - } - - $c =~ s@(?<=\(size )(\d+)\)(?= with)@$h{'Number'}$1$h{'Standard'}@; - $c =~ s@(?<=\(new size )(\d+)@$h{'Number'}$1$h{'Standard'}@; - $c =~ s@(?<=produced )(\d+)(?= hits)@$h{'Number'}$1$h{'Standard'}@; - - $c =~ s@([^\s]+?)(\'? produced)@$h{'filter'}$1$h{'Standard'}$2@; - $c = highlight_matched_host($c, '(?<=filtering )[^\s]+'); - - $c =~ s@\.$@ @; - $c .= "(" . $h{'Number'}; - $c .= "+" if ($req{$t}{'content_size_change'} >= 0); - $c .= $req{$t}{'content_size_change'} . $h{'Standard'} . ")"; - $content = $c; - } elsif ($c =~ m/^De-chunking successful. Shrunk from (\d+) to (\d+)/) { $req{$t}{'chunked-size'} = $1; @@ -1168,6 +1195,13 @@ sub handle_loglevel_re_filter ($) { # Adding dynamic re_filter job s@^(?:\w*)\s+.*\s+HTTP/\d\.\d\s*@IP-ADDRESS: $origin@D\ # to filter client-ip-address succeeded. + } elsif ($c =~ m/^Compressed content from /) { + + # Compressed content from 29258 to 8630 bytes. Compression level: 3 + $content =~ s@(?<=from )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $content =~ s@(?<=to )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $content =~ s@(?<=level: )(\d+)@$h{'Number'}$1$h{'Standard'}@; + } elsif ($c =~ m/^Reading in filter/) { return '' unless SHOW_FILTER_READIN_IN; @@ -1184,9 +1218,6 @@ sub handle_loglevel_re_filter ($) { sub handle_loglevel_redirect ($) { my $c = shift; - our $t; - our %req; - our %h; if ($c =~ m/^Decoding "([^""]*)"/) { @@ -1204,13 +1235,11 @@ sub handle_loglevel_redirect ($) { $c = highlight_matched_path($c, '(?<=Checking ")[^"]*'); $c =~ s@\"@@g; - } elsif ($c =~ m/^pcrs command "([^""]*)" changed "([^""]*)" to "([^""]*)" \((\d+) hits?\)/) { + } elsif ($c =~ m/^pcrs command "([^""]*)" changed /) { - # pcrs command "s@&from=rss@@" changed "http://it.slashdot.org/article.pl?sid=07/03/02/1657247&from=rss"\ + # pcrs command "s@&from=rss@@" changed \ + # "http://it.slashdot.org/article.pl?sid=07/03/02/1657247&from=rss"\ # to "http://it.slashdot.org/article.pl?sid=07/03/02/1657247" (1 hit). - - my ($pcrs_command, $url_before, $url_after, $hits) = ($1, $2, $3, $4); # XXX: save these? - $c =~ s@(?<=pcrs command )"([^""]*)"@$h{'filter'}$1$h{'Standard'}@; $c = highlight_matched_url($c, '(?<=changed ")[^""]*'); $c =~ s@(?<=changed )"([^""]*)"@$1@; # Remove quotes @@ -1218,6 +1247,13 @@ sub handle_loglevel_redirect ($) { $c =~ s@(?<=to )"([^""]*)"@$1@; # Remove quotes $c =~ s@(\d+)(?= hits?)@$h{'hits'}$1$h{'Standard'}@; + } elsif ($c =~ m/^pcrs command "([^""]*)" didn\'t change/) { + + # pcrs command "s@^http://([^.]+?)/?$@http://www.bing.com/search?q=$1@" didn't \ + # change "http://www.example.org/". + $c =~ s@(?<=pcrs command )"([^""]*)"@$h{'filter'}$1$h{'Standard'}@; + $c = highlight_matched_url($c, '(?<=change ")[^""]*'); + } elsif ($c =~ m/(^New URL is: )(.*)/) { # New URL is: http://it.slashdot.org/article.pl?sid=07/03/04/1511210 @@ -1231,6 +1267,11 @@ sub handle_loglevel_redirect ($) { # XXX: assume the same? $c = highlight_matched_url($c, '(?<=assuming that \")[^"]*'); + } elsif ($c =~ m/^Percent-encoding redirect/) { + + # Percent-encoding redirect URL: http://www.example.org/\x02 + $c = highlight_matched_url($c, '(?<=redirect URL: ).*'); + } else { found_unknown_content($c); @@ -1243,9 +1284,6 @@ sub handle_loglevel_redirect ($) { sub handle_loglevel_gif_deanimate ($) { my $content = shift; - our $t; - our %req; - our %h; if ($content =~ m/Success! GIF shrunk from (\d+) bytes to (\d+)\./) { @@ -1265,7 +1303,7 @@ sub handle_loglevel_gif_deanimate ($) { } elsif ($content =~ m/^failed! \(gif parsing\)/) { # failed! (gif parsing) - # XXX: Replace this error message with something less stupid + # XXX: Replace this error message with something less stupid $content =~ s@(failed!)@$h{'error'}$1$h{'Standard'}@; } elsif ($content =~ m/^Need to de-chunk first/) { @@ -1276,7 +1314,7 @@ sub handle_loglevel_gif_deanimate ($) { } elsif ($content =~ m/^(?:No GIF header found|failed while parsing)/) { # No GIF header found (XXX: Did I ever commit this?) - # failed while parsing 195 134747048 (XXX: never commited) + # failed while parsing 195 134747048 (XXX: never committed) # Ignore these for now @@ -1292,10 +1330,6 @@ sub handle_loglevel_gif_deanimate ($) { sub handle_loglevel_request ($) { my $content = shift; - our $t; - our %req; - our %h; - our %reason_colours; if ($content =~ m/crunch! /) { @@ -1324,15 +1358,13 @@ sub handle_loglevel_request ($) { found_unknown_content($content); } - + return $content; } sub handle_loglevel_crunch ($) { my $content = shift; - our %h; - our %reason_colours; # Highlight crunch reason foreach my $reason (keys %reason_colours) { @@ -1357,9 +1389,6 @@ sub handle_loglevel_crunch ($) { sub handle_loglevel_connect ($) { my $c = shift; - our $t; - our %req; - our %h; if ($c =~ m/^via [^\s]+ to: [^\s]+/) { @@ -1376,9 +1405,10 @@ sub handle_loglevel_connect ($) { $c =~ s@(?<=failed: )(.*)@$h{'error'}$1$h{'Standard'}@; - } elsif ($c =~ m/^to ([^\s]*) successful$/) { + } elsif ($c =~ m/^to ([^\s]*)( successful)?$/) { # Connect: to www.nzherald.co.nz successful + # Connect: to archiv.radiotux.de return '' if SUPPRESS_SUCCESSFUL_CONNECTIONS; $c = highlight_matched_host($c, '(?<=to )[^\s]+'); @@ -1440,7 +1470,7 @@ sub handle_loglevel_connect ($) { $c = highlight_matched_host($c, '(?<=from )[^\s]+'); # XXX: not an URL } elsif ($c =~ m/^socks5_connect:/) { - + $c =~ s@(?<=socks5_connect: )(.*)@$h{'error'}$1$h{'Standard'}@; } elsif ($c =~ m/^Created new connection to/) { @@ -1449,12 +1479,18 @@ sub handle_loglevel_connect ($) { $c = highlight_matched_host($c, '(?<=connection to )[^\s]+'); $c =~ s@(?<=on socket )(\d+)@$h{'Number'}$1$h{'Standard'}@; - } elsif ($c =~ m/^^Found reusable socket/) { + } elsif ($c =~ m/^Found reusable socket/) { # Found reusable socket 9 for www.privoxy.org:80 in slot 0. + # 3.0.15 and later: + # Found reusable socket 8 for www.privoxy.org:80 in slot 2.\ + # Timestamp made 0 seconds ago. Timeout: 1. Latency: 0. $c =~ s@(?<=Found reusable socket )(\d+)@$h{'Number'}$1$h{'Standard'}@; $c = highlight_matched_host($c, '(?<=for )[^\s]+'); $c =~ s@(?<=in slot )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $c =~ s@(?<=made )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $c =~ s@(?<=Timeout: )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $c =~ s@(?<=Latency: )(\d+)@$h{'Number'}$1$h{'Standard'}@; } elsif ($c =~ m/^Marking open socket/) { @@ -1472,6 +1508,7 @@ sub handle_loglevel_connect ($) { # Remembering socket 13 for www.privoxy.org:80 in slot 0. # Forgetting socket 38 for www.privoxy.org:80 in slot 5. + $c =~ s@(?<=socket )(\d+)@$h{'Number'}$1$h{'Standard'}@; $c = highlight_matched_host($c, '(?<=for )[^\s]+'); $c =~ s@(?<=in slot )(\d+)@$h{'Number'}$1$h{'Standard'}@; @@ -1484,13 +1521,22 @@ sub handle_loglevel_connect ($) { } elsif ($c =~ m/^The connection to/) { # The connection to www.privoxy.org:80 in slot 6 timed out. Closing socket 19. Timeout is: 61. + # 3.0.15 and later: + # The connection to 1.bp.blogspot.com:80 in slot 0 timed out. Closing socket 5.\ + # Timeout is: 1. Assumed latency: 4. # The connection to 10.0.0.1:80 in slot 0 is no longer usable. Closing socket 4. $c = highlight_matched_host($c, '(?<=connection to )[^\s]+'); $c =~ s@(?<=in slot )(\d+)@$h{'Number'}$1$h{'Standard'}@; $c =~ s@(?<=Closing socket )(\d+)@$h{'Number'}$1$h{'Standard'}@; $c =~ s@(?<=Timeout is: )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $c =~ s@(?<=Assumed latency: )(\d+)@$h{'Number'}$1$h{'Standard'}@; - } elsif ($c =~ m/^Waiting for/) { + } elsif ($c =~ m/^Stopped waiting for the request line./) { + + # Stopped waiting for the request line. Timeout: 121. + $c =~ s@(?<=Timeout: )(\d+)@$h{'Number'}$1$h{'Standard'}@; + + } elsif ($c =~ m/^Waiting for \d/) { # Waiting for 1 connections to timeout. $c =~ s@(?<=^Waiting for )(\d+)@$h{'Number'}$1$h{'Standard'}@; @@ -1504,9 +1550,14 @@ sub handle_loglevel_connect ($) { # Done reading from server. Expected content length: 24892. \ # Actual content length: 24892. Most recently received: 4412. - $c =~ s@(?<=Expected content length: )(\d+)@$h{'Number'}$1$h{'Standard'}@; - $c =~ s@(?<=Actual content length: )(\d+)@$h{'Number'}$1$h{'Standard'}@; + # 3.0.15 and later: + # Done reading from server. Expected content length: 24892. \ + # Actual content length: 24892. Bytes most recently read: 4412. + # Done reading from server. Content length: 6018 as expected. \ + # Bytes most recently read: 294. + $c =~ s@(?<=ontent length: )(\d+)@$h{'Number'}$1$h{'Standard'}@g; $c =~ s@(?<=received: )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $c =~ s@(?<=read: )(\d+)@$h{'Number'}$1$h{'Standard'}@; } elsif ($c =~ m/^Continuing buffering headers/) { @@ -1514,6 +1565,9 @@ sub handle_loglevel_connect ($) { $c =~ s@(?<=byte_count: )(\d+)@$h{'Number'}$1$h{'Standard'}@; $c =~ s@(?<=header_offset: )(\d+)@$h{'Number'}$1$h{'Standard'}@; $c =~ s@(?<=len: )(\d+)@$h{'Number'}$1$h{'Standard'}@; + # 3.0.15 and later: + # Continuing buffering headers. Bytes most recently read: %d. + $c =~ s@(?<=read: )(\d+)@$h{'Number'}$1$h{'Standard'}@; } elsif ($c =~ m/^Received \d+ bytes while/) { @@ -1521,27 +1575,126 @@ sub handle_loglevel_connect ($) { $c =~ s@(?<=Received )(\d+)@$h{'Number'}$1$h{'Standard'}@; $c =~ s@(?<=expecting )(\d+)@$h{'Number'}$1$h{'Standard'}@; - } elsif ($c =~ m/^Connection from/) { + } elsif ($c =~ m/^(Rejecting c|C)onnection from/) { # Connection from 81.163.28.218 dropped due to ACL - $c =~ s@(?<=^Connection from )((?:\d+\.?){4})@$h{'Number'}$1$h{'Standard'}@; + # Rejecting connection from 178.63.152.227. Maximum number of connections reached. + $c =~ s@(?<=onnection from )((?:\d+\.?){3}\d+)@$h{'Number'}$1$h{'Standard'}@; - } elsif ($c =~ m/^Looks like we rea/ or + } elsif ($c =~ m/^(?:Reusing|Closing) server socket \d./ or + $c =~ m/^No additional client request/) { + + # Reusing server socket 4. Opened for 10.0.0.1. + # Closing server socket 2. Opened for 10.0.0.1. + # No additional client request received in time. \ + # Closing server socket 4, initially opened for 10.0.0.1. + # No additional client request received in time on socket 29. + + $c =~ s@(?<= socket )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $c = highlight_matched_host($c, '(?<=for )[^\s]+(?=\.$)'); + + } elsif ($c =~ m/^Connected to /) { + + # Connected to tor-jail[10.0.0.2]:9050. + + $c = highlight_matched_host($c, '(?<=\[)[^\]]+'); + $c = highlight_matched_host($c, '(?<=Connected to )[^\[\s]+'); + $c =~ s@(?<=\]:)(\d+)@$h{'Number'}$1$h{'Standard'}@; + + } elsif ($c =~ m/^Could not connect to /) { + + # Could not connect to [10.0.0.1]:80. + + $c = highlight_matched_host($c, '(?<=\[)[^\]]+'); + $c =~ s@(?<=\]:)(\d+)@$h{'Number'}$1$h{'Standard'}@; + + } elsif ($c =~ m/^Waiting for the next client request/ or + $c =~ m/^The connection on server socket/ or + $c =~ m/^Client request arrived in time /) { + + # Waiting for the next client request on socket 3. Keeping the server \ + # socket 12 to a.fsdn.com open. + # The connection on server socket 6 to upload.wikimedia.org isn't reusable. Closing. + # Used by Privoxy 3.0.18 and later: + # Client request arrived in time on socket 21. + # Used by earlier version: + # Client request arrived in time or the client closed the connection on socket 12. + + $c =~ s@(?<=on socket )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $c =~ s@(?<=server socket )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $c = highlight_matched_host($c, '(?<=to )[^\s]+'); + + } elsif ($c =~ m/^Marking the server socket/) { + + # Marking the server socket 7 tainted. + + $c =~ s@(?<=server socket )(\d+)@$h{'Number'}$1$h{'Standard'}@; + + } elsif ($c =~ m/^Reduced expected bytes to /) { + + # Reduced expected bytes to 0 to account for the 1542 ones we already got. + $c =~ s@(?<=bytes to )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $c =~ s@(?<=for the )(\d+)@$h{'Number'}$1$h{'Standard'}@; + + } elsif ($c =~ m/^The client closed socket /) { + + # The client closed socket 2 while the server socket 4 is still open. + $c =~ s@(?<=closed socket )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $c =~ s@(?<=server socket )(\d+)@$h{'Number'}$1$h{'Standard'}@; + + } elsif ($c =~ m/^Expected client content length set /) { + + # Expected client content length set to 667325411 after reading 4999 bytes. + $c =~ s@(?<=set to )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $c =~ s@(?<=reading )(\d+)@$h{'Number'}$1$h{'Standard'}@; + + } elsif ($c =~ m/^Reducing expected bytes to /) { + + # Reducing expected bytes to 0. Marking the server socket tainted after throwing 4 bytes away. + $c =~ s@(?<=bytes to )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $c =~ s@(?<=after throwing )(\d+)@$h{'Number'}$1$h{'Standard'}@; + + } elsif ($c =~ m/^Waiting for up to /) { + + # Waiting for up to 4999 bytes from the client. + $c =~ s@(?<=up to )(\d+)@$h{'Number'}$1$h{'Standard'}@; + + } elsif ($c =~ m/^Looks like we / or $c =~ m/^Unsetting keep-alive flag/ or - $c =~ m/^No connections to wait/) { + $c =~ m/^No connections to wait/ or + $c =~ m/^Complete client request received/ or + $c =~ m/^Possible pipeline attempt detected./ or + $c =~ m/^POST request detected. The connection will not be kept alive./ or + $c =~ m/^The server still wants to talk, but the client hung up on us./ or + $c =~ m/^The server didn't specify how long the connection will stay open/ or + $c =~ m/^There might be a request body. The connection will not be kept alive/ or + $c =~ m/^Stopping to watch the client socket. There's already another request waiting./ or + $c =~ m/^Done reading from the client\.$/) { # Looks like we reached the end of the last chunk. We better stop reading. # Looks like we read the end of the last chunk together with the server \ # headers. We better stop reading. + # Looks like we got the last chunk together with the server headers. \ + # We better stop reading. # Unsetting keep-alive flag. # No connections to wait for left. + # Client request arrived in time or the client closed the connection. + # Complete client request received + # Possible pipeline attempt detected. The connection will not be \ + # kept alive and we will only serve the first request. + # POST request detected. The connection will not be kept alive. + # The server still wants to talk, but the client hung up on us. + # The server didn't specify how long the connection will stay open. Assume it's only a second. + # There might be a request body. The connection will not be kept alive. + # Stopping to watch the client socket. There's already another request waiting. + # Done reading from the client\. } else { found_unknown_content($c); } - + return $c; } @@ -1549,10 +1702,7 @@ sub handle_loglevel_connect ($) { sub handle_loglevel_info ($) { my $c = shift; - our $t; - our %req; - our %h; - + if ($c =~ m/^Rewrite detected:/) { # Rewrite detected: GET http://10.0.0.2:88/blah.txt HTTP/1.1 @@ -1560,12 +1710,15 @@ sub handle_loglevel_info ($) { } elsif ($c =~ m/^Decompress(ing deflated|ion didn)/ or $c =~ m/^Compressed content detected/ or + $c =~ m/^SDCH-compressed content detected/ or $c =~ m/^Tagger/ ) { # Decompressing deflated iob: 117 # Decompression didn't result in any content. # Compressed content detected, content filtering disabled. Consider recompiling Privoxy\ # with zlib support or enable the prevent-compression action. + # SDCH-compressed content detected, content filtering disabled.\ + # Consider suppressing SDCH offers made by the client. # Tagger 'complete-url' created empty tag. Ignored. # Ignored for now @@ -1576,13 +1729,19 @@ sub handle_loglevel_info ($) { # Reloading configuration file '/usr/local/etc/privoxy/config' $c =~ s@(?<=loading configuration file \')([^\']*)@$h{'file'}$1$h{'Standard'}@; + } elsif ($c =~ m/^Loading (actions|filter) file: /) { + + # Loading actions file: /usr/local/etc/privoxy/default.action + # Loading filter file: /usr/local/etc/privoxy/default.filter + $c =~ s@(?<= file: )(.*)$@$h{'file'}$1$h{'Standard'}@; + } elsif ($c =~ m/^exiting by signal/) { - + # exiting by signal 15 .. bye $c =~ s@(?<=exiting by signal )(\d+)@$h{'signal'}$1$h{'Standard'}@; } elsif ($c =~ m/^Privoxy version/) { - + # Privoxy version 3.0.7 $c =~ s@(?<=^Privoxy version )(\d+\.\d+\.\d+)$@$h{'version'}$1$h{'Standard'}@; @@ -1606,12 +1765,15 @@ sub handle_loglevel_info ($) { # Request from 10.0.0.1 denied. limit-connect{,} doesn't allow CONNECT requests to port 443. # Request from 10.0.0.1 marked for blocking. limit-connect{,} doesn't allow CONNECT requests to port 443. + # 3.0.18 and later: + # Request from 10.0.0.1 marked for blocking. limit-connect{0} doesn't allow CONNECT requests to www.example.org:443 # Malformed server response detected. Downgrading to HTTP/1.0 impossible. $c =~ s@(?<=Request from )([^\s]*)@$h{'ip-address'}$1$h{'Standard'}@; $c =~ s@(denied|blocking)@$h{'warning'}$1$h{'Standard'}@; $c =~ s@(CONNECT)@$h{'method'}$1$h{'Standard'}@; $c =~ s@(?<=to port )(\d+)@$h{'port'}$1$h{'Standard'}@; + $c =~ s@(?<=to )([^\s]+)@$h{'request_'}$1$h{'Standard'}@; } elsif ($c =~ m/^Status code/) { @@ -1629,11 +1791,17 @@ sub handle_loglevel_info ($) { $c =~ s@(?<=Needed: )(\d+)@$h{'Number'}$1$h{'Standard'}@; $c =~ s@(?<=Limit: )(\d+)@$h{'Number'}$1$h{'Standard'}@; + } elsif ($c =~ m/^File modification detected: /) { + + # File modification detected: /usr/local/etc/privoxy/user-agent.action + $c =~ s@(?<= detected: )(.*)$@$h{'file'}$1$h{'Standard'}@; + } elsif ($c =~ m/^No logfile configured/ or $c =~ m/^Malformerd HTTP headers detected and MS IIS5 hack enabled/ or $c =~ m/^Invalid \"chunked\" transfer/ or $c =~ m/^Support for/ or - $c =~ m/^Flushing header and buffers/ + $c =~ m/^Flushing header and buffers/ or + $c =~ m/^Can not resolve/ ) { # No logfile configured. Please enable it before reporting any problems. @@ -1644,6 +1812,7 @@ sub handle_loglevel_info ($) { # Support for 'Connection: keep-alive' is experimental, incomplete and\ # known not to work properly in some situations. # Flushing header and buffers. Stepping back from filtering. + # Can not resolve doesnotexist: hostname nor servname provided, or not known } else { @@ -1657,16 +1826,13 @@ sub handle_loglevel_info ($) { sub handle_loglevel_cgi ($) { my $c = shift; - our $t; - our %req; - our %h; if ($c =~ m/^Granting access to/) { - + #Granting access to http://config.privoxy.org/send-stylesheet, referrer http://p.p/ is trustworthy. } elsif ($c =~ m/^Substituting: s(.)/) { - + # Substituting: s/@else-not-FEATURE_ZLIB@.*@endif-FEATURE_ZLIB@//sigTU # XXX: prone to span several lines @@ -1682,18 +1848,15 @@ sub handle_loglevel_cgi ($) { sub handle_loglevel_force ($) { my $c = shift; - our $t; - our %req; - our %h; if ($c =~ m/^Ignored force prefix in request:/) { - + # Ignored force prefix in request: "GET http://10.0.0.1/PRIVOXY-FORCE/block HTTP/1.1" $c =~ s@^(Ignored)@$h{'ignored'}$1$h{'Standard'}@; $c = highlight_matched_request_line($c, '(?<=request: ")[^"]*'); } elsif ($c =~ m/^Enforcing request:/) { - + # Enforcing request: "GET http://10.0.0.1/block HTTP/1.1". $c = highlight_matched_request_line($c, '(?<=request: ")[^"]*'); @@ -1706,10 +1869,248 @@ sub handle_loglevel_force ($) { return $c; } +sub handle_loglevel_error ($) { + + my $c = shift; + + if ($c =~ m/^(?:Empty|No) server or forwarder response received on socket \d+\./) { + + # Empty server or forwarder response received on socket 4. + # Empty server or forwarder response received on socket 3. \ + # Closing client socket 15 without sending data. + # Used by Privoxy 3.0.18 and later: + # No server or forwarder response received on socket 8. \ + # Closing client socket 10 without sending data. + + $c =~ s@(?<=on socket )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $c =~ s@(?<=client socket )(\d+)@$h{'Number'}$1$h{'Standard'}@; + + } elsif ($c =~ m/^Didn't receive data in time:/) { + + # Didn't receive data in time: a.fsdn.com:443 + $c =~ s@(?<=in time: )(.*)@$h{'destination'}$1$h{'Standard'}@; + } + + # XXX: There are probably more messages that deserve highlighting. + + return $c; +} + + sub handle_loglevel_ignore ($) { return shift; } +sub gather_loglevel_request_stats ($$) { + my $c = shift; + my $thread = shift; + our %stats; + + $stats{requests}++; +} + +sub gather_loglevel_crunch_stats ($$) { + my $c = shift; + my $thread = shift; + our %stats; + + $stats{requests}++; + $stats{crunches}++; + + if ($c =~ m/^Redirected:/) { + # Redirected: http://www.example.org/http://p.p/ + $stats{'fast-redirections'}++; + + } elsif ($c =~ m/^Blocked:/) { + # Blocked: blogger.googleusercontent.com:443 + $stats{'blocked'}++; + } +} + + +sub gather_loglevel_error_stats ($$) { + + my $c = shift; + my $thread = shift; + our %stats; + our %thread_data; + + if ($c =~ m/^Empty server or forwarder response received on socket \d+./) { + + # Empty server or forwarder response received on socket 4. + $stats{'empty-responses'}++; + if ($thread_data{$thread}{'new_connection'}) { + $stats{'empty-responses-on-new-connections'}++; + } else { + $stats{'empty-responses-on-reused-connections'}++; + } + } +} + +sub gather_loglevel_connect_stats ($$) { + + my ($c, $thread) = @_; + our %thread_data; + our %stats; + + if ($c =~ m/^via ([^\s]+) to: [^\s]+/) { + + # Connect: via 10.0.0.1:8123 to: www.example.org.noconnect + $thread_data{$thread}{'forwarder'} = $1; # XXX: is this missue? + + } elsif ($c =~ m/^to ([^\s]*)$/) { + + # Connect: to lists.sourceforge.net:443 + + $thread_data{$thread}{'forwarder'} = 'direct connection'; + + } elsif ($c =~ m/^Created new connection to/) { + + # Created new connection to www.privoxy.org:80 on socket 11. + + $thread_data{$thread}{'new_connection'} = 1; + + } elsif ($c =~ m/^Reusing server socket \d./ or + $c =~ m/^Found reusable socket/) { + + # Reusing server socket 4. Opened for 10.0.0.1. + # Found reusable socket 9 for www.privoxy.org:80 in slot 0. + + $thread_data{$thread}{'new_connection'} = 0; + $stats{'reused-connections'}++; + } +} + +sub gather_loglevel_header_stats ($$) { + + my ($c, $thread) = @_; + our %stats; + + if ($c =~ m/^A HTTP\/1\.1 response without/ or + $c =~ m/^Keeping the server header 'Connection: keep-alive' around./) + { + # A HTTP/1.1 response without Connection header implies keep-alive. + # Keeping the server header 'Connection: keep-alive' around. + $stats{'server-keep-alive'}++; + + } elsif ($c =~ m/^scan: ((\w+) (.+) (HTTP\/\d\.\d))/) { + + # scan: HTTP/1.1 200 OK + $stats{'method'}{$2}++; + $stats{'ressource'}{$3}++; + $stats{'http-version'}{$4}++; + + } elsif ($c =~ m/^scan: Host: ([^\s]+)/) { + + # scan: Host: p.p + $stats{'hosts'}{$1}++; + } +} + +sub init_stats () { + our %stats = ( + requests => 0, + crunches => 0, + 'server-keep-alive' => 0, + 'reused-connections' => 0, + 'empty-responses' => 0, + 'empty-responses-on-new-connections' => 0, + 'empty-responses-on-reused-connections' => 0, + 'fast-redirections' => 0, + 'blocked' => 0, + 'reused-connections' => 0, + 'server-keep-alive' => 0, + ); +} + +sub get_percentage ($$) { + my $big = shift; + my $small = shift; + return "NaN" if ($big eq 0); + return sprintf("%.2f%%", $small / $big * 100); +} + +sub print_stats () { + + our %stats; + our %cli_options; + my $new_connections = $stats{requests} - $stats{crunches} - $stats{'reused-connections'}; + my $outgoing_requests = $stats{requests} - $stats{crunches}; + + if ($stats{requests} eq 0) { + print "No requests yet.\n"; + return; + } + + print "Client requests total: " . $stats{requests} . "\n"; + print "Crunches: " . $stats{crunches} . " (" . + get_percentage($stats{requests}, $stats{crunches}) . ")\n"; + print "Blocks: " . $stats{'blocked'} . " (" . + get_percentage($stats{requests}, $stats{'blocked'}) . ")\n"; + print "Fast redirections: " . $stats{'fast-redirections'} . " (" . + get_percentage($stats{requests}, $stats{'fast-redirections'}) . ")\n"; + print "Outgoing requests: " . $outgoing_requests . " (" . + get_percentage($stats{requests}, $outgoing_requests) . ")\n"; + print "Server keep-alive offers: " . $stats{'server-keep-alive'} . " (" . + get_percentage($stats{requests}, $stats{'server-keep-alive'}) . ")\n"; + print "New outgoing connections: " . $new_connections . " (" . + get_percentage($stats{requests}, $new_connections) . ")\n"; + print "Reused connections: " . $stats{'reused-connections'} . " (" . + get_percentage($stats{requests}, $stats{'reused-connections'}) . + "; server offers accepted: " . + get_percentage($stats{'server-keep-alive'}, $stats{'reused-connections'}) . ")\n"; + print "Empty responses: " . $stats{'empty-responses'} . " (" . + get_percentage($stats{requests}, $stats{'empty-responses'}) . ")\n"; + print "Empty responses on new connections: " + . $stats{'empty-responses-on-new-connections'} . " (" . + get_percentage($stats{requests}, $stats{'empty-responses-on-new-connections'}) + . ")\n"; + print "Empty responses on reused connections: " . + $stats{'empty-responses-on-reused-connections'} . " (" . + get_percentage($stats{requests}, $stats{'empty-responses-on-reused-connections'}) . + ")\n"; + + if ($stats{method} eq 0) { + print "No response lines parsed yet yet.\n"; + return; + } + print "Method distribution:\n"; + foreach my $method (sort {$stats{'method'}{$b} <=> $stats{'method'}{$a}} keys %{$stats{'method'}}) { + printf "%8d : %-8s\n", $stats{'method'}{$method}, $method; + } + print "Client HTTP versions:\n"; + foreach my $http_version (sort {$stats{'http-version'}{$b} <=> $stats{'http-version'}{$a}} keys %{$stats{'http-version'}}) { + printf "%d : %s\n", $stats{'http-version'}{$http_version}, $http_version; + } + + if ($cli_options{'url-statistics-threshold'} == 0) { + print "URL statistics are disabled. Increase --url-statistics-threshold to enable them.\n"; + } else { + print "Requested URLs:\n"; + foreach my $ressource (sort {$stats{'ressource'}{$b} <=> $stats{'ressource'}{$a}} keys %{$stats{'ressource'}}) { + if ($stats{'ressource'}{$ressource} < $cli_options{'url-statistics-threshold'}) { + print "Skipped statistics for URLs below the treshold.\n"; + last; + } + printf "%d : %s\n", $stats{'ressource'}{$ressource}, $ressource; + } + } + + if ($cli_options{'host-statistics-threshold'} == 0) { + print "Host statistics are disabled. Increase --host-statistics-threshold to enable them.\n"; + } else { + print "Requested Hosts:\n"; + foreach my $host (sort {$stats{'hosts'}{$b} <=> $stats{'hosts'}{$a}} keys %{$stats{'hosts'}}) { + if ($stats{'hosts'}{$host} < $cli_options{'host-statistics-threshold'}) { + print "Skipped statistics for Hosts below the treshold.\n"; + last; + } + printf "%d : %s\n", $stats{'hosts'}{$host}, $host; + } + } +} + + ################################################################################ # Functions that actually print stuff ################################################################################ @@ -1717,7 +2118,6 @@ sub handle_loglevel_ignore ($) { sub print_clf_message () { our ($ip, $timestamp, $request_line, $status_code, $size); - our %h; my $output = ''; return if DEBUG_SUPPRESS_LOG_MESSAGES; @@ -1732,109 +2132,91 @@ sub print_clf_message () { $output .= $h{'Status'} . $status_code . $h{'Standard'}; $output .= " "; $output .= $h{'Number'} . $size . $h{'Standard'}; - $output .= get_line_end(); + $output .= $line_end; print $output; } sub print_non_clf_message ($) { - our %req; - our %thread_colours; - our %h; - our $t; - our $time_colour_index; - our @time_colours; - my $output; my $content = shift; - my ($day, $time_stamp, $msecs, $thread, $log_level) - = ($req{$t}{'day'}, $req{$t}{'time-stamp'}, $req{$t}{'msecs'}, $t, $req{$t}{'log-level'} ); + my $msec_string = "." . $req{$t}{'msecs'} unless $no_msecs_mode; + my $line_start = $html_output_mode ? '' : $h{"Standard"}; return if DEBUG_SUPPRESS_LOG_MESSAGES; - $output .= $h{"Standard"} unless cli_option_is_set('html-output'); - # $output .= "$day "; - $output .= $time_colours[$time_colour_index % 2]; + print $line_start + . $time_colours[$time_colour_index % 2] + . $req{$t}{'time-stamp'} + . $msec_string + . $h{Standard} . " " + . $thread_colours{$t} + . $t + . $h{Standard} + . " " + . $h{$req{$t}{'log-level'}} + . $req{$t}{'log-level'} + . $h{Standard} + . ": " + . $content + . $line_end; +} - $output .= $time_stamp; - $output .= ".$msecs" unless cli_option_is_set('no-msecs'); - $output .= $h{"Standard"}; - $output .= " "; - $output .= $thread_colours{$thread} if (defined($thread_colours{$thread})); - $output .= $thread; - $output .= $h{"Standard"} . " "; - $output .= $h{$log_level} if (defined($h{$log_level})); - $output .= $log_level; - $output .= $h{"Standard"} . ": "; - $output .= "$content"; - $output .= get_line_end(); +sub shorten_thread_id ($) { - print $output; + my $thread_id = shift; + + our %short_thread_ids; + our $max_threadid; + + unless (defined $short_thread_ids{$thread_id}) { + $short_thread_ids{$thread_id} = sprintf "%.3d", $max_threadid++; + } + + return $short_thread_ids{$thread_id} } sub parse_loop () { - our $t; - our %req; # request data from previous lines - our %h; - our %thread_colours; - our @all_colours; - our @time_colours; - our $thread_colour_index = 0; - our $header_colour_index = 0; - our $time_colour_index = 0; - my ($day, $time_stamp, $thread, $log_level, $content, $c, $msecs); my $last_msecs = 0; my $last_thread = 0; my $last_timestamp = 0; - my $output; my $filters_that_did_nothing; my $key; my $time_colour; - our $no_special_header_highlighting; $time_colour = paint_it('white'); - my %log_level_count; my %log_level_handlers = ( - 'Re-Filter' => \&handle_loglevel_re_filter, - 'Header' => \&handle_loglevel_header, - 'Connect' => \&handle_loglevel_connect, - 'Redirect' => \&handle_loglevel_redirect, - 'Request' => \&handle_loglevel_request, - 'Crunch' => \&handle_loglevel_crunch, - 'Gif-Deanimate' => \&handle_loglevel_gif_deanimate, - 'Info' => \&handle_loglevel_info, - 'CGI' => \&handle_loglevel_cgi, - 'Force' => \&handle_loglevel_force, - 'Error' => \&handle_loglevel_ignore, - 'Fatal error' => \&handle_loglevel_ignore, - 'Writing' => \&handle_loglevel_ignore, + 'Re-Filter' => \&handle_loglevel_re_filter, + 'Header' => \&handle_loglevel_header, + 'Connect' => \&handle_loglevel_connect, + 'Redirect' => \&handle_loglevel_redirect, + 'Request' => \&handle_loglevel_request, + 'Crunch' => \&handle_loglevel_crunch, + 'Gif-Deanimate' => \&handle_loglevel_gif_deanimate, + 'Info' => \&handle_loglevel_info, + 'CGI' => \&handle_loglevel_cgi, + 'Force' => \&handle_loglevel_force, + 'Error' => \&handle_loglevel_error, + 'Fatal error' => \&handle_loglevel_ignore, + 'Writing' => \&handle_loglevel_ignore, + 'Received' => \&handle_loglevel_ignore, + 'Unknown log level' => \&handle_loglevel_ignore, ); while (<>) { - - $output = ''; - if (m/^(\w{3} \d{2}) (\d\d:\d\d:\d\d)\.?(\d+)? (?:Privoxy\()?([^\)\s]*)[\)]? ([\w -]*): (.*)$/) { - # XXX: Put in req hash? - $day = $1; - $time_stamp = $2; - $msecs = $3 ? $3 : 0; # Only the cool kids have micro second resolution - $log_level = $5; - $content = $c = $6; - $thread = $t = $4; - - $req{$t}{'day'} = $day; - $req{$t}{'time-stamp'} = $time_stamp; - $req{$t}{'msecs'} = $msecs; # Only the cool kids have micro second resolution; - $req{$t}{'log-level'} = $log_level; - $req{$t}{'content'} = $content; + if (m/^(\d{4}-\d{2}-\d{2}|\w{3} \d{2}) (\d\d:\d\d:\d\d)\.?(\d+)? (?:Privoxy\()?([^\)\s]*)[\)]? ([\w -]*): (.*?)\r?$/) { + $thread = $t = ($shorten_thread_ids) ? shorten_thread_id($4) : $4; + $req{$t}{'day'} = $day = $1; + $req{$t}{'time-stamp'} = $time_stamp = $2; + $req{$t}{'msecs'} = $msecs = $3 ? $3 : 0; # Only the cool kids have micro second resolution; + $req{$t}{'log-level'} = $log_level = $5; + $req{$t}{'content'} = $content = $c = $6; $req{$t}{'log-message'} = $_; $no_special_header_highlighting = 0; - $log_level_count{$log_level}++; - if (defined($log_level_handlers{$log_level})) { $content = $log_level_handlers{$log_level}($content); @@ -1842,12 +2224,11 @@ sub parse_loop () { } else { die "No handler found for log level \"$log_level\"\n"; - } - # Highlight Truncations - if (m/\.\.\. \[(too long, truncated)/) { - $content =~ s@($1)@$h{'Truncation'}$1$h{'Standard'}@g; + # Highlight Truncations + if (length($_) > 4000) { + $content =~ s@(too long, truncated)]$@$h{'Truncation'}$1$h{'Standard'}]@g; } next unless $content; @@ -1859,19 +2240,19 @@ sub parse_loop () { } # Switch timestamp colour if timestamps differ - if ($msecs != $last_msecs || !($time_stamp =~ m/$last_timestamp/)) { + if (($msecs ne $last_msecs) || ($time_stamp ne $last_timestamp)) { debug_message("Tick tack!") if DEBUG_TICKS; - $time_colour = $time_colours[$time_colour_index % 2]; - $time_colour_index++ + $time_colour = $time_colours[$time_colour_index % 2]; + $time_colour_index++; + $last_msecs = $msecs; + $last_timestamp = $time_stamp; } - $last_msecs = $msecs; $last_thread = $thread; - $last_timestamp = $time_stamp; print_non_clf_message($content); - } elsif (m/^(\d+\.\d+\.\d+\.\d+) - - \[(.*)\] "(.*)" (\d+) (\d+)/) { + } elsif (m/^((?:\d+\.\d+\.\d+\.\d+|[:\d]+)) - - \[(.*)\] "(.*)" (\d+) (\d+)/) { # LOG_LEVEL_CLF lines look like this # 61.152.239.32 - - [04/Mar/2007:18:28:23 +0100] "GET \ @@ -1880,7 +2261,7 @@ sub parse_loop () { our ($ip, $timestamp, $request_line, $status_code, $size) = ($1, $2, $3, $4, $5); print_clf_message(); - + } else { # Some Privoxy log messages span more than one line, @@ -1892,19 +2273,83 @@ sub parse_loop () { } } } +} - if (cli_option_is_set('statistic')) { - foreach (keys %log_level_count) { - print $_ . ": " . $log_level_count{$_} . " "; +sub stats_loop () { + + my ($day, $time_stamp, $msecs, $thread, $log_level, $content); + my %log_level_handlers = ( + 'Re-Filter' => \&handle_loglevel_ignore, + 'Header' => \&gather_loglevel_header_stats, + 'Connect' => \&gather_loglevel_connect_stats, + 'Redirect' => \&handle_loglevel_ignore, + 'Request' => \&gather_loglevel_request_stats, + 'Crunch' => \&gather_loglevel_crunch_stats, + 'Gif-Deanimate' => \&handle_loglevel_ignore, + 'Info' => \&handle_loglevel_ignore, + 'CGI' => \&handle_loglevel_ignore, + 'Force' => \&handle_loglevel_ignore, + 'Error' => \&gather_loglevel_error_stats, + 'Fatal error' => \&handle_loglevel_ignore, + 'Writing' => \&handle_loglevel_ignore, + 'Received' => \&handle_loglevel_ignore, + 'Unknown log level' => \&handle_loglevel_ignore + ); + + while (<>) { + if (m/^(\d{4}-\d{2}-\d{2}|\w{3} \d{2}) (\d\d:\d\d:\d\d)\.?(\d+)? (?:Privoxy\()?([^\)\s]*)[\)]? ([\w -]*): (.*?)\r?$/) { + $day = $1; + $time_stamp = $2; + $msecs = $3 ? $3 : 0; + $thread = $4; + $log_level = $5; + $content = $6; + + if (defined($log_level_handlers{$log_level})) { + + $content = $log_level_handlers{$log_level}($content, $thread); + + } else { + + die "No handler found for log level \"$log_level\"\n"; + + } } } + + print_stats(); + +} + +sub unbreak_lines_only_loop() { + my $log_messages_reached = 0; + while (<>) { + chomp; + + # Log level other than LOG_LEVEL_CLF? + if (m/^(\d{4}-\d{2}-\d{2}|\w{3} \d{2}) (\d\d:\d\d:\d\d)\.?(\d+)? (?:Privoxy\()?([^\)\s]*)[\)]? ([\w -]*): (.*?)\r?$/ or + # LOG_LEVEL_CLF? + m/^((?:\d+\.\d+\.\d+\.\d+)) - - \[(.*)\] "(.*)" (\d+) (\d+)/) { + $log_messages_reached = 1; + print "\n"; + + } else { + # Wrapped message + $_ = "\n". $_ if /^(?:\d+\.\d+\.\d+\.\d+)/; + $_ = " " . $_; + } + s@
    $@@; + print; + print "\n" unless $log_messages_reached; + } + print "\n"; } sub VersionMessage { my $version_message; $version_message .= 'Privoxy-Log-Parser ' . PRIVOXY_LOG_PARSER_VERSION . "\n"; - $version_message .= 'Copyright (C) 2007-2009 Fabian Keil ' . "\n"; + $version_message .= 'Copyright (C) 2007-2010 Fabian Keil ' . "\n"; $version_message .= 'http://www.fabiankeil.de/sourcecode/privoxy-log-parser/' . "\n"; print $version_message; @@ -1918,10 +2363,14 @@ sub get_cli_options () { 'no-syntax-highlighting' => CLI_OPTION_NO_SYNTAX_HIGHLIGHTING, 'no-embedded-css' => CLI_OPTION_NO_EMBEDDED_CSS, 'no-msecs' => CLI_OPTION_NO_MSECS, + 'shorten-thread-ids' => CLI_OPTION_SHORTEN_THREAD_IDS, 'show-ineffective-filters' => CLI_OPTION_SHOW_INEFFECTIVE_FILTERS, 'accept-unknown-messages' => CLI_OPTION_ACCEPT_UNKNOWN_MESSAGES, - 'statistic' => CLI_OPTION_STATISTIC, - ); + 'statistics' => CLI_OPTION_STATISTICS, + 'url-statistics-threshold' => CLI_OPTION_URL_STATISTICS_THRESHOLD, + 'unbreak-lines-only' => CLI_OPTION_UNBREAK_LINES_ONLY, + 'host-statistics-threshold'=> CLI_OPTION_HOST_STATISTICS_THRESHOLD, + ); GetOptions ( 'html-output' => \$cli_options{'html-output'}, @@ -1929,14 +2378,50 @@ sub get_cli_options () { 'no-syntax-highlighting' => \$cli_options{'no-syntax-highlighting'}, 'no-embedded-css' => \$cli_options{'no-embedded-css'}, 'no-msecs' => \$cli_options{'no-msecs'}, + 'shorten-thread-ids' => \$cli_options{'shorten-thread-ids'}, 'show-ineffective-filters' => \$cli_options{'show-ineffective-filters'}, 'accept-unknown-messages' => \$cli_options{'accept-unknown-messages'}, - 'statistic' => \$cli_options{'statistic'}, - 'version' => sub { VersionMessage && exit(0) } - ); + 'statistics' => \$cli_options{'statistics'}, + 'unbreak-lines-only' => \$cli_options{'unbreak-lines-only'}, + 'url-statistics-threshold=i'=> \$cli_options{'url-statistics-threshold'}, + 'host-statistics-threshold=i'=> \$cli_options{'host-statistics-threshold'}, + 'version' => sub { VersionMessage && exit(0) }, + 'help' => \&help, + ) or exit(1); + + $html_output_mode = cli_option_is_set('html-output'); + $no_msecs_mode = cli_option_is_set('no-msecs'); + $shorten_thread_ids = cli_option_is_set('shorten-thread-ids'); + $line_end = get_line_end(); } +sub help () { + our %cli_options; + + VersionMessage(); + + print << " EOF" + +Options and their default values if they have any: + [--accept-unknown-messages] + [--host-statistics-threshold $cli_options{'host-statistics-threshold'}] + [--html-output] + [--no-embedded-css] + [--no-msecs] + [--no-syntax-highlighting] + [--shorten-thread-ids] + [--show-ineffective-filters] + [--statistics] + [--unbreak-lines-only] + [--url-statistics-threshold $cli_options{'url-statistics-threshold'}] + [--title $cli_options{'title'}] + [--version] +see "perldoc $0" for more information + EOF + ; + exit(0); +} ################################################################################ # main @@ -1949,7 +2434,14 @@ sub main () { print_intro(); - parse_loop(); + # XXX: should explicitly reject incompatible argument combinations + if (cli_option_is_set('unbreak-lines-only')) { + unbreak_lines_only_loop(); + } elsif (cli_option_is_set('statistics')) { + stats_loop(); + } else { + parse_loop(); + } print_outro(); } @@ -1963,8 +2455,9 @@ B - A parser and syntax-highlighter for Privoxy log messages =head1 SYNOPSIS B [B<--accept-unknown-messages>] [B<--html-output>] -[B<--no-msecs>] [B<--no-syntax-higlighting>] [B<--show-ineffective-filters>] -[B<--version>] +[B<--no-msecs>] [B<--no-syntax-higlighting>] [B<--statistics>] +[B<--shorten-thread-ids>] [B<--show-ineffective-filters>] +[B<--url-statistics-threshold>] [B<--version>] =head1 DESCRIPTION @@ -1979,7 +2472,7 @@ B reads Privoxy log messages and - (in some cases) calculates additional information, like the compression ratio or how a filter affected the content size. - + With B you should be able to increase Privoxy's log level without getting confused by the resulting amount of output. For example for "debug 64" B will (by default) only show messages that @@ -1991,10 +2484,14 @@ will hide the "filter foo caused 0 hits" message. [B<--accept-unknown-messages>] Don't print warnings in case of unknown messages, just don't highlight them. +[B<--host-statistics-threshold>] Only show the request count for a host +if it's above or equal to the given threshold. If the threshold is 0, host +statistics are disabled. + [B<--html-output>] Use HTML and CSS for the syntax highlighting. If this option is omitted, ANSI escape sequences are used unless B<--no-syntax-highlighting> is active. This option is only intended to make embedding log excerpts in web pages easier. -It does not excape any input! +It does not escape any input! [B<--no-msecs>] Don't expect milisecond resolution @@ -2003,9 +2500,28 @@ the filtered output is piped into less in which case the ANSI control codes don't work, or if the terminal itself doesn't support the control codes. +[B<--shorten-thread-ids>] Shorten the thread ids to a three-digit decimal number. +Note that the mapping from thread ids to shortened ids is created at run-time +and thus varies with the input. + [B<--show-ineffective-filters>] Don't suppress log lines for filters that didn't modify the content. +[B<--statistics>] Gather various statistics instead of syntax highlighting +log messages. This is an experimental feature, if the results look wrong +they very well might be. Also note that the results are pretty much guaranteed +to be incorrect if Privoxy and Privoxy-Log-Parser aren't in sync. + +[B<--unbreak-lines-only>] Tries to fix lines that got messed up by a broken or +interestingly configured mail client and thus are no longer recognized properly. +Only fixes some breakage, but may be good enough or at least better than nothing. +Doesn't do anything else, so you probably want to pipe the output into +B again. + +[B<--url-statistics-threshold>] Only show the request count for a ressource +if it's above or equal to the given threshold. If the threshold is 0, URL +statistics are disabled. + [B<--version>] Print version and exit. =head1 EXAMPLES diff --git a/external/privoxy/tools/privoxy-regression-test.pl b/external/privoxy/tools/privoxy-regression-test.pl index c7269b78..347583ac 100755 --- a/external/privoxy/tools/privoxy-regression-test.pl +++ b/external/privoxy/tools/privoxy-regression-test.pl @@ -7,7 +7,7 @@ # A regression test "framework" for Privoxy. For documentation see: # perldoc privoxy-regression-test.pl # -# $Id: privoxy-regression-test.pl,v 1.34 2009/02/27 18:35:22 fabiankeil Exp $ +# $Id: privoxy-regression-test.pl,v 1.81 2011/10/30 16:22:29 fabiankeil Exp $ # # Wish list: # @@ -19,7 +19,7 @@ # - Document magic Expect Header values # - Internal fuzz support? # -# Copyright (c) 2007-2009 Fabian Keil +# Copyright (c) 2007-2011 Fabian Keil # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -40,7 +40,7 @@ use strict; use Getopt::Long; use constant { - PRT_VERSION => 'Privoxy-Regression-Test 0.3', + PRT_VERSION => 'Privoxy-Regression-Test 0.5', CURL => 'curl', @@ -52,6 +52,7 @@ use constant { # XXX: why limit at all? CLI_MAX_LEVEL => 100, CLI_FORKS => 0, + CLI_SLEEP_TIME => 0, PRIVOXY_CGI_URL => 'http://p.p/', FELLATIO_URL => 'http://127.0.0.1:8080/', @@ -69,13 +70,12 @@ use constant { # Internal use, don't modify # Available debug bits: - LL_ERROR => 1, + LL_SOFT_ERROR => 1, LL_VERBOSE_FAILURE => 2, LL_PAGE_FETCHING => 4, LL_FILE_LOADING => 8, LL_VERBOSE_SUCCESS => 16, LL_STATUS => 32, - LL_SOFT_ERROR => 64, CLIENT_HEADER_TEST => 1, SERVER_HEADER_TEST => 2, @@ -84,19 +84,16 @@ use constant { STICKY_ACTIONS_TEST => 5, TRUSTED_CGI_REQUEST => 6, BLOCK_TEST => 7, + REDIRECT_TEST =>108, }; sub init_our_variables () { our $leading_log_time = LEADING_LOG_TIME; our $leading_log_date = LEADING_LOG_DATE; - our $privoxy_cgi_url = PRIVOXY_CGI_URL; - our $verbose_test_description = VERBOSE_TEST_DESCRIPTION; - our $log_level = get_default_log_level(); - } sub get_default_log_level () { @@ -109,9 +106,8 @@ sub get_default_log_level () { $log_level |= LL_VERBOSE_SUCCESS if DEBUG_LEVEL_VERBOSE_SUCCESS; $log_level |= LL_STATUS if DEBUG_LEVEL_STATUS; - # These are intended to be always on. + # This one is supposed to be always on. $log_level |= LL_SOFT_ERROR; - $log_level |= LL_ERROR; return $log_level; } @@ -140,18 +136,173 @@ sub parse_tag ($) { sub check_for_forbidden_characters ($) { - my $tag = shift; # XXX: also used to check values though. - my $allowed = '[-=\dA-Za-z~{}:.\/();\s,+@"_%\?&*^]'; + my $string = shift; + my $allowed = '[-=\dA-Za-z~{}:./();\t ,+@"_%?&*^]'; - unless ($tag =~ m/^$allowed*$/) { - my $forbidden = $tag; + unless ($string =~ m/^$allowed*$/o) { + my $forbidden = $string; $forbidden =~ s@^$allowed*(.).*@$1@; - l(LL_ERROR, "'" . $tag . "' contains character '" . $forbidden. "' which is unacceptable."); + log_and_die("'" . $string . "' contains character '" . $forbidden. "' which is unacceptable."); } } -sub load_regressions_tests () { +sub load_regression_tests() { + if (cli_option_is_set('local-test-file')) { + load_regression_tests_from_file(get_cli_option('local-test-file')); + } else { + load_regression_tests_through_privoxy(); + } +} + +# XXX: Contains a lot of code duplicated from load_action_files() +# that should be factored out. +sub load_regression_tests_from_file ($) { + my $action_file = shift; + + # initialized here + our %actions; + our @regression_tests; + + my $si = 0; # Section index + my $ri = -1; # Regression test index + my $count = 0; + + my $ignored = 0; + + my $sticky_actions = undef; + + l(LL_STATUS, "Gathering regression tests from local file " . $action_file); + + open(my $ACTION_FILE, "<", $action_file) + or log_and_die("Failed to open $action_file: $!"); + + while (<$ACTION_FILE>) { + + my $no_checks = 0; + chomp; + my ($token, $value) = tokenize($_); + + next unless defined $token; + + # Load regression tests + + if (token_starts_new_test($token)) { + + # Beginning of new regression test. + $ri++; + $count++; + enlist_new_test(\@regression_tests, $token, $value, $si, $ri, $count); + $no_checks = 1; # Already validated by enlist_new_test(). + } + + if ($token =~ /level\s+(\d+)/i) { + + my $level = $1; + register_dependency($level, $value); + } + + if ($token eq 'sticky actions') { + + # Will be used by each following Sticky URL. + $sticky_actions = $value; + if ($sticky_actions =~ /{[^}]*\s/) { + log_and_die("'Sticky Actions' with whitespace inside the " . + "action parameters are currently unsupported."); + } + } + + if ($si == -1 || $ri == -1) { + # No beginning of a test detected yet, + # so we don't care about any other test + # attributes. + next; + } + + if ($token eq 'expect header') { + + l(LL_FILE_LOADING, "Detected expectation: " . $value); + $regression_tests[$si][$ri]{'expect-header'} = $value; + + } elsif ($token eq 'tag') { + + next if ($ri == -1); + + my $tag = parse_tag($value); + + # We already checked in parse_tag() after filtering + $no_checks = 1; + + l(LL_FILE_LOADING, "Detected TAG: " . $tag); + + # Save tag for all tests in this section + do { + $regression_tests[$si][$ri]{'tag'} = $tag; + } while ($ri-- > 0); + + $si++; + $ri = -1; + + } elsif ($token eq 'ignore' && $value =~ /Yes/i) { + + l(LL_FILE_LOADING, "Ignoring section: " . test_content_as_string($regression_tests[$si][$ri])); + $regression_tests[$si][$ri]{'ignore'} = 1; + $ignored++; + + } elsif ($token eq 'expect status code') { + + l(LL_FILE_LOADING, "Expecting status code: " . $value); + $regression_tests[$si][$ri]{'expected-status-code'} = $value; + + } elsif ($token eq 'level') { # XXX: stupid name + + $value =~ s@(\d+).*@$1@; + l(LL_FILE_LOADING, "Level: " . $value); + $regression_tests[$si][$ri]{'level'} = $value; + + } elsif ($token eq 'method') { + + l(LL_FILE_LOADING, "Method: " . $value); + $regression_tests[$si][$ri]{'method'} = $value; + + } elsif ($token eq 'redirect destination') { + + l(LL_FILE_LOADING, "Redirect destination: " . $value); + $regression_tests[$si][$ri]{'redirect destination'} = $value; + + } elsif ($token eq 'url') { + + if (defined $sticky_actions) { + die "WTF? Attempted to overwrite Sticky Actions" + if defined ($regression_tests[$si][$ri]{'sticky-actions'}); + + l(LL_FILE_LOADING, "Sticky actions: " . $sticky_actions); + $regression_tests[$si][$ri]{'sticky-actions'} = $sticky_actions; + } else { + log_and_die("Sticky URL without Sticky Actions: $value"); + } + + } else { + + # We don't use it, so we don't need + $no_checks = 1; + l(LL_STATUS, "Enabling no_checks for $token") unless $no_checks; + } + + # XXX: Necessary? + unless ($no_checks) { + check_for_forbidden_characters($value); + check_for_forbidden_characters($token); + } + } + + l(LL_FILE_LOADING, "Done loading " . $count . " regression tests." + . " Of which " . $ignored. " will be ignored)\n"); + +} + + +sub load_regression_tests_through_privoxy () { our $privoxy_cgi_url; our @privoxy_config; @@ -166,6 +317,10 @@ sub load_regressions_tests () { l(LL_STATUS, "Asking Privoxy for the number of action files available ..."); + # Dear Privoxy, please reload the config file if necessary ... + get_cgi_page_or_else($curl_url); + + # ... so we get the latest one here. foreach (@{get_cgi_page_or_else($curl_url)}) { chomp; @@ -200,7 +355,7 @@ sub token_starts_new_test ($) { my $token = shift; my @new_test_directives = ('set header', 'fetch test', 'trusted cgi request', 'request header', 'method test', - 'blocked url', 'url'); + 'blocked url', 'url', 'redirected url'); foreach my $new_test_directive (@new_test_directives) { return 1 if $new_test_directive eq $token; @@ -218,12 +373,12 @@ sub tokenize ($) { s@\s*$@@; # Reverse HTML-encoding - # XXX: Seriously imcomplete. + # XXX: Seriously incomplete. s@"@"@g; s@&@&@g; # Tokenize - if (/^\#\s*([^=:]*?)\s*[=]\s*(.+?)\s*$/) { + if (/^\#\s*([^=:#]*?)\s*[=]\s*([^#]+)(?:#.*)?$/) { $token = $1; $value = $2; @@ -244,45 +399,59 @@ sub enlist_new_test ($$$$$$) { my ($regression_tests, $token, $value, $si, $ri, $number) = @_; my $type; + my $executor; if ($token eq 'set header') { l(LL_FILE_LOADING, "Header to set: " . $value); $type = CLIENT_HEADER_TEST; + $executor = \&execute_client_header_regression_test; } elsif ($token eq 'request header') { l(LL_FILE_LOADING, "Header to request: " . $value); $type = SERVER_HEADER_TEST; + $executor = \&execute_server_header_regression_test; $$regression_tests[$si][$ri]{'expected-status-code'} = 200; } elsif ($token eq 'trusted cgi request') { l(LL_FILE_LOADING, "CGI URL to test in a dumb way: " . $value); $type = TRUSTED_CGI_REQUEST; + $executor = \&execute_dumb_fetch_test; $$regression_tests[$si][$ri]{'expected-status-code'} = 200; } elsif ($token eq 'fetch test') { l(LL_FILE_LOADING, "URL to test in a dumb way: " . $value); $type = DUMB_FETCH_TEST; + $executor = \&execute_dumb_fetch_test; $$regression_tests[$si][$ri]{'expected-status-code'} = 200; } elsif ($token eq 'method test') { l(LL_FILE_LOADING, "Method to test: " . $value); $type = METHOD_TEST; + $executor = \&execute_method_test; $$regression_tests[$si][$ri]{'expected-status-code'} = 200; } elsif ($token eq 'blocked url') { l(LL_FILE_LOADING, "URL to block-test: " . $value); + $executor = \&execute_block_test; $type = BLOCK_TEST; } elsif ($token eq 'url') { l(LL_FILE_LOADING, "Sticky URL to test: " . $value); $type = STICKY_ACTIONS_TEST; + $executor = \&execute_sticky_actions_test; + + } elsif ($token eq 'redirected url') { + + l(LL_FILE_LOADING, "Redirected URL to test: " . $value); + $type = REDIRECT_TEST; + $executor = \&execute_redirect_test; } else { @@ -291,6 +460,7 @@ sub enlist_new_test ($$$$$$) { $$regression_tests[$si][$ri]{'type'} = $type; $$regression_tests[$si][$ri]{'level'} = $type; + $$regression_tests[$si][$ri]{'executor'} = $executor; check_for_forbidden_characters($value); @@ -304,6 +474,8 @@ sub enlist_new_test ($$$$$$) { "Regression test " . $number . " (section:" . $si . "):"); } +# XXX: Shares a lot of code with load_regression_tests_from_file() +# that should be factored out. sub load_action_files ($) { # initialized here @@ -324,7 +496,7 @@ sub load_action_files ($) { for my $file_number (0 .. @actionfiles - 1) { - my $curl_url = ' "' . $actionfiles[$file_number] . '"'; + my $curl_url = quote($actionfiles[$file_number]); my $actionfile = undef; my $sticky_actions = undef; @@ -353,6 +525,7 @@ sub load_action_files ($) { $ri++; $count++; enlist_new_test(\@regression_tests, $token, $value, $si, $ri, $count); + $no_checks = 1; # Already validated by enlist_new_test(). } if ($token =~ /level\s+(\d+)/i) { @@ -366,9 +539,8 @@ sub load_action_files ($) { # Will be used by each following Sticky URL. $sticky_actions = $value; if ($sticky_actions =~ /{[^}]*\s/) { - l(LL_ERROR, - "'Sticky Actions' with whitespace inside the " . - "action parameters are currently unsupported."); + log_and_die("'Sticky Actions' with whitespace inside the " . + "action parameters are currently unsupported."); } } @@ -425,6 +597,11 @@ sub load_action_files ($) { l(LL_FILE_LOADING, "Method: " . $value); $regression_tests[$si][$ri]{'method'} = $value; + } elsif ($token eq 'redirect destination') { + + l(LL_FILE_LOADING, "Redirect destination: " . $value); + $regression_tests[$si][$ri]{'redirect destination'} = $value; + } elsif ($token eq 'url') { if (defined $sticky_actions) { @@ -434,17 +611,21 @@ sub load_action_files ($) { l(LL_FILE_LOADING, "Sticky actions: " . $sticky_actions); $regression_tests[$si][$ri]{'sticky-actions'} = $sticky_actions; } else { - l(LL_ERROR, "Sticky URL without Sticky Actions: $value"); + log_and_die("Sticky URL without Sticky Actions: $value"); } } else { # We don't use it, so we don't need $no_checks = 1; + l(LL_STATUS, "Enabling no_checks for $token") unless $no_checks; + } + + # XXX: Necessary? + unless ($no_checks) { + check_for_forbidden_characters($value); + check_for_forbidden_characters($token); } - # XXX: Neccessary? - check_for_forbidden_characters($value) unless $no_checks; - check_for_forbidden_characters($token); } } @@ -458,6 +639,16 @@ sub load_action_files ($) { # ############################################################################ +# Fisher Yates shuffle from Perl's "How do I shuffle an array randomly?" FAQ +sub fisher_yates_shuffle ($) { + my $deck = shift; + my $i = @$deck; + while ($i--) { + my $j = int rand($i+1); + @$deck[$i,$j] = @$deck[$j,$i]; + } +} + sub execute_regression_tests () { our @regression_tests; @@ -481,47 +672,51 @@ sub execute_regression_tests () { my $failures; my $skipped = 0; - for my $s (0 .. @regression_tests - 1) { + if (cli_option_is_set('shuffle-tests')) { + + # Shuffle both the test sections and + # the tests they contain. + # + # XXX: With the current data layout, shuffling tests + # from different sections isn't possible. + # Is this worth changing the layout? + fisher_yates_shuffle(\@regression_tests); + for (my $s = 0; $s < @regression_tests; $s++) { + fisher_yates_shuffle($regression_tests[$s]); + } + } + + for (my $s = 0; $s < @regression_tests; $s++) { my $r = 0; while (defined $regression_tests[$s][$r]) { - die "Section id mismatch" if ($s != $regression_tests[$s][$r]{'section-id'}); - die "Regression test id mismatch" if ($r != $regression_tests[$s][$r]{'regression-test-id'}); + unless (cli_option_is_set('shuffle-tests')) { + die "Section id mismatch" if ($s != $regression_tests[$s][$r]{'section-id'}); + die "Regression test id mismatch" if ($r != $regression_tests[$s][$r]{'regression-test-id'}); + } + die "Internal error. Test executor missing." + unless defined $regression_tests[$s][$r]{executor}; my $number = $regression_tests[$s][$r]{'number'}; - my $skip_reason = undef; - - if ($regression_tests[$s][$r]{'ignore'}) { - - $skip_reason = "Ignore flag is set"; - - } elsif (cli_option_is_set('test-number') - and get_cli_option('test-number') != $number) { - - $skip_reason = "Only executing test " . get_cli_option('test-number'); - - } else { - - $skip_reason = level_is_unacceptable($regression_tests[$s][$r]{'level'}); - } + my $skip_reason = get_skip_reason($regression_tests[$s][$r]); if (defined $skip_reason) { my $message = "Skipping test " . $number . ": " . $skip_reason . "."; - log_message($message) if (cli_option_is_set('verbose') or - cli_option_is_set('show-skipped-tests')); + log_message($message) if (cli_option_is_set('show-skipped-tests')); $skipped++; } else { - my $result = execute_regression_test($regression_tests[$s][$r]); + my $result = $regression_tests[$s][$r]{executor}($regression_tests[$s][$r]); log_result($regression_tests[$s][$r], $result, $tests); $successes += $result; $tests++; + sleep(get_cli_option('sleep-time')) if (cli_option_is_set('sleep-time')); } $r++; } @@ -535,7 +730,6 @@ sub execute_regression_tests () { $all_tests += $tests; $all_failures += $failures; $all_successes += $successes; - } if (get_cli_option('loops') > 1) { @@ -544,6 +738,27 @@ sub execute_regression_tests () { } } +sub get_skip_reason ($) { + my $test = shift; + my $skip_reason = undef; + + if ($test->{'ignore'}) { + + $skip_reason = "Ignore flag is set"; + + } elsif (cli_option_is_set('test-number') and + get_cli_option('test-number') != $test->{'number'}) { + + $skip_reason = "Only executing test " . get_cli_option('test-number'); + + } else { + + $skip_reason = level_is_unacceptable($test->{'level'}); + } + + return $skip_reason; +} + sub level_is_unacceptable ($) { my $level = shift; my $min_level = get_cli_option('min-level'); @@ -559,11 +774,11 @@ sub level_is_unacceptable ($) { } elsif ($level < $min_level) { - $reason = "Level to low (" . $level . " < " . $min_level . ")"; + $reason = "Level too low (" . $level . " < " . $min_level . ")"; } elsif ($level > $max_level) { - $reason = "Level to high (" . $level . " > " . $max_level . ")"; + $reason = "Level too high (" . $level . " > " . $max_level . ")"; } else { @@ -589,11 +804,16 @@ sub dependency_unsatisfied ($) { foreach (@privoxy_config) { - $dependency_problem = undef if (/$dependency/); - last; # XXX: this looks ... interesting. + if (/$dependency/) { + $dependency_problem = undef; + last; + } } - } elsif (defined ($dependencies{$level}{'feature status'})) { + } + + if (defined ($dependencies{$level}{'feature status'}) + and not defined $dependency_problem) { my $dependency = $dependencies{$level}{'feature status'}; my ($feature, $status) = $dependency =~ /([^\s]*)\s+(Yes|No)/; @@ -623,59 +843,21 @@ sub register_dependency ($$) { $dependencies{$level}{'feature status'} = $1; - } -} - -# XXX: somewhat misleading name -sub execute_regression_test ($) { - - my $test_ref = shift; - my %test = %{$test_ref}; - my $result = 0; - - if ($test{'type'} == CLIENT_HEADER_TEST) { - - $result = execute_client_header_regression_test($test_ref); - - } elsif ($test{'type'} == SERVER_HEADER_TEST) { - - $result = execute_server_header_regression_test($test_ref); - - } elsif ($test{'type'} == DUMB_FETCH_TEST - or $test{'type'} == TRUSTED_CGI_REQUEST) { - - $result = execute_dumb_fetch_test($test_ref); - - } elsif ($test{'type'} == METHOD_TEST) { - - $result = execute_method_test($test_ref); - - } elsif ($test{'type'} == BLOCK_TEST) { - - $result = execute_block_test($test_ref); - - } elsif ($test{'type'} == STICKY_ACTIONS_TEST) { - - $result = execute_sticky_actions_test($test_ref); - } else { - die "Unsupported test type detected: " . $test{'type'}; + log_and_die("Didn't recognize dependency: $dependency."); } - - return $result; } sub execute_method_test ($) { - my $test_ref = shift; - my %test = %{$test_ref}; + my $test = shift; my $buffer_ref; my $status_code; - my $method = $test{'data'}; + my $method = $test->{'data'}; my $curl_parameters = ''; - my $expected_status_code = $test{'expected-status-code'}; + my $expected_status_code = $test->{'expected-status-code'}; $curl_parameters .= '--request ' . $method . ' '; # Don't complain about the 'missing' body @@ -689,24 +871,68 @@ sub execute_method_test ($) { return check_status_code_result($status_code, $expected_status_code); } -sub execute_dumb_fetch_test ($) { +sub execute_redirect_test ($) { - my $test_ref = shift; - my %test = %{$test_ref}; + my $test = shift; my $buffer_ref; my $status_code; my $curl_parameters = ''; - my $expected_status_code = $test{'expected-status-code'}; + my $url = $test->{'data'}; + my $redirect_destination; + my $expected_redirect_destination = $test->{'redirect destination'}; - if (defined $test{method}) { - $curl_parameters .= '--request ' . $test{method} . ' '; + # XXX: Check if a redirect actually applies before doing the request. + # otherwise the test may hit a real server in failure cases. + + $curl_parameters .= '--head '; + + $curl_parameters .= quote($url); + + $buffer_ref = get_page_with_curl($curl_parameters); + $status_code = get_status_code($buffer_ref); + + if ($status_code ne "302") { + l(LL_VERBOSE_FAILURE, + "Ooops. Expected redirect to: '" . $expected_redirect_destination + . "' but got a response with status code: " . $status_code); + return 0; } - if ($test{type} == TRUSTED_CGI_REQUEST) { - $curl_parameters .= '--referer ' . PRIVOXY_CGI_URL . ' '; + foreach (@{$buffer_ref}) { + if (/^Location: (.*)\r\n/) { + $redirect_destination = $1; + last; + } } - $curl_parameters .= $test{'data'}; + my $success = ($redirect_destination eq $expected_redirect_destination); + + unless ($success) { + l(LL_VERBOSE_FAILURE, + "Ooops. Expected redirect to: '" . $expected_redirect_destination + . "' but the redirect leads to: '" . $redirect_destination. "'"); + } + + return $success; +} + +sub execute_dumb_fetch_test ($) { + + my $test = shift; + my $buffer_ref; + my $status_code; + + my $curl_parameters = ''; + my $expected_status_code = $test->{'expected-status-code'}; + + if (defined $test->{method}) { + $curl_parameters .= '--request ' . quote($test->{method}) . ' '; + } + if ($test->{type} == TRUSTED_CGI_REQUEST) { + $curl_parameters .= '--referer ' . quote(PRIVOXY_CGI_URL) . ' '; + } + + $curl_parameters .= quote($test->{'data'}); $buffer_ref = get_page_with_curl($curl_parameters); $status_code = get_status_code($buffer_ref); @@ -733,15 +959,18 @@ sub execute_sticky_actions_test ($) { my $final_results = get_final_results($url); foreach my $sticky_action (@sticky_actions) { + if (defined $final_results->{$sticky_action}) { # Exact match $verified_actions++; - }elsif ($sticky_action =~ /-.*\{/ and - not defined $final_results->{$sticky_action}) { + + } elsif ($sticky_action =~ /-.*\{/) { + # Disabled multi actions aren't explicitly listed as # disabled and thus have to be checked by verifying # that they aren't enabled. $verified_actions++; + } else { l(LL_VERBOSE_FAILURE, "Ooops. '$sticky_action' is not among the final results."); @@ -775,7 +1004,10 @@ sub get_final_results ($) { next unless ($final_results_reached); last if (m@@); - if (m@
    ([-+])([^>]*)(?: (\{.*\}))?@) { + # Privoxy versions before 3.0.16 add a space + # between action name and parameters, therefore + # the " ?". + if (m@
    ([-+])([^>]*)(?: ?(\{.*\}))?@) { my $action = $1.$2; my $parameter = $3; @@ -827,28 +1059,28 @@ sub check_status_code_result ($$) { sub execute_client_header_regression_test ($) { - my $test_ref = shift; + my $test = shift; my $buffer_ref; my $header; - $buffer_ref = get_show_request_with_curl($test_ref); + $buffer_ref = get_show_request_with_curl($test); - $header = get_header($buffer_ref, $test_ref); + $header = get_header($buffer_ref, $test); - return check_header_result($test_ref, $header); + return check_header_result($test, $header); } sub execute_server_header_regression_test ($) { - my $test_ref = shift; + my $test = shift; my $buffer_ref; my $header; - $buffer_ref = get_head_with_curl($test_ref); + $buffer_ref = get_head_with_curl($test); - $header = get_server_header($buffer_ref, $test_ref); + $header = get_server_header($buffer_ref, $test); - return check_header_result($test_ref, $header); + return check_header_result($test, $header); } sub interpret_result ($) { @@ -858,65 +1090,51 @@ sub interpret_result ($) { sub check_header_result ($$) { - my $test_ref = shift; + my $test = shift; my $header = shift; - my %test = %{$test_ref}; - my $expect_header = $test{'expect-header'}; + my $expect_header = $test->{'expect-header'}; my $success = 0; if ($expect_header eq 'NO CHANGE') { - if (defined($header) and $header eq $test{'data'}) { - - $success = 1; - - } else { + $success = (defined($header) and $header eq $test->{'data'}); + unless ($success) { $header = "REMOVAL" unless defined $header; l(LL_VERBOSE_FAILURE, - "Ooops. Got: " . $header . " while expecting: " . $expect_header); + "Ooops. Got: '" . $header . "' while expecting: '" . $expect_header . "'"); } } elsif ($expect_header eq 'REMOVAL') { - if (defined($header) and $header eq $test{'data'}) { + # XXX: Use more reliable check here and make sure + # the header has a different name. + $success = not (defined($header) and $header eq $test->{'data'}); + unless ($success) { l(LL_VERBOSE_FAILURE, - "Ooops. Expected removal but: " . $header . " is still there."); - - } else { - - # XXX: Use more reliable check here and make sure - # the header has a different name. - $success = 1; + "Ooops. Expected removal but: '" . $header . "' is still there."); } } elsif ($expect_header eq 'SOME CHANGE') { - if (defined($header) and not $header eq $test{'data'}) { - - $success = 1; - - } else { + $success = (defined($header) and $header ne $test->{'data'}); + unless ($success) { $header = "REMOVAL" unless defined $header; l(LL_VERBOSE_FAILURE, - "Ooops. Got: " . $header . " while expecting: SOME CHANGE"); + "Ooops. Got: '" . $header . "' while expecting: SOME CHANGE"); } - } else { - if (defined($header) and $header eq $expect_header) { + $success = (defined($header) and $header eq $expect_header); - $success = 1; - - } else { - - $header = "'No matching header'" unless defined $header; # XXX: No header detected to be precise + unless ($success) { + $header = "No matching header" unless defined $header; # XXX: No header detected to be precise l(LL_VERBOSE_FAILURE, - "Ooops. Got: " . $header . " while expecting: " . $expect_header); + "Ooops. Got: '" . $header . "' while expecting: '" . $expect_header . "'"); } } return $success; @@ -936,12 +1154,11 @@ sub get_header ($$) { our $filtered_request = ''; my $buffer_ref = shift; - my $test_ref = shift; + my $test = shift; - my %test = %{$test_ref}; my @buffer = @{$buffer_ref}; - my $expect_header = $test{'expect-header'}; + my $expect_header = $test->{'expect-header'}; die "get_header called with no expect header" unless defined $expect_header; @@ -954,10 +1171,9 @@ sub get_header ($$) { if ($expect_header eq 'REMOVAL' or $expect_header eq 'NO CHANGE' - or $expect_header eq 'SOME CHANGE') { - - $expect_header = $test{'data'}; + or $expect_header eq 'SOME CHANGE') { + $expect_header = $test->{'data'}; } $header_to_get = get_header_name($expect_header); @@ -996,24 +1212,23 @@ sub get_header ($$) { sub get_server_header ($$) { my $buffer_ref = shift; - my $test_ref = shift; + my $test = shift; - my %test = %{$test_ref}; my @buffer = @{$buffer_ref}; - my $expect_header = $test{'expect-header'}; + my $expect_header = $test->{'expect-header'}; my $header; my $header_to_get; # XXX: Should be caught before starting to test. - l(LL_ERROR, "No expect header for test " . $test{'number'}) + log_and_die("No expect header for test " . $test->{'number'}) unless defined $expect_header; if ($expect_header eq 'REMOVAL' or $expect_header eq 'NO CHANGE' or $expect_header eq 'SOME CHANGE') { - $expect_header = $test{'data'}; + $expect_header = $test->{'data'}; } $header_to_get = get_header_name($expect_header); @@ -1047,7 +1262,7 @@ sub get_status_code ($) { return '123' if cli_option_is_set('fuzzer-feeding'); chomp; - l(LL_ERROR, 'Unexpected buffer line: "' . $_ . '"'); + log_and_die('Unexpected buffer line: "' . $_ . '"'); } } } @@ -1059,22 +1274,21 @@ sub get_test_keys () { # XXX: incomplete sub test_content_as_string ($) { - my $test_ref = shift; - my %test = %{$test_ref}; + my $test = shift; my $s = "\n\t"; foreach my $key (get_test_keys()) { - $test{$key} = 'Not set' unless (defined $test{$key}); + $test->{$key} = 'Not set' unless (defined $test->{$key}); } - $s .= 'Tag: ' . $test{'tag'}; + $s .= 'Tag: ' . $test->{'tag'}; $s .= "\n\t"; - $s .= 'Set header: ' . $test{'data'}; # XXX: adjust for other test types + $s .= 'Set header: ' . $test->{'data'}; # XXX: adjust for other test types $s .= "\n\t"; - $s .= 'Expected header: ' . $test{'expect-header'}; + $s .= 'Expected header: ' . $test->{'expect-header'}; $s .= "\n\t"; - $s .= 'Ignore: ' . $test{'ignore'}; + $s .= 'Ignore: ' . $test->{'ignore'}; return $s; } @@ -1099,11 +1313,6 @@ sub fuzz_header($) { # ############################################################################ -sub check_for_curl () { - my $curl = CURL; - l(LL_ERROR, "No curl found.") unless (`which $curl`); -} - sub get_cgi_page_or_else ($) { my $cgi_url = shift; @@ -1123,7 +1332,7 @@ sub get_cgi_page_or_else ($) { } else { - l(LL_ERROR, $log_message); + log_and_die($log_message); } } @@ -1134,18 +1343,17 @@ sub get_cgi_page_or_else ($) { sub get_show_request_with_curl ($) { our $privoxy_cgi_url; - my $test_ref = shift; - my %test = %{$test_ref}; + my $test = shift; my $curl_parameters = ' '; - my $header = $test{'data'}; + my $header = $test->{'data'}; if (cli_option_is_set('header-fuzzing')) { $header = fuzz_header($header); } # Enable the action to test - $curl_parameters .= '-H \'X-Privoxy-Control: ' . $test{'tag'} . '\' '; + $curl_parameters .= '-H \'X-Privoxy-Control: ' . $test->{'tag'} . '\' '; # The header to filter $curl_parameters .= '-H \'' . $header . '\' '; @@ -1159,15 +1367,14 @@ sub get_show_request_with_curl ($) { sub get_head_with_curl ($) { our $fellatio_url = FELLATIO_URL; - my $test_ref = shift; - my %test = %{$test_ref}; + my $test = shift; my $curl_parameters = ' '; # Enable the action to test - $curl_parameters .= '-H \'X-Privoxy-Control: ' . $test{'tag'} . '\' '; + $curl_parameters .= '-H \'X-Privoxy-Control: ' . $test->{'tag'} . '\' '; # The header to filter - $curl_parameters .= '-H \'X-Gimme-Head-With: ' . $test{'data'} . '\' '; + $curl_parameters .= '-H \'X-Gimme-Head-With: ' . $test->{'data'} . '\' '; $curl_parameters .= '--head '; $curl_parameters .= ' '; @@ -1186,8 +1393,9 @@ sub get_page_with_curl ($) { my $retries_left = get_cli_option('retries') + 1; my $failure_reason; - $curl_line .= ' --proxy ' . $proxy if (defined $proxy); - + if (defined $proxy) { + $curl_line .= ' --proxy ' . quote($proxy); + } # We want to see the HTTP status code $curl_line .= " --include "; # Let Privoxy emit two log messages less. @@ -1212,6 +1420,7 @@ sub get_page_with_curl ($) { @buffer = `$curl_line`; if ($?) { + log_and_die("Executing '$curl_line' failed.") unless @buffer; $failure_reason = array_as_string(\@buffer); chomp $failure_reason; l(LL_SOFT_ERROR, "Fetch failure: '" . $failure_reason . $! ."'"); @@ -1219,9 +1428,8 @@ sub get_page_with_curl ($) { } while ($? && --$retries_left); unless ($retries_left) { - l(LL_ERROR, - "Running curl failed " . get_cli_option('retries') . - " times in a row. Last error: '" . $failure_reason . "'."); + log_and_die("Running curl failed " . get_cli_option('retries') . + " times in a row. Last error: '" . $failure_reason . "'."); } return \@buffer; @@ -1246,8 +1454,8 @@ sub array_as_string ($) { } sub show_test ($) { - my $test_ref = shift; - log_message('Test is:' . test_content_as_string($test_ref)); + my $test = shift; + log_message('Test is:' . test_content_as_string($test)); } # Conditional log @@ -1256,17 +1464,14 @@ sub l ($$) { my $this_level = shift; my $message = shift; - return unless ($log_level & $this_level); + log_message($message) if ($log_level & $this_level); +} - if (LL_ERROR & $this_level) { - $message = 'Oh noes. ' . $message . ' Fatal error. Exiting.'; - } +sub log_and_die ($) { + my $message = shift; - log_message($message); - - if (LL_ERROR & $this_level) { - exit; - } + log_message('Oh noes. ' . $message . ' Fatal error. Exiting.'); + exit; } sub log_message ($) { @@ -1286,7 +1491,7 @@ sub log_message ($) { if ($leading_log_date) { $year += 1900; $mon += 1; - $time_stamp = sprintf("%i/%.2i/%.2i", $year, $mon, $mday); + $time_stamp = sprintf("%i-%.2i-%.2i", $year, $mon, $mday); } if ($leading_log_time) { @@ -1305,76 +1510,82 @@ sub log_result ($$) { our $verbose_test_description; our $filtered_request; - my $test_ref = shift; + my $test = shift; my $result = shift; my $number = shift; - my %test = %{$test_ref}; my $message = ''; $message .= interpret_result($result); $message .= " for test "; $message .= $number; $message .= '/'; - $message .= $test{'number'}; + $message .= $test->{'number'}; $message .= '/'; - $message .= $test{'section-id'}; + $message .= $test->{'section-id'}; $message .= '/'; - $message .= $test{'regression-test-id'}; + $message .= $test->{'regression-test-id'}; $message .= '.'; if ($verbose_test_description) { - if ($test{'type'} == CLIENT_HEADER_TEST) { + if ($test->{'type'} == CLIENT_HEADER_TEST) { $message .= ' Header '; - $message .= quote($test{'data'}); + $message .= quote($test->{'data'}); $message .= ' and tag '; - $message .= quote($test{'tag'}); + $message .= quote($test->{'tag'}); - } elsif ($test{'type'} == SERVER_HEADER_TEST) { + } elsif ($test->{'type'} == SERVER_HEADER_TEST) { $message .= ' Request Header '; - $message .= quote($test{'data'}); + $message .= quote($test->{'data'}); $message .= ' and tag '; - $message .= quote($test{'tag'}); + $message .= quote($test->{'tag'}); - } elsif ($test{'type'} == DUMB_FETCH_TEST) { + } elsif ($test->{'type'} == DUMB_FETCH_TEST) { $message .= ' URL '; - $message .= quote($test{'data'}); + $message .= quote($test->{'data'}); $message .= ' and expected status code '; - $message .= quote($test{'expected-status-code'}); + $message .= quote($test->{'expected-status-code'}); - } elsif ($test{'type'} == TRUSTED_CGI_REQUEST) { + } elsif ($test->{'type'} == TRUSTED_CGI_REQUEST) { $message .= ' CGI URL '; - $message .= quote($test{'data'}); + $message .= quote($test->{'data'}); $message .= ' and expected status code '; - $message .= quote($test{'expected-status-code'}); + $message .= quote($test->{'expected-status-code'}); - } elsif ($test{'type'} == METHOD_TEST) { + } elsif ($test->{'type'} == METHOD_TEST) { $message .= ' HTTP method '; - $message .= quote($test{'data'}); + $message .= quote($test->{'data'}); $message .= ' and expected status code '; - $message .= quote($test{'expected-status-code'}); + $message .= quote($test->{'expected-status-code'}); - } elsif ($test{'type'} == BLOCK_TEST) { + } elsif ($test->{'type'} == BLOCK_TEST) { $message .= ' Supposedly-blocked URL: '; - $message .= quote($test{'data'}); + $message .= quote($test->{'data'}); - } elsif ($test{'type'} == STICKY_ACTIONS_TEST) { + } elsif ($test->{'type'} == STICKY_ACTIONS_TEST) { $message .= ' Sticky Actions: '; - $message .= quote($test{'sticky-actions'}); + $message .= quote($test->{'sticky-actions'}); $message .= ' and URL: '; - $message .= quote($test{'data'}); + $message .= quote($test->{'data'}); + + } elsif ($test->{'type'} == REDIRECT_TEST) { + + $message .= ' Redirected URL: '; + $message .= quote($test->{'data'}); + $message .= ' and redirect destination: '; + $message .= quote($test->{'redirect destination'}); } else { - die "Incomplete support for test type " . $test{'type'} . " detected."; + die "Incomplete support for test type " . $test->{'type'} . " detected."; } } @@ -1387,7 +1598,25 @@ sub quote ($) { } sub print_version () { - printf PRT_VERSION . "\n" . 'Copyright (C) 2007-2009 Fabian Keil ' . "\n"; + printf PRT_VERSION . "\n" . 'Copyright (C) 2007-2011 Fabian Keil ' . "\n"; +} + +sub list_test_types () { + my %test_types = ( + 'Client header test' => CLIENT_HEADER_TEST, + 'Server header test' => 2, + 'Dumb fetch test' => 3, + 'Method test' => 4, + 'Sticky action test' => 5, + 'Trusted CGI test' => 6, + 'Block test' => 7, + 'Redirect test' => 108, + ); + + print "\nThe supported test types and their default levels are:\n"; + foreach my $test_type (sort { $test_types{$a} <=> $test_types{$b} } keys %test_types) { + printf " %-20s -> %3.d\n", $test_type, $test_types{$test_type}; + } } sub help () { @@ -1406,6 +1635,7 @@ Options and their default values if they have any: [--help] [--header-fuzzing] [--level] + [--local-test-file] [--loops $cli_options{'loops'}] [--max-level $cli_options{'max-level'}] [--max-time $cli_options{'max-time'}] @@ -1413,12 +1643,22 @@ Options and their default values if they have any: [--privoxy-address] [--retries $cli_options{'retries'}] [--show-skipped-tests] + [--shuffle-tests] + [--sleep-time $cli_options{'sleep-time'}] [--test-number] [--verbose] [--version] -see "perldoc $0" for more information EOF ; + + list_test_types(); + + print << " EOF" + +Try "perldoc $0" for more information + EOF + ; + exit(0); } @@ -1433,6 +1673,7 @@ sub init_cli_options () { $cli_options{'max-level'} = CLI_MAX_LEVEL; $cli_options{'max-time'} = CLI_MAX_TIME; $cli_options{'min-level'} = CLI_MIN_LEVEL; + $cli_options{'sleep-time'}= CLI_SLEEP_TIME; $cli_options{'retries'} = CLI_RETRIES; } @@ -1444,24 +1685,27 @@ sub parse_cli_options () { init_cli_options(); GetOptions ( - 'debug=s' => \$cli_options{'debug'}, - 'forks=s' => \$cli_options{'forks'}, + 'debug=i' => \$cli_options{'debug'}, + 'forks=i' => \$cli_options{'forks'}, 'fuzzer-address=s' => \$cli_options{'fuzzer-address'}, 'fuzzer-feeding' => \$cli_options{'fuzzer-feeding'}, 'header-fuzzing' => \$cli_options{'header-fuzzing'}, - 'help' => sub {help}, - 'level=s' => \$cli_options{'level'}, - 'loops=s' => \$cli_options{'loops'}, - 'max-level=s' => \$cli_options{'max-level'}, - 'max-time=s' => \$cli_options{'max-time'}, - 'min-level=s' => \$cli_options{'min-level'}, + 'help' => \&help, + 'level=i' => \$cli_options{'level'}, + 'local-test-file=s' => \$cli_options{'local-test-file'}, + 'loops=i' => \$cli_options{'loops'}, + 'max-level=i' => \$cli_options{'max-level'}, + 'max-time=i' => \$cli_options{'max-time'}, + 'min-level=i' => \$cli_options{'min-level'}, 'privoxy-address=s' => \$cli_options{'privoxy-address'}, - 'retries=s' => \$cli_options{'retries'}, + 'retries=i' => \$cli_options{'retries'}, + 'shuffle-tests' => \$cli_options{'shuffle-tests'}, 'show-skipped-tests' => \$cli_options{'show-skipped-tests'}, - 'test-number=s' => \$cli_options{'test-number'}, + 'sleep-time=i' => \$cli_options{'sleep-time'}, + 'test-number=i' => \$cli_options{'test-number'}, 'verbose' => \$cli_options{'verbose'}, 'version' => sub {print_version && exit(0)} - ); + ) or exit(1); $log_level |= $cli_options{'debug'}; } @@ -1497,14 +1741,13 @@ sub init_proxy_settings($) { if (cli_option_is_set('privoxy-address')) { $proxy .= get_cli_option('privoxy-address'); } - } } sub start_forks($) { my $forks = shift; - l(LL_ERROR, "Invalid --fork value: " . $forks . ".") if ($forks < 0); + log_and_die("Invalid --fork value: " . $forks . ".") if ($forks < 0); foreach my $fork (1 .. $forks) { log_message("Starting fork $fork"); @@ -1519,9 +1762,8 @@ sub main () { init_our_variables(); parse_cli_options(); - check_for_curl(); init_proxy_settings('vanilla-proxy'); - load_regressions_tests(); + load_regression_tests(); init_proxy_settings('fuzz-proxy'); start_forks(get_cli_option('forks')) if cli_option_is_set('forks'); execute_regression_tests(); @@ -1537,10 +1779,10 @@ B - A regression test "framework" for Privoxy. B [B<--debug bitmask>] [B<--forks> forks] [B<--fuzzer-feeding>] [B<--fuzzer-feeding>] [B<--help>] [B<--level level>] -[B<--loops count>] [B<--max-level max-level>] [B<--max-time max-time>] -[B<--min-level min-level>] B<--privoxy-address proxy-address> +[B<--local-test-file testfile>] [B<--loops count>] [B<--max-level max-level>] +[B<--max-time max-time>] [B<--min-level min-level>] B<--privoxy-address proxy-address> [B<--retries retries>] [B<--test-number test-number>] -[B<--show-skipped-tests>] [B<--verbose>] +[B<--show-skipped-tests>] [B<--sleep-time> seconds] [B<--verbose>] [B<--version>] =head1 DESCRIPTION @@ -1624,6 +1866,11 @@ To verify that a specific set of actions is applied to an URL, use: The sticky actions will be checked for all URLs below it until the next sticky actions directive. +To verify that requests for a URL get redirected, use: + + # Redirected URL = http://www.example.com/redirect-me + # Redirect Destination = http://www.example.org/redirected + =head1 TEST LEVELS All tests have test levels to let the user @@ -1631,9 +1878,15 @@ control which ones to execute (see I below). Test levels are either set with the B directive, or implicitly through the test type. -Block tests default to level 7, fetch tests to level 6, -"Sticky Actions" tests default to level 5, tests for trusted CGI -requests to level 3 and client-header-action tests to level 1. +Redirect tests default to level 108, block tests to level 7, +fetch tests to level 6, "Sticky Actions" tests default to +level 5, tests for trusted CGI requests to level 3 and +client-header-action tests to level 1. + +The current redirect test level is above the default +max-level value as failed tests will result in outgoing +connections. Use the B<--max-level> option to run them +as well. =head1 OPTIONS @@ -1662,6 +1915,12 @@ headers in a way that should not affect the test result. B<--level level> Only execute tests with the specified B. +B<--local-test-file test-file> Do not get the tests +through Privoxy's web interface, but use a single local +file. Not recommended for testing Privoxy, but can be useful +to "misappropriate" Privoxy-Regression-Test to test other +stuff, like webserver configurations. + B<--loop count> Loop through the regression tests B times. Useful to feed a fuzzer, or when doing stress tests with several Privoxy-Regression-Test instances running at the same @@ -1691,7 +1950,16 @@ number. B<--show-skipped-tests> Log skipped tests even if verbose mode is off. -B<--verbose> Log succesful and skipped tests. +B<--shuffle-tests> Shuffle test sections and their tests before +executing them. When combined with B<--forks>, this can increase +the chances of detecting race conditions. Of course some problems +are easier to detect without this option. + +B<--sleep-time seconds> Wait B between tests. Useful when +debugging issues with systems that don't log with millisecond precision. + +B<--verbose> Log successful tests as well. By default only +the failures are logged. B<--version> Print version and exit. diff --git a/external/privoxy/tools/url-pattern-translator.pl b/external/privoxy/tools/url-pattern-translator.pl index a5753331..0f084f4a 100755 --- a/external/privoxy/tools/url-pattern-translator.pl +++ b/external/privoxy/tools/url-pattern-translator.pl @@ -18,7 +18,7 @@ # Only convert your files once, or, as RoboCop used to say, # there will be... trouble. # -# $Id: url-pattern-translator.pl,v 1.3 2009/01/13 17:01:04 fabiankeil Exp $ +# $Id: url-pattern-translator.pl,v 1.4 2009/06/21 18:15:24 fabiankeil Exp $ # # Copyright (c) 2008 Fabian Keil # @@ -63,7 +63,7 @@ sub convert_host_pattern ($) { } # Match-all syntax has changed ... - $hp =~ s@\*@.*@g; + $hp =~ s@\*@[^.]*@g; # Extended host patterns are right-anchored by default $hp =~ s@\.$@(\..*)?@; diff --git a/external/privoxy/urlmatch.c b/external/privoxy/urlmatch.c index 47b607cc..79f00f45 100644 --- a/external/privoxy/urlmatch.c +++ b/external/privoxy/urlmatch.c @@ -1,4 +1,4 @@ -const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.47 2009/03/02 19:18:10 fabiankeil Exp $"; +const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.65 2011/11/06 11:41:34 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/urlmatch.c,v $ @@ -6,7 +6,7 @@ const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.47 2009/03/02 19:18:10 fabianke * Purpose : Declares functions to match URLs against URL * patterns. * - * Copyright : Written by and Copyright (C) 2001-2009 + * Copyright : Written by and Copyright (C) 2001-2011 * the Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written @@ -31,228 +31,8 @@ const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.47 2009/03/02 19:18:10 fabianke * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: urlmatch.c,v $ - * Revision 1.47 2009/03/02 19:18:10 fabiankeil - * Streamline parse_http_request()'s prototype. As - * cparser pointed out it doesn't actually use csp. - * - * Revision 1.46 2009/02/11 19:31:32 fabiankeil - * Reject request lines that end with neither HTTP/1.0 nor HTTP/1.1. - * - * Revision 1.45 2008/06/21 21:19:18 fabiankeil - * Silence bogus compiler warning. - * - * Revision 1.44 2008/05/04 16:18:32 fabiankeil - * Provide parse_http_url() with a third parameter to specify - * whether or not URLs without protocol are acceptable. - * - * Revision 1.43 2008/05/04 13:30:55 fabiankeil - * Streamline parse_http_url()'s prototype. - * - * Revision 1.42 2008/05/04 13:24:16 fabiankeil - * If the method isn't CONNECT, reject URLs without protocol. - * - * Revision 1.41 2008/05/02 09:51:34 fabiankeil - * In parse_http_url(), don't muck around with values - * that are none of its business: require an initialized - * http structure and never unset http->ssl. - * - * Revision 1.40 2008/04/23 16:12:28 fabiankeil - * Free with freez(). - * - * Revision 1.39 2008/04/22 16:27:42 fabiankeil - * In parse_http_request(), remove a pointless - * temporary variable and free the buffer earlier. - * - * Revision 1.38 2008/04/18 05:17:18 fabiankeil - * Mark simplematch()'s parameters as immutable. - * - * Revision 1.37 2008/04/17 14:53:29 fabiankeil - * Move simplematch() into urlmatch.c as it's only - * used to match (old-school) domain patterns. - * - * Revision 1.36 2008/04/14 18:19:48 fabiankeil - * Remove now-pointless cast in create_url_spec(). - * - * Revision 1.35 2008/04/14 18:11:21 fabiankeil - * The compiler might not notice it, but the buffer passed to - * create_url_spec() is modified later on and thus shouldn't - * be declared immutable. - * - * Revision 1.34 2008/04/13 13:32:07 fabiankeil - * Factor URL pattern compilation out of create_url_spec(). - * - * Revision 1.33 2008/04/12 14:03:13 fabiankeil - * Remove an obvious comment and improve another one. - * - * Revision 1.32 2008/04/12 12:38:06 fabiankeil - * Factor out duplicated code to compile host, path and tag patterns. - * - * Revision 1.31 2008/04/10 14:41:04 fabiankeil - * Ditch url_spec's path member now that it's no longer used. - * - * Revision 1.30 2008/04/10 04:24:24 fabiankeil - * Stop duplicating the plain text representation of the path regex - * (and keeping the copy around). Once the regex is compiled it's no - * longer useful. - * - * Revision 1.29 2008/04/10 04:17:56 fabiankeil - * In url_match(), check the right member for NULL when determining - * whether there's a path regex to execute. Looking for a plain-text - * representation works as well, but it looks "interesting" and that - * member will be removed soonish anyway. - * - * Revision 1.28 2008/04/08 16:07:39 fabiankeil - * Make it harder to mistake url_match()'s - * second parameter for an url_spec. - * - * Revision 1.27 2008/04/08 15:44:33 fabiankeil - * Save a bit of memory (and a few cpu cycles) by not bothering to - * compile slash-only path regexes that don't affect the result. - * - * Revision 1.26 2008/04/07 16:57:18 fabiankeil - * - Use free_url_spec() more consistently. - * - Let it reset url->dcount just in case. - * - * Revision 1.25 2008/04/06 15:18:38 fabiankeil - * Oh well, rename the --enable-pcre-host-patterns option to - * --enable-extended-host-patterns as it's not really PCRE syntax. - * - * Revision 1.24 2008/04/06 14:54:26 fabiankeil - * Use PCRE syntax in host patterns when configured - * with --enable-pcre-host-patterns. - * - * Revision 1.23 2008/04/05 12:19:20 fabiankeil - * Factor compile_host_pattern() out of create_url_spec(). - * - * Revision 1.22 2008/03/30 15:02:32 fabiankeil - * SZitify unknown_method(). - * - * Revision 1.21 2007/12/24 16:34:23 fabiankeil - * Band-aid (and micro-optimization) that makes it less likely to run out of - * stack space with overly-complex path patterns. Probably masks the problem - * reported by Lee in #1856679. Hohoho. - * - * Revision 1.20 2007/09/02 15:31:20 fabiankeil - * Move match_portlist() from filter.c to urlmatch.c. - * It's used for url matching, not for filtering. - * - * Revision 1.19 2007/09/02 13:42:11 fabiankeil - * - Allow port lists in url patterns. - * - Ditch unused url_spec member pathlen. - * - * Revision 1.18 2007/07/30 16:42:21 fabiankeil - * Move the method check into unknown_method() - * and loop through the known methods instead - * of using a screen-long OR chain. - * - * Revision 1.17 2007/04/15 16:39:21 fabiankeil - * Introduce tags as alternative way to specify which - * actions apply to a request. At the moment tags can be - * created based on client and server headers. - * - * Revision 1.16 2007/02/13 13:59:24 fabiankeil - * Remove redundant log message. - * - * Revision 1.15 2007/01/28 16:11:23 fabiankeil - * Accept WebDAV methods for subversion - * in parse_http_request(). Closes FR 1581425. - * - * Revision 1.14 2007/01/06 14:23:56 fabiankeil - * Fix gcc43 warnings. Mark *csp as immutable - * for parse_http_url() and url_match(). - * Replace a sprintf call with snprintf. - * - * Revision 1.13 2006/12/06 19:50:54 fabiankeil - * parse_http_url() now handles intercepted - * HTTP request lines as well. Moved parts - * of parse_http_url()'s code into - * init_domain_components() so that it can - * be reused in chat(). - * - * Revision 1.12 2006/07/18 14:48:47 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.10.2.7 2003/05/17 15:57:24 oes - * - parse_http_url now checks memory allocation failure for - * duplication of "*" URL and rejects "*something" URLs - * Closes bug #736344 - * - Added a comment to what might look like a bug in - * create_url_spec (see !bug #736931) - * - Comment cosmetics - * - * Revision 1.10.2.6 2003/05/07 12:39:48 oes - * Fix typo: Default port for https URLs is 443, not 143. - * Thanks to Scott Tregear for spotting this one. - * - * Revision 1.10.2.5 2003/02/28 13:09:29 oes - * Fixed a rare double free condition as per Bug #694713 - * - * Revision 1.10.2.4 2003/02/28 12:57:44 oes - * Moved freeing of http request structure to its owner - * as per Dan Price's observations in Bug #694713 - * - * Revision 1.10.2.3 2002/11/12 16:50:40 oes - * Fixed memory leak in parse_http_request() reported by Oliver Stoeneberg. Fixes bug #637073 - * - * Revision 1.10.2.2 2002/09/25 14:53:15 oes - * Added basic support for OPTIONS and TRACE HTTP methods: - * parse_http_url now recognizes the "*" URI as well as - * the OPTIONS and TRACE method keywords. - * - * Revision 1.10.2.1 2002/06/06 19:06:44 jongfoster - * Adding support for proprietary Microsoft WebDAV extensions - * - * Revision 1.10 2002/05/12 21:40:37 jongfoster - * - Removing some unused code - * - * Revision 1.9 2002/04/04 00:36:36 gliptak - * always use pcre for matching - * - * Revision 1.8 2002/04/03 23:32:47 jongfoster - * Fixing memory leak on error - * - * Revision 1.7 2002/03/26 22:29:55 swa - * we have a new homepage! - * - * Revision 1.6 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.5 2002/03/13 00:27:05 jongfoster - * Killing warnings - * - * Revision 1.4 2002/03/07 03:46:17 oes - * Fixed compiler warnings - * - * Revision 1.3 2002/03/03 14:51:11 oes - * Fixed CLF logging: Added ocmd member for client's request to struct http_request - * - * Revision 1.2 2002/01/21 00:14:09 jongfoster - * Correcting comment style - * Fixing an uninitialized memory bug in create_url_spec() - * - * Revision 1.1 2002/01/17 20:53:46 jongfoster - * Moving all our URL and URL pattern parsing code to the same file - it - * was scattered around in filters.c, loaders.c and parsers.c. - * - * Providing a single, simple url_match(pattern,url) function - rather than - * the 3-line match routine which was repeated all over the place. - * - * Renaming free_url to free_url_spec, since it frees a struct url_spec. - * - * Providing parse_http_url() so that URLs can be parsed without faking a - * HTTP request line for parse_http_request() or repeating the parsing - * code (both of which were techniques that were actually in use). - * - * Standardizing that struct http_request is used to represent a URL, and - * struct url_spec is used to represent a URL pattern. (Before, URLs were - * represented as seperate variables and a partially-filled-in url_spec). - * - * *********************************************************************/ - + #include "config.h" @@ -278,7 +58,13 @@ const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.47 2009/03/02 19:18:10 fabianke const char urlmatch_h_rcs[] = URLMATCH_H_VERSION; -enum regex_anchoring {NO_ANCHORING, LEFT_ANCHORED, RIGHT_ANCHORED}; +enum regex_anchoring +{ + NO_ANCHORING, + LEFT_ANCHORED, + RIGHT_ANCHORED, + RIGHT_ANCHORED_HOST +}; static jb_err compile_host_pattern(struct url_spec *url, const char *host_pattern); /********************************************************************* @@ -306,12 +92,15 @@ void free_http_request(struct http_request *http) freez(http->path); freez(http->ver); freez(http->host_ip_addr_str); +#ifndef FEATURE_EXTENDED_HOST_PATTERNS freez(http->dbuffer); freez(http->dvec); http->dcount = 0; +#endif } +#ifndef FEATURE_EXTENDED_HOST_PATTERNS /********************************************************************* * * Function : init_domain_components @@ -375,6 +164,54 @@ jb_err init_domain_components(struct http_request *http) return JB_ERR_OK; } +#endif /* ndef FEATURE_EXTENDED_HOST_PATTERNS */ + + +/********************************************************************* + * + * Function : url_requires_percent_encoding + * + * Description : Checks if an URL contains invalid characters + * according to RFC 3986 that should be percent-encoded. + * Does not verify whether or not the passed string + * actually is a valid URL. + * + * Parameters : + * 1 : url = URL to check + * + * Returns : True in case of valid URLs, false otherwise + * + *********************************************************************/ +int url_requires_percent_encoding(const char *url) +{ + static const char allowed_characters[128] = { + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '!', '\0', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', + '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', + '\0', '=', '\0', '?', '@', 'A', 'B', 'C', 'D', 'E', + 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', + 'Z', '[', '\0', ']', '\0', '_', '\0', 'a', 'b', 'c', + 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', + 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '\0', '\0', '\0', '~', '\0' + }; + + while (*url != '\0') + { + const unsigned int i = (unsigned char)*url++; + if (i >= sizeof(allowed_characters) || '\0' == allowed_characters[i]) + { + return TRUE; + } + } + + return FALSE; + +} /********************************************************************* @@ -413,11 +250,11 @@ jb_err parse_http_url(const char *url, struct http_request *http, int require_pr /* * Check for * URI. If found, we're done. - */ + */ if (*http->url == '*') { if ( NULL == (http->path = strdup("*")) - || NULL == (http->hostport = strdup("")) ) + || NULL == (http->hostport = strdup("")) ) { return JB_ERR_MEMORY; } @@ -540,8 +377,40 @@ jb_err parse_http_url(const char *url, struct http_request *http, int require_pr host = buf; } + /* Move after hostname before port number */ + if (*host == '[') + { + /* Numeric IPv6 address delimited by brackets */ + host++; + port = strchr(host, ']'); + + if (port == NULL) + { + /* Missing closing bracket */ + freez(buf); + return JB_ERR_PARSE; + } + + *port++ = '\0'; + + if (*port == '\0') + { + port = NULL; + } + else if (*port != ':') + { + /* Garbage after closing bracket */ + freez(buf); + return JB_ERR_PARSE; + } + } + else + { + /* Plain non-escaped hostname */ + port = strchr(host, ':'); + } + /* check if url contains port */ - port = strchr(host, ':'); if (port != NULL) { /* Contains port */ @@ -565,10 +434,12 @@ jb_err parse_http_url(const char *url, struct http_request *http, int require_pr } } - /* - * Split domain name so we can compare it against wildcards - */ +#ifdef FEATURE_EXTENDED_HOST_PATTERNS + return JB_ERR_OK; +#else + /* Split domain name so we can compare it against wildcards */ return init_domain_components(http); +#endif /* def FEATURE_EXTENDED_HOST_PATTERNS */ } @@ -587,7 +458,7 @@ jb_err parse_http_url(const char *url, struct http_request *http, int require_pr *********************************************************************/ static int unknown_method(const char *method) { - static const char *known_http_methods[] = { + static const char * const known_http_methods[] = { /* Basic HTTP request type */ "GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS", "TRACE", "CONNECT", /* webDAV extensions (RFC2518) */ @@ -596,14 +467,14 @@ static int unknown_method(const char *method) * Microsoft webDAV extension for Exchange 2000. See: * http://lists.w3.org/Archives/Public/w3c-dist-auth/2002JanMar/0001.html * http://msdn.microsoft.com/library/en-us/wss/wss/_webdav_methods.asp - */ + */ "BCOPY", "BMOVE", "BDELETE", "BPROPFIND", "BPROPPATCH", /* * Another Microsoft webDAV extension for Exchange 2000. See: * http://systems.cs.colorado.edu/grunwald/MobileComputing/Papers/draft-cohen-gena-p-base-00.txt * http://lists.w3.org/Archives/Public/w3c-dist-auth/2002JanMar/0001.html * http://msdn.microsoft.com/library/en-us/wss/wss/_webdav_methods.asp - */ + */ "SUBSCRIBE", "UNSUBSCRIBE", "NOTIFY", "POLL", /* * Yet another WebDAV extension, this time for @@ -728,9 +599,10 @@ jb_err parse_http_request(const char *req, struct http_request *http) * * Parameters : * 1 : pattern = The pattern to compile. - * 2 : anchoring = How the regex should be anchored. - * Can be either one of NO_ANCHORING, - * LEFT_ANCHORED or RIGHT_ANCHORED. + * 2 : anchoring = How the regex should be modified + * before compilation. Can be either + * one of NO_ANCHORING, LEFT_ANCHORED, + * RIGHT_ANCHORED or RIGHT_ANCHORED_HOST. * 3 : url = In case of failures, the spec member is * logged and the structure freed. * 4 : regex = Where the compiled regex should be stored. @@ -764,6 +636,9 @@ static jb_err compile_pattern(const char *pattern, enum regex_anchoring anchorin case RIGHT_ANCHORED: fmt = "%s$"; break; + case RIGHT_ANCHORED_HOST: + fmt = "%s\\.?$"; + break; case LEFT_ANCHORED: fmt = "^%s"; break; @@ -844,7 +719,33 @@ static jb_err compile_url_pattern(struct url_spec *url, char *buf) *p = '\0'; } - p = strchr(buf, ':'); + /* + * IPv6 numeric hostnames can contain colons, thus we need + * to delimit the hostname before the real port separator. + * As brackets are already used in the hostname pattern, + * we use angle brackets ('<', '>') instead. + */ + if ((buf[0] == '<') && (NULL != (p = strchr(buf + 1, '>')))) + { + *p++ = '\0'; + buf++; + + if (*p == '\0') + { + /* IPv6 address without port number */ + p = NULL; + } + else if (*p != ':') + { + /* Garbage after address delimiter */ + return JB_ERR_PARSE; + } + } + else + { + p = strchr(buf, ':'); + } + if (NULL != p) { *p++ = '\0'; @@ -887,7 +788,7 @@ static jb_err compile_url_pattern(struct url_spec *url, char *buf) *********************************************************************/ static jb_err compile_host_pattern(struct url_spec *url, const char *host_pattern) { - return compile_pattern(host_pattern, RIGHT_ANCHORED, url, &url->host_regex); + return compile_pattern(host_pattern, RIGHT_ANCHORED_HOST, url, &url->host_regex); } #else @@ -925,7 +826,7 @@ static jb_err compile_host_pattern(struct url_spec *url, const char *host_patter url->unanchored |= ANCHOR_LEFT; } - /* + /* * Split domain into components */ url->dbuffer = strdup(host_pattern); @@ -935,7 +836,7 @@ static jb_err compile_host_pattern(struct url_spec *url, const char *host_patter return JB_ERR_MEMORY; } - /* + /* * Map to lower case */ for (p = url->dbuffer; *p ; p++) @@ -943,7 +844,7 @@ static jb_err compile_host_pattern(struct url_spec *url, const char *host_patter *p = (char)tolower((int)(unsigned char)*p); } - /* + /* * Split the domain name into components */ url->dcount = ssplit(url->dbuffer, ".", v, SZ(v), 1, 1); @@ -955,11 +856,11 @@ static jb_err compile_host_pattern(struct url_spec *url, const char *host_patter } else if (url->dcount != 0) { - /* + /* * Save a copy of the pointers in dvec */ size = (size_t)url->dcount * sizeof(*url->dvec); - + url->dvec = (char **)malloc(size); if (NULL == url->dvec) { @@ -998,13 +899,13 @@ static int simplematch(const char *pattern, const char *text) { const unsigned char *pat = (const unsigned char *)pattern; const unsigned char *txt = (const unsigned char *)text; - const unsigned char *fallback = pat; + const unsigned char *fallback = pat; int wildcard = 0; - + unsigned char lastchar = 'a'; unsigned i; unsigned char charmap[32]; - + while (*txt) { @@ -1022,15 +923,15 @@ static int simplematch(const char *pattern, const char *text) } /* '*' in the pattern? */ - if (*pat == '*') + if (*pat == '*') { - + /* The pattern ends afterwards? Speed up the return. */ if (*++pat == '\0') { return 0; } - + /* Else, set wildcard mode and remember position after '*' */ wildcard = 1; fallback = pat; @@ -1044,7 +945,7 @@ static int simplematch(const char *pattern, const char *text) while (*++pat != ']') { if (!*pat) - { + { return 1; } else if (*pat == '-') @@ -1056,7 +957,7 @@ static int simplematch(const char *pattern, const char *text) for (i = lastchar; i <= *pat; i++) { charmap[i / 8] |= (unsigned char)(1 << (i % 8)); - } + } } else { @@ -1067,21 +968,21 @@ static int simplematch(const char *pattern, const char *text) } /* -END- if Character range specification */ - /* - * Char match, or char range match? + /* + * Char match, or char range match? */ if ( (*pat == *txt) || (*pat == '?') || ((*pat == ']') && (charmap[*txt / 8] & (1 << (*txt % 8)))) ) { - /* - * Sucess: Go ahead + /* + * Success: Go ahead */ pat++; } else if (!wildcard) { - /* + /* * No match && no wildcard: No luck */ return 1; @@ -1273,15 +1174,15 @@ jb_err create_url_spec(struct url_spec *url, char *buf) return JB_ERR_MEMORY; } - /* Is it tag pattern? */ - if (0 == strncmpic("TAG:", url->spec, 4)) + /* Is it a tag pattern? */ + if (0 == strncmpic(url->spec, "TAG:", 4)) { /* The pattern starts with the first character after "TAG:" */ const char *tag_pattern = buf + 4; return compile_pattern(tag_pattern, NO_ANCHORING, url, &url->tag_regex); } - /* If it isn't a tag pattern it must be a URL pattern. */ + /* If it isn't a tag pattern it must be an URL pattern. */ return compile_url_pattern(url, buf); } @@ -1329,6 +1230,70 @@ void free_url_spec(struct url_spec *url) } +/********************************************************************* + * + * Function : port_matches + * + * Description : Compares a port against a port list. + * + * Parameters : + * 1 : port = The port to check. + * 2 : port_list = The list of port to compare with. + * + * Returns : TRUE for yes, FALSE otherwise. + * + *********************************************************************/ +static int port_matches(const int port, const char *port_list) +{ + return ((NULL == port_list) || match_portlist(port_list, port)); +} + + +/********************************************************************* + * + * Function : host_matches + * + * Description : Compares a host against a host pattern. + * + * Parameters : + * 1 : url = The URL to match + * 2 : pattern = The URL pattern + * + * Returns : TRUE for yes, FALSE otherwise. + * + *********************************************************************/ +static int host_matches(const struct http_request *http, + const struct url_spec *pattern) +{ +#ifdef FEATURE_EXTENDED_HOST_PATTERNS + return ((NULL == pattern->host_regex) + || (0 == regexec(pattern->host_regex, http->host, 0, NULL, 0))); +#else + return ((NULL == pattern->dbuffer) || (0 == domain_match(pattern, http))); +#endif +} + + +/********************************************************************* + * + * Function : path_matches + * + * Description : Compares a path against a path pattern. + * + * Parameters : + * 1 : path = The path to match + * 2 : pattern = The URL pattern + * + * Returns : TRUE for yes, FALSE otherwise. + * + *********************************************************************/ +static int path_matches(const char *path, const struct url_spec *pattern) +{ + return ((NULL == pattern->preg) + || (0 == regexec(pattern->preg, path, 0, NULL, 0))); +} + + /********************************************************************* * * Function : url_match @@ -1345,22 +1310,14 @@ void free_url_spec(struct url_spec *url) int url_match(const struct url_spec *pattern, const struct http_request *http) { - /* XXX: these should probably be functions. */ -#define PORT_MATCHES ((NULL == pattern->port_list) || match_portlist(pattern->port_list, http->port)) -#ifdef FEATURE_EXTENDED_HOST_PATTERNS -#define DOMAIN_MATCHES ((NULL == pattern->host_regex) || (0 == regexec(pattern->host_regex, http->host, 0, NULL, 0))) -#else -#define DOMAIN_MATCHES ((NULL == pattern->dbuffer) || (0 == domain_match(pattern, http))) -#endif -#define PATH_MATCHES ((NULL == pattern->preg) || (0 == regexec(pattern->preg, http->path, 0, NULL, 0))) - if (pattern->tag_regex != NULL) { /* It's a tag pattern and shouldn't be matched against URLs */ return 0; - } + } - return (PORT_MATCHES && DOMAIN_MATCHES && PATH_MATCHES); + return (port_matches(http->port, pattern->port_list) + && host_matches(http, pattern) && path_matches(http->path, pattern)); } @@ -1384,7 +1341,7 @@ int match_portlist(const char *portlist, int port) { char *min, *max, *next, *portlist_copy; - min = next = portlist_copy = strdup(portlist); + min = portlist_copy = strdup(portlist); /* * Zero-terminate first item and remember offset for next @@ -1397,7 +1354,7 @@ int match_portlist(const char *portlist, int port) /* * Loop through all items, checking for match */ - while(min) + while (NULL != min) { if (NULL == (max = strchr(min, (int) '-'))) { @@ -1445,6 +1402,59 @@ int match_portlist(const char *portlist, int port) } +/********************************************************************* + * + * Function : parse_forwarder_address + * + * Description : Parse out the host and port from a forwarder address. + * + * Parameters : + * 1 : address = The forwarder address to parse. + * 2 : hostname = Used to return the hostname. NULL on error. + * 3 : port = Used to return the port. Untouched if no port + * is specified. + * + * Returns : JB_ERR_OK on success + * JB_ERR_MEMORY on out of memory + * JB_ERR_PARSE on malformed address. + * + *********************************************************************/ +jb_err parse_forwarder_address(char *address, char **hostname, int *port) +{ + char *p = address; + + if ((*address == '[') && (NULL == strchr(address, ']'))) + { + /* XXX: Should do some more validity checks here. */ + return JB_ERR_PARSE; + } + + *hostname = strdup(address); + if (NULL == *hostname) + { + return JB_ERR_MEMORY; + } + + if ((**hostname == '[') && (NULL != (p = strchr(*hostname, ']')))) + { + *p++ = '\0'; + memmove(*hostname, (*hostname + 1), (size_t)(p - *hostname)); + if (*p == ':') + { + *port = (int)strtol(++p, NULL, 0); + } + } + else if (NULL != (p = strchr(*hostname, ':'))) + { + *p++ = '\0'; + *port = (int)strtol(p, NULL, 0); + } + + return JB_ERR_OK; + +} + + /* Local Variables: tab-width: 3 diff --git a/external/privoxy/urlmatch.h b/external/privoxy/urlmatch.h index db5c60bd..0cf22f2c 100644 --- a/external/privoxy/urlmatch.h +++ b/external/privoxy/urlmatch.h @@ -1,6 +1,6 @@ #ifndef URLMATCH_H_INCLUDED #define URLMATCH_H_INCLUDED -#define URLMATCH_H_VERSION "$Id: urlmatch.h,v 1.13 2009/03/02 19:18:11 fabiankeil Exp $" +#define URLMATCH_H_VERSION "$Id: urlmatch.h,v 1.18 2011/11/06 11:41:05 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/urlmatch.h,v $ @@ -8,14 +8,14 @@ * Purpose : Declares functions to match URLs against URL * patterns. * - * Copyright : Written by and Copyright (C) 2001-2002, 2006 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2002, 2006 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -33,69 +33,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: urlmatch.h,v $ - * Revision 1.13 2009/03/02 19:18:11 fabiankeil - * Streamline parse_http_request()'s prototype. As - * cparser pointed out it doesn't actually use csp. - * - * Revision 1.12 2008/05/04 16:18:32 fabiankeil - * Provide parse_http_url() with a third parameter to specify - * whether or not URLs without protocol are acceptable. - * - * Revision 1.11 2008/05/04 13:30:55 fabiankeil - * Streamline parse_http_url()'s prototype. - * - * Revision 1.10 2008/04/14 18:11:21 fabiankeil - * The compiler might not notice it, but the buffer passed to - * create_url_spec() is modified later on and thus shouldn't - * be declared immutable. - * - * Revision 1.9 2008/04/08 16:07:39 fabiankeil - * Make it harder to mistake url_match()'s - * second parameter for an url_spec. - * - * Revision 1.8 2007/09/02 15:31:20 fabiankeil - * Move match_portlist() from filter.c to urlmatch.c. - * It's used for url matching, not for filtering. - * - * Revision 1.7 2007/01/06 14:24:38 fabiankeil - * Mark *csp as immutable for parse_http_url() - * and url_match(). - * - * Revision 1.6 2006/12/06 19:12:43 fabiankeil - * Added prototype for init_domain_components(). - * - * Revision 1.5 2006/07/18 14:48:47 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.3 2002/03/26 22:29:55 swa - * we have a new homepage! - * - * Revision 1.2 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.1 2002/01/17 20:53:46 jongfoster - * Moving all our URL and URL pattern parsing code to the same file - it - * was scattered around in filters.c, loaders.c and parsers.c. - * - * Providing a single, simple url_match(pattern,url) function - rather than - * the 3-line match routine which was repeated all over the place. - * - * Renaming free_url to free_url_spec, since it frees a struct url_spec. - * - * Providing parse_http_url() so that URLs can be parsed without faking a - * HTTP request line for parse_http_request() or repeating the parsing - * code (both of which were techniques that were actually in use). - * - * Standardizing that struct http_request is used to represent a URL, and - * struct url_spec is used to represent a URL pattern. (Before, URLs were - * represented as seperate variables and a partially-filled-in url_spec). - * - * *********************************************************************/ - + #include "project.h" @@ -104,11 +43,15 @@ extern "C" { #endif extern void free_http_request(struct http_request *http); +#ifndef FEATURE_EXTENDED_HOST_PATTERNS extern jb_err init_domain_components(struct http_request *http); +#endif extern jb_err parse_http_request(const char *req, struct http_request *http); extern jb_err parse_http_url(const char *url, struct http_request *http, int require_protocol); +extern int url_requires_percent_encoding(const char *url); + #define REQUIRE_PROTOCOL 1 extern int url_match(const struct url_spec *pattern, @@ -117,6 +60,7 @@ extern int url_match(const struct url_spec *pattern, extern jb_err create_url_spec(struct url_spec *url, char *buf); extern void free_url_spec(struct url_spec *url); extern int match_portlist(const char *portlist, int port); +extern jb_err parse_forwarder_address(char *address, char **hostname, int *port); /* Revision control strings from this header and associated .c file */ diff --git a/external/privoxy/user.action b/external/privoxy/user.action index 7b18dd9e..2a990b1f 100644 --- a/external/privoxy/user.action +++ b/external/privoxy/user.action @@ -2,7 +2,7 @@ # # File : $Source: /cvsroot/ijbswa/current/user.action,v $ # -# $Id: user.action,v 1.9 2008/03/27 18:27:37 fabiankeil Exp $ +# $Id: user.action,v 1.13 2011/11/06 11:36:01 fabiankeil Exp $ # # Purpose : User-maintained actions file, see # http://www.privoxy.org/user-manual/actions-file.html @@ -166,4 +166,32 @@ www.example.com/nasty-ads/sponsor.gif { +set-image-blocker{blank} } #/ -## set vi:nowrap tw=72 +# Enable the following section (not the regression-test directives) +# to rewrite and redirect click-tracking URLs on news.google.com. +# Disabling JavaScript should work as well and probably works more reliably. +# +# Redirected URL = http://news.google.com/news/url?ct2=us%2F0_0_s_1_1_a&sa=t&usg=AFQjCNHJWPc7ffoSXPSqBRz55jDA0KgxOQ&cid=8797762374160&url=http%3A%2F%2Fonline.wsj.com%2Farticle%2FSB10001424052970204485304576640791304008536.html&ei=YcqeTsymCIjxggf8uQE&rt=HOMEPAGE&vm=STANDARD&bvm=section&did=-6537064229385238098 +# Redirect Destination = http://online.wsj.com/article/SB10001424052970204485304576640791304008536.html +# Ignore = Yes +# +#{+fast-redirects{check-decoded-url}} +#news.google.com/news/url.*&url=http.*& + +# Enable the following section (not the regression-test directives) +# to block various Facebook "like" and similar tracking URLs. At the +# time this section was added it was reported to not break Facebook +# itself but this may have changed by the time you read this. This URL +# list is probably incomplete and if you don't have an account anyway, +# you may prefer to block the whole domain. +# +# Blocked URL = http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Ffacebook.com%2Farstechnica&width=300&colorscheme=light&show_faces=false&stream=false&header=false&height=62&border_color=%23FFFFFF +# Ignore = Yes +# Blocked URL = http://www.facebook.com/plugins/activity.php?site=arstechnica.com&width=300&height=370&header=false&colorscheme=light&recommendations=false&border_color=%23FFFFFF +# Ignore = Yes +# Blocked URL = http://www.facebook.com/plugins/fan.php?api_key=368513495882&connections=10&height=250&id=8304333127&locale=en_US&sdk=joey&stream=false&width=377 +# Ignore = Yes +# Blocked URL = http://www.facebook.com/plugins/like.php?api_key=368513495882&channel_url=http%3A%2F%2Fstatic.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%3Fversion%3D3%23cb%3Df13997452c%26origin%3Dhttp%253A%252F%252Fonline.wsj.com%252Ff1b037e354%26relation%3Dparent.parent%26transport%3Dpostmessage&extended_social_context=false&href=http%3A%2F%2Fonline.wsj.com%2Farticle%2FSB10001424052970204485304576640791304008536.html&layout=button_count&locale=en_US&node_type=link&ref=wsj_share_FB&sdk=joey&send=false&show_faces=false&width=90 +# Ignore = Yes +# +#{+block{Facebook "like" and similar tracking URLs.}} +#www.facebook.com/(extern|plugins)/(login_status|like(box)?|activity|fan)\.php diff --git a/external/privoxy/utils/changelog2doc.pl b/external/privoxy/utils/changelog2doc.pl index a12cb32e..4e6196c3 100755 --- a/external/privoxy/utils/changelog2doc.pl +++ b/external/privoxy/utils/changelog2doc.pl @@ -1,11 +1,27 @@ #!/usr/bin/perl -# $Id: changelog2doc.pl,v 1.2 2008/09/26 16:49:09 fabiankeil Exp $ -# $Source: /cvsroot/ijbswa/current/utils/changelog2doc.pl,v $ - +########################################################################## +# +# $Id: changelog2doc.pl,v 1.8 2011/11/13 17:00:54 fabiankeil Exp $ +# # Filter to parse the ChangeLog and translate the changes for # the most recent version into something that looks like markup # for the documentation but still needs fine-tuning. +# +# Copyright (c) 2008, 2010 Fabian Keil +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +########################################################################## use strict; use warnings; @@ -25,37 +41,80 @@ sub read_entries() { next unless $section_reached; next if /^\s*$/; - if (/^-/) { + if (/^(\s*)-/) { + my $indentation = length($1); + if ($i > 1 and $entries[$i]{indentation} > $indentation) { + $entries[$i]{last_list_item} = 1; + } $i++; - $entries[$i] = ''; + $entries[$i]{description} = ''; + $entries[$i]{indentation} = $indentation; + } + if (/:\s*$/) { + $entries[$i]{list_header} = 1; } - s@^-?\s*@@; - $entries[$i] .= $_; + s@^\s*-?\s*@@; + + $entries[$i]{description} .= $_; + } + if ($entries[$i]{indentation} != 0) { + $entries[$i]{last_list_item} = 1; } print "Parsed " . @entries . " entries.\n"; } +sub create_listitem_markup($) { + my $entry = shift; + my $description = $entry->{description}; + my $markup = ''; + my $default_lws = ' '; + my $lws = $default_lws x ($entry->{indentation} ? 2 : 1); + + chomp $description; + + $description =~ s@\n@\n ${lws}@g; + + $markup .= $lws . "\n" . + $lws . " \n"; + + $markup .= $lws . " " . $description . "\n"; + + if (defined $entry->{list_header}) { + $markup .= $lws . " \n"; + + } else { + if (defined $entry->{last_list_item}) { + $markup .= $lws . " \n"; + $markup .= $lws . " \n"; + $markup .= $lws . "\n"; + $lws = $default_lws; + } + $markup .= $lws . " \n" . + $lws . "\n"; + } + + return $markup; +} + +sub wrap_in_para_itemlist_markup($) { + my $content = shift; + my $markup = "\n" . + " \n" . + " $content" . + " \n" . + "\n"; + return $markup; +} + sub generate_markup() { my $markup = ''; - $markup .= "\n" . - " \n"; - foreach my $entry (@entries) { - chomp $entry; - $entry =~ s@\n@\n @g; - $markup .= " \n" . - " \n" . - " " . $entry . "\n" . - " \n" . - " \n" - ; + $markup .= create_listitem_markup(\%{$entry}); } - $markup .= " \n" . - "\n"; - print $markup; + print wrap_in_para_itemlist_markup($markup); } sub main () { diff --git a/external/privoxy/vc_config_pthreads.h b/external/privoxy/vc_config_pthreads.h deleted file mode 100644 index 638f5bd9..00000000 --- a/external/privoxy/vc_config_pthreads.h +++ /dev/null @@ -1,484 +0,0 @@ -#ifndef CONFIG_H_INCLUDED -#define CONFIG_H_INCLUDED -/********************************************************************* - * - * File : $Source: /cvsroot/ijbswa/current/vc_config_pthreads.h,v $ - * - * Purpose : This file should be the first thing included in every - * .c file. (Before even system headers). It contains - * #define statements for various features. It was - * introduced because the compile command line started - * getting ludicrously long with feature defines. - * - * Copyright : Written by and Copyright (C) 2001 the SourceForge - * Privoxy team. http://www.privoxy.org/ - * - * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and - * Junkbusters Corporation. http://www.junkbusters.com - * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General - * Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will - * be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * The GNU General Public License should be included with - * this file. If not, you can view it at - * http://www.gnu.org/copyleft/gpl.html - * or write to the Free Software Foundation, Inc., 59 - * Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Revisions : - * $Log: vc_config_pthreads.h,v $ - * Revision 1.6 2008/03/27 18:27:38 fabiankeil - * Remove kill-popups action. - * - * Revision 1.5 2006/07/18 14:48:47 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.3 2002/05/03 22:54:24 jongfoster - * Version number bump to 2.9.15 - * - * Revision 1.2 2002/04/26 18:26:09 jongfoster - * Bumping version numbers - * - * Revision 1.1 2002/04/06 20:38:01 jongfoster - * Renaming VC++ versions of config.h - * - * Revision 1.20 2002/04/03 22:28:03 gliptak - * Removed references to gnu_regex - * - * Revision 1.19 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.18 2002/03/24 17:08:12 jongfoster - * Version number bump - * - * Revision 1.17 2002/03/24 13:33:26 swa - * name change related issues - * - * Revision 1.16 2002/03/16 14:27:22 jongfoster - * Ignoring a very common warning. - * - * Revision 1.15 2002/03/13 00:28:32 jongfoster - * Hiding all the warnings generated by #include - * - * Revision 1.14 2001/11/30 21:35:54 jongfoster - * Bumping version number to 2.9.10 - * - * Revision 1.13 2001/10/23 21:24:09 jongfoster - * Support for FEATURE_CGI_EDIT_ACTIONS - * - * Revision 1.12 2001/10/07 15:33:14 oes - * Removed FEATURE_DENY_GZIP - * Bumped up version number - * - * Revision 1.11 2001/09/16 16:59:34 jongfoster - * Bugfix - couldn't build resources with previous version. - * - * Revision 1.10 2001/09/16 16:19:02 jongfoster - * New version based on latest configure.in and acconfig.h - * - * Revision 1.9 2001/07/30 22:16:07 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.8 2001/07/25 19:16:27 oes - * Bumping version number to 2.9.8 - * - * Revision 1.7 2001/07/21 18:00:07 jongfoster - * Bumping version number to 2.9.7 - * - * Revision 1.6 2001/07/15 20:08:40 jongfoster - * New build files for VC++ which provide the option of POSIX - * or Win32 threads. - * - * Revision 1.5 2001/07/15 18:00:46 jongfoster - * Renaming STATIC to STATIC_PCRE. - * Replacing this file with one built by "configure" from - * "config.h.in", for consistency. - * - * Revision 1.6 2001/07/15 17:54:29 jongfoster - * Renaming #define STATIC to STATIC_PCRE - * Adding new #define FEATURE_PTHREAD that will be used to enable - * POSIX threads support. - * - * Revision 1.5 2001/07/13 13:48:37 oes - * - (Fix:) Copied CODE_STATUS #define from config.h.in - * - split REGEX #define into REGEX_GNU and REGEX_PCRE - * and removed PCRE. - * (REGEX = REGEX_GNU || REGEX_PCRE per project.h) - * - Moved STATIC (for pcre) here from Makefile.in - * - Introduced STATIC_PCRS #define to allow for dynaimc linking with - * libpcrs - * - Removed PCRS #define, since pcrs is now needed for CGI anyway - * - * Revision 1.4 2001/05/29 09:50:24 jongfoster - * Unified blocklist/imagelist/permissionslist. - * File format is still under discussion, but the internal changes - * are (mostly) done. - * - * Also modified interceptor behaviour: - * - We now intercept all URLs beginning with one of the following - * prefixes (and *only* these prefixes): - * * http://i.j.b/ - * * http://ijbswa.sf.net/config/ - * * http://ijbswa.sourceforge.net/config/ - * - New interceptors "home page" - go to http://i.j.b/ to see it. - * - Internal changes so that intercepted and fast redirect pages - * are not replaced with an image. - * - Interceptors now have the option to send a binary page direct - * to the client. (i.e. ijb-send-banner uses this) - * - Implemented show-url-info interceptor. (Which is why I needed - * the above interceptors changes - a typical URL is - * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". - * The previous mechanism would not have intercepted that, and - * if it had been intercepted then it then it would have replaced - * it with an image.) - * - * Revision 1.3 2001/05/26 01:26:34 jongfoster - * New #define, WIN_GUI_EDIT, enables the (embryonic) Win32 GUI editor. - * This #define cannot be set from ./configure - there's no point, it - * doesn't work yet. See feature request # 425722 - * - * Revision 1.2 2001/05/22 17:43:35 oes - * - * - Enabled filtering banners by size rather than URL - * by adding patterns that replace all standard banner - * sizes with the "Junkbuster" gif to the re_filterfile - * - * - Enabled filtering WebBugs by providing a pattern - * which kills all 1x1 images - * - * - Added support for PCRE_UNGREEDY behaviour to pcrs, - * which is selected by the (nonstandard and therefore - * capital) letter 'U' in the option string. - * It causes the quantifiers to be ungreedy by default. - * Appending a ? turns back to greedy (!). - * - * - Added a new interceptor ijb-send-banner, which - * sends back the "Junkbuster" gif. Without imagelist or - * MSIE detection support, or if tinygif = 1, or the - * URL isn't recognized as an imageurl, a lame HTML - * explanation is sent instead. - * - * - Added new feature, which permits blocking remote - * script redirects and firing back a local redirect - * to the browser. - * The feature is conditionally compiled, i.e. it - * can be disabled with --disable-fast-redirects, - * plus it must be activated by a "fast-redirects" - * line in the config file, has its own log level - * and of course wants to be displayed by show-proxy-args - * Note: Boy, all the #ifdefs in 1001 locations and - * all the fumbling with configure.in and acconfig.h - * were *way* more work than the feature itself :-( - * - * - Because a generic redirect template was needed for - * this, tinygif = 3 now uses the same. - * - * - Moved GIFs, and other static HTTP response templates - * to project.h - * - * - Many minor fixes - * - * - Removed some >400 CRs again (Jon, you really worked - * a lot! ;-) - * - * Revision 1.1.1.1 2001/05/15 13:58:45 oes - * Initial import of version 2.9.3 source tree - * - * - *********************************************************************/ - - -/* - * Version number - Major (X._._) - */ -#define VERSION_MAJOR 2 - -/* - * Version number - Minor (_.X._) - */ -#define VERSION_MINOR 9 - -/* - * Version number - Point (_._.X) - */ -#define VERSION_POINT 15 - -/* - * Version number, as a string - */ -#define VERSION "2.9.15" - -/* - * Status of the code: alpha, beta or stable - */ -#define CODE_STATUS "beta" - -/* - * Regular expression matching for URLs. (Highly recommended). - * If neither of these are defined then you can ony use prefix matching. - * Don't bother to change this here! Use configure instead. - */ -#define REGEX_PCRE 1 - -/* - * Should pcre be statically built in instead of linkling with libpcre? - * (This is determined by configure depending on the availiability of - * libpcre and user preferences). The name is ugly, but pcre needs it. - * Don't bother to change this here! Use configure instead. - */ -#define STATIC_PCRE 1 - -/* - * Should pcrs be statically built in instead of linkling with libpcrs? - * (This is determined by configure depending on the availiability of - * libpcrs and user preferences). - * Don't bother to change this here! Use configure instead. - */ -#define STATIC_PCRS 1 - -/* - * Allows the use of an ACL to control access to the proxy by IP address. - */ -#define FEATURE_ACL 1 - -/* - * Enables the web-based configuration (actionsfile) editor. If you - * have a shared proxy, you might want to turn this off. - */ -#define FEATURE_CGI_EDIT_ACTIONS 1 - -/* - * Allows the use of jar files to capture cookies. - */ -#define FEATURE_COOKIE_JAR 1 - -/* - * Locally redirect remote script-redirect URLs - */ -#define FEATURE_FAST_REDIRECTS 1 - -/* - * Bypass filtering for 1 page only - */ -#define FEATURE_FORCE_LOAD 1 - -/* - * Allow blocking using images as well as HTML. - * If you do not define this then everything is blocked as HTML. - * - * Note that this is required if you want to use FEATURE_IMAGE_DETECT_MSIE. - */ -#define FEATURE_IMAGE_BLOCKING 1 - -/* - * Detect image requests automatically for MSIE. Will fall back to - * other image-detection methods (i.e. "+image" permission) for other - * browsers. - * - * You must also define FEATURE_IMAGE_BLOCKING to use this feature. - * - * It detects the following header pair as an image request: - * - * User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) - * Accept: * / * - * - * And the following as a HTML request: - * - * User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) - * Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, * / * - * - * And no, I haven't got that backwards - IE is being wierd. - * - * Known limitations: - * 1) If you press shift-reload on a blocked HTML page, you get - * the image "blocked" page, not the HTML "blocked" page. - * 2) Once an image "blocked" page has been sent, viewing it - * in it's own browser window *should* bring up the HTML - * "blocked" page, but it doesn't. You need to clear the - * browser cache to get the HTML version again. - * - * These limitations are due to IE making inconsistent choices - * about which "Accept:" header to send. - */ -#define FEATURE_IMAGE_DETECT_MSIE 1 - -/* - * Use POSIX threads instead of native threads. - */ -#define FEATURE_PTHREAD 1 - -/* - * Enables statistics function. - */ -#define FEATURE_STATISTICS 1 - -/* - * Allow JunkBuster to be "disabled" so it is just a normal non-blocking - * non-anonymizing proxy. This is useful if you're trying to access a - * blocked or broken site - just change the setting in the config file, - * or use the handy "Disable" menu option in the Windows GUI. - */ -#define FEATURE_TOGGLE 1 - -/* - * Allows the use of trust files. - */ -#define FEATURE_TRUST 1 - - -/**************************************************************************** - * The following values are correct for MS VC++97. - * You should normally not change them. - ***************************************************************************/ - - -/* - * Defined on Solaris only. Makes the system libraries thread safe. - */ -/* #define _REENTRANT 1 */ - -/* - * Defined on Solaris only. Without this, many important functions are not - * defined in the system headers. - */ -/* #define __EXTENSIONS__ 1 */ - -/* - * Defined always. - * FIXME: Don't know what it does or why we need it. - * (presumably something to do with MultiThreading?) - */ -#define __MT__ 1 - - -/* Define if you have the `bcopy' function. */ -/* #define HAVE_BCOPY 1 */ - -/* Define if you have the header file. */ -/* #define HAVE_INTTYPES_H 1 */ - -/* Define if you have the `memmove' function. */ -#define HAVE_MEMMOVE 1 - -/* Define if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define if you have the header file. */ -/* #define HAVE_STDINT_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define if you have the `strerror' function. */ -#define HAVE_STRERROR 1 - -/* Define if you have the header file. */ -/* #define HAVE_STRINGS_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define if you have the header file. */ -/* #define HAVE_UNISTD_H 1 */ - -/* The size of a `char *', as computed by sizeof. */ -#define SIZEOF_CHAR_P 4 - -/* The size of a `int', as computed by sizeof. */ -#define SIZEOF_INT 4 - -/* The size of a `long', as computed by sizeof. */ -#define SIZEOF_LONG 4 - -/* The size of a `long long', as computed by sizeof. */ -/* #define SIZEOF_LONG_LONG ---not supported--- */ - -/* The size of a `size_t', as computed by sizeof. */ -#define SIZEOF_SIZE_T 4 - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #define const */ - -/* Define to `unsigned' if does not define. */ -/* #define size_t unsigned */ - -/* - * Defined always. - * FIXME: Don't know what it does or why we need it. - * (presumably something to do with ANSI Standard C?) - */ -/* Don't define for MS VC++ or you don't get strdup() declared. -#ifndef __STDC__ -#define __STDC__ 1 -#endif -*/ - -/* - * Need to set up this define only for the Pthreads library for - * Win32, available from http://sources.redhat.com/pthreads-win32/ - */ -#if defined(FEATURE_PTHREAD) && defined(_WIN32) -#define __CLEANUP_C -#endif /* defined(FEATURE_PTHREAD) && defined(_WIN32) */ - -/* - * BEOS does not currently support POSIX threads. - * This *should* be detected by ./configure, but let's be sure. - */ -#if defined(FEATURE_PTHREAD) && defined(__BEOS__) -#error BEOS does not support pthread - please run ./configure again with "--disable-pthread" - -#endif /* defined(FEATURE_PTHREAD) && defined(__BEOS__) */ - - -#if (!defined(_MSC_VER)) && (!defined(RC_INVOKED)) -#error This file is only intended for MS VC++ on Win32. For other compilers, please run configure. -#endif /* (!defined(_MSC_VER)) && (!defined(RC_INVOKED)) */ - -#pragma warning ( disable: 4100 4115 4201 4214 4244 4514 ) - -/* - * C4100 : unreferenced formal parameter - * Very common, not a bug - * - * C4115 : named type definition in parentheses - * #include causes a warning about one of these. - * - * C4201 : nonstandard extension used : nameless struct/union - * Endemic in - * - * C4214 nonstandard extension used : bit field types other than int - * Endemic in - * - * C4244 conversion from 'int' to 'char', possible loss of data - * Should really fix this one. Throughout the JB code. - * - * C4514 unreferenced inline/local function has been removed - * Caused by #include - */ - -#endif /* CONFIG_H_INCLUDED */ - diff --git a/external/privoxy/vc_config_winthreads.h b/external/privoxy/vc_config_winthreads.h deleted file mode 100644 index ca863a95..00000000 --- a/external/privoxy/vc_config_winthreads.h +++ /dev/null @@ -1,675 +0,0 @@ -#ifndef CONFIG_H_INCLUDED -#define CONFIG_H_INCLUDED -/********************************************************************* - * - * File : $Source: /cvsroot/ijbswa/current/vc_config_winthreads.h,v $ - * - * Purpose : This file should be the first thing included in every - * .c file. (Before even system headers). It contains - * #define statements for various features. It was - * introduced because the compile command line started - * getting ludicrously long with feature defines. - * - * Copyright : Written by and Copyright (C) 2001 the SourceForge - * Privoxy team. http://www.privoxy.org/ - * - * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and - * Junkbusters Corporation. http://www.junkbusters.com - * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General - * Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will - * be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * The GNU General Public License should be included with - * this file. If not, you can view it at - * http://www.gnu.org/copyleft/gpl.html - * or write to the Free Software Foundation, Inc., 59 - * Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Revisions : - * $Log: vc_config_winthreads.h,v $ - * Revision 1.6 2008/03/27 18:27:39 fabiankeil - * Remove kill-popups action. - * - * Revision 1.5 2006/07/18 14:48:47 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.3.2.1 2006/04/08 21:57:26 david__schmidt - * Synchronize with a more modern copy of config.h. - * - * Revision 1.3 2002/05/03 22:54:24 jongfoster - * Version number bump to 2.9.15 - * - * Revision 1.2 2002/04/26 18:26:09 jongfoster - * Bumping version numbers - * - * Revision 1.1 2002/04/06 20:38:01 jongfoster - * Renaming VC++ versions of config.h - * - * Revision 1.14 2002/03/26 22:29:54 swa - * we have a new homepage! - * - * Revision 1.13 2002/03/24 17:08:12 jongfoster - * Version number bump - * - * Revision 1.12 2002/03/24 13:25:43 swa - * name change related issues - * - * Revision 1.11 2002/03/16 14:27:22 jongfoster - * Ignoring a very common warning. - * - * Revision 1.10 2002/03/13 00:28:32 jongfoster - * Hiding all the warnings generated by #include - * - * Revision 1.9 2001/11/30 21:35:54 jongfoster - * Bumping version number to 2.9.10 - * - * Revision 1.8 2001/10/23 21:24:09 jongfoster - * Support for FEATURE_CGI_EDIT_ACTIONS - * - * Revision 1.7 2001/10/07 15:33:14 oes - * Removed FEATURE_DENY_GZIP - * Bumped up version number - * - * Revision 1.6 2001/09/16 16:59:34 jongfoster - * Bugfix - couldn't build resources with previous version. - * - * Revision 1.5 2001/09/16 16:19:02 jongfoster - * New version based on latest configure.in and acconfig.h - * - * Revision 1.9 2001/07/30 22:16:07 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.8 2001/07/25 19:16:27 oes - * Bumping version number to 2.9.8 - * - * Revision 1.7 2001/07/21 18:00:07 jongfoster - * Bumping version number to 2.9.7 - * - * Revision 1.6 2001/07/15 20:08:40 jongfoster - * New build files for VC++ which provide the option of POSIX - * or Win32 threads. - * - * Revision 1.5 2001/07/15 18:00:46 jongfoster - * Renaming STATIC to STATIC_PCRE. - * Replacing this file with one built by "configure" from - * "config.h.in", for consistency. - * - * Revision 1.6 2001/07/15 17:54:29 jongfoster - * Renaming #define STATIC to STATIC_PCRE - * Adding new #define FEATURE_PTHREAD that will be used to enable - * POSIX threads support. - * - * Revision 1.5 2001/07/13 13:48:37 oes - * - (Fix:) Copied CODE_STATUS #define from config.h.in - * - split REGEX #define into REGEX_GNU and REGEX_PCRE - * and removed PCRE. - * (REGEX = REGEX_GNU || REGEX_PCRE per project.h) - * - Moved STATIC (for pcre) here from Makefile.in - * - Introduced STATIC_PCRS #define to allow for dynaimc linking with - * libpcrs - * - Removed PCRS #define, since pcrs is now needed for CGI anyway - * - * Revision 1.4 2001/05/29 09:50:24 jongfoster - * Unified blocklist/imagelist/permissionslist. - * File format is still under discussion, but the internal changes - * are (mostly) done. - * - * Also modified interceptor behaviour: - * - We now intercept all URLs beginning with one of the following - * prefixes (and *only* these prefixes): - * * http://i.j.b/ - * * http://ijbswa.sf.net/config/ - * * http://ijbswa.sourceforge.net/config/ - * - New interceptors "home page" - go to http://i.j.b/ to see it. - * - Internal changes so that intercepted and fast redirect pages - * are not replaced with an image. - * - Interceptors now have the option to send a binary page direct - * to the client. (i.e. ijb-send-banner uses this) - * - Implemented show-url-info interceptor. (Which is why I needed - * the above interceptors changes - a typical URL is - * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". - * The previous mechanism would not have intercepted that, and - * if it had been intercepted then it then it would have replaced - * it with an image.) - * - * Revision 1.3 2001/05/26 01:26:34 jongfoster - * New #define, WIN_GUI_EDIT, enables the (embryonic) Win32 GUI editor. - * This #define cannot be set from ./configure - there's no point, it - * doesn't work yet. See feature request # 425722 - * - * Revision 1.2 2001/05/22 17:43:35 oes - * - * - Enabled filtering banners by size rather than URL - * by adding patterns that replace all standard banner - * sizes with the "Junkbuster" gif to the re_filterfile - * - * - Enabled filtering WebBugs by providing a pattern - * which kills all 1x1 images - * - * - Added support for PCRE_UNGREEDY behaviour to pcrs, - * which is selected by the (nonstandard and therefore - * capital) letter 'U' in the option string. - * It causes the quantifiers to be ungreedy by default. - * Appending a ? turns back to greedy (!). - * - * - Added a new interceptor ijb-send-banner, which - * sends back the "Junkbuster" gif. Without imagelist or - * MSIE detection support, or if tinygif = 1, or the - * URL isn't recognized as an imageurl, a lame HTML - * explanation is sent instead. - * - * - Added new feature, which permits blocking remote - * script redirects and firing back a local redirect - * to the browser. - * The feature is conditionally compiled, i.e. it - * can be disabled with --disable-fast-redirects, - * plus it must be activated by a "fast-redirects" - * line in the config file, has its own log level - * and of course wants to be displayed by show-proxy-args - * Note: Boy, all the #ifdefs in 1001 locations and - * all the fumbling with configure.in and acconfig.h - * were *way* more work than the feature itself :-( - * - * - Because a generic redirect template was needed for - * this, tinygif = 3 now uses the same. - * - * - Moved GIFs, and other static HTTP response templates - * to project.h - * - * - Many minor fixes - * - * - Removed some >400 CRs again (Jon, you really worked - * a lot! ;-) - * - * Revision 1.1.1.1 2001/05/15 13:58:45 oes - * Initial import of version 2.9.3 source tree - * - * - *********************************************************************/ - - -/* - * Version number - Major (X._._) - */ -#define VERSION_MAJOR 0 - -/* - * Version number - Minor (_.X._) - */ -#define VERSION_MINOR 0 - -/* - * Version number - Point (_._.X) - */ -#define VERSION_POINT 0 - -/* - * Version number, as a string - */ -#define VERSION "0.0.0" - -/* - * Status of the code: alpha, beta or stable - */ -#define CODE_STATUS "UNRELEASED" - -/* - * Regular expression matching for URLs. (Highly recommended). - * If neither of these are defined then you can ony use prefix matching. - * Don't bother to change this here! Use configure instead. - */ -/* #define REGEX_GNU 1 */ -#define REGEX_PCRE 1 - -/* - * Should pcre be statically built in instead of linkling with libpcre? - * (This is determined by configure depending on the availiability of - * libpcre and user preferences). The name is ugly, but pcre needs it. - * Don't bother to change this here! Use configure instead. - */ -#define STATIC_PCRE 1 - -/* - * Should pcrs be statically built in instead of linkling with libpcrs? - * (This is determined by configure depending on the availiability of - * libpcrs and user preferences). - * Don't bother to change this here! Use configure instead. - */ -#define STATIC_PCRS 1 - -/* - * Allows the use of an ACL to control access to the proxy by IP address. - */ -#define FEATURE_ACL 1 - -/* - * Enables the web-based configuration (actionsfile) editor. If you - * have a shared proxy, you might want to turn this off. - */ -#define FEATURE_CGI_EDIT_ACTIONS 1 - -/* - * Allows the use of jar files to capture cookies. - */ -#define FEATURE_COOKIE_JAR 1 - -/* - * Locally redirect remote script-redirect URLs - */ -#define FEATURE_FAST_REDIRECTS 1 - -/* - * Bypass filtering for 1 page only - */ -#define FEATURE_FORCE_LOAD 1 - -/* - * Allow blocking using images as well as HTML. - * If you do not define this then everything is blocked as HTML. - * - * Note that this is required if you want to use FEATURE_IMAGE_DETECT_MSIE. - */ -#define FEATURE_IMAGE_BLOCKING 1 - -/* - * Detect image requests automatically for MSIE. Will fall back to - * other image-detection methods (i.e. "+image" permission) for other - * browsers. - * - * You must also define FEATURE_IMAGE_BLOCKING to use this feature. - * - * It detects the following header pair as an image request: - * - * User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) - * Accept: * / * - * - * And the following as a HTML request: - * - * User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) - * Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, * / * - * - * And no, I haven't got that backwards - IE is being wierd. - * - * Known limitations: - * 1) If you press shift-reload on a blocked HTML page, you get - * the image "blocked" page, not the HTML "blocked" page. - * 2) Once an image "blocked" page has been sent, viewing it - * in it's own browser window *should* bring up the HTML - * "blocked" page, but it doesn't. You need to clear the - * browser cache to get the HTML version again. - * - * These limitations are due to IE making inconsistent choices - * about which "Accept:" header to send. - */ -#define FEATURE_IMAGE_DETECT_MSIE 1 - -/* - * Use PNG instead of GIF for built-in images - */ -/* #undef FEATURE_NO_GIFS */ - -/* - * Use POSIX threads instead of native threads. - */ -/* #define FEATURE_PTHREAD 1 */ - -/* - * Enables statistics function. - */ -#define FEATURE_STATISTICS 1 - -/* - * Allow JunkBuster to be "disabled" so it is just a normal non-blocking - * non-anonymizing proxy. This is useful if you're trying to access a - * blocked or broken site - just change the setting in the config file, - * or use the handy "Disable" menu option in the Windows GUI. - */ -#define FEATURE_TOGGLE 1 - -/* - * Allows the use of trust files. - */ -#define FEATURE_TRUST 1 - - -/**************************************************************************** - * The following values are correct for MS VC++97. - * You should normally not change them. - ***************************************************************************/ - - -/* - * Defined on Solaris only. Makes the system libraries thread safe. - */ -/* #define _REENTRANT 1 */ - -/* - * Defined on Solaris only. Without this, many important functions are not - * defined in the system headers. - */ -/* #define __EXTENSIONS__ 1 */ - -/* - * Defined always. - * FIXME: Don't know what it does or why we need it. - * (presumably something to do with MultiThreading?) - */ -#define __MT__ 1 - -/* If the (nonstandard and thread-safe) function gethostbyname_r - * is available, select which signature to use - */ -/* #undef HAVE_GETHOSTBYNAME_R_6_ARGS */ -/* #undef HAVE_GETHOSTBYNAME_R_5_ARGS */ -/* #undef HAVE_GETHOSTBYNAME_R_3_ARGS */ - -/* If the (nonstandard and thread-safe) function gethostbyaddr_r - * is available, select which signature to use - */ -/* #undef HAVE_GETHOSTBYADDR_R_8_ARGS */ -/* #undef HAVE_GETHOSTBYADDR_R_7_ARGS */ -/* #undef HAVE_GETHOSTBYADDR_R_5_ARGS */ - -/* Defined if you have gmtime_r and localtime_r with a signature - * of (struct time *, struct tm *) - */ -#undef HAVE_GMTIME_R - -/* #define HAVE_LOCALTIME_R 1 */ - -/* Define to 'int' if doesn't have it. - */ -#define socklen_t int - -/* Define if pcre.h must be included as - */ -/* #undef PCRE_H_IN_SUBDIR */ - -/* Define if pcreposix.h must be included as - */ -/* #undef PCREPOSIX_H_IN_SUBDIR */ - - -/* Define to 1 if you have the header file. */ -#define HAVE_ARPA_INET_H 1 - -/* Define to 1 if you have the `atexit' function. */ -#define HAVE_ATEXIT 1 - -/* Define if you have the `bcopy' function. */ -/* #define HAVE_BCOPY 1 */ - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#define HAVE_DIRENT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ERRNO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* Define to 1 if you have the `getcwd' function. */ -#define HAVE_GETCWD 1 - -/* Define to 1 if you have the `gethostbyaddr' function. */ -#define HAVE_GETHOSTBYADDR 1 - -/* Define to 1 if you have the `gethostbyname' function. */ -#define HAVE_GETHOSTBYNAME 1 - -/* Define to 1 if you have the `inet_ntoa' function. */ -#define HAVE_INET_NTOA 1 - -/* Define if you have the header file. */ -/* #define HAVE_INTTYPES_H 1 */ - -/* Define to 1 if you have the `nsl' library (-lnsl). */ -/* #undef HAVE_LIBNSL */ - -/* Define to 1 if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LOCALE_H 1 - -/* Define to 1 if you have the `localtime_r' function. */ -#undef HAVE_LOCALTIME_R - -/* Define to 1 if you have the `memchr' function. */ -#define HAVE_MEMCHR 1 - -/* Define if you have the `memmove' function. */ -#define HAVE_MEMMOVE 1 - -/* Define if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the `memset' function. */ -#define HAVE_MEMSET 1 - -/* Define to 1 if you have the header file, and it defines `DIR'. */ -/* #undef HAVE_NDIR_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_NETDB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NETINET_IN_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_OS_H */ - -/* Define to 1 if you have the `regcomp' function. */ -#define HAVE_REGCOMP 1 - -/* Define to 1 if you have the `select' function. */ -#define HAVE_SELECT 1 - -/* Define to 1 if you have the `setlocale' function. */ -#define HAVE_SETLOCALE 1 - -/* Define to 1 if you have the `socket' function. */ -#define HAVE_SOCKET 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDDEF_H 1 - -/* Define if you have the header file. */ -/* #define HAVE_STDINT_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the `strchr' function. */ -#define HAVE_STRCHR 1 - -/* Define to 1 if you have the `strdup' function. */ -#define HAVE_STRDUP 1 - -/* Define if you have the `strerror' function. */ -#define HAVE_STRERROR 1 - -/* Define to 1 if you have the `strftime' function. */ -#define HAVE_STRFTIME 1 - -/* Define if you have the header file. */ -/* #define HAVE_STRINGS_H 1 */ - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the `strstr' function. */ -#define HAVE_STRSTR 1 - -/* Define to 1 if you have the `strtoul' function. */ -#define HAVE_STRTOUL 1 - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -/* #undef HAVE_SYS_DIR_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_IOCTL_H 1 - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -/* #undef HAVE_SYS_NDIR_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SOCKET_H 1 - -/* Define if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TIMEB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_WAIT_H 1 - -/* Define if you have the header file. */ -/* #define HAVE_UNISTD_H 1 */ - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define as the return type of signal handlers (`int' or `void'). */ -#define RETSIGTYPE void - -/* Define to 1 if the `setpgrp' function takes no argument. */ -#define SETPGRP_VOID 1 - -/* The size of a `char *', as computed by sizeof. */ -#define SIZEOF_CHAR_P 4 - -/* The size of a `int', as computed by sizeof. */ -#define SIZEOF_INT 4 - -/* The size of a `long', as computed by sizeof. */ -#define SIZEOF_LONG 4 - -/* The size of a `long long', as computed by sizeof. */ -/* #define SIZEOF_LONG_LONG ---not supported--- */ - -/* The size of a `size_t', as computed by sizeof. */ -#define SIZEOF_SIZE_T 4 - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define to 1 if you can safely include both and . */ -#define TIME_WITH_SYS_TIME 1 - -/* Define to 1 if your declares `struct tm'. */ -/* #undef TM_IN_SYS_TIME */ - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #define const */ - -/* Define to `int' if does not define. */ -/* #undef pid_t */ - -/* Define to `unsigned' if does not define. */ -/* #define size_t unsigned */ - -/* Define to 'int' if doesn't have it. */ -#define socklen_t int - -/* - * Defined always. - * FIXME: Don't know what it does or why we need it. - * (presumably something to do with ANSI Standard C?) - */ -/* Don't define for MS VC++ or you don't get strdup() declared. -#ifndef __STDC__ -#define __STDC__ 1 -#endif -*/ - -/* - * Need to set up this define only for the Pthreads library for - * Win32, available from http://sources.redhat.com/pthreads-win32/ - */ -#if defined(FEATURE_PTHREAD) && defined(_WIN32) -#define __CLEANUP_C -#endif /* defined(FEATURE_PTHREAD) && defined(_WIN32) */ - -/* - * Need to keep errlog.c from trying to inline the non-existent - * locking stubs. Could be removed once a real platform-specific - * solution is generated. - */ -#define inline "" - -/* - * BEOS does not currently support POSIX threads. - * This *should* be detected by ./configure, but let's be sure. - */ -#if defined(FEATURE_PTHREAD) && defined(__BEOS__) -#error BEOS does not support pthread - please run ./configure again with "--disable-pthread" - -#endif /* defined(FEATURE_PTHREAD) && defined(__BEOS__) */ - - -#if (!defined(_MSC_VER)) && (!defined(RC_INVOKED)) -#error This file is only intended for MS VC++ on Win32. For other compilers, please run configure. -#endif /* (!defined(_MSC_VER)) && (!defined(RC_INVOKED)) */ - -#pragma warning ( disable: 4100 4115 4201 4214 4244 4514 ) - -/* - * C4100 : unreferenced formal parameter - * Very common, not a bug - * - * C4115 : named type definition in parentheses - * #include causes a warning about one of these. - * - * C4201 : nonstandard extension used : nameless struct/union - * Endemic in - * - * C4214 nonstandard extension used : bit field types other than int - * Endemic in - * - * C4244 conversion from 'int' to 'char', possible loss of data - * Should really fix this one. Throughout the JB code. - * - * C4514 unreferenced inline/local function has been removed - * Caused by #include - */ - - -#endif /* CONFIG_H_INCLUDED */ - diff --git a/external/privoxy/vc_console.dsp b/external/privoxy/vc_console.dsp deleted file mode 100644 index 3561b5eb..00000000 --- a/external/privoxy/vc_console.dsp +++ /dev/null @@ -1,405 +0,0 @@ -# Microsoft Developer Studio Project File - Name="vc_console" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=vc_console - Win32 Debug with Win32 threads -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "vc_console.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "vc_console.mak"\ - CFG="vc_console - Win32 Debug with Win32 threads" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "vc_console - Win32 Release" (based on\ - "Win32 (x86) Console Application") -!MESSAGE "vc_console - Win32 Debug" (based on\ - "Win32 (x86) Console Application") -!MESSAGE "vc_console - Win32 Debug with Win32 threads" (based on\ - "Win32 (x86) Console Application") -!MESSAGE "vc_console - Win32 Release with Win32 threads" (based on\ - "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "vc_console - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "console_release" -# PROP Intermediate_Dir "console_release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "pcre" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WIN_CONSOLE" /D "STATIC" /YX /FD /c -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib comctl32.lib pthreadVC.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "vc_console - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "console_debug" -# PROP Intermediate_Dir "console_debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "pcre" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WIN_CONSOLE" /D "STATIC" /FR /YX /FD /c -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib comctl32.lib pthreadVC.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ELSEIF "$(CFG)" == "vc_console - Win32 Debug with Win32 threads" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "console_" -# PROP BASE Intermediate_Dir "console_" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "console_debug_winthr" -# PROP Intermediate_Dir "console_debug_winthr" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "pcre" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WIN_CONSOLE" /D "STATIC" /FR /YX /FD /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "pcre" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WIN_CONSOLE" /D "STATIC" /FR /YX /FD /c -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib comctl32.lib pthreadVC.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib comctl32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ELSEIF "$(CFG)" == "vc_console - Win32 Release with Win32 threads" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "console0" -# PROP BASE Intermediate_Dir "console0" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "console_release_winthr" -# PROP Intermediate_Dir "console_release_winthr" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "pcre" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WIN_CONSOLE" /D "STATIC" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "pcre" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WIN_CONSOLE" /D "STATIC" /YX /FD /c -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib comctl32.lib pthreadVC.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib comctl32.lib /nologo /subsystem:console /machine:I386 - -!ENDIF - -# Begin Target - -# Name "vc_console - Win32 Release" -# Name "vc_console - Win32 Debug" -# Name "vc_console - Win32 Debug with Win32 threads" -# Name "vc_console - Win32 Release with Win32 threads" -# Begin Group "JunkBuster" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\actionlist.h -# End Source File -# Begin Source File - -SOURCE=.\actions.c -# End Source File -# Begin Source File - -SOURCE=.\actions.h -# End Source File -# Begin Source File - -SOURCE=.\cgi.c -# End Source File -# Begin Source File - -SOURCE=.\cgi.h -# End Source File -# Begin Source File - -SOURCE=.\cgiedit.c -# End Source File -# Begin Source File - -SOURCE=.\cgiedit.h -# End Source File -# Begin Source File - -SOURCE=.\cgisimple.c -# End Source File -# Begin Source File - -SOURCE=.\cgisimple.h -# End Source File -# Begin Source File - -SOURCE=.\config.h -# End Source File -# Begin Source File - -SOURCE=.\deanimate.c -# End Source File -# Begin Source File - -SOURCE=.\deanimate.h -# End Source File -# Begin Source File - -SOURCE=.\errlog.c -# End Source File -# Begin Source File - -SOURCE=.\errlog.h -# End Source File -# Begin Source File - -SOURCE=.\filters.c -# End Source File -# Begin Source File - -SOURCE=.\filters.h -# End Source File -# Begin Source File - -SOURCE=.\jcc.c -# End Source File -# Begin Source File - -SOURCE=.\jcc.h -# End Source File -# Begin Source File - -SOURCE=.\loadcfg.c -# End Source File -# Begin Source File - -SOURCE=.\loadcfg.h -# End Source File -# Begin Source File - -SOURCE=.\loaders.c -# End Source File -# Begin Source File - -SOURCE=.\loaders.h -# End Source File -# Begin Source File - -SOURCE=.\parsers.c -# End Source File -# Begin Source File - -SOURCE=.\parsers.h -# End Source File -# Begin Source File - -SOURCE=.\project.h -# End Source File -# Begin Source File - -SOURCE=.\urlmatch.c -# End Source File -# Begin Source File - -SOURCE=.\urlmatch.h -# End Source File -# End Group -# Begin Group "Win32" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\cygwin.h -# End Source File -# Begin Source File - -SOURCE=.\win32.c -# End Source File -# Begin Source File - -SOURCE=.\win32.h -# End Source File -# End Group -# Begin Group "PCRE" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\pcre\chartables.c - -!IF "$(CFG)" == "vc_console - Win32 Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "vc_console - Win32 Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "vc_console - Win32 Debug with Win32 threads" - -# PROP BASE Exclude_From_Build 1 -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "vc_console - Win32 Release with Win32 threads" - -# PROP BASE Exclude_From_Build 1 -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\pcre\config.h -# End Source File -# Begin Source File - -SOURCE=.\pcre\get.c -# End Source File -# Begin Source File - -SOURCE=.\pcre\internal.h -# End Source File -# Begin Source File - -SOURCE=.\pcre\maketables.c -# End Source File -# Begin Source File - -SOURCE=.\pcre\pcre.c -# End Source File -# Begin Source File - -SOURCE=.\pcre\pcre.h -# End Source File -# Begin Source File - -SOURCE=.\pcre\pcreposix.c -# End Source File -# Begin Source File - -SOURCE=.\pcre\pcreposix.h -# End Source File -# Begin Source File - -SOURCE=.\pcre\study.c -# End Source File -# End Group -# Begin Group "PCRS" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\pcrs.c -# End Source File -# Begin Source File - -SOURCE=.\pcrs.h -# End Source File -# End Group -# Begin Group "Sockets" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\gateway.c -# End Source File -# Begin Source File - -SOURCE=.\gateway.h -# End Source File -# Begin Source File - -SOURCE=.\jbsockets.c -# End Source File -# Begin Source File - -SOURCE=.\jbsockets.h -# End Source File -# End Group -# Begin Group "Utilities" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\encode.c -# End Source File -# Begin Source File - -SOURCE=.\encode.h -# End Source File -# Begin Source File - -SOURCE=.\list.c -# End Source File -# Begin Source File - -SOURCE=.\list.h -# End Source File -# Begin Source File - -SOURCE=.\miscutil.c -# End Source File -# Begin Source File - -SOURCE=.\miscutil.h -# End Source File -# Begin Source File - -SOURCE=.\ssplit.c -# End Source File -# Begin Source File - -SOURCE=.\ssplit.h -# End Source File -# End Group -# End Target -# End Project diff --git a/external/privoxy/vc_privoxy.dsp b/external/privoxy/vc_privoxy.dsp deleted file mode 100644 index 5afaec95..00000000 --- a/external/privoxy/vc_privoxy.dsp +++ /dev/null @@ -1,488 +0,0 @@ -# Microsoft Developer Studio Project File - Name="vc_privoxy" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=vc_privoxy - Win32 Debug with Win32 threads -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "vc_privoxy.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "vc_privoxy.mak"\ - CFG="vc_privoxy - Win32 Debug with Win32 threads" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "vc_privoxy - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "vc_privoxy - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE "vc_privoxy - Win32 Release with Win32 threads" (based on\ - "Win32 (x86) Application") -!MESSAGE "vc_privoxy - Win32 Debug with Win32 threads" (based on\ - "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "vc_privoxy - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "vc_release" -# PROP BASE Intermediate_Dir "vc_release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "vc_release" -# PROP Intermediate_Dir "vc_release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /Ob2 /I "pcre" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "STATIC" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib comctl32.lib pthreadVC.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "vc_privoxy - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "vc_debug" -# PROP BASE Intermediate_Dir "vc_debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "vc_debug" -# PROP Intermediate_Dir "vc_debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "pcre" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "STATIC" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib comctl32.lib pthreadVC.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ELSEIF "$(CFG)" == "vc_privoxy - Win32 Release with Win32 threads" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "vc_junkb" -# PROP BASE Intermediate_Dir "vc_junkb" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "vc_release_winthr" -# PROP Intermediate_Dir "vc_release_winthr" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /Ob2 /I "pcre" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "STATIC" /FR /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /Ob2 /I "pcre" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "STATIC" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib comctl32.lib pthreadVC.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib comctl32.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "vc_privoxy - Win32 Debug with Win32 threads" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "vc_junk0" -# PROP BASE Intermediate_Dir "vc_junk0" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "vc_debug_winthr" -# PROP Intermediate_Dir "vc_debug_winthr" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /O2 /I "pcre" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "STATIC" /YX /FD /c -# ADD CPP /nologo /MTd /W4 /Gm /GX /Zi /Od /I "pcre" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "STATIC" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib comctl32.lib pthreadVC.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib comctl32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "vc_privoxy - Win32 Release" -# Name "vc_privoxy - Win32 Debug" -# Name "vc_privoxy - Win32 Release with Win32 threads" -# Name "vc_privoxy - Win32 Debug with Win32 threads" -# Begin Group "JunkBuster" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\actionlist.h -# End Source File -# Begin Source File - -SOURCE=.\actions.c -# End Source File -# Begin Source File - -SOURCE=.\actions.h -# End Source File -# Begin Source File - -SOURCE=.\cgi.c -# End Source File -# Begin Source File - -SOURCE=.\cgi.h -# End Source File -# Begin Source File - -SOURCE=.\cgiedit.c -# End Source File -# Begin Source File - -SOURCE=.\cgiedit.h -# End Source File -# Begin Source File - -SOURCE=.\cgisimple.c -# End Source File -# Begin Source File - -SOURCE=.\cgisimple.h -# End Source File -# Begin Source File - -SOURCE=.\config.h -# End Source File -# Begin Source File - -SOURCE=.\deanimate.c -# End Source File -# Begin Source File - -SOURCE=.\deanimate.h -# End Source File -# Begin Source File - -SOURCE=.\errlog.c -# End Source File -# Begin Source File - -SOURCE=.\errlog.h -# End Source File -# Begin Source File - -SOURCE=.\filters.c -# End Source File -# Begin Source File - -SOURCE=.\filters.h -# End Source File -# Begin Source File - -SOURCE=.\jcc.c -# End Source File -# Begin Source File - -SOURCE=.\jcc.h -# End Source File -# Begin Source File - -SOURCE=.\loadcfg.c -# End Source File -# Begin Source File - -SOURCE=.\loadcfg.h -# End Source File -# Begin Source File - -SOURCE=.\loaders.c -# End Source File -# Begin Source File - -SOURCE=.\loaders.h -# End Source File -# Begin Source File - -SOURCE=.\parsers.c -# End Source File -# Begin Source File - -SOURCE=.\parsers.h -# End Source File -# Begin Source File - -SOURCE=.\project.h -# End Source File -# Begin Source File - -SOURCE=.\urlmatch.c -# End Source File -# Begin Source File - -SOURCE=.\urlmatch.h -# End Source File -# End Group -# Begin Group "Win32" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\cygwin.h -# End Source File -# Begin Source File - -SOURCE=.\w32log.c -# End Source File -# Begin Source File - -SOURCE=.\w32log.h -# End Source File -# Begin Source File - -SOURCE=.\w32res.h -# End Source File -# Begin Source File - -SOURCE=.\w32taskbar.c -# End Source File -# Begin Source File - -SOURCE=.\w32taskbar.h -# End Source File -# Begin Source File - -SOURCE=.\win32.c -# End Source File -# Begin Source File - -SOURCE=.\win32.h -# End Source File -# Begin Source File - -SOURCE=.\w32svrapi.c -# End Source File -# Begin Source File - -SOURCE=.\w32svrapi.h -# End Source File -# End Group -# Begin Group "Resources" - -# PROP Default_Filter "rc,ico,bmp" -# Begin Source File - -SOURCE=.\icons\ico00001.ico -# End Source File -# Begin Source File - -SOURCE=.\icons\ico00002.ico -# End Source File -# Begin Source File - -SOURCE=.\icons\ico00003.ico -# End Source File -# Begin Source File - -SOURCE=.\icons\ico00004.ico -# End Source File -# Begin Source File - -SOURCE=.\icons\ico00005.ico -# End Source File -# Begin Source File - -SOURCE=.\icons\ico00006.ico -# End Source File -# Begin Source File - -SOURCE=.\icons\ico00007.ico -# End Source File -# Begin Source File - -SOURCE=.\icons\ico00008.ico -# End Source File -# Begin Source File - -SOURCE=.\icons\idle.ico -# End Source File -# Begin Source File - -SOURCE=.\icons\privoxy.ico -# End Source File -# Begin Source File - -SOURCE=.\w32.rc -# End Source File -# End Group -# Begin Group "PCRE" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\pcre\chartables.c - -!IF "$(CFG)" == "vc_privoxy - Win32 Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "vc_privoxy - Win32 Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "vc_privoxy - Win32 Release with Win32 threads" - -# PROP BASE Exclude_From_Build 1 -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "vc_privoxy - Win32 Debug with Win32 threads" - -# PROP BASE Exclude_From_Build 1 -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\pcre\config.h -# End Source File -# Begin Source File - -SOURCE=.\pcre\get.c -# End Source File -# Begin Source File - -SOURCE=.\pcre\internal.h -# End Source File -# Begin Source File - -SOURCE=.\pcre\maketables.c -# End Source File -# Begin Source File - -SOURCE=.\pcre\pcre.c -# End Source File -# Begin Source File - -SOURCE=.\pcre\pcre.h -# End Source File -# Begin Source File - -SOURCE=.\pcre\pcreposix.c -# End Source File -# Begin Source File - -SOURCE=.\pcre\pcreposix.h -# End Source File -# Begin Source File - -SOURCE=.\pcre\study.c -# End Source File -# End Group -# Begin Group "PCRS" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\pcrs.c -# End Source File -# Begin Source File - -SOURCE=.\pcrs.h -# End Source File -# End Group -# Begin Group "Sockets" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\gateway.c -# End Source File -# Begin Source File - -SOURCE=.\gateway.h -# End Source File -# Begin Source File - -SOURCE=.\jbsockets.c -# End Source File -# Begin Source File - -SOURCE=.\jbsockets.h -# End Source File -# End Group -# Begin Group "Utilities" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\encode.c -# End Source File -# Begin Source File - -SOURCE=.\encode.h -# End Source File -# Begin Source File - -SOURCE=.\list.c -# End Source File -# Begin Source File - -SOURCE=.\list.h -# End Source File -# Begin Source File - -SOURCE=.\miscutil.c -# End Source File -# Begin Source File - -SOURCE=.\miscutil.h -# End Source File -# Begin Source File - -SOURCE=.\ssplit.c -# End Source File -# Begin Source File - -SOURCE=.\ssplit.h -# End Source File -# End Group -# End Target -# End Project diff --git a/external/privoxy/vc_privoxy.dsw b/external/privoxy/vc_privoxy.dsw deleted file mode 100644 index 9685de23..00000000 --- a/external/privoxy/vc_privoxy.dsw +++ /dev/null @@ -1,59 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "vc_console"=".\vc_console.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name vc_dftables - End Project Dependency -}}} - -############################################################################### - -Project: "vc_dftables"=".\pcre\vc_dftables.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "vc_privoxy"=".\vc_privoxy.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name vc_dftables - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/external/privoxy/w32.rc b/external/privoxy/w32.rc index 93b518ab..ec7ff263 100644 --- a/external/privoxy/w32.rc +++ b/external/privoxy/w32.rc @@ -4,7 +4,7 @@ * * Purpose : Windows GUI resource script. * - * Copyright : Written by and Copyright (C) 2001-2002 members of + * Copyright : Written by and Copyright (C) 2001-2009 members of * the Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written @@ -29,128 +29,6 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: w32.rc,v $ - * Revision 1.22 2009/01/01 15:09:23 ler762 - * Change the Windows taskbar icon when privoxy is toggled off. - * - * Revision 1.21 2008/11/02 14:37:47 ler762 - * commit the part of the patches I've been using that were written by torford and gjmurphy - * [ 1824315 ] Minor code cleanup - * [ 1781135 ] Patch - Add clear log, select all, and Accelerators for w32 - * http://sourceforge.net/tracker/?func=detail&atid=311118&aid=1781135&group_id=11118 - * The full patch adds control keys A(select all), C(copy) and D(delete all) to the - * Privoxy log window menu. Select all and copy work for me without the patch - * (albeit without showing the accelerator keys on the menu), so the only part of the - * patch I've been using for the last year or so has been the ctrl-d to delete - * everything in the Privoxy log window. - * - * Revision 1.20 2006/08/18 02:06:25 david__schmidt - * Making icon go back to blue when idle. - * See: bug #967648. - * - * Revision 1.19 2006/07/18 14:48:48 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.17.2.1 2002/08/21 17:58:40 oes - * - Reorder of Win32 menu - * - "Show Privoxy Window" now a toggle - * - Temp kludge to let user and default action file be edited through win32 GUI (FR 592080) - * - * Revision 1.17 2002/03/31 17:19:00 jongfoster - * Win32 only: Enabling STRICT to fix a VC++ compile warning. - * - * Revision 1.16 2002/03/26 22:57:44 jongfoster - * Web server name should begin www. - * - * Revision 1.15 2002/03/24 14:29:25 jongfoster - * Renaming icon file - * - * Revision 1.14 2002/03/24 12:07:36 jongfoster - * Consistern name for filters file - * - * Revision 1.13 2002/03/24 12:03:47 jongfoster - * Name change - * - * Revision 1.12 2001/07/30 22:16:07 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.11 2001/07/21 17:53:41 jongfoster - * Adding version information block. - * - * Revision 1.10 2001/07/19 19:14:19 haroon - * - Removed all #ifdef PCRS. The .rc file extension had eluded Andreas. - * - * Revision 1.9 2001/06/07 23:08:54 jongfoster - * Forward and ACL edit options removed. - * Config edit option renamed from "&Junkbuster" to "&Configuration". - * - * Revision 1.8 2001/05/31 21:37:11 jongfoster - * GUI changes to rename "permissions file" to "actions file". - * - * Revision 1.7 2001/05/29 09:50:24 jongfoster - * Unified blocklist/imagelist/permissionslist. - * File format is still under discussion, but the internal changes - * are (mostly) done. - * - * Also modified interceptor behaviour: - * - We now intercept all URLs beginning with one of the following - * prefixes (and *only* these prefixes): - * * http://i.j.b/ - * * http://ijbswa.sf.net/config/ - * * http://ijbswa.sourceforge.net/config/ - * - New interceptors "home page" - go to http://i.j.b/ to see it. - * - Internal changes so that intercepted and fast redirect pages - * are not replaced with an image. - * - Interceptors now have the option to send a binary page direct - * to the client. (i.e. ijb-send-banner uses this) - * - Implemented show-url-info interceptor. (Which is why I needed - * the above interceptors changes - a typical URL is - * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". - * The previous mechanism would not have intercepted that, and - * if it had been intercepted then it then it would have replaced - * it with an image.) - * - * Revision 1.6 2001/05/26 14:15:18 jongfoster - * Cosmetic fix: // -> block comment - * - * Revision 1.5 2001/05/26 13:24:31 jongfoster - * New #define, WIN_GUI_EDIT, enables the (embryonic) Win32 GUI editor. - * This #define cannot be set from ./configure - there's no point, it - * doesn't work yet. See feature request # 425722 - * (I missed this file in my original checkin) - * - * Revision 1.4 2001/05/26 00:28:36 jongfoster - * Automatic reloading of config file. - * Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32). - * Most of the global variables have been moved to a new - * struct configuration_spec, accessed through csp->config->globalname - * Most of the globals remaining are used by the Win32 GUI. - * - * Revision 1.3 2001/05/25 22:33:40 jongfoster - * CRLF->LF - * - * Revision 1.2 2001/05/20 01:21:20 jongfoster - * Version 2.9.4 checkin. - * - Merged popupfile and cookiefile, and added control over PCRS - * filtering, in new "permissionsfile". - * - Implemented LOG_LEVEL_FATAL, so that if there is a configuration - * file error you now get a message box (in the Win32 GUI) rather - * than the program exiting with no explanation. - * - Made killpopup use the PCRS MIME-type checking and HTTP-header - * skipping. - * - Removed tabs from "config" - * - Moved duplicated url parsing code in "loaders.c" to a new funcition. - * - Bumped up version number. - * - * Revision 1.1.1.1 2001/05/15 13:59:07 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ #include "config.h" @@ -183,14 +61,14 @@ * remains consistent on all systems. */ IDI_MAINICON ICON DISCARDABLE "icons/privoxy.ico" -IDI_ANIMATED1 ICON DISCARDABLE "icons/ico00001.ico" -IDI_ANIMATED2 ICON DISCARDABLE "icons/ico00002.ico" -IDI_ANIMATED3 ICON DISCARDABLE "icons/ico00003.ico" -IDI_ANIMATED4 ICON DISCARDABLE "icons/ico00004.ico" -IDI_ANIMATED5 ICON DISCARDABLE "icons/ico00005.ico" -IDI_ANIMATED6 ICON DISCARDABLE "icons/ico00006.ico" -IDI_ANIMATED7 ICON DISCARDABLE "icons/ico00007.ico" -IDI_ANIMATED8 ICON DISCARDABLE "icons/ico00008.ico" +IDI_ANIMATED1 ICON DISCARDABLE "icons/radar-01.ico" +IDI_ANIMATED2 ICON DISCARDABLE "icons/radar-02.ico" +IDI_ANIMATED3 ICON DISCARDABLE "icons/radar-03.ico" +IDI_ANIMATED4 ICON DISCARDABLE "icons/radar-04.ico" +IDI_ANIMATED5 ICON DISCARDABLE "icons/radar-05.ico" +IDI_ANIMATED6 ICON DISCARDABLE "icons/radar-06.ico" +IDI_ANIMATED7 ICON DISCARDABLE "icons/radar-07.ico" +IDI_ANIMATED8 ICON DISCARDABLE "icons/radar-08.ico" IDI_IDLE ICON DISCARDABLE "icons/privoxy.ico" IDI_OFF ICON DISCARDABLE "icons/off.ico" @@ -263,7 +141,8 @@ BEGIN MENUITEM "&Main Configuration", ID_TOOLS_EDITCONFIG MENUITEM "&Default Actions", ID_TOOLS_EDITDEFAULTACTIONS MENUITEM "&User Actions", ID_TOOLS_EDITUSERACTIONS - MENUITEM "&Filters", ID_TOOLS_EDITFILTERS + MENUITEM "Default &Filters", ID_TOOLS_EDITDEFAULTFILTERS + MENUITEM "U&ser Filters", ID_TOOLS_EDITUSERFILTERS #ifdef FEATURE_TRUST MENUITEM "&Trust list", ID_TOOLS_EDITTRUST #endif /* def FEATURE_TRUST */ @@ -304,7 +183,8 @@ BEGIN MENUITEM "Edit Main &Configuration", ID_TOOLS_EDITCONFIG MENUITEM "Edit &Default Actions", ID_TOOLS_EDITDEFAULTACTIONS MENUITEM "Edit &User Actions", ID_TOOLS_EDITUSERACTIONS - MENUITEM "Edit &Filters", ID_TOOLS_EDITFILTERS + MENUITEM "Edit Default &Filters", ID_TOOLS_EDITDEFAULTFILTERS + MENUITEM "Edit U&ser Filters", ID_TOOLS_EDITUSERFILTERS #ifdef FEATURE_TRUST MENUITEM "Edit &Trust list", ID_TOOLS_EDITTRUST #endif /* def FEATURE_TRUST */ diff --git a/external/privoxy/w32log.c b/external/privoxy/w32log.c index e5df8b09..76f8cdc0 100644 --- a/external/privoxy/w32log.c +++ b/external/privoxy/w32log.c @@ -1,4 +1,4 @@ -const char w32log_rcs[] = "$Id: w32log.c,v 1.33 2009/03/09 19:02:09 fabiankeil Exp $"; +const char w32log_rcs[] = "$Id: w32log.c,v 1.40 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/w32log.c,v $ @@ -12,7 +12,7 @@ const char w32log_rcs[] = "$Id: w32log.c,v 1.33 2009/03/09 19:02:09 fabiankeil E * Written by and Copyright (C) 1999 Adam Lock * * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -30,183 +30,8 @@ const char w32log_rcs[] = "$Id: w32log.c,v 1.33 2009/03/09 19:02:09 fabiankeil E * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: w32log.c,v $ - * Revision 1.33 2009/03/09 19:02:09 fabiankeil - * Request the default charset in LogPutStringNoMatch(). - * Submitted by Burberry in #2674342 as fix for #2662382. - * - * Revision 1.32 2009/03/09 18:32:48 fabiankeil - * Use the Privoxy icon in the alt+tab window. - * Patch submitted by Burberry in #2674342. - * - * Revision 1.31 2009/03/07 17:58:02 fabiankeil - * Fix two mingw32-only buffer overflows. Note that triggering - * them requires control over the configuration file in which - * case all bets are off anyway. - * - * Revision 1.30 2009/01/01 15:09:23 ler762 - * Change the Windows taskbar icon when privoxy is toggled off. - * - * Revision 1.29 2008/12/20 15:27:40 ler762 - * The crunch log message format changed, so update the strings to highlight - * in the log window. - * - * Revision 1.28 2008/11/02 14:37:47 ler762 - * commit the part of the patches I've been using that were written by torford and gjmurphy - * [ 1824315 ] Minor code cleanup - * [ 1781135 ] Patch - Add clear log, select all, and Accelerators for w32 - * http://sourceforge.net/tracker/?func=detail&atid=311118&aid=1781135&group_id=11118 - * The full patch adds control keys A(select all), C(copy) and D(delete all) to the - * Privoxy log window menu. Select all and copy work for me without the patch - * (albeit without showing the accelerator keys on the menu), so the only part of the - * patch I've been using for the last year or so has been the ctrl-d to delete - * everything in the Privoxy log window. - * - * Revision 1.27 2006/07/18 14:48:48 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.25.2.5 2003/04/04 12:48:51 oes - * Fixed bug #711865: - * - Made tray menu correctly reflect initial window visibility state - * - Hopefully fixed problem where log window contents wasn't visible - * until vertical scroll bar was clicked. Thanks to Guy for the fix! - * - * Revision 1.25.2.4 2003/03/11 11:53:59 oes - * Cosmetic: Renamed cryptic variable - * - * Revision 1.25.2.3 2002/11/20 14:39:05 oes - * Fixed compiler warning - * - * Revision 1.25.2.2 2002/09/25 15:23:10 oes - * Uncheck the "Show Privoxy Window" taskbar menu item when window gets minimized. Fixes bug #606804 - * - * Revision 1.25.2.1 2002/08/21 17:59:05 oes - * - "Show Privoxy Window" now a toggle - * - Temp kludge to let user and default action file be edited through win32 GUI (FR 592080) - * - * Revision 1.25 2002/04/04 00:36:36 gliptak - * always use pcre for matching - * - * Revision 1.24 2002/03/31 17:19:00 jongfoster - * Win32 only: Enabling STRICT to fix a VC++ compile warning. - * - * Revision 1.23 2002/03/26 22:57:10 jongfoster - * Web server name should begin www. - * - * Revision 1.22 2002/03/24 12:48:23 jongfoster - * Fixing doc links - * - * Revision 1.21 2002/03/24 12:07:35 jongfoster - * Consistern name for filters file - * - * Revision 1.20 2002/03/24 12:03:47 jongfoster - * Name change - * - * Revision 1.19 2002/01/17 21:04:17 jongfoster - * Replacing hard references to the URL of the config interface - * with #defines from project.h - * - * Revision 1.18 2001/11/30 23:37:24 jongfoster - * Renaming the Win32 config file to config.txt - this is almost the - * same as the corresponding UNIX name "config" - * - * Revision 1.17 2001/11/16 00:46:31 jongfoster - * Fixing compiler warnings - * - * Revision 1.16 2001/08/01 19:58:12 jongfoster - * Fixing documentation filenames in help menu, and making status - * option work without needing the "Junkbuster Status.URL" file. - * - * Revision 1.15 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.14 2001/07/29 18:47:05 jongfoster - * Adding missing #include "loadcfg.h" - * - * Revision 1.13 2001/07/19 19:15:14 haroon - * - Added a FIXME for EditFile but didn't fix :-) - * - * Revision 1.12 2001/07/13 14:04:59 oes - * Removed all #ifdef PCRS - * - * Revision 1.11 2001/06/07 23:08:12 jongfoster - * Forward and ACL edit options removed. - * - * Revision 1.10 2001/05/31 21:37:11 jongfoster - * GUI changes to rename "permissions file" to "actions file". - * - * Revision 1.9 2001/05/31 17:33:13 oes - * - * CRLF -> LF - * - * Revision 1.8 2001/05/29 09:50:24 jongfoster - * Unified blocklist/imagelist/permissionslist. - * File format is still under discussion, but the internal changes - * are (mostly) done. - * - * Also modified interceptor behaviour: - * - We now intercept all URLs beginning with one of the following - * prefixes (and *only* these prefixes): - * * http://i.j.b/ - * * http://ijbswa.sf.net/config/ - * * http://ijbswa.sourceforge.net/config/ - * - New interceptors "home page" - go to http://i.j.b/ to see it. - * - Internal changes so that intercepted and fast redirect pages - * are not replaced with an image. - * - Interceptors now have the option to send a binary page direct - * to the client. (i.e. ijb-send-banner uses this) - * - Implemented show-url-info interceptor. (Which is why I needed - * the above interceptors changes - a typical URL is - * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". - * The previous mechanism would not have intercepted that, and - * if it had been intercepted then it then it would have replaced - * it with an image.) - * - * Revision 1.7 2001/05/26 01:26:34 jongfoster - * New #define, WIN_GUI_EDIT, enables the (embryonic) Win32 GUI editor. - * This #define cannot be set from ./configure - there's no point, it - * doesn't work yet. See feature request # 425722 - * - * Revision 1.6 2001/05/26 00:31:30 jongfoster - * Fixing compiler warning about comparing signed/unsigned. - * - * Revision 1.5 2001/05/26 00:28:36 jongfoster - * Automatic reloading of config file. - * Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32). - * Most of the global variables have been moved to a new - * struct configuration_spec, accessed through csp->config->globalname - * Most of the globals remaining are used by the Win32 GUI. - * - * Revision 1.4 2001/05/22 18:56:28 oes - * CRLF -> LF - * - * Revision 1.3 2001/05/20 15:07:54 jongfoster - * File is now ignored if _WIN_CONSOLE is defined. - * - * Revision 1.2 2001/05/20 01:21:20 jongfoster - * Version 2.9.4 checkin. - * - Merged popupfile and cookiefile, and added control over PCRS - * filtering, in new "permissionsfile". - * - Implemented LOG_LEVEL_FATAL, so that if there is a configuration - * file error you now get a message box (in the Win32 GUI) rather - * than the program exiting with no explanation. - * - Made killpopup use the PCRS MIME-type checking and HTTP-header - * skipping. - * - Removed tabs from "config" - * - Moved duplicated url parsing code in "loaders.c" to a new funcition. - * - Bumped up version number. - * - * Revision 1.1.1.1 2001/05/15 13:59:07 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include "config.h" @@ -310,7 +135,8 @@ int g_nFontSize = DEFAULT_LOG_FONT_SIZE; const char * g_default_actions_file = NULL; const char * g_user_actions_file = NULL; -const char * g_re_filterfile = NULL; +const char * g_default_filterfile = NULL; +const char * g_user_filterfile = NULL; #ifdef FEATURE_TRUST const char * g_trustfile = NULL; #endif /* def FEATURE_TRUST */ @@ -342,6 +168,11 @@ static struct _Pattern { "Crunch: Forwarding failed", STYLE_HIGHLIGHT }, { "Crunch: Connection failure", STYLE_HIGHLIGHT }, { "Crunch: Out of memory", STYLE_HIGHLIGHT }, + { "Connect: Found reusable socket", STYLE_HIGHLIGHT }, + { "Connect: Reusing server socket", STYLE_HIGHLIGHT }, + { "Connect: Created new connection to", STYLE_HIGHLIGHT }, + { "hung up on us", STYLE_HIGHLIGHT }, + { "Crunching Referer:", STYLE_HIGHLIGHT }, /* what are all the possible error strings?? */ { "Error:", STYLE_HIGHLIGHT }, /* http headers */ @@ -519,67 +350,6 @@ void LogDestroyPatternMatchingBuffers(void) } -/********************************************************************* - * - * Function : LogGetURLUnderCursor - * - * Description : Returns the URL from under the cursor (remember to free it!). - * - * Parameters : None - * - * Returns : NULL or a pointer to an URL string. - * - *********************************************************************/ -char *LogGetURLUnderCursor(void) -{ - char *szResult = NULL; - regex_t re; - POINT ptCursor; - POINTL ptl; - DWORD nPos; - DWORD nWordStart = 0; - DWORD nWordEnd = 0; - - regcomp(&re, RE_URL, REG_ICASE); - - /* Get the position of the cursor over the text window */ - GetCursorPos(&ptCursor); - ScreenToClient(g_hwndLogBox, &ptCursor); - ptl.x = ptCursor.x; - ptl.y = ptCursor.y; - - /* Search backwards and fowards to obtain the word that is highlighted */ - nPos = LOWORD(SendMessage(g_hwndLogBox, EM_CHARFROMPOS, 0, (LPARAM) &ptl)); - nWordStart = SendMessage(g_hwndLogBox, EM_FINDWORDBREAK, WB_LEFT, nPos); - nWordEnd = SendMessage(g_hwndLogBox, EM_FINDWORDBREAK, WB_RIGHTBREAK, nPos); - - /* Compare the string to the pattern */ - if (nWordEnd > nWordStart) - { - TEXTRANGE range; - regmatch_t match; - - range.chrg.cpMin = nWordStart; - range.chrg.cpMax = nWordEnd; - range.lpstrText = (LPSTR)zalloc(nWordEnd - nWordStart + 1); - SendMessage(g_hwndLogBox, EM_GETTEXTRANGE, 0, (LPARAM) &range); - - if (regexec(&re, range.lpstrText, 1, &match, 0) == 0) - { - szResult = range.lpstrText; - } - else - { - free(range.lpstrText); - } - - regfree(&re); - } - return szResult; - -} - - /********************************************************************* * * Function : LogPutString @@ -600,12 +370,12 @@ int LogPutString(const char *pszText) int i; int result = 0; - if (pszText == NULL || strlen(pszText) == 0) + if (!g_bLogMessages) { return 1; } - if (!g_bLogMessages) + if (pszText == NULL || strlen(pszText) == 0) { return 1; } @@ -828,13 +598,13 @@ void LogClipBuffer(void) range.cpMin = SendMessage (g_hwndLogBox, WM_GETTEXTLENGTH, 0, 0); range.cpMax = -1; SendMessage(g_hwndLogBox, EM_EXSETSEL, 0, (LPARAM) &range); - + /* restore vertical ScrollBar stuff (messed up by AUTOVSCROLL) */ SendMessage (g_hwndLogBox, EM_SCROLL, SB_LINEDOWN, 0); - + } -} +} /********************************************************************* @@ -1036,7 +806,7 @@ void ShowLogWindow(BOOL bShow) { SetForegroundWindow(g_hwndLogFrame); SetWindowPos(g_hwndLogFrame, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE); - + } else if (g_bShowOnTaskBar) { @@ -1201,8 +971,12 @@ void OnLogCommand(int nCommand) EditFile(g_user_actions_file); break; - case ID_TOOLS_EDITFILTERS: - EditFile(g_re_filterfile); + case ID_TOOLS_EDITDEFAULTFILTERS: + EditFile(g_default_filterfile); + break; + + case ID_TOOLS_EDITUSERFILTERS: + EditFile(g_user_filterfile); break; #ifdef FEATURE_TRUST @@ -1257,7 +1031,8 @@ void OnLogInitMenu(HMENU hmenu) /* Only enable editors if there is a file to edit */ EnableMenuItem(hmenu, ID_TOOLS_EDITDEFAULTACTIONS, MF_BYCOMMAND | (g_default_actions_file ? MF_ENABLED : MF_GRAYED)); EnableMenuItem(hmenu, ID_TOOLS_EDITUSERACTIONS, MF_BYCOMMAND | (g_user_actions_file ? MF_ENABLED : MF_GRAYED)); - EnableMenuItem(hmenu, ID_TOOLS_EDITFILTERS, MF_BYCOMMAND | (g_re_filterfile ? MF_ENABLED : MF_GRAYED)); + EnableMenuItem(hmenu, ID_TOOLS_EDITDEFAULTFILTERS, MF_BYCOMMAND | (g_default_filterfile ? MF_ENABLED : MF_GRAYED)); + EnableMenuItem(hmenu, ID_TOOLS_EDITUSERFILTERS, MF_BYCOMMAND | (g_user_filterfile ? MF_ENABLED : MF_GRAYED)); #ifdef FEATURE_TRUST EnableMenuItem(hmenu, ID_TOOLS_EDITTRUST, MF_BYCOMMAND | (g_trustfile ? MF_ENABLED : MF_GRAYED)); #endif /* def FEATURE_TRUST */ diff --git a/external/privoxy/w32log.h b/external/privoxy/w32log.h index fff13ad7..c8e0371f 100644 --- a/external/privoxy/w32log.h +++ b/external/privoxy/w32log.h @@ -1,6 +1,6 @@ #ifndef W32LOG_H_INCLUDED #define W32LOG_H_INCLUDED -#define W32LOG_H_VERSION "$Id: w32log.h,v 1.13 2009/03/07 17:58:02 fabiankeil Exp $" +#define W32LOG_H_VERSION "$Id: w32log.h,v 1.16 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/w32log.h,v $ @@ -14,7 +14,7 @@ * Written by and Copyright (C) 1999 Adam Lock * * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -32,84 +32,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: w32log.h,v $ - * Revision 1.13 2009/03/07 17:58:02 fabiankeil - * Fix two mingw32-only buffer overflows. Note that triggering - * them requires control over the configuration file in which - * case all bets are off anyway. - * - * Revision 1.12 2006/07/18 14:48:48 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.10.2.2 2002/11/20 14:39:05 oes - * Fixed compiler warning - * - * Revision 1.10.2.1 2002/08/21 17:58:05 oes - * Temp kludge to let user and default action file be edited through win32 GUI (FR 592080) - * - * Revision 1.10 2002/03/26 22:57:10 jongfoster - * Web server name should begin www. - * - * Revision 1.9 2002/03/24 12:03:47 jongfoster - * Name change - * - * Revision 1.8 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.7 2001/07/29 18:43:08 jongfoster - * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to - * ANSI C rules. - * - * Revision 1.6 2001/07/13 14:04:59 oes - * Removed all #ifdef PCRS - * - * Revision 1.5 2001/06/07 23:08:12 jongfoster - * Forward and ACL edit options removed. - * - * Revision 1.4 2001/05/31 21:37:11 jongfoster - * GUI changes to rename "permissions file" to "actions file". - * - * Revision 1.3 2001/05/29 09:50:24 jongfoster - * Unified blocklist/imagelist/permissionslist. - * File format is still under discussion, but the internal changes - * are (mostly) done. - * - * Also modified interceptor behaviour: - * - We now intercept all URLs beginning with one of the following - * prefixes (and *only* these prefixes): - * * http://i.j.b/ - * * http://ijbswa.sf.net/config/ - * * http://ijbswa.sourceforge.net/config/ - * - New interceptors "home page" - go to http://i.j.b/ to see it. - * - Internal changes so that intercepted and fast redirect pages - * are not replaced with an image. - * - Interceptors now have the option to send a binary page direct - * to the client. (i.e. ijb-send-banner uses this) - * - Implemented show-url-info interceptor. (Which is why I needed - * the above interceptors changes - a typical URL is - * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". - * The previous mechanism would not have intercepted that, and - * if it had been intercepted then it then it would have replaced - * it with an image.) - * - * Revision 1.2 2001/05/26 00:28:36 jongfoster - * Automatic reloading of config file. - * Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32). - * Most of the global variables have been moved to a new - * struct configuration_spec, accessed through csp->config->globalname - * Most of the globals remaining are used by the Win32 GUI. - * - * Revision 1.1.1.1 2001/05/15 13:59:07 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #ifdef __cplusplus extern "C" { @@ -149,7 +73,8 @@ extern int g_nFontSize; extern const char * g_default_actions_file; extern const char * g_user_actions_file; -extern const char * g_re_filterfile; +extern const char * g_default_filterfile; +extern const char * g_user_filterfile; #ifdef FEATURE_TRUST extern const char * g_trustfile; #endif /* def FEATURE_TRUST */ diff --git a/external/privoxy/w32res.h b/external/privoxy/w32res.h index ecee2c37..a0e50879 100644 --- a/external/privoxy/w32res.h +++ b/external/privoxy/w32res.h @@ -1,6 +1,6 @@ #ifndef W32RES_H_INCLUDED #define W32RES_H_INCLUDED -#define W32RES_H_VERSION "$Id: w32res.h,v 1.17 2009/01/01 15:09:23 ler762 Exp $" +#define W32RES_H_VERSION "$Id: w32res.h,v 1.20 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/w32res.h,v $ @@ -11,10 +11,10 @@ * the Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -32,110 +32,6 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: w32res.h,v $ - * Revision 1.17 2009/01/01 15:09:23 ler762 - * Change the Windows taskbar icon when privoxy is toggled off. - * - * Revision 1.16 2008/11/02 14:37:47 ler762 - * commit the part of the patches I've been using that were written by torford and gjmurphy - * [ 1824315 ] Minor code cleanup - * [ 1781135 ] Patch - Add clear log, select all, and Accelerators for w32 - * http://sourceforge.net/tracker/?func=detail&atid=311118&aid=1781135&group_id=11118 - * The full patch adds control keys A(select all), C(copy) and D(delete all) to the - * Privoxy log window menu. Select all and copy work for me without the patch - * (albeit without showing the accelerator keys on the menu), so the only part of the - * patch I've been using for the last year or so has been the ctrl-d to delete - * everything in the Privoxy log window. - * - * Revision 1.15 2006/07/18 14:48:48 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.13.2.1 2002/08/21 17:59:06 oes - * - "Show Privoxy Window" now a toggle - * - Temp kludge to let user and default action file be edited through win32 GUI (FR 592080) - * - * Revision 1.13 2002/03/26 22:57:10 jongfoster - * Web server name should begin www. - * - * Revision 1.12 2002/03/24 12:07:36 jongfoster - * Consistern name for filters file - * - * Revision 1.11 2002/03/24 12:03:47 jongfoster - * Name change - * - * Revision 1.10 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.9 2001/07/29 18:43:08 jongfoster - * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to - * ANSI C rules. - * - * Revision 1.8 2001/07/13 14:04:59 oes - * Removed all #ifdef PCRS - * - * Revision 1.7 2001/06/07 23:08:12 jongfoster - * Forward and ACL edit options removed. - * - * Revision 1.6 2001/05/31 21:37:11 jongfoster - * GUI changes to rename "permissions file" to "actions file". - * - * Revision 1.5 2001/05/29 09:50:24 jongfoster - * Unified blocklist/imagelist/permissionslist. - * File format is still under discussion, but the internal changes - * are (mostly) done. - * - * Also modified interceptor behaviour: - * - We now intercept all URLs beginning with one of the following - * prefixes (and *only* these prefixes): - * * http://i.j.b/ - * * http://ijbswa.sf.net/config/ - * * http://ijbswa.sourceforge.net/config/ - * - New interceptors "home page" - go to http://i.j.b/ to see it. - * - Internal changes so that intercepted and fast redirect pages - * are not replaced with an image. - * - Interceptors now have the option to send a binary page direct - * to the client. (i.e. ijb-send-banner uses this) - * - Implemented show-url-info interceptor. (Which is why I needed - * the above interceptors changes - a typical URL is - * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif". - * The previous mechanism would not have intercepted that, and - * if it had been intercepted then it then it would have replaced - * it with an image.) - * - * Revision 1.4 2001/05/26 01:26:34 jongfoster - * New #define, WIN_GUI_EDIT, enables the (embryonic) Win32 GUI editor. - * This #define cannot be set from ./configure - there's no point, it - * doesn't work yet. See feature request # 425722 - * - * Revision 1.3 2001/05/26 00:28:36 jongfoster - * Automatic reloading of config file. - * Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32). - * Most of the global variables have been moved to a new - * struct configuration_spec, accessed through csp->config->globalname - * Most of the globals remaining are used by the Win32 GUI. - * - * Revision 1.2 2001/05/20 01:21:20 jongfoster - * Version 2.9.4 checkin. - * - Merged popupfile and cookiefile, and added control over PCRS - * filtering, in new "permissionsfile". - * - Implemented LOG_LEVEL_FATAL, so that if there is a configuration - * file error you now get a message box (in the Win32 GUI) rather - * than the program exiting with no explanation. - * - Made killpopup use the PCRS MIME-type checking and HTTP-header - * skipping. - * - Removed tabs from "config" - * - Moved duplicated url parsing code in "loaders.c" to a new funcition. - * - Bumped up version number. - * - * Revision 1.1.1.1 2001/05/15 13:59:08 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ #define IDR_TRAYMENU 101 @@ -176,10 +72,11 @@ #define ID_TOOLS_EDITCONFIG 5000 #define ID_TOOLS_EDITDEFAULTACTIONS 5001 #define ID_TOOLS_EDITUSERACTIONS 5002 -#define ID_TOOLS_EDITFILTERS 5003 +#define ID_TOOLS_EDITDEFAULTFILTERS 5003 +#define ID_TOOLS_EDITUSERFILTERS 5004 #ifdef FEATURE_TRUST -#define ID_TOOLS_EDITTRUST 5004 +#define ID_TOOLS_EDITTRUST 5005 #endif /* def FEATURE_TRUST */ #define ID_EDIT_COPY 30000 diff --git a/external/privoxy/w32svrapi.c b/external/privoxy/w32svrapi.c index aed12327..987cfb5e 100644 --- a/external/privoxy/w32svrapi.c +++ b/external/privoxy/w32svrapi.c @@ -1,4 +1,4 @@ -const char w32_svrapi_rcs[] = "$Id: w32svrapi.c,v 1.2 2006/09/20 03:15:43 david__schmidt Exp $"; +const char w32_svrapi_rcs[] = "$Id: w32svrapi.c,v 1.5 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/w32svrapi.c,v $ @@ -26,7 +26,7 @@ const char w32_svrapi_rcs[] = "$Id: w32svrapi.c,v 1.2 2006/09/20 03:15:43 david_ * some very helpful feedback and suggestions during the * development of this code. * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -44,19 +44,8 @@ const char w32_svrapi_rcs[] = "$Id: w32svrapi.c,v 1.2 2006/09/20 03:15:43 david_ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: w32svrapi.c,v $ - * Revision 1.2 2006/09/20 03:15:43 david__schmidt - * Clean up a variable type declaration which just - * happened to work... - * - * Revision 1.1 2006/08/12 03:54:37 david__schmidt - * Windows service integration - * - * - * *********************************************************************/ - + #include "config.h" @@ -130,7 +119,7 @@ static BOOL HasServiceControlManager() return FALSE; } - /* Try and connect to the SCM. If it fails check and see if the error + /* Try and connect to the SCM. If it fails check and see if the error * code is ERROR_CALL_NOT_IMPLEMENTED, which means: * "This function is not supported on this system." */ @@ -176,12 +165,12 @@ BOOL CanSystemSupportServices() * The Service functions are defined in which is where * the declarations used in this file are taken from * - *********************************************************************/ + *********************************************************************/ /********************************************************************* * Open a connection to the service control manager - *********************************************************************/ + *********************************************************************/ SC_HANDLE w32_open_sc_manager( LPCTSTR lpMachineName, /* computer name */ LPCTSTR lpDatabaseName, /* SCM database name */ @@ -216,7 +205,7 @@ SC_HANDLE w32_open_sc_manager( */ FreeLibrary(hDll); SetLastError(dwLastErr); - + return hScm; } /* -END- w32_open_sc_manager */ @@ -264,7 +253,7 @@ BOOL w32_close_service_handle( /********************************************************************* * Open a service - *********************************************************************/ + *********************************************************************/ SC_HANDLE w32_open_service( SC_HANDLE hSCManager, /* handle to SCM database */ LPCTSTR lpServiceName, /* service name */ @@ -299,7 +288,7 @@ SC_HANDLE w32_open_service( */ FreeLibrary(hDll); SetLastError(dwLastErr); - + return hSrv; } /* -END- w32_open_service */ @@ -362,7 +351,7 @@ SC_HANDLE w32_create_service( */ FreeLibrary(hDll); SetLastError(dwLastErr); - + return hSrv; } /* -END- w32_create_service */ @@ -574,12 +563,12 @@ static void display_win32_msg(BOOL bIsError, char *msg) #else if (bIsError) { - MessageBox(NULL, msg, "Privoxy Error", + MessageBox(NULL, msg, "Privoxy Error", MB_OK | MB_ICONERROR | MB_TASKMODAL | MB_SETFOREGROUND | MB_TOPMOST); } else { - MessageBox(NULL, msg, "Privoxy Information", + MessageBox(NULL, msg, "Privoxy Information", MB_OK | MB_ICONINFORMATION | MB_TASKMODAL | MB_SETFOREGROUND | MB_TOPMOST); } #endif @@ -639,9 +628,9 @@ BOOL install_service(const char *service_name) * We'll temporarily use szDisplayName as a second buffer. *********************************************************************/ GetModuleFileName(NULL, szDisplayName, MAX_PATH); - sprintf(szModule, "\"%s\" --service", szDisplayName); + sprintf(szModule, "\"%s\" --service", szDisplayName); + - /********************************************************************* * Get the display name for the service *********************************************************************/ @@ -651,7 +640,7 @@ BOOL install_service(const char *service_name) /********************************************************************* * Create the service *********************************************************************/ - hService = w32_create_service(hSCM, + hService = w32_create_service(hSCM, service_name, /* the internal service name */ szDisplayName, /* the display name */ SERVICE_ALL_ACCESS, /* get full access during creation */ @@ -774,7 +763,7 @@ static void WINAPI privoxy_w32_service_start(DWORD dw, LPSTR* pszArgs) { int child_id; - /* Arg zero is always the service name, and we need to + /* Arg zero is always the service name, and we need to * know it when we call RegisterServiceCtrlHandler. */ strcpy(szThisServiceName, pszArgs[0]); @@ -926,7 +915,7 @@ static void WINAPI privoxy_w32_service_handler(DWORD dwOpcode) * even after the process had disappeared. * * It seems that if we call exit in the ServiceMain thread, it causes - * the SCM to not recieve the status we sent in the line above. The + * the SCM to not receive the status we sent in the line above. The * simple fix was to create a new thread to actually call exit for us * whilst this thread continues and returns to its caller. */ diff --git a/external/privoxy/w32svrapi.h b/external/privoxy/w32svrapi.h index 48a6d8d6..f4e1ddd7 100644 --- a/external/privoxy/w32svrapi.h +++ b/external/privoxy/w32svrapi.h @@ -1,6 +1,6 @@ #ifndef W32_SVRAPI_H_INCLUDED #define W32_SVRAPI_H_INCLUDED -#define W32_SVRAPI_H_VERSION "$Id: w32svrapi.h,v 1.1 2006/08/12 03:54:37 david__schmidt Exp $" +#define W32_SVRAPI_H_VERSION "$Id: w32svrapi.h,v 1.3 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/w32svrapi.h,v $ @@ -29,7 +29,7 @@ * development of this code. * * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -47,15 +47,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: w32svrapi.h,v $ - * Revision 1.1 2006/08/12 03:54:37 david__schmidt - * Windows service integration - * - * - * *********************************************************************/ - + #ifdef __cplusplus extern "C" { @@ -143,4 +136,4 @@ extern BOOL w32_set_service_status( #endif #endif /* ndef W32_SVRAPI_H_INCLUDED */ - + diff --git a/external/privoxy/w32taskbar.c b/external/privoxy/w32taskbar.c index 079e45e7..451d5e5b 100644 --- a/external/privoxy/w32taskbar.c +++ b/external/privoxy/w32taskbar.c @@ -1,4 +1,4 @@ -const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.10 2006/09/23 13:26:38 roro Exp $"; +const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.12 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/w32taskbar.c,v $ @@ -12,7 +12,7 @@ const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.10 2006/09/23 13:26:38 roro * Written by and Copyright (C) 1999 Adam Lock * * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -30,46 +30,8 @@ const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.10 2006/09/23 13:26:38 roro * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: w32taskbar.c,v $ - * Revision 1.10 2006/09/23 13:26:38 roro - * Replace TABs by spaces in source code. - * - * Revision 1.9 2006/07/18 14:48:48 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.7.2.2 2003/03/19 21:27:42 gliptak - * Corrected compilation error/typo - * - * Revision 1.7.2.1 2002/11/20 14:39:32 oes - * Applied patch by Mattes Dolak which adds re-creation of the win32 taskbar - * icon on reception of the "TaskbarCreated" window message. - * - * Revision 1.7 2002/03/31 17:19:00 jongfoster - * Win32 only: Enabling STRICT to fix a VC++ compile warning. - * - * Revision 1.6 2002/03/26 22:57:10 jongfoster - * Web server name should begin www. - * - * Revision 1.5 2002/03/24 12:03:47 jongfoster - * Name change - * - * Revision 1.4 2001/11/16 00:46:31 jongfoster - * Fixing compiler warnings - * - * Revision 1.3 2001/05/22 18:56:28 oes - * CRLF -> LF - * - * Revision 1.2 2001/05/20 15:07:54 jongfoster - * File is now ignored if _WIN_CONSOLE is defined. - * - * Revision 1.1.1.1 2001/05/15 13:59:08 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include "config.h" diff --git a/external/privoxy/w32taskbar.h b/external/privoxy/w32taskbar.h index 7ea75886..911f96e0 100644 --- a/external/privoxy/w32taskbar.h +++ b/external/privoxy/w32taskbar.h @@ -1,6 +1,6 @@ #ifndef W32TASKBAR_H_INCLUDED #define W32TASKBAR_H_INCLUDED -#define W32TASKBAR_H_VERSION "$Id: w32taskbar.h,v 1.6 2006/07/18 14:48:48 david__schmidt Exp $" +#define W32TASKBAR_H_VERSION "$Id: w32taskbar.h,v 1.8 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/w32taskbar.h,v $ @@ -14,7 +14,7 @@ * Written by and Copyright (C) 1999 Adam Lock * * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -32,28 +32,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: w32taskbar.h,v $ - * Revision 1.6 2006/07/18 14:48:48 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.4 2002/03/26 22:57:10 jongfoster - * Web server name should begin www. - * - * Revision 1.3 2002/03/24 12:03:47 jongfoster - * Name change - * - * Revision 1.2 2001/07/29 18:43:08 jongfoster - * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to - * ANSI C rules. - * - * Revision 1.1.1.1 2001/05/15 13:59:08 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #ifdef __cplusplus extern "C" { diff --git a/external/privoxy/win32.c b/external/privoxy/win32.c index 3aedd533..a7216d56 100644 --- a/external/privoxy/win32.c +++ b/external/privoxy/win32.c @@ -1,4 +1,4 @@ -const char win32_rcs[] = "$Id: win32.c,v 1.15 2009/02/09 19:16:35 fabiankeil Exp $"; +const char win32_rcs[] = "$Id: win32.c,v 1.18 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/win32.c,v $ @@ -11,7 +11,7 @@ const char win32_rcs[] = "$Id: win32.c,v 1.15 2009/02/09 19:16:35 fabiankeil Exp * Written by and Copyright (C) 1999 Adam Lock * * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -29,61 +29,8 @@ const char win32_rcs[] = "$Id: win32.c,v 1.15 2009/02/09 19:16:35 fabiankeil Exp * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: win32.c,v $ - * Revision 1.15 2009/02/09 19:16:35 fabiankeil - * Bump copyright year in win32_blurb[]. - * - * Revision 1.14 2008/03/02 18:15:41 fabiankeil - * Update copyright year in win32_blurb[]. - * - * Revision 1.13 2007/01/31 16:25:24 fabiankeil - * Update copyright range for the About message. - * - * Revision 1.12 2006/08/12 03:54:37 david__schmidt - * Windows service integration - * - * Revision 1.11 2006/07/18 14:48:48 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.9.2.2 2002/08/27 18:03:40 oes - * Fixed stupid typo - * - * Revision 1.9.2.1 2002/08/21 17:59:27 oes - * Sync win32_blurb[] with our standard blurb - * - * Revision 1.9 2002/03/31 17:19:00 jongfoster - * Win32 only: Enabling STRICT to fix a VC++ compile warning. - * - * Revision 1.8 2002/03/26 22:57:10 jongfoster - * Web server name should begin www. - * - * Revision 1.7 2002/03/24 12:03:47 jongfoster - * Name change - * - * Revision 1.6 2002/03/16 21:53:28 jongfoster - * VC++ Heap debug option - * - * Revision 1.5 2002/03/04 23:47:30 jongfoster - * - Rewritten, simpler command-line pre-parser - * - not using raise(SIGINT) any more - * - * Revision 1.4 2001/11/30 21:29:33 jongfoster - * Fixing a warning - * - * Revision 1.3 2001/11/16 00:46:31 jongfoster - * Fixing compiler warnings - * - * Revision 1.2 2001/07/29 19:32:00 jongfoster - * Renaming _main() [mingw32 only] to real_main(), for ANSI compliance. - * - * Revision 1.1.1.1 2001/05/15 13:59:08 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include "config.h" @@ -121,16 +68,16 @@ const char win32_h_rcs[] = WIN32_H_VERSION; */ const char win32_blurb[] = "Privoxy version " VERSION " for Windows\n" -"Copyright (C) 2000-2009 the Privoxy Team (" HOME_PAGE_URL ")\n" +"Copyright (C) 2000-2010 the Privoxy Team (" HOME_PAGE_URL ")\n" "Based on the Internet Junkbuster by Junkbusters Corp.\n" "This is free software; it may be used and copied under the\n" -"GNU General Public License: http://www.gnu.org/copyleft/gpl.html .\n" +"GNU General Public License, version 2: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html\n" "This program comes with ABSOLUTELY NO WARRANTY OF ANY KIND.\n"; #ifdef _WIN_CONSOLE /** - * Hide the console. If set, the program will disconnect from the + * Hide the console. If set, the program will disconnect from the * console and run in the background. This allows the command-prompt * window to close. */ @@ -299,8 +246,8 @@ void InitWin32(void) if (WSAStartup(wVersionRequested, &wsaData) != 0) { #ifndef _WIN_CONSOLE - MessageBox(NULL, "Cannot initialize WinSock library", "Privoxy Error", - MB_OK | MB_ICONERROR | MB_TASKMODAL | MB_SETFOREGROUND | MB_TOPMOST); + MessageBox(NULL, "Cannot initialize WinSock library", "Privoxy Error", + MB_OK | MB_ICONERROR | MB_TASKMODAL | MB_SETFOREGROUND | MB_TOPMOST); #endif exit(1); } diff --git a/external/privoxy/win32.h b/external/privoxy/win32.h index 1b4e814f..51401755 100644 --- a/external/privoxy/win32.h +++ b/external/privoxy/win32.h @@ -1,6 +1,6 @@ #ifndef WIN32_H_INCLUDED #define WIN32_H_INCLUDED -#define WIN32_H_VERSION "$Id: win32.h,v 1.7 2006/07/18 14:48:48 david__schmidt Exp $" +#define WIN32_H_VERSION "$Id: win32.h,v 1.9 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/win32.h,v $ @@ -13,7 +13,7 @@ * Written by and Copyright (C) 1999 Adam Lock * * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -31,34 +31,8 @@ * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: win32.h,v $ - * Revision 1.7 2006/07/18 14:48:48 david__schmidt - * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) - * with what was really the latest development (the v_3_0_branch branch) - * - * Revision 1.5 2002/03/26 22:57:10 jongfoster - * Web server name should begin www. - * - * Revision 1.4 2002/03/24 12:03:47 jongfoster - * Name change - * - * Revision 1.3 2001/07/30 22:08:36 jongfoster - * Tidying up #defines: - * - All feature #defines are now of the form FEATURE_xxx - * - Permanently turned off WIN_GUI_EDIT - * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS - * - * Revision 1.2 2001/07/29 18:43:08 jongfoster - * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to - * ANSI C rules. - * - * Revision 1.1.1.1 2001/05/15 13:59:08 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #ifdef __cplusplus extern "C" { @@ -86,7 +60,7 @@ extern const char win32_h_rcs[]; #endif #endif /* ndef WIN32_H_INCLUDED */ - + /* Local Variables: tab-width: 3