@@ -1310,38 +1310,40 @@ static apr_status_t deflate_in_filter(ap_filter_t *f,
1310
1310
if (APR_BUCKET_IS_FLUSH (bkt )) {
1311
1311
apr_bucket * tmp_b ;
1312
1312
1313
- ctx -> inflate_total += ctx -> stream .avail_out ;
1314
- zRC = inflate (& (ctx -> stream ), Z_SYNC_FLUSH );
1315
- ctx -> inflate_total -= ctx -> stream .avail_out ;
1316
- if (zRC != Z_OK ) {
1317
- inflateEnd (& ctx -> stream );
1318
- ap_log_rerror (APLOG_MARK , APLOG_WARNING , 0 , r , APLOGNO (01391 )
1319
- "Zlib error %d inflating data (%s)" , zRC ,
1320
- ctx -> stream .msg );
1321
- return APR_EGENERAL ;
1322
- }
1313
+ if (!ctx -> done ) {
1314
+ ctx -> inflate_total += ctx -> stream .avail_out ;
1315
+ zRC = inflate (& (ctx -> stream ), Z_SYNC_FLUSH );
1316
+ ctx -> inflate_total -= ctx -> stream .avail_out ;
1317
+ if (zRC != Z_OK ) {
1318
+ inflateEnd (& ctx -> stream );
1319
+ ap_log_rerror (APLOG_MARK , APLOG_WARNING , 0 , r , APLOGNO (01391 )
1320
+ "Zlib error %d inflating data (%s)" , zRC ,
1321
+ ctx -> stream .msg );
1322
+ return APR_EGENERAL ;
1323
+ }
1323
1324
1324
- if (inflate_limit && ctx -> inflate_total > inflate_limit ) {
1325
- inflateEnd (& ctx -> stream );
1326
- ap_log_rerror (APLOG_MARK , APLOG_WARNING , 0 , r , APLOGNO (02647 )
1327
- "Inflated content length of %" APR_OFF_T_FMT
1328
- " is larger than the configured limit"
1329
- " of %" APR_OFF_T_FMT ,
1330
- ctx -> inflate_total , inflate_limit );
1331
- return APR_ENOSPC ;
1332
- }
1325
+ if (inflate_limit && ctx -> inflate_total > inflate_limit ) {
1326
+ inflateEnd (& ctx -> stream );
1327
+ ap_log_rerror (APLOG_MARK , APLOG_WARNING , 0 , r , APLOGNO (02647 )
1328
+ "Inflated content length of %" APR_OFF_T_FMT
1329
+ " is larger than the configured limit"
1330
+ " of %" APR_OFF_T_FMT ,
1331
+ ctx -> inflate_total , inflate_limit );
1332
+ return APR_ENOSPC ;
1333
+ }
1333
1334
1334
- if (!check_ratio (r , ctx , dc )) {
1335
- inflateEnd (& ctx -> stream );
1336
- ap_log_rerror (APLOG_MARK , APLOG_WARNING , 0 , r , APLOGNO (02805 )
1337
- "Inflated content ratio is larger than the "
1338
- "configured limit %i by %i time(s)" ,
1339
- dc -> ratio_limit , dc -> ratio_burst );
1340
- return APR_EINVAL ;
1341
- }
1335
+ if (!check_ratio (r , ctx , dc )) {
1336
+ inflateEnd (& ctx -> stream );
1337
+ ap_log_rerror (APLOG_MARK , APLOG_WARNING , 0 , r , APLOGNO (02805 )
1338
+ "Inflated content ratio is larger than the "
1339
+ "configured limit %i by %i time(s)" ,
1340
+ dc -> ratio_limit , dc -> ratio_burst );
1341
+ return APR_EINVAL ;
1342
+ }
1342
1343
1343
- consume_buffer (ctx , c , c -> bufferSize - ctx -> stream .avail_out ,
1344
- UPDATE_CRC , ctx -> proc_bb );
1344
+ consume_buffer (ctx , c , c -> bufferSize - ctx -> stream .avail_out ,
1345
+ UPDATE_CRC , ctx -> proc_bb );
1346
+ }
1345
1347
1346
1348
/* Flush everything so far in the returning brigade, but continue
1347
1349
* reading should EOS/more follow (don't lose them).
0 commit comments