summaryrefslogtreecommitdiffstats
path: root/src/vnet/session-apps
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2019-06-19 14:47:41 +0200
committerFlorin Coras <florin.coras@gmail.com>2019-06-20 14:43:19 +0000
commite4a1a328351482a900ba4da9d47ff8eaa0dd6ffd (patch)
treee67c59c9d557fe30de5eb06430d9ae0dc856c256 /src/vnet/session-apps
parentff55c816c966bdd6928c22ee764358c0a61436dc (diff)
quic: remove session flags identifying Q/S sessions
Type: refactor Change-Id: Id68c5ae6d57df0fc556bbf583a66e538e641ffb1 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/vnet/session-apps')
-rw-r--r--src/vnet/session-apps/echo_client.c2
-rw-r--r--src/vnet/session-apps/echo_server.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/src/vnet/session-apps/echo_client.c b/src/vnet/session-apps/echo_client.c
index bde9f489a34..24a3433d707 100644
--- a/src/vnet/session-apps/echo_client.c
+++ b/src/vnet/session-apps/echo_client.c
@@ -420,7 +420,7 @@ quic_echo_clients_session_connected_callback (u32 app_index, u32 api_context,
return 0;
}
- if (!(s->flags & SESSION_F_QUIC_STREAM))
+ if (s->listener_handle == SESSION_INVALID_HANDLE)
return quic_echo_clients_qsession_connected_callback (app_index,
api_context, s,
is_fail);
diff --git a/src/vnet/session-apps/echo_server.c b/src/vnet/session-apps/echo_server.c
index 7459d03202f..b7a74818cca 100644
--- a/src/vnet/session-apps/echo_server.c
+++ b/src/vnet/session-apps/echo_server.c
@@ -55,6 +55,7 @@ typedef struct
u64 byte_index;
u32 **rx_retries;
u8 transport_proto;
+ u64 listener_handle; /**< Session handle of the root listener */
vlib_main_t *vlib_main;
} echo_server_main_t;
@@ -72,7 +73,7 @@ int
quic_echo_server_session_accept_callback (session_t * s)
{
echo_server_main_t *esm = &echo_server_main;
- if (!(s->flags & SESSION_F_QUIC_STREAM))
+ if (s->listener_handle == esm->listener_handle)
return quic_echo_server_qsession_accept_callback (s);
DBG ("SSESSION %u accept w/opaque %d", s->session_index, s->opaque);
@@ -398,12 +399,15 @@ echo_server_detach (void)
static int
echo_server_listen ()
{
+ int rv;
echo_server_main_t *esm = &echo_server_main;
vnet_listen_args_t _a, *a = &_a;
clib_memset (a, 0, sizeof (*a));
a->app_index = esm->app_index;
a->uri = esm->server_uri;
- return vnet_bind_uri (a);
+ rv = vnet_bind_uri (a);
+ esm->listener_handle = a->handle;
+ return rv;
}
static int