X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvcl%2Fvcl_test_server.c;h=2913452ab1066ad95e03ad27f3a54c7e49236c97;hb=539663c401b087e4576e41af35144e73e1907c9d;hp=a184d995372595176b2ebdd7c8605406e936bab9;hpb=537b17ef954b68d09b6f559dc05672cf7acfbe7c;p=vpp.git diff --git a/src/vcl/vcl_test_server.c b/src/vcl/vcl_test_server.c index a184d995372..2913452ab10 100644 --- a/src/vcl/vcl_test_server.c +++ b/src/vcl/vcl_test_server.c @@ -112,8 +112,9 @@ conn_pool_expand (vcl_test_server_worker_t * wrk, size_t expand_size) static inline vcl_test_server_conn_t * conn_pool_alloc (vcl_test_server_worker_t * wrk) { - int i; + int i, expand = 0; +again: for (i = 0; i < wrk->conn_pool_size; i++) { if (!wrk->conn_pool[i].is_alloc) @@ -124,6 +125,13 @@ conn_pool_alloc (vcl_test_server_worker_t * wrk) } } + if (expand == 0) + { + conn_pool_expand (wrk, 2 * wrk->conn_pool_size); + expand = 1; + goto again; + } + vtwrn ("Failed to allocate connection even after expand"); return 0; } @@ -530,7 +538,7 @@ vts_conn_expect_config (vcl_test_server_conn_t * conn) return 1; return (conn->stats.rx_bytes < 128 - || conn->stats.rx_bytes > conn->cfg.total_bytes); + || conn->stats.rx_bytes >= conn->cfg.total_bytes); } static sock_test_cfg_t *