summaryrefslogtreecommitdiffstats
path: root/src/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'src/vcl')
-rw-r--r--src/vcl/vppcom.c17
-rw-r--r--src/vcl/vppcom.h2
2 files changed, 16 insertions, 3 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index f56c02b6d9d..72ec4f4b966 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -1590,10 +1590,14 @@ vppcom_session_connect (uint32_t session_handle, vppcom_endpt_t * server_ep)
clib_net_to_host_u16 (session->transport.rmt_port),
vppcom_proto_str (session->session_type));
+ vcl_send_session_connect (wrk, session);
+
+ if (VCL_SESS_ATTR_TEST (session->attr, VCL_SESS_ATTR_NONBLOCK))
+ return VPPCOM_EINPROGRESS;
+
/*
- * Send connect request and wait for reply from vpp
+ * Wait for reply from vpp if blocking
*/
- vcl_send_session_connect (wrk, session);
rv = vppcom_wait_for_session_state_change (session_index, STATE_CONNECT,
vcm->cfg.session_timeout);
@@ -2033,7 +2037,14 @@ vcl_select_handle_mq_event (vcl_worker_t * wrk, session_event_t * e,
break;
case SESSION_CTRL_EVT_CONNECTED:
connected_msg = (session_connected_msg_t *) e->data;
- vcl_session_connected_handler (wrk, connected_msg);
+ sid = vcl_session_connected_handler (wrk, connected_msg);
+ if (sid == VCL_INVALID_SESSION_INDEX)
+ break;
+ if (sid < n_bits && write_map)
+ {
+ clib_bitmap_set_no_check ((uword *) write_map, sid, 1);
+ *bits_set += 1;
+ }
break;
case SESSION_CTRL_EVT_DISCONNECTED:
disconnected_msg = (session_disconnected_msg_t *) e->data;
diff --git a/src/vcl/vppcom.h b/src/vcl/vppcom.h
index 90bec310d06..62815090e37 100644
--- a/src/vcl/vppcom.h
+++ b/src/vcl/vppcom.h
@@ -18,6 +18,7 @@
#include <netdb.h>
#include <errno.h>
+#include <sys/fcntl.h>
#include <sys/poll.h>
#include <sys/epoll.h>
@@ -115,6 +116,7 @@ typedef enum
VPPCOM_OK = 0,
VPPCOM_EAGAIN = -EAGAIN,
VPPCOM_EWOULDBLOCK = -EWOULDBLOCK,
+ VPPCOM_EINPROGRESS = -EINPROGRESS,
VPPCOM_EFAULT = -EFAULT,
VPPCOM_ENOMEM = -ENOMEM,
VPPCOM_EINVAL = -EINVAL,