Mercurial > hg > nginx
comparison src/http/ngx_http_request_body.c @ 303:00c5660d2707
nginx-0.0.3-2004-04-01-20:20:53 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 01 Apr 2004 16:20:53 +0000 |
parents | 46b7eeb8a116 |
children | 6bdf858bff8c |
comparison
equal
deleted
inserted
replaced
302:1526e7686b20 | 303:00c5660d2707 |
---|---|
9 static ngx_int_t ngx_http_do_read_client_request_body(ngx_http_request_t *r); | 9 static ngx_int_t ngx_http_do_read_client_request_body(ngx_http_request_t *r); |
10 | 10 |
11 | 11 |
12 ngx_int_t ngx_http_read_client_request_body(ngx_http_request_t *r) | 12 ngx_int_t ngx_http_read_client_request_body(ngx_http_request_t *r) |
13 { | 13 { |
14 ssize_t size; | 14 ssize_t size; |
15 ngx_hunk_t *h; | 15 ngx_hunk_t *h; |
16 ngx_chain_t *cl; | 16 ngx_chain_t *cl; |
17 | 17 ngx_http_core_loc_conf_t *clcf; |
18 | 18 |
19 size = r->header_in->last - r->header_in->pos; | 19 size = r->header_in->last - r->header_in->pos; |
20 | 20 |
21 if (size) { | 21 if (size) { |
22 | 22 |
45 | 45 |
46 r->header_in->pos = r->header_in->last; | 46 r->header_in->pos = r->header_in->last; |
47 } | 47 } |
48 | 48 |
49 | 49 |
50 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); | |
51 | |
50 r->request_body->rest = r->headers_in.content_length_n - size; | 52 r->request_body->rest = r->headers_in.content_length_n - size; |
51 | 53 |
52 if (r->request_body->rest | 54 if (r->request_body->rest |
53 < r->request_body->buf_size + (r->request_body->buf_size >> 2)) | 55 < clcf->client_body_buffer_size |
56 + (clcf->client_body_buffer_size >> 2)) | |
54 { | 57 { |
55 size = r->request_body->rest; | 58 size = r->request_body->rest; |
56 | 59 |
57 } else { | 60 } else { |
58 size = r->request_body->buf_size; | 61 size = clcf->client_body_buffer_size; |
59 } | 62 } |
60 | 63 |
61 ngx_test_null(r->request_body->buf, ngx_create_temp_hunk(r->pool, size), | 64 ngx_test_null(r->request_body->buf, ngx_create_temp_hunk(r->pool, size), |
62 NGX_HTTP_INTERNAL_SERVER_ERROR); | 65 NGX_HTTP_INTERNAL_SERVER_ERROR); |
63 | 66 |