Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Florian Fischer
emper-echo-server
Commits
5a03476d
Commit
5a03476d
authored
Jan 04, 2021
by
Florian Fischer
Browse files
exit when receiving quit\n
parent
f186c520
Pipeline
#55187
failed with stages
in 37 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/emper-echo-server.c
View file @
5a03476d
...
...
@@ -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
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment