comparison src/http/ngx_http_request_body.c @ 7740:967cfa6e2ff8

Request body: removed error assumption (ticket #2058). Before introduction of request body filter in 42d9beeb22db, the only possible return code from the ngx_http_request_body_filter() call without actual buffers was NGX_HTTP_INTERNAL_SERVER_ERROR, and the code in ngx_http_read_client_request_body() hardcoded the only possible error to simplify the code of initial call to set rb->rest. This is no longer true after introduction of request body filters though, as a request body filter might need to return other errors, such as 403. Fix is to preserve the error code actually returned by the call instead of assuming 500.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 09 Nov 2020 22:41:54 +0300
parents 4d5b04daeaff
children d869e43643ac 507da0d3b070
comparison
equal deleted inserted replaced
7739:4d5b04daeaff 7740:967cfa6e2ff8
135 } 135 }
136 136
137 } else { 137 } else {
138 /* set rb->rest */ 138 /* set rb->rest */
139 139
140 if (ngx_http_request_body_filter(r, NULL) != NGX_OK) { 140 rc = ngx_http_request_body_filter(r, NULL);
141 rc = NGX_HTTP_INTERNAL_SERVER_ERROR; 141
142 if (rc != NGX_OK) {
142 goto done; 143 goto done;
143 } 144 }
144 } 145 }
145 146
146 if (rb->rest == 0) { 147 if (rb->rest == 0) {