You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2011/10/24 00:17:52 UTC
svn commit: r1187991 - /httpd/httpd/trunk/modules/filters/mod_deflate.c
Author: sf
Date: Sun Oct 23 22:17:52 2011
New Revision: 1187991
URL: http://svn.apache.org/viewvc?rev=1187991&view=rev
Log:
Log reason for not deflating at level trace1
Modified:
httpd/httpd/trunk/modules/filters/mod_deflate.c
Modified: httpd/httpd/trunk/modules/filters/mod_deflate.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_deflate.c?rev=1187991&r1=1187990&r2=1187991&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_deflate.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_deflate.c Sun Oct 23 22:17:52 2011
@@ -463,7 +463,7 @@ static apr_status_t deflate_out_filter(a
while (1) {
apr_status_t rc;
if (APR_BUCKET_IS_EOS(e)) {
- ap_log_rerror(APLOG_MARK, APLOG_TRACE4, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r,
"Not compressing very small response of %"
APR_SIZE_T_FMT " bytes", len);
ap_remove_output_filter(f);
@@ -498,6 +498,15 @@ static apr_status_t deflate_out_filter(a
apr_table_get(r->subprocess_env, "no-gzip") ||
apr_table_get(r->headers_out, "Content-Range")
) {
+ if (APLOG_R_IS_LEVEL(r, APLOG_TRACE1)) {
+ const char *reason =
+ (r->main != NULL) ? "subrequest" :
+ (r->status == HTTP_NO_CONTENT) ? "no content" :
+ apr_table_get(r->subprocess_env, "no-gzip") ? "no-gzip" :
+ "content-range";
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r,
+ "Not compressing (%s)", reason);
+ }
ap_remove_output_filter(f);
return ap_pass_brigade(f->next, bb);
}
@@ -511,6 +520,8 @@ static apr_status_t deflate_out_filter(a
const char *env_value = apr_table_get(r->subprocess_env,
"gzip-only-text/html");
if ( env_value && (strcmp(env_value,"1") == 0) ) {
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r,
+ "Not compressing, (gzip-only-text/html)");
ap_remove_output_filter(f);
return ap_pass_brigade(f->next, bb);
}
@@ -547,7 +558,9 @@ static apr_status_t deflate_out_filter(a
/* stolen from mod_negotiation: */
if (strcmp(token, "identity") && strcmp(token, "7bit") &&
strcmp(token, "8bit") && strcmp(token, "binary")) {
-
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r,
+ "Not compressing (content-encoding already "
+ " set: %s)", token);
ap_remove_output_filter(f);
return ap_pass_brigade(f->next, bb);
}
@@ -595,10 +608,16 @@ static apr_status_t deflate_out_filter(a
/* No acceptable token found. */
if (token == NULL || token[0] == '\0') {
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r,
+ "Not compressing (no Accept-Encoding: gzip)");
ap_remove_output_filter(f);
return ap_pass_brigade(f->next, bb);
}
}
+ else {
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r,
+ "Forcing compression (force-gzip set)");
+ }
/* At this point we have decided to filter the content. Let's try to
* to initialize zlib (except for 304 responses, where we will only