Kouhei Sutou
null+****@clear*****
Mon Jan 26 14:03:42 JST 2015
Kouhei Sutou 2015-01-26 14:03:42 +0900 (Mon, 26 Jan 2015) New Revision: f79935b4719236661a586dd1b886a0b3fc4ed03c https://github.com/groonga/groonga/commit/f79935b4719236661a586dd1b886a0b3fc4ed03c Message: groonga-httpd dump: support the last output without data Modified files: src/httpd/nginx-module/ngx_http_groonga_module.c Modified: src/httpd/nginx-module/ngx_http_groonga_module.c (+10 -4) =================================================================== --- src/httpd/nginx-module/ngx_http_groonga_module.c 2015-01-26 13:21:54 +0900 (488baef) +++ src/httpd/nginx-module/ngx_http_groonga_module.c 2015-01-26 14:03:42 +0900 (8320efe) @@ -428,7 +428,7 @@ ngx_http_groonga_context_receive_handler_raw(grn_ctx *context, } } - if (chunk_size > 0) { + if (chunk_size > 0 || is_last_chunk) { ngx_chain_t *chain; chain = ngx_chain_get_free_buf(r->pool, &(data->raw.free_chain)); @@ -438,12 +438,18 @@ ngx_http_groonga_context_receive_handler_raw(grn_ctx *context, data->raw.rc = NGX_ERROR; return; } - chain->buf->pos = (u_char *)chunk; - chain->buf->last = (u_char *)chunk + chunk_size; + if (chunk_size == 0) { + chain->buf->pos = NULL; + chain->buf->last = NULL; + chain->buf->memory = 0; + } else { + chain->buf->pos = (u_char *)chunk; + chain->buf->last = (u_char *)chunk + chunk_size; + chain->buf->memory = 1; + } chain->buf->tag = (ngx_buf_tag_t)&ngx_http_groonga_module; chain->buf->flush = 1; chain->buf->temporary = 0; - chain->buf->memory = 1; chain->buf->in_file = 0; if (is_last_chunk) { chain->buf->last_buf = 1; -------------- next part -------------- HTML����������������������������...ダウンロード