Nginx Brunzip

Maxim Dounin mdounin at mdounin.ru
Mon Apr 20 18:52:24 UTC 2020


Hello!

On Thu, Apr 16, 2020 at 03:48:27PM +1000, Mathew Heard wrote:

> Maxim,
> 
> > Likely unrealted, but "ctx->flush = FLUSH_NOFLUSH" at
> >
> https://github.com/splitice/ngx_brunzip_module/blob/master/ngx_http_brunzip_filter_module.c#L393
> > is meaningless.
> 
> Is beause of
> https://github.com/splitice/ngx_brunzip_module/blob/master/ngx_http_brunzip_filter_module.c#L513
> correct?
> Because FLUSH_FLUSH always resets state to FLUSH_NOFLUSH.

No.  Because of the "ctx->flush != FLUSH_NOFLUSH" condition at the 
very start of the same function.  In the particular place the 
ctx->field is guaranteed to be set to FLUSH_NOFLUSH, and there is 
no need to set it again.

As you can see in the original code, there is no assignment.  
Instead, it simply states that "ctx->flush == Z_NO_FLUSH" in a 
comment.

(http://hg.nginx.org/nginx/file/3a860f22c879/src/http/modules/ngx_http_gunzip_filter_module.c#l365)

-- 
Maxim Dounin
http://mdounin.ru/


More information about the nginx mailing list