X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=jcc.c;h=d0c7d42ed60eaa782b20755fd01f158307a8d35b;hb=3747654d2e0435e9b7acb0b587232da58368824f;hp=9a05b306be69cf36baf09108cb22a3495d1f92a9;hpb=1c79e7655de8bcab545c9f044ac6197b233d9ec1;p=privoxy.git diff --git a/jcc.c b/jcc.c index 9a05b306..d0c7d42e 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.230 2009/03/07 13:09:17 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.234 2009/03/18 20:48:42 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -33,6 +33,22 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.230 2009/03/07 13:09:17 fabiankeil Exp $" * * Revisions : * $Log: jcc.c,v $ + * 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 @@ -2586,7 +2602,7 @@ static void chat(struct client_state *csp) int max_forwarded_connect_retries = csp->config->forwarded_connect_retries; const struct forward_spec *fwd; struct http_request *http; - int len = 0; /* for buffer sizes (and negative error codes) */ + 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; @@ -2596,8 +2612,6 @@ static void chat(struct client_state *csp) struct timeval timeout; memset(buf, 0, sizeof(buf)); - memset(&timeout, 0, sizeof(timeout)); - timeout.tv_sec = csp->config->socket_timeout; http = csp->http; @@ -2839,6 +2853,8 @@ static void chat(struct client_state *csp) } #endif /* FEATURE_CONNECTION_KEEP_ALIVE */ + timeout.tv_sec = csp->config->socket_timeout; + timeout.tv_usec = 0; n = select((int)maxfd+1, &rfds, NULL, NULL, &timeout); if (n == 0) @@ -3060,7 +3076,7 @@ static void chat(struct client_state *csp) if (add_to_iob(csp, buf, len)) { size_t hdrlen; - int flushed; + long flushed; log_error(LOG_LEVEL_INFO, "Flushing header and buffers. Stepping back from filtering."); @@ -3678,6 +3694,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; } @@ -3893,8 +3910,8 @@ int main(int argc, const char *argv[]) } #endif /* 1 */ /* - * stderr (fd 2) will be closed later on, when the - * log file has been parsed. + * stderr (fd 2) will be closed later on, + * when the config file has been parsed. */ close( 0 );