Skip to content

Commit

Permalink
Fixed bug: dummy field did not appear if form contained only non-file…
Browse files Browse the repository at this point in the history
… fields
  • Loading branch information
Valery Kholodkov committed Sep 21, 2009
1 parent e8f2887 commit 5c57c1b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ngx_http_upload_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,6 @@ static ngx_int_t ngx_http_upload_start_handler(ngx_http_upload_ctx_t *u) { /* {{
ngx_upload_cleanup_t *ucln;

if(u->is_file) {
u->no_content = 0;

u->cln = ngx_pool_cleanup_add(r->pool, sizeof(ngx_upload_cleanup_t));

if(u->cln == NULL)
Expand Down Expand Up @@ -875,7 +873,7 @@ static ngx_int_t ngx_http_upload_start_handler(ngx_http_upload_ctx_t *u) { /* {{

if(pass_field && u->field_name.len > 0) {
/*
* Here we do a small hack: the content of a normal field
* Here we do a small hack: the content of a non-file field
* is not known until ngx_http_upload_flush_output_buffer
* is called. We pass empty field value to simplify things.
*/
Expand Down Expand Up @@ -1142,6 +1140,8 @@ ngx_http_upload_append_field(ngx_http_upload_ctx_t *u, ngx_str_t *name, ngx_str_
+ ngx_upload_field_part2.len + value->len;

u->first_part = 0;

u->no_content = 0;
}

return NGX_OK;
Expand Down

0 comments on commit 5c57c1b

Please sign in to comment.