Skip to content

Commit

Permalink
code clean
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Oct 10, 2023
1 parent 15c5f09 commit f037fc2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/ngx_http_lua_kong_request_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ ngx_http_lua_kong_variable_request_id(ngx_http_request_t *r,
ngx_http_variable_value_t *v, uintptr_t data)
{
u_char *id;
u_char buf[8];
uint32_t i, rnd;

id = ngx_pnalloc(r->pool, KONG_REQUEST_ID_NUM * UINT32_HEX_LEN);
Expand All @@ -44,8 +43,7 @@ ngx_http_lua_kong_variable_request_id(ngx_http_request_t *r,

for (i = 0; i < KONG_REQUEST_ID_NUM; i++) {
rnd = (uint32_t) ngx_random();
ngx_memcpy(buf, rand, sizeof(rnd));
ngx_hex_dump(id + i * UINT32_HEX_LEN, buf, UINT32_HEX_LEN);
ngx_hex_dump(id + i * UINT32_HEX_LEN, (u_char *) &rnd, sizeof(uint32_t));
}

return NGX_OK;
Expand Down

0 comments on commit f037fc2

Please sign in to comment.