Ticket #2058: ngx-catch-body.patch
| File ngx-catch-body.patch, 1008 bytes (added by , 6 years ago) |
|---|
-
ngx_http_catch_body_filter_module.c
old new 72 72 u_char *p; 73 73 ngx_chain_t *cl; 74 74 ngx_http_catch_body_conf_t *conf; 75 int count = 0; 76 int len; 75 77 76 78 conf = ngx_http_get_module_loc_conf(r, ngx_http_catch_body_filter_module); 77 79 … … 85 87 for (cl = in; cl; cl = cl->next) { 86 88 87 89 p = cl->buf->pos; 90 len = cl->buf->last - p; 91 count += len; 88 92 89 93 for (p = cl->buf->pos; p < cl->buf->last; p++) { 90 94 … … 108 112 } 109 113 } 110 114 } 115 if (count == 0) { 116 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "catch body: wrong length"); 117 r->keepalive = 0; 118 return NGX_HTTP_BAD_REQUEST; 119 } 111 120 112 121 return ngx_http_next_request_body_filter(r, in); 113 122 }
