Skip to content

Commit 992bfc3

Browse files
rodman10timzrhuang
andauthored
style: use forward declaration.
Co-authored-by: timzrhuang <timzrhuang@tencent.com>
1 parent 1a48599 commit 992bfc3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/ngx_http_lua_socket_tcp.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4744,6 +4744,7 @@ ngx_http_lua_socket_read_until(void *data, ssize_t bytes)
47444744
u_char c;
47454745
u_char *pat;
47464746
size_t pat_len;
4747+
size_t pending_len;
47474748
int i;
47484749
int state;
47494750
int old_state = 0; /* just to make old
@@ -4872,13 +4873,12 @@ ngx_http_lua_socket_read_until(void *data, ssize_t bytes)
48724873

48734874
/* matched */
48744875

4875-
int pending_bytes = old_state + 1 - state;
4876+
pending_len = old_state + 1 - state;
48764877

4877-
dd("adding pending data: %.*s", (int) pending_bytes,
4878-
(char *) pat);
4878+
dd("adding pending data: %.*s", (int) pending_len, (char *) pat);
48794879

48804880
rc = ngx_http_lua_socket_add_pending_data(r, u, b->pos, i, pat,
4881-
pending_bytes,
4881+
pending_len,
48824882
old_state);
48834883

48844884
if (rc != NGX_OK) {
@@ -4889,14 +4889,14 @@ ngx_http_lua_socket_read_until(void *data, ssize_t bytes)
48894889
i++;
48904890

48914891
if (u->length) {
4892-
if (u->rest <= (size_t) pending_bytes) {
4892+
if (u->rest <= pending_len) {
48934893
u->rest = 0;
48944894
cp->state = state;
48954895
b->pos += i;
48964896
return NGX_OK;
48974897

48984898
} else {
4899-
u->rest -= pending_bytes;
4899+
u->rest -= pending_len;
49004900
}
49014901
}
49024902

0 commit comments

Comments
 (0)