Skip to content

Commit 362cdd9

Browse files
committed
Fixed compilation problem in amd 64; added support for named locations
1 parent b36afcc commit 362cdd9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ngx_http_upload_module.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,12 @@ static ngx_int_t ngx_http_upload_body_handler(ngx_http_request_t *r) { /* {{{ */
674674
ngx_sprintf(r->headers_in.content_length->value.data, "%O", r->headers_in.content_length_n)
675675
- r->headers_in.content_length->value.data;
676676

677-
rc = ngx_http_internal_redirect(r, uri, &args);
677+
if(uri->len != 0 && uri->data[0] == '/') {
678+
rc = ngx_http_internal_redirect(r, uri, &args);
679+
}
680+
else{
681+
rc = ngx_http_named_location(r, uri);
682+
}
678683

679684
if (rc == NGX_ERROR) {
680685
return NGX_HTTP_INTERNAL_SERVER_ERROR;
@@ -978,7 +983,7 @@ static ngx_int_t ngx_http_upload_flush_output_buffer(ngx_http_upload_ctx_t *u, u
978983
ngx_crc32_update(&u->crc32, buf, len);
979984

980985
if(ulcf->max_file_size != 0) {
981-
if(u->output_file.offset + (off_t)len > ulcf->max_file_size)
986+
if(u->output_file.offset + len > ulcf->max_file_size)
982987
return NGX_UPLOAD_TOOLARGE;
983988
}
984989

0 commit comments

Comments
 (0)