Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/ngx_http_lua_io_input_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ ngx_http_lua_io_read_chunk(void *data, ngx_buf_t *buf, size_t size)
return NGX_OK;
}

if(file_ctx->buf_in == NULL) {
return NGX_OK;
}

if (size >= rest) {
buf->pos += rest;
file_ctx->buf_in->buf->last += rest;
Expand Down Expand Up @@ -64,6 +68,10 @@ ngx_http_lua_io_read_line(void *data, ngx_buf_t *buf, size_t size)

#endif

if(file_ctx->buf_in == NULL) {
return NGX_OK;
}

while (size--) {

c = *buf->pos++;
Expand Down Expand Up @@ -98,6 +106,10 @@ ngx_http_lua_io_read_all(void *data, ngx_buf_t *buf, size_t size)
{
ngx_http_lua_io_file_ctx_t *file_ctx = data;

if(file_ctx->buf_in == NULL) {
return NGX_OK;
}

file_ctx->buf_in->buf->last += size;
buf->pos += size;

Expand Down