summaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/session.c29
-rw-r--r--src/vnet/session/transport.c6
-rw-r--r--src/vnet/session/transport.h1
-rw-r--r--src/vnet/session/transport_types.h1
4 files changed, 31 insertions, 6 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 0e5fb8edb1a..3a6d7e29e45 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -601,8 +601,9 @@ session_main_flush_all_enqueue_events (u8 transport_proto)
return errors;
}
-int
-session_stream_connect_notify (transport_connection_t * tc, u8 is_fail)
+static inline int
+session_stream_connect_notify_inline (transport_connection_t * tc, u8 is_fail,
+ session_state_t opened_state)
{
u32 opaque = 0, new_ti, new_si;
app_worker_t *app_wrk;
@@ -645,6 +646,10 @@ session_stream_connect_notify (transport_connection_t * tc, u8 is_fail)
return -1;
}
+ s = session_get (new_si, new_ti);
+ s->session_state = opened_state;
+ session_lookup_add_connection (tc, session_handle (s));
+
if (app_worker_connect_notify (app_wrk, s, opaque))
{
s = session_get (new_si, new_ti);
@@ -652,13 +657,23 @@ session_stream_connect_notify (transport_connection_t * tc, u8 is_fail)
return -1;
}
- s = session_get (new_si, new_ti);
- s->session_state = SESSION_STATE_READY;
- session_lookup_add_connection (tc, session_handle (s));
-
return 0;
}
+int
+session_stream_connect_notify (transport_connection_t * tc, u8 is_fail)
+{
+ return session_stream_connect_notify_inline (tc, is_fail,
+ SESSION_STATE_READY);
+}
+
+int
+session_ho_stream_connect_notify (transport_connection_t * tc, u8 is_fail)
+{
+ return session_stream_connect_notify_inline (tc, is_fail,
+ SESSION_STATE_OPENED);
+}
+
typedef struct _session_switch_pool_args
{
u32 session_index;
@@ -966,6 +981,8 @@ session_open_vc (u32 app_wrk_index, session_endpoint_t * rmt, u32 opaque)
* thing but better than allocating a separate half-open pool.
*/
tc->s_index = opaque;
+ if (transport_half_open_has_fifos (rmt->transport_proto))
+ return session_ho_stream_connect_notify (tc, 0 /* is_fail */ );
return 0;
}
diff --git a/src/vnet/session/transport.c b/src/vnet/session/transport.c
index f971288f90c..bb4c6817345 100644
--- a/src/vnet/session/transport.c
+++ b/src/vnet/session/transport.c
@@ -288,6 +288,12 @@ transport_protocol_get_vft (transport_proto_t transport_proto)
return &tp_vfts[transport_proto];
}
+u8
+transport_half_open_has_fifos (transport_proto_t tp)
+{
+ return tp_vfts[tp].transport_options.half_open_has_fifos;
+}
+
transport_service_type_t
transport_protocol_service_type (transport_proto_t tp)
{
diff --git a/src/vnet/session/transport.h b/src/vnet/session/transport.h
index 978e3f072b1..6e2feb02ba4 100644
--- a/src/vnet/session/transport.h
+++ b/src/vnet/session/transport.h
@@ -23,6 +23,7 @@ typedef struct _transport_options_t
{
transport_tx_fn_type_t tx_type;
transport_service_type_t service_type;
+ u8 half_open_has_fifos;
} transport_options_t;
/*
diff --git a/src/vnet/session/transport_types.h b/src/vnet/session/transport_types.h
index e262ddad583..87daa76005e 100644
--- a/src/vnet/session/transport_types.h
+++ b/src/vnet/session/transport_types.h
@@ -184,6 +184,7 @@ transport_endpoint_fib_proto (transport_endpoint_t * tep)
}
u8 transport_protocol_is_cl (transport_proto_t tp);
+u8 transport_half_open_has_fifos (transport_proto_t tp);
transport_service_type_t transport_protocol_service_type (transport_proto_t);
transport_tx_fn_type_t transport_protocol_tx_fn_type (transport_proto_t tp);