summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/application.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-04-09 09:24:52 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2018-04-18 07:23:46 +0000
commit7fb0fe1f6972a7a35146fa9115b866ba29a6fbb7 (patch)
tree46f1236450ae918383bf56204b98a68199d28501 /src/vnet/session/application.c
parent684d08c7e5378af5310346e9219a79ef1d901084 (diff)
udp/session: refactor to support dgram mode
- adds session layer support for datagram based protocols - updates udp to work in pure connectionless and datagram mode. The existing connected mode is now 'accessible' for apps as a dummy UDPC, as in, connected udp, protocol. - updates udp_echo, echo client, echo server code to work in datagram mode. Change-Id: I2960c0d2d246cb166005f545794ec31fe0d546dd Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/application.c')
-rw-r--r--src/vnet/session/application.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c
index 1c46e786e13..68bbd59098e 100644
--- a/src/vnet/session/application.c
+++ b/src/vnet/session/application.c
@@ -445,13 +445,9 @@ application_start_listen (application_t * srv, session_endpoint_t * sep,
s = listen_session_new (0, sst);
s->app_index = srv->index;
- if (stream_session_listen (s, sep))
- goto err;
-
/* Allocate segment manager. All sessions derived out of a listen session
* have fifos allocated by the same segment manager. */
- sm = application_alloc_segment_manager (srv);
- if (sm == 0)
+ if (!(sm = application_alloc_segment_manager (srv)))
goto err;
/* Add to app's listener table. Useful to find all child listeners
@@ -459,6 +455,13 @@ application_start_listen (application_t * srv, session_endpoint_t * sep,
handle = listen_session_get_handle (s);
hash_set (srv->listeners_table, handle, segment_manager_index (sm));
+ if (stream_session_listen (s, sep))
+ {
+ segment_manager_del (sm);
+ hash_unset (srv->listeners_table, handle);
+ goto err;
+ }
+
*res = handle;
return 0;