X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=parsers.c;h=27ada5f76c44b1263a97f0d42c7b47c0ce50caa2;hb=243151bf53f4898b89323eb73e1e41619cb2d7f0;hp=8b1a7a7ada17d06f9267dc9b7292adf454b94c22;hpb=669e502a39f941fbe1cf1444b611d3ab49a97c4c;p=privoxy.git diff --git a/parsers.c b/parsers.c index 8b1a7a7a..27ada5f7 100644 --- a/parsers.c +++ b/parsers.c @@ -1,4 +1,4 @@ -const char parsers_rcs[] = "$Id: parsers.c,v 1.292 2014/07/25 11:57:17 fabiankeil Exp $"; +const char parsers_rcs[] = "$Id: parsers.c,v 1.296 2014/11/03 14:41:12 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.c,v $ @@ -1662,6 +1662,8 @@ static jb_err server_keep_alive(struct client_state *csp, char **header) csp->flags |= CSP_FLAG_SERVER_KEEP_ALIVE_TIMEOUT_SET; } + freez(*header); + return JB_ERR_OK; } @@ -2195,11 +2197,12 @@ static jb_err server_content_type(struct client_state *csp, char **header) */ if ((csp->content_type & CT_TEXT) || (csp->action->flags & ACTION_FORCE_TEXT_MODE)) { + jb_err err; freez(*header); *header = strdup_or_die("Content-Type: "); - string_append(header, csp->action->string[ACTION_STRING_CONTENT_TYPE]); - if (header == NULL) + err = string_append(header, csp->action->string[ACTION_STRING_CONTENT_TYPE]); + if (JB_ERR_OK != err) { log_error(LOG_LEVEL_HEADER, "Insufficient memory to replace Content-Type!"); return JB_ERR_MEMORY; @@ -2321,8 +2324,7 @@ static jb_err server_content_encoding(struct client_state *csp, char **header) /* * Log a warning if the user expects the content to be filtered. */ - if ((csp->rlist != NULL) && - (!list_is_empty(csp->action->multi[ACTION_MULTI_FILTER]))) + if (content_filters_enabled(csp->action)) { log_error(LOG_LEVEL_INFO, "SDCH-compressed content detected, content filtering disabled. " @@ -3878,7 +3880,7 @@ static jb_err server_http(struct client_state *csp, char **header) reason_phrase=""; } - if (3 != sscanf(*header, "HTTP/%u.%u %u", &major_version, + if (3 != sscanf(*header, "HTTP/%u.%u %d", &major_version, &minor_version, &(csp->http->status))) { log_error(LOG_LEVEL_ERROR, @@ -3913,7 +3915,7 @@ static jb_err server_http(struct client_state *csp, char **header) length = sizeof("HTTP/1.1 200 ") + strlen(reason_phrase) + 1; new_response_line = malloc_or_die(length); - snprintf(new_response_line, length, "HTTP/%u.%u %u %s", + snprintf(new_response_line, length, "HTTP/%u.%u %d %s", major_version, minor_version, csp->http->status, reason_phrase); if (0 != strcmp(*header, new_response_line))