summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/application_local.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session/application_local.c')
-rw-r--r--src/vnet/session/application_local.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/vnet/session/application_local.c b/src/vnet/session/application_local.c
index 88536dc27c6..f68567f7fd3 100644
--- a/src/vnet/session/application_local.c
+++ b/src/vnet/session/application_local.c
@@ -963,6 +963,15 @@ ct_program_cleanup (ct_connection_t *ct)
thread_index, ct_handle_cleanups, uword_to_pointer (thread_index, void *));
}
+static inline int
+ct_close_is_reset (ct_connection_t *ct, session_t *s)
+{
+ if (ct->flags & CT_CONN_F_CLIENT)
+ return (svm_fifo_max_dequeue (ct->client_rx_fifo) > 0);
+ else
+ return (svm_fifo_max_dequeue (s->rx_fifo) > 0);
+}
+
static void
ct_session_close (u32 ct_index, u32 thread_index)
{
@@ -981,7 +990,12 @@ ct_session_close (u32 ct_index, u32 thread_index)
ct_session_connect_notify (s, SESSION_E_REFUSED);
}
else if (peer_ct->c_s_index != ~0)
- session_transport_closing_notify (&peer_ct->connection);
+ {
+ if (ct_close_is_reset (ct, s))
+ session_transport_reset_notify (&peer_ct->connection);
+ else
+ session_transport_closing_notify (&peer_ct->connection);
+ }
else
{
/* should not happen */