X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=jcc.c;h=2beca7b62c57f3520f32d1081e96d118bd5de185;hp=9f379c013068ea824280f6ac07b95e076f5629a2;hb=4da2e32f7f7b84c8fdc01855e668bfca600d7105;hpb=1b5968c7f2f7495d7858011d40c44b02d7ab3975 diff --git a/jcc.c b/jcc.c index 9f379c01..2beca7b6 100644 --- a/jcc.c +++ b/jcc.c @@ -2080,12 +2080,13 @@ static int read_http_request_body(struct client_state *csp) if (to_read != 0) { - log_error(LOG_LEVEL_CONNECT, "Not enough request body has been read: expected %llu more bytes", - csp->expected_client_content_length); + log_error(LOG_LEVEL_CONNECT, + "Not enough request body has been read: expected %lu more bytes", + to_read); return 1; } - log_error(LOG_LEVEL_CONNECT, "The last %llu bytes of the request body have been read", - csp->expected_client_content_length); + log_error(LOG_LEVEL_CONNECT, + "The last %d bytes of the request body have been read", len); return 0; } @@ -2205,6 +2206,7 @@ static int send_http_request(struct client_state *csp) update_client_headers(csp, to_send_len)) { log_error(LOG_LEVEL_HEADER, "Error updating client headers"); + freez(to_send); return 1; } csp->expected_client_content_length = 0; @@ -2229,6 +2231,10 @@ static int send_http_request(struct client_state *csp) { log_error(LOG_LEVEL_CONNECT, "Failed sending request headers to: %s: %E", csp->http->hostport); + if (filter_client_body) + { + freez(to_send); + } return 1; } @@ -2800,6 +2806,8 @@ static jb_err process_encrypted_request_headers(struct client_state *csp) "Failed to get the encrypted request destination"); ssl_send_data_delayed(&(csp->ssl_client_attr), (const unsigned char *)CHEADER, strlen(CHEADER), get_write_delay(csp)); + destroy_list(headers); + return JB_ERR_PARSE; } @@ -2872,7 +2880,7 @@ static jb_err process_encrypted_request_headers(struct client_state *csp) return JB_ERR_PARSE; } - log_error(LOG_LEVEL_HEADER, "Encrypted request processed"); + log_error(LOG_LEVEL_HEADER, "Encrypted request headers processed"); log_error(LOG_LEVEL_REQUEST, "https://%s%s", csp->http->hostport, csp->http->path); @@ -4340,13 +4348,14 @@ static void chat(struct client_state *csp) } #endif + log_applied_actions(csp->action); + /* decide how to route the HTTP request */ fwd = forward_url(csp, http); freez(csp->headers->first->str); build_request_line(csp, fwd, &csp->headers->first->str); - log_applied_actions(csp->action); if (fwd->forward_host) { log_error(LOG_LEVEL_CONNECT, "via [%s]:%d to: %s", @@ -6274,6 +6283,8 @@ static void listen_loop(void) log_error(LOG_LEVEL_INFO, "Graceful termination requested."); + close_ports_helper(bfds); + unload_current_config_file(); unload_current_actions_file(); unload_current_re_filterfile();