Skip to content

Commit 7d6e96f

Browse files
committed
Fixed compilation issue on 0.6.32
1 parent 5c1fbca commit 7d6e96f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Changelog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Version 2.0.3
77
* In case of any errors at the last chunk of request body only 500 Internal Server Error
88
was generated intead of 400 Bad Request and 503 Service Unavailable.
99
* Fixed copyrights for temporary file name generation code
10+
* Fixed compilation issue on 0.6.32. Thanks to Tomas Pollak.
1011

1112
Version 2.0.2
1213
* Fixed crash in logging filename while aborting upload

ngx_http_upload_module.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ ngx_http_read_upload_client_request_body(ngx_http_request_t *r) {
10031003

10041004
rb->rest = r->headers_in.content_length_n - preread;
10051005

1006-
if (rb->rest <= (size_t) (b->end - b->last)) {
1006+
if (rb->rest <= (off_t) (b->end - b->last)) {
10071007

10081008
/* the whole request body may be placed in r->header_in */
10091009

@@ -1027,7 +1027,7 @@ ngx_http_read_upload_client_request_body(ngx_http_request_t *r) {
10271027
size = clcf->client_body_buffer_size;
10281028
size += size >> 2;
10291029

1030-
if (rb->rest < (size_t) size) {
1030+
if (rb->rest < (ssize_t) size) {
10311031
size = rb->rest;
10321032

10331033
if (r->request_body_in_single_buf) {
@@ -1135,8 +1135,8 @@ ngx_http_do_read_upload_client_request_body(ngx_http_request_t *r)
11351135

11361136
size = rb->buf->end - rb->buf->last;
11371137

1138-
if (size > rb->rest) {
1139-
size = rb->rest;
1138+
if ((off_t)size > rb->rest) {
1139+
size = (size_t)rb->rest;
11401140
}
11411141

11421142
n = c->recv(c, rb->buf->last, size);

0 commit comments

Comments
 (0)