Skip to content

Commit cd4c631

Browse files
committed
This should fix compatibility issue with new versions
1 parent fb66c11 commit cd4c631

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

ngx_http_upload_module.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ typedef struct ngx_http_upload_ctx_s {
233233
ngx_chain_t *chain;
234234
ngx_chain_t *last;
235235
ngx_chain_t *checkpoint;
236+
ngx_chain_t *to_write;
236237
size_t output_body_len;
237238
size_t limit_rate;
238239
ssize_t received;
@@ -2975,7 +2976,7 @@ ngx_http_read_upload_client_request_body(ngx_http_request_t *r) {
29752976

29762977
/* the whole request body may be placed in r->header_in */
29772978

2978-
rb->to_write = rb->bufs;
2979+
u->to_write = rb->bufs;
29792980

29802981
r->read_event_handler = ngx_http_read_upload_client_request_body_handler;
29812982

@@ -3034,7 +3035,7 @@ ngx_http_read_upload_client_request_body(ngx_http_request_t *r) {
30343035

30353036
*next = cl;
30363037

3037-
rb->to_write = rb->bufs;
3038+
u->to_write = rb->bufs;
30383039

30393040
r->read_event_handler = ngx_http_read_upload_client_request_body_handler;
30403041

@@ -3116,7 +3117,7 @@ ngx_http_do_read_upload_client_request_body(ngx_http_request_t *r)
31163117
for ( ;; ) {
31173118
if (rb->buf->last == rb->buf->end) {
31183119

3119-
rc = ngx_http_process_request_body(r, rb->to_write);
3120+
rc = ngx_http_process_request_body(r, u->to_write);
31203121

31213122
switch(rc) {
31223123
case NGX_OK:
@@ -3132,7 +3133,7 @@ ngx_http_do_read_upload_client_request_body(ngx_http_request_t *r)
31323133
return NGX_HTTP_INTERNAL_SERVER_ERROR;
31333134
}
31343135

3135-
rb->to_write = rb->bufs->next ? rb->bufs->next : rb->bufs;
3136+
u->to_write = rb->bufs->next ? rb->bufs->next : rb->bufs;
31363137
rb->buf->last = rb->buf->start;
31373138
}
31383139

@@ -3224,7 +3225,7 @@ ngx_http_do_read_upload_client_request_body(ngx_http_request_t *r)
32243225
ngx_del_timer(c->read);
32253226
}
32263227

3227-
rc = ngx_http_process_request_body(r, rb->to_write);
3228+
rc = ngx_http_process_request_body(r, u->to_write);
32283229

32293230
switch(rc) {
32303231
case NGX_OK:

0 commit comments

Comments
 (0)