]> git.ipfire.org Git - fireperf.git/commitdiff
server: Do not send any data when in keepalive only mode
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 23 Feb 2021 14:44:30 +0000 (14:44 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 23 Feb 2021 14:44:30 +0000 (14:44 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/server.c

index c47c57bfb04ac394713a18ff3b93a191164210e1..e332b2d6a90ce14433db1f009c2f0225be92653b 100644 (file)
@@ -225,8 +225,10 @@ int fireperf_server(struct fireperf_config* conf, struct fireperf_stats* stats,
                                        goto ERROR;
 
                                // Add the new socket to epoll()
-                               ev.events  = EPOLLIN|EPOLLOUT|EPOLLRDHUP;
                                ev.data.fd = connfd;
+                               ev.events  = EPOLLIN|EPOLLRDHUP;
+                               if (!conf->keepalive_only)
+                                       ev.events |= EPOLLOUT;
 
                                if (epoll_ctl(epollfd, EPOLL_CTL_ADD, connfd, &ev)) {
                                        ERROR(conf, "Could not add socket file descriptor to epoll(): %s\n",