aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlibmemory
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2019-04-15 11:27:22 +0200
committerFlorin Coras <florin.coras@gmail.com>2019-04-23 18:49:22 +0000
commit4ff09ae3483593f51faa160829fbcad4c77ed5b3 (patch)
treef2fa50765a7deaa081d26841437e9e9f24c00337 /src/vlibmemory
parent59e0c8f5dc4b9c2b580c68da5595e4ed750194fe (diff)
API: Python and Unix domain socket improvement
Handle the case where buffer overflows. Then SOCK_SEQPACKET assumption that multiple API messages are not returned by recv() is broken. Use SOCK_STREAM for API exchanges instead. Add support for running tests over sockets. make test SOCKET=1 Change-Id: Ibe5fd69b1bf617de4c7ba6cce0a7c2b3f97a2821 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vlibmemory')
-rw-r--r--src/vlibmemory/socket_api.c3
-rw-r--r--src/vlibmemory/socket_client.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/src/vlibmemory/socket_api.c b/src/vlibmemory/socket_api.c
index a8423d11ccb..a8a45a7e6bc 100644
--- a/src/vlibmemory/socket_api.c
+++ b/src/vlibmemory/socket_api.c
@@ -722,8 +722,7 @@ vl_sock_api_init (vlib_main_t * vm)
vec_free (tmp);
}
- sock->flags = CLIB_SOCKET_F_IS_SERVER | CLIB_SOCKET_F_SEQPACKET |
- CLIB_SOCKET_F_ALLOW_GROUP_WRITE;
+ sock->flags = CLIB_SOCKET_F_IS_SERVER | CLIB_SOCKET_F_ALLOW_GROUP_WRITE;
error = clib_socket_init (sock);
if (error)
return error;
diff --git a/src/vlibmemory/socket_client.c b/src/vlibmemory/socket_client.c
index ca1e53538ae..96330ce481a 100644
--- a/src/vlibmemory/socket_client.c
+++ b/src/vlibmemory/socket_client.c
@@ -374,8 +374,7 @@ vl_socket_client_connect (char *socket_path, char *client_name,
sock = &scm->client_socket;
sock->config = socket_path;
- sock->flags = CLIB_SOCKET_F_IS_CLIENT
- | CLIB_SOCKET_F_SEQPACKET | CLIB_SOCKET_F_NON_BLOCKING_CONNECT;
+ sock->flags = CLIB_SOCKET_F_IS_CLIENT | CLIB_SOCKET_F_NON_BLOCKING_CONNECT;
if ((error = clib_socket_init (sock)))
{