Graham Leggett wrote: > On 15 May 2013, at 9:23 PM, Ruediger Pluem <rpl...@apache.org> wrote: > >> Now we have: >> >> t/apache/pr17629.t (Wstat: 0 Tests: 4 Failed: 1) >> Failed test: 4 > > Looking at a verbose version of this test, we see this: > > # expected: begin-foobar-end > # received: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> > # <html><head> > # <title>400 Bad Request</title> > # </head><body> > # <h1>Bad Request</h1> > # <p>Your browser sent a request that this server could not understand.<br /> > # </p> > # </body></html> > not ok 4 > > Tracing through the code, we get a bad request because we trip over this code > in mod_deflate: > > /* If we actually see the EOS, that means we screwed up! */ > if (APR_BUCKET_IS_EOS(bkt)) { > inflateEnd(&ctx->stream); > ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01390) > "Encountered EOS bucket in inflate filter > (bug?)"); > return APR_EGENERAL; > } > > Why does seeing an EOS in the input stream mean we screwed up? I don't follow.
We should not see an EOS bucket before inflate(&ctx->stream, Z_NO_FLUSH); in line 1061 returned Z_STREAM_END. This would mean we received an incomplete compressed stream. And if we see Z_STREAM_END we leave the for loop and stop processing buckets. Hence we cannot hit a possible EOS bucket in the brigade any longer. So the test possibly sents an incomplete compressed body. Regards Rüdiger