Commit 5a03476d authored by Florian Fischer's avatar Florian Fischer
Browse files

exit when receiving quit\n

parent f186c520
Pipeline #55187 failed with stages
in 37 seconds
......@@ -56,6 +56,11 @@ void client_func(void* arg) {
return;
}
}
if (bytes_recv == 5 && strncmp(buf, "quit\n", 5) == 0) {
exit(EXIT_SUCCESS);
}
ssize_t bytes_send = send_all(client_fd, buf, bytes_recv);
// socket was shutdown
if (unlikely(bytes_send == 0)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment