diff options
author | Dave Wallace <dwallacelf@gmail.com> | 2017-11-24 21:44:06 -0500 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2017-11-25 03:36:10 -0500 |
commit | ee45d41a10c3459fc11e7d037fc411fd4cdfd495 (patch) | |
tree | 60c245db1cb84c8c6780e00499b0808b339ff7ca /src/vcl/sock_test_client.c | |
parent | 60d48bbd13649133e51cf56e072c11305c661797 (diff) |
VCL: improve debug output
- Refactor debug output to include vpp handle associated
with session id where appropriate.
- Fix vcom_connect return value on error.
- Refactor vcom_socket_epoll_pwait().
- Fix sock_test_server/client connect failure handling.
Change-Id: I2649596aa4b8a77d9bd876409a76810cb2785797
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'src/vcl/sock_test_client.c')
-rw-r--r-- | src/vcl/sock_test_client.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/vcl/sock_test_client.c b/src/vcl/sock_test_client.c index 40ba043adae..41ee4be9241 100644 --- a/src/vcl/sock_test_client.c +++ b/src/vcl/sock_test_client.c @@ -525,6 +525,11 @@ sock_test_connect_test_sockets (uint32_t num_test_sockets) #ifdef VCL_TEST rv = vppcom_session_connect (tsock->fd, &scm->server_endpt); + if (rv) + { + errno = -rv; + rv = -1; + } #else rv = connect (tsock->fd, (struct sockaddr *) &scm->server_addr, @@ -533,9 +538,10 @@ sock_test_connect_test_sockets (uint32_t num_test_sockets) if (rv < 0) { errno_val = errno; - perror ("ERROR in main()"); + perror ("ERROR in sock_test_connect_test_sockets()"); fprintf (stderr, "ERROR: connect failed (errno = %d)!\n", errno_val); + return -1; } tsock->cfg = ctrl->cfg; sock_test_socket_buf_alloc (tsock); @@ -632,6 +638,7 @@ cfg_num_test_sockets_set (void) { ctrl->cfg.num_test_sockets = num_test_sockets; sock_test_connect_test_sockets (num_test_sockets); + sock_test_cfg_dump (&ctrl->cfg, 1 /* is_client */ ); } else @@ -965,6 +972,11 @@ main (int argc, char **argv) #ifdef VCL_TEST rv = vppcom_session_connect (ctrl->fd, &scm->server_endpt); + if (rv) + { + errno = -rv; + rv = -1; + } #else rv = connect (ctrl->fd, (struct sockaddr *) &scm->server_addr, @@ -976,6 +988,7 @@ main (int argc, char **argv) perror ("ERROR in main()"); fprintf (stderr, "ERROR: connect failed (errno = %d)!\n", errno_val); + return -1; } sock_test_cfg_sync (ctrl); |