return NGX_OK;
}
+ if (rb->rest < 0) {
+ ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
+ "negative request body rest");
+ rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
+ goto done;
+ }
+
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
size = clcf->client_body_buffer_size;
}
rb->chunked = ngx_pcalloc(r->pool, sizeof(ngx_http_chunked_t));
- if (rb == NULL) {
+ if (rb->chunked == NULL) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
/* TODO: coalesce neighbouring buffers */
- ngx_chain_add_copy(r->pool, &rb->bufs, in);
+ if (ngx_chain_add_copy(r->pool, &rb->bufs, in) != NGX_OK) {
+ return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ }
return NGX_OK;
}