Skip to content
Snippets Groups Projects
Commit c18bfc11 authored by Bartłomiej Piotrowski's avatar Bartłomiej Piotrowski
Browse files

Check if sent() returned correctly, otherwise print errno message

parent aa4bfb14
No related branches found
No related tags found
No related merge requests found
...@@ -545,8 +545,15 @@ xit\n"); ...@@ -545,8 +545,15 @@ xit\n");
if (client_limit > 0 && current_count >= client_limit) { if (client_limit > 0 && current_count >= client_limit) {
fanout_debug (1, "hit connection limit of: %d\n", fanout_debug (1, "hit connection limit of: %d\n",
client_limit); client_limit);
send (client_i->fd, "debug!busy\n",
errno = 0;
ssize_t sentout = send (client_i->fd, "debug!busy\n",
strlen ("debug!busy\n"), 0); strlen ("debug!busy\n"), 0);
if ((sentout == -1) && errno) {
fanout_debug (0, "%s\n", strerror (errno));
}
close (client_i->fd); close (client_i->fd);
free (client_i); free (client_i);
if (client_limit_count == ULLONG_MAX) { if (client_limit_count == ULLONG_MAX) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment