fix: correct typos and improve comments across multiple files by codespell (#4116)

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi
2025-03-07 08:21:54 +08:00
committed by GitHub
parent 73998e4c85
commit 412631ac13
108 changed files with 215 additions and 215 deletions

View File

@ -54,7 +54,7 @@ The output of client is like:
[Client] Connect socket
[Client] Client receive
[Client] 115 bytes received:
Buffer recieved:
Buffer received:
Say Hi from the Server
Say Hi from the Server
Say Hi from the Server
@ -117,7 +117,7 @@ The output is:
```bash
Wait for client to connect
Client connected, sleeping for 10s
Shuting down
Shutting down
```
```bash
@ -195,7 +195,7 @@ The output of client is like:
[Client] Create socket
[Client] Client send
[Client] Client receive
[Client] Buffer recieved: Hello from server
[Client] Buffer received: Hello from server
[Client] BYE
```

View File

@ -97,7 +97,7 @@ main(int argc, char *argv[])
printf("[Client] %d bytes received:\n", total_size);
if (total_size > 0) {
printf("Buffer recieved:\n%s\n", buffer);
printf("Buffer received:\n%s\n", buffer);
}
close(socket_fd);

View File

@ -37,7 +37,7 @@ run(void *arg)
}
}
printf("[Server] Shuting down the new connection #%u ..\n", new_socket);
printf("[Server] Shutting down the new connection #%u ..\n", new_socket);
shutdown(new_socket, SHUT_RDWR);
return NULL;
@ -137,14 +137,14 @@ main(int argc, char *argv[])
pthread_join(workers[i], NULL);
}
printf("[Server] Shuting down ..\n");
printf("[Server] Shutting down ..\n");
shutdown(socket_fd, SHUT_RDWR);
sleep(3);
printf("[Server] BYE \n");
return EXIT_SUCCESS;
fail:
printf("[Server] Shuting down ..\n");
printf("[Server] Shutting down ..\n");
if (socket_fd >= 0)
close(socket_fd);
sleep(3);

View File

@ -56,7 +56,7 @@ main(int argc, char *argv[])
printf("Client connected, sleeping for 10s\n");
sleep(10);
printf("Shuting down\n");
printf("Shutting down\n");
shutdown(client_socket_fd, SHUT_RDWR);
close(client_socket_fd);
shutdown(socket_fd, SHUT_RDWR);

View File

@ -75,7 +75,7 @@ main(int argc, char *argv[])
if (ret > 0) {
buffer[ret] = '\0';
printf("[Client] Buffer recieved: %s\n", buffer);
printf("[Client] Buffer received: %s\n", buffer);
}
close(socket_fd);

View File

@ -106,7 +106,7 @@ main(int argc, char *argv[])
printf("[Server] Achieve maximum amount of connections\n");
}
printf("[Server] Shuting down ..\n");
printf("[Server] Shutting down ..\n");
shutdown(socket_fd, SHUT_RDWR);
close(socket_fd);
sleep(3);
@ -114,7 +114,7 @@ main(int argc, char *argv[])
return EXIT_SUCCESS;
fail:
printf("[Server] Shuting down ..\n");
printf("[Server] Shutting down ..\n");
if (socket_fd >= 0)
close(socket_fd);
sleep(3);