Gunzip module and buffer managment

I’m trying to use the http_gunzip module as an example for a filter I
am
trying to write. I’m particularly interested in the buffer management.

The module has a value in its ctx stuct called last_buf


ngx_chain_t **last_out;

last_out is set in various places throughout the code. Sometimes to
other
chains in the ctx, sometimes to newly allocated chains.

But as far as I can tell, none of the code ever uses the value stored in
last_out. (It seems to be a write-only variable :slight_smile:

Anybody know what I’m missing?

Posted at Nginx Forum:

On Friday 07 June 2013 01:57:54 kpstein wrote:

chains in the ctx, sometimes to newly allocated chains.

But as far as I can tell, none of the code ever uses the value stored in
last_out. (It seems to be a write-only variable :slight_smile:

Anybody know what I’m missing?

% grep ‘*ctx->last_out’ -n
src/http/modules/ngx_http_gunzip_filter_module.c
461: *ctx->last_out = cl;
497: *ctx->last_out = cl;
546: *ctx->last_out = cl;
592: *ctx->last_out = cl;

wbr, Valentin V. Bartenev


http://nginx.org/en/donation.html

second rank pointer.

---- ctx->last_out Matches (10 in 1 files) ----
Ngx_http_gunzip_filter_module.c (add-on): ctx->last_out =
&ctx->out;
Ngx_http_gunzip_filter_module.c (add-on): ctx->last_out = &ctx->out;
Ngx_http_gunzip_filter_module.c (add-on): *ctx->last_out = cl;
Ngx_http_gunzip_filter_module.c (add-on): ctx->last_out =
&cl->next;
Ngx_http_gunzip_filter_module.c (add-on): *ctx->last_out = cl;
Ngx_http_gunzip_filter_module.c (add-on): ctx->last_out =
&cl->next;
Ngx_http_gunzip_filter_module.c (add-on): *ctx->last_out = cl;
Ngx_http_gunzip_filter_module.c (add-on): ctx->last_out =
&cl->next;
Ngx_http_gunzip_filter_module.c (add-on): *ctx->last_out = cl;
Ngx_http_gunzip_filter_module.c (add-on): ctx->last_out = &cl->next;

Posted at Nginx Forum: