| 88 |
* If a request has multiple encodings, we need the gzip |
* If a request has multiple encodings, we need the gzip |
| 89 |
* to be the outermost non-identity encoding. |
* to be the outermost non-identity encoding. |
| 90 |
*/ |
*/ |
| 91 |
static int check_gzip(apr_pool_t *pool, apr_table_t *hdrs) |
static int check_gzip(apr_pool_t *pool, apr_table_t *hdrs, |
| 92 |
|
apr_table_t *hdrs2, const char *enc_in) |
| 93 |
{ |
{ |
| 94 |
int found = 0; |
int found = 0; |
| 95 |
const char *encoding = apr_table_get(hdrs, "Content-Encoding"); |
const char *encoding = apr_table_get(hdrs, "Content-Encoding"); |
| 96 |
|
|
| 97 |
|
if (!encoding && (hdrs2 != NULL)) { |
| 98 |
|
encoding = apr_table_get(hdrs2, "Content-Encoding"); |
| 99 |
|
} |
| 100 |
|
if (!encoding) { |
| 101 |
|
encoding = enc_in; |
| 102 |
|
} |
| 103 |
if (encoding && *encoding) { |
if (encoding && *encoding) { |
| 104 |
|
|
| 105 |
/* check the usual/simple case first */ |
/* check the usual/simple case first */ |
| 743 |
* |
* |
| 744 |
* If not, we just remove ourself. |
* If not, we just remove ourself. |
| 745 |
*/ |
*/ |
| 746 |
if (check_gzip(r->pool, r->headers_in) == 0) { |
if (check_gzip(r->pool, r->headers_in, NULL, NULL) == 0) { |
| 747 |
ap_remove_input_filter(f); |
ap_remove_input_filter(f); |
| 748 |
return ap_get_brigade(f->next, bb, mode, block, readbytes); |
return ap_get_brigade(f->next, bb, mode, block, readbytes); |
| 749 |
} |
} |
| 998 |
* Let's see what our current Content-Encoding is. |
* Let's see what our current Content-Encoding is. |
| 999 |
* Only inflate if gzipped. |
* Only inflate if gzipped. |
| 1000 |
*/ |
*/ |
| 1001 |
if (check_gzip(r->pool, r->headers_out) == 0) { |
if (check_gzip(r->pool, r->headers_out, r->err_headers_out, |
| 1002 |
|
r->content_encoding) == 0) { |
| 1003 |
ap_remove_output_filter(f); |
ap_remove_output_filter(f); |
| 1004 |
return ap_pass_brigade(f->next, bb); |
return ap_pass_brigade(f->next, bb); |
| 1005 |
} |
} |