X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvcl%2Fvcl_test_server.c;h=5c8656c96034ee5399adb50d9b50fcf9fb9a3c91;hb=2179513b71963a0b42ca6f1f2b641e79ce89447b;hp=2fdd7ec157d8a324c58f3b3a88ba0cffc4dc9fc7;hpb=97f592f474ebaeba0c9a0f50db8f5627cc444aca;p=vpp.git diff --git a/src/vcl/vcl_test_server.c b/src/vcl/vcl_test_server.c index 2fdd7ec157d..5c8656c9603 100644 --- a/src/vcl/vcl_test_server.c +++ b/src/vcl/vcl_test_server.c @@ -497,6 +497,7 @@ vts_worker_init (vcl_test_server_worker_t * wrk) if (rv < 0) vtfail ("vppcom_epoll_ctl", rv); + ssm->active_workers += 1; vtinf ("Waiting for a client to connect on port %d ...", ssm->cfg.port); } @@ -532,6 +533,12 @@ vts_worker_loop (void *arg) if (wrk->wait_events[i].events & (EPOLLHUP | EPOLLRDHUP)) { vppcom_session_close (conn->fd); + wrk->nfds -= 1; + if (!wrk->nfds) + { + vtinf ("All client connections closed\n"); + goto done; + } continue; } if (wrk->wait_events[i].data.u32 == ~0) @@ -542,6 +549,7 @@ vts_worker_loop (void *arg) if (EPOLLIN & wrk->wait_events[i].events) { + read_again: rx_bytes = vcl_test_read (conn->fd, conn->buf, conn->buf_size, &conn->stats); @@ -563,7 +571,6 @@ vts_worker_loop (void *arg) if (!wrk->nfds) { vtinf ("All client connections closed\n"); - vtinf ("May the force be with you!\n"); goto done; } continue; @@ -572,6 +579,9 @@ vts_worker_loop (void *arg) || (conn->cfg.test == SOCK_TEST_TYPE_BI)) { vts_server_rx (conn, rx_bytes); + if (vppcom_session_attr (conn->fd, VPPCOM_ATTR_GET_NREAD, 0, + 0) > 0) + goto read_again; continue; } else if (isascii (conn->buf[0]))