summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Wallace <dwallacelf@gmail.com>2018-03-13 19:37:54 -0400
committerDamjan Marion <dmarion.lists@gmail.com>2018-03-14 13:33:25 +0000
commit63f1859de149e79d7b85af25882faaac5f6e530a (patch)
tree7844fae6a313a3181b2d480206f9d9a8cfedd3b4 /src
parentf4e58086a7f10d12f705b0d06986450875dca054 (diff)
VCL: Handle epoll HUP events in sock_test_server
Change-Id: I7b13319228c498a565f8556b73628e7ff3b106c4 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/vcl/sock_test_server.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/vcl/sock_test_server.c b/src/vcl/sock_test_server.c
index c0baefa99de..39ffb8e2f48 100644
--- a/src/vcl/sock_test_server.c
+++ b/src/vcl/sock_test_server.c
@@ -704,6 +704,16 @@ main (int argc, char **argv)
}
for (i = 0; i < num_ev; i++)
{
+ conn = &ssm->conn_pool[ssm->wait_events[i].data.u32];
+ if (ssm->wait_events[i].events & (EPOLLHUP | EPOLLRDHUP))
+ {
+#ifdef VCL_TEST
+ vppcom_session_close (conn->fd);
+#else
+ close (conn->fd);
+#endif
+ continue;
+ }
if (ssm->wait_events[i].data.u32 == ~0)
{
new_client ();
@@ -717,7 +727,6 @@ main (int argc, char **argv)
continue;
}
#endif
- conn = &ssm->conn_pool[ssm->wait_events[i].data.u32];
#endif
client_fd = conn->fd;