X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=jcc.c;h=8c34236f7e2eb2d4502c1a770b739b178a166122;hp=d73b4a99cba096cd335bf708a40e250a2e772989;hb=03f944bb7d3c7cf1fcae82c2b3e70ff8e0a6ea02;hpb=555b12c0eaa9a409bc041de6db940907f866e98a diff --git a/jcc.c b/jcc.c index d73b4a99..8c34236f 100644 --- a/jcc.c +++ b/jcc.c @@ -376,7 +376,8 @@ static void sig_handler(int the_signal) * We shouldn't be here, unless we catch signals * in main() that we can't handle here! */ - log_error(LOG_LEVEL_FATAL, "sig_handler: exiting on unexpected signal %d", the_signal); + log_error(LOG_LEVEL_FATAL, + "sig_handler: exiting on unexpected signal %d", the_signal); } return; @@ -1552,7 +1553,8 @@ static jb_err receive_chunked_client_request_body(struct client_state *csp) len = read_socket(csp->cfd, buf, sizeof(buf) - 1); if (len <= 0) { - log_error(LOG_LEVEL_ERROR, "Read the client body failed: %E"); + log_error(LOG_LEVEL_ERROR, + "Reading the client body failed: %E"); break; } if (add_to_iob(csp->client_iob, csp->config->buffer_limit, buf, len)) @@ -6182,11 +6184,6 @@ static void listen_loop(void) /* NOTREACHED unless FEATURE_GRACEFUL_TERMINATION is defined */ -#ifdef FEATURE_HTTPS_INSPECTION - /* Clean up. Aim: free all memory (no leaks) */ - ssl_release(); -#endif - #ifdef FEATURE_GRACEFUL_TERMINATION log_error(LOG_LEVEL_INFO, "Graceful termination requested."); @@ -6209,7 +6206,8 @@ static void listen_loop(void) if (i <= 0) { - log_error(LOG_LEVEL_ERROR, "Graceful termination failed - still some live clients after 1 minute wait."); + log_error(LOG_LEVEL_ERROR, "Graceful termination failed " + "- still some live clients after 1 minute wait."); } } sweep(); @@ -6219,6 +6217,17 @@ static void listen_loop(void) freez(basedir); #endif +#ifdef FEATURE_HTTPS_INSPECTION + /* + * Only release TLS backed resources if there + * are no active connections left. + */ + if (clients->next == NULL) + { + ssl_release(); + } +#endif + log_error(LOG_LEVEL_INFO, "Exiting gracefully."); #if defined(_WIN32) && !defined(_WIN_CONSOLE)