summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2023-10-07 14:22:52 -0700
committerFlorin Coras <fcoras@cisco.com>2023-10-07 14:23:18 -0700
commit431b489c5a4f60a82781ace60d07471d003787af (patch)
tree81ec65e99919739367cbd0bec39b354bab147be9 /src
parent9ffec14a2202e1268c4a2f189c39a90986090a25 (diff)
session: propagate delayed rx evts after connect/accept
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4a2e8f864df7269ec5a3c4fd4d8785a67b687d58
Diffstat (limited to 'src')
-rw-r--r--src/vnet/session/session_input.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/vnet/session/session_input.c b/src/vnet/session/session_input.c
index cdd6a884949..404ee8b2d82 100644
--- a/src/vnet/session/session_input.c
+++ b/src/vnet/session/session_input.c
@@ -112,16 +112,18 @@ app_worker_flush_events_inline (app_worker_t *app_wrk, u32 thread_index,
{
case SESSION_IO_EVT_RX:
s = session_get (evt->session_index, thread_index);
- s->flags &= ~SESSION_F_RX_EVT;
/* Application didn't confirm accept yet */
- if (PREDICT_FALSE (s->session_state == SESSION_STATE_ACCEPTING))
+ if (PREDICT_FALSE (s->session_state == SESSION_STATE_ACCEPTING ||
+ s->session_state == SESSION_STATE_CONNECTING))
break;
+ s->flags &= ~SESSION_F_RX_EVT;
app->cb_fns.builtin_app_rx_callback (s);
break;
/* Handle sessions that might not be on current thread */
case SESSION_IO_EVT_BUILTIN_RX:
s = session_get_from_handle_if_valid (evt->session_handle);
- if (!s || s->session_state == SESSION_STATE_ACCEPTING)
+ if (!s || s->session_state == SESSION_STATE_ACCEPTING ||
+ s->session_state == SESSION_STATE_CONNECTING)
break;
s->flags &= ~SESSION_F_RX_EVT;
app->cb_fns.builtin_app_rx_callback (s);
@@ -153,8 +155,16 @@ app_worker_flush_events_inline (app_worker_t *app_wrk, u32 thread_index,
s->app_wrk_index = SESSION_INVALID_INDEX;
break;
}
- if (is_builtin && was_closed)
- app_worker_close_notify (app_wrk, s);
+ if (is_builtin)
+ {
+ if (s->flags & SESSION_F_RX_EVT)
+ {
+ s->flags &= ~SESSION_F_RX_EVT;
+ app->cb_fns.builtin_app_rx_callback (s);
+ }
+ if (was_closed)
+ app_worker_close_notify (app_wrk, s);
+ }
break;
case SESSION_CTRL_EVT_CONNECTED:
if (!(evt->as_u64[1] & 0xffffffff))
@@ -177,6 +187,11 @@ app_worker_flush_events_inline (app_worker_t *app_wrk, u32 thread_index,
}
if (was_closed)
app_worker_close_notify (app_wrk, s);
+ if (s->flags & SESSION_F_RX_EVT)
+ {
+ s->flags &= ~SESSION_F_RX_EVT;
+ app->cb_fns.builtin_app_rx_callback (s);
+ }
break;
case SESSION_CTRL_EVT_DISCONNECTED:
s = session_get (evt->session_index, thread_index);