mirror of
https://github.com/apache/httpd.git
synced 2026-01-06 09:01:14 +03:00
style
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104166 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
#define RESERVED 0xE0 /* bits 5..7: reserved */
|
||||
|
||||
|
||||
|
||||
#include "httpd.h"
|
||||
#include "http_config.h"
|
||||
#include "http_log.h"
|
||||
@@ -881,8 +880,8 @@ static apr_status_t deflate_in_filter(ap_filter_t *f,
|
||||
static apr_status_t inflate_out_filter(ap_filter_t *f,
|
||||
apr_bucket_brigade *bb)
|
||||
{
|
||||
int zlib_method ;
|
||||
int zlib_flags ;
|
||||
int zlib_method;
|
||||
int zlib_flags;
|
||||
int deflate_init = 1;
|
||||
apr_bucket *bkt;
|
||||
request_rec *r = f->r;
|
||||
@@ -972,7 +971,7 @@ static apr_status_t inflate_out_filter(ap_filter_t *f,
|
||||
zRC = inflate(&(ctx->stream), Z_SYNC_FLUSH);
|
||||
if (zRC != Z_OK) {
|
||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
|
||||
"Inflate error %d on flush", zRC) ;
|
||||
"Inflate error %d on flush", zRC);
|
||||
inflateEnd(&ctx->stream);
|
||||
return APR_EGENERAL;
|
||||
}
|
||||
@@ -995,53 +994,53 @@ static apr_status_t inflate_out_filter(ap_filter_t *f,
|
||||
apr_bucket_read(bkt, &data, &len, APR_BLOCK_READ);
|
||||
|
||||
/* first bucket contains zlib header */
|
||||
if ( ! deflate_init++ ) {
|
||||
if ( len < 10 ) {
|
||||
if (!deflate_init++) {
|
||||
if (len < 10) {
|
||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
|
||||
"Insufficient data for inflate");
|
||||
return APR_EGENERAL ;
|
||||
return APR_EGENERAL;
|
||||
}
|
||||
else {
|
||||
zlib_method = data[2] ;
|
||||
zlib_flags = data[3] ;
|
||||
if ( zlib_method != Z_DEFLATED ) {
|
||||
zlib_method = data[2];
|
||||
zlib_flags = data[3];
|
||||
if (zlib_method != Z_DEFLATED) {
|
||||
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
|
||||
"inflate: data not deflated!") ;
|
||||
ap_remove_output_filter(f) ;
|
||||
return ap_pass_brigade(f->next, bb) ;
|
||||
"inflate: data not deflated!");
|
||||
ap_remove_output_filter(f);
|
||||
return ap_pass_brigade(f->next, bb);
|
||||
}
|
||||
if (data[0] != deflate_magic[0] ||
|
||||
data[1] != deflate_magic[1] ||
|
||||
(zlib_flags & RESERVED) != 0 ) {
|
||||
(zlib_flags & RESERVED) != 0) {
|
||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
|
||||
"deflate: bad header");
|
||||
"inflate: bad header");
|
||||
return APR_EGENERAL ;
|
||||
}
|
||||
data += 10 ;
|
||||
len -= 10 ;
|
||||
}
|
||||
if ( zlib_flags & EXTRA_FIELD) {
|
||||
unsigned int bytes =
|
||||
(unsigned int)(data[0]) ;
|
||||
bytes += ((unsigned int)(data[1])) << 8 ;
|
||||
bytes += 2 ;
|
||||
if ( len < bytes ) {
|
||||
if (zlib_flags & EXTRA_FIELD) {
|
||||
unsigned int bytes = (unsigned int)(data[0]);
|
||||
bytes += ((unsigned int)(data[1])) << 8;
|
||||
bytes += 2;
|
||||
if (len < bytes) {
|
||||
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
|
||||
"inflate: extra field too big (not supported)") ;
|
||||
return APR_EGENERAL ;
|
||||
"inflate: extra field too big (not "
|
||||
"supported)");
|
||||
return APR_EGENERAL;
|
||||
}
|
||||
data += bytes ;
|
||||
len -= bytes ;
|
||||
data += bytes;
|
||||
len -= bytes;
|
||||
}
|
||||
if ( zlib_flags & ORIG_NAME) {
|
||||
while ( len-- && *data++ ) ;
|
||||
if (zlib_flags & ORIG_NAME) {
|
||||
while (len-- && *data++);
|
||||
}
|
||||
if ( zlib_flags & COMMENT) {
|
||||
while ( len-- && *data++ ) ;
|
||||
if (zlib_flags & COMMENT) {
|
||||
while (len-- && *data++);
|
||||
}
|
||||
if ( zlib_flags & HEAD_CRC) {
|
||||
len -= 2 ;
|
||||
data += 2 ;
|
||||
if (zlib_flags & HEAD_CRC) {
|
||||
len -= 2;
|
||||
data += 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user