mcdullbloom commented on issue #10379:
URL: https://github.com/apache/apisix/issues/10379#issuecomment-1780315277
There're not any error logs.Just set max_body_size failed.
plugin:
"plugins": {
"client-control":{
"max_body_size": 100
}
}
(gdb) p max_body_size
$1 = 0
Detail debug infoļ¼
```
(gdb)
(gdb) b ngx_http_read_client_request_body
Breakpoint 1 at 0x47d5b0: file src/http/ngx_http_request_body.c, line 37.
(gdb) c
Continuing.
Breakpoint 1, ngx_http_read_client_request_body (r=r@entry=0x150bd60,
post_handler=post_handler@entry=0x7f1eaefb2520
<ngx_http_t1k_req_request_body_handler>) at src/http/ngx_http_request_body.c:37
37 {
(gdb) l
32
33
34 ngx_int_t
35 ngx_http_read_client_request_body(ngx_http_request_t *r,
36 ngx_http_client_body_handler_pt post_handler)
37 {
38 size_t preread;
39 ssize_t size;
40 ngx_int_t rc;
41 ngx_buf_t *b;
(gdb) n
46 r->main->count++;
(gdb)
48 if (r != r->main || r->request_body || r->discard_body) {
(gdb)
55 if (ngx_http_apisix_delay_client_max_body_check(r)) {
(gdb)
56 off_t max_body_size =
ngx_http_apisix_client_max_body_size(r);
(gdb)
58 if (r->headers_in.content_length_n != -1
(gdb)
60 && max_body_size < r->headers_in.content_length_n)
(gdb) p max_body_size
$1 = 0
(gdb) n
59 && max_body_size
(gdb)
60 && max_body_size < r->headers_in.content_length_n)
(gdb)
73 if (ngx_http_test_expect(r) != NGX_OK) {
(gdb)
78 rb = ngx_pcalloc(r->pool, sizeof(ngx_http_request_body_t));
(gdb)
79 if (rb == NULL) {
(gdb)
78 rb = ngx_pcalloc(r->pool, sizeof(ngx_http_request_body_t));
(gdb)
79 if (rb == NULL) {
(gdb)
99 if (r->headers_in.content_length_n < 0 &&
!r->headers_in.chunked) {
(gdb)
94 rb->rest = -1;
(gdb)
95 rb->post_handler = post_handler;
(gdb)
97 r->request_body = rb;
(gdb)
99 if (r->headers_in.content_length_n < 0 &&
!r->headers_in.chunked) {
(gdb)
106 if (r->stream) {
(gdb)
112 preread = r->header_in->last - r->header_in->pos;
(gdb)
114 if (preread) {
(gdb)
118 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
(gdb)
124 rc = ngx_http_request_body_filter(r, &out);
(gdb)
121 out.buf = r->header_in;
(gdb)
122 out.next = NULL;
(gdb)
124 rc = ngx_http_request_body_filter(r, &out);
(gdb)
126 if (rc != NGX_OK) {
(gdb)
130 r->request_length += preread - (r->header_in->last -
r->header_in->pos);
(gdb)
132 if (!r->headers_in.chunked
(gdb)
133 && rb->rest > 0
(gdb)
168 if (rb->rest == 0) {
(gdb)
170 r->request_body_no_buffering = 0;
(gdb)
171 post_handler(r);
(gdb)
172 return NGX_OK;
(gdb)
233 }
(gdb)
ngx_http_t1k_req_module_handler (r=0x150bd60) at
/opt/openresty-1.19.3.1-build/openresty-1.19.3.1/modules/ngx-http-t1k-module-t1k-3.0.4-5a1ed627/ngx_http_t1k_req.c:182
182 if (rc == NGX_ERROR || rc >= NGX_HTTP_SPECIAL_RESPONSE) {
(gdb)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]