+ * 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.
+ *