X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=jcc.c;h=cde64b09426c8590ff3f79a8b9f314aaa80a7314;hp=e57cd0027cc655759184655792dd5ae6eed78f74;hb=cd275efe90ca39d461537daf389e79a3cd79e507;hpb=af4000fd934222b7b6043cdd4e19f5ddc2ce99ab;ds=sidebyside diff --git a/jcc.c b/jcc.c index e57cd002..cde64b09 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.202 2008/11/02 18:40:34 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.204 2008/11/06 19:42:17 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -33,6 +33,14 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.202 2008/11/02 18:40:34 fabiankeil Exp $" * * Revisions : * $Log: jcc.c,v $ + * 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. @@ -2756,7 +2764,7 @@ static void chat(struct client_state *csp) #ifdef FEATURE_CONNECTION_KEEP_ALIVE if (csp->flags & CSP_FLAG_CHUNKED) { - if ((len > 5) && !memcmp(buf+len-5, "0\r\n\r\n", 5)) + if ((len >= 5) && !memcmp(buf+len-5, "0\r\n\r\n", 5)) { /* XXX: this is a temporary hack */ log_error(LOG_LEVEL_CONNECT, @@ -3154,7 +3162,8 @@ static void serve(struct client_state *csp) if (csp->sfd != JB_INVALID_SOCKET) { #ifdef FEATURE_CONNECTION_KEEP_ALIVE - if ((csp->flags & CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE)) + if ((csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE) + && (csp->flags & CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE)) { remember_connection(csp->sfd, csp->http, forward_url(csp, csp->http)); }