X-Git-Url: http://www.privoxy.org/gitweb/%40proxy-info-url%40?a=blobdiff_plain;f=jcc.c;h=ee408b3c010ceb94691ab1b1dfae99b94c4f0747;hb=cda4f358011b254baa2f09dd264aba7f3b9638a7;hp=1e8ad445066da86bde6853023569d109d82a7487;hpb=d6c9b0e695a20c79e3365b6c5eec71f78f50750f;p=privoxy.git diff --git a/jcc.c b/jcc.c index 1e8ad445..ee408b3c 100644 --- a/jcc.c +++ b/jcc.c @@ -1153,10 +1153,10 @@ static void wait_for_alive_connections(void) * Returns : void * *********************************************************************/ -void save_connection_destination(jb_socket sfd, - const struct http_request *http, - const struct forward_spec *fwd, - struct reusable_connection *server_connection) +static 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); @@ -1503,6 +1503,12 @@ static enum chunk_status chunked_body_is_complete(struct iob *iob, size_t *lengt /* Move beyond the chunkdata. */ p += 2 + chunksize; + /* Make sure we're still within the buffer and have two bytes left */ + if (p + 2 > iob->eod) + { + return CHUNK_STATUS_MISSING_DATA; + } + /* There should be another "\r\n" to skip */ if (memcmp(p, "\r\n", 2)) { @@ -2966,6 +2972,7 @@ static void continue_https_chat(struct client_state *csp) csp->cfd); return; } + csp->server_connection.request_sent = time(NULL); csp->server_connection.requests_sent_total++; handle_established_connection(csp); freez(csp->receive_buffer); @@ -3858,6 +3865,18 @@ static void handle_established_connection(struct client_state *csp) return; } + /* + * Disable redirect checkers, so that they will be only run + * again if the user also enables them through tags. + * + * From a performance point of view it doesn't matter, + * but it prevents duplicated log messages. + */ +#ifdef FEATURE_FAST_REDIRECTS + csp->action->flags &= ~ACTION_FAST_REDIRECTS; +#endif + csp->action->flags &= ~ACTION_REDIRECT; + /* * We have now received the entire server header, * filter it and send the result to the client