Skip to content

Commit 377877b

Browse files
authored
Merge pull request #8 from xadhoom/master
Fix filter fields regexp and corner case parsing
2 parents a7eda47 + 3c296f8 commit 377877b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ngx_http_upload_module.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,16 @@ ngx_http_read_upload_client_request_body(ngx_http_request_t *r)
873873

874874
rc = ngx_http_do_read_client_request_body(r);
875875
goto done;
876+
} else if (rb->rest == 0) {
877+
/* everything already read in ngx_http_request_body_filter */
878+
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http client request body fully read in ngx_http_request_body_filter");
879+
880+
if (r->connection->read->timer_set) {
881+
ngx_del_timer(r->connection->read);
882+
}
883+
upload_shutdown_ctx(u);
884+
885+
return ngx_http_upload_body_handler(r);
876886
}
877887

878888
} else {
@@ -1885,7 +1895,7 @@ static ngx_int_t ngx_http_upload_start_handler(ngx_http_upload_ctx_t *u) { /* {{
18851895
/*
18861896
* If at least one filter succeeds, we pass the field
18871897
*/
1888-
if(rc == 0)
1898+
if(rc >= 0)
18891899
pass_field = 1;
18901900
#else
18911901
if(ngx_strncmp(f[i].text.data, u->field_name.data, u->field_name.len) == 0)

0 commit comments

Comments
 (0)