summaryrefslogtreecommitdiffhomepage
path: root/src/child.c
diff options
context:
space:
mode:
authorrofl0r <rofl0r@users.noreply.github.com>2020-09-09 12:31:19 +0100
committerrofl0r <rofl0r@users.noreply.github.com>2020-09-09 12:37:23 +0100
commitb549ba5af38786319f27ce7abb40c610f11cdea9 (patch)
tree394074398fb483109049fc587edcf7c1ed9ce9c5 /src/child.c
parentb4e3f1a896989d1e5190e114b5bc05cd613ef646 (diff)
remove bogus custom timeout handling code
in networking, hitting a timeout requires that *nothing* happens during the interval. whenever anything happens, the timeout is reset. there's no need to do custom time calculations, it's perfectly fine to let the kernel handle it using the select() syscall. additionally the code added in 0b9a74c29036f9215b2b97a301b7b25933054302 assures that read and write syscalls() don't block indefinitely and return on the timeout too, so there's no need to switch sockets back and forth between blocking/nonblocking.
Diffstat (limited to 'src/child.c')
-rw-r--r--src/child.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/src/child.c b/src/child.c
index 15d4fe8..9d59d20 100644
--- a/src/child.c
+++ b/src/child.c
@@ -130,14 +130,6 @@ void child_main_loop (void)
for (i = 0; i < vector_length(listen_fds); i++) {
int *fd = (int *) vector_getentry(listen_fds, i, NULL);
- ret = socket_nonblocking(*fd);
- if (ret != 0) {
- log_message(LOG_ERR, "Failed to set the listening "
- "socket %d to non-blocking: %s",
- fd, strerror(errno));
- continue;
- }
-
FD_SET(*fd, &rfds);
maxfd = max(maxfd, *fd);
}
@@ -175,14 +167,6 @@ void child_main_loop (void)
continue;
}
- ret = socket_blocking(listenfd);
- if (ret != 0) {
- log_message(LOG_ERR, "Failed to set listening "
- "socket %d to blocking for accept: %s",
- listenfd, strerror(errno));
- continue;
- }
-
/*
* We have a socket that is readable.
* Continue handling this connection.