Skip to content

Commit

Permalink
Merge pull request #6 from Risheng1128/pr1
Browse files Browse the repository at this point in the history
Reset buffer to ensure buffer correct
  • Loading branch information
jserv committed Jun 2, 2022
2 parents b98013d + 2be19db commit 0cfbd71
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion http_server.c
Expand Up @@ -169,7 +169,9 @@ static int http_server_worker(void *arg)
http_parser_init(&parser, HTTP_REQUEST);
parser.data = &request;
while (!kthread_should_stop()) {
int ret = http_server_recv(socket, buf, RECV_BUFFER_SIZE - 1);
int ret;
memset(buf, 0, RECV_BUFFER_SIZE);
ret = http_server_recv(socket, buf, RECV_BUFFER_SIZE - 1);
if (ret <= 0) {
if (ret)
pr_err("recv error: %d\n", ret);
Expand Down

0 comments on commit 0cfbd71

Please sign in to comment.