/[Apache-SVN]/httpd/httpd/trunk/modules/filters/mod_deflate.c
ViewVC logotype

Diff of /httpd/httpd/trunk/modules/filters/mod_deflate.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 563230, Mon Aug 6 19:24:10 2007 UTC revision 563317, Mon Aug 6 22:45:39 2007 UTC
# Line 88  static const char deflate_magic[2] = { ' Line 88  static const char deflate_magic[2] = { '
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 */
# Line 735  static apr_status_t deflate_in_filter(ap Line 743  static apr_status_t deflate_in_filter(ap
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          }          }
# Line 990  static apr_status_t inflate_out_filter(a Line 998  static apr_status_t inflate_out_filter(a
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          }          }

Legend:
Removed from v.563230  
changed lines
  Added in v.563317

apache@apache.org
ViewVC Help
Powered by ViewVC 1.1.2