diff options
author | Florin Coras <fcoras@cisco.com> | 2017-08-14 22:33:41 -0700 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2017-08-16 13:28:27 +0000 |
commit | 0e9c33bb5fef22be4db350a33bef1f7534123b04 (patch) | |
tree | dc880008afc5783c421822d5d283da270dd5d8dd /src/vnet/session/application.c | |
parent | 4f80b81d4a7ab537b7a6ede88abed26f278c0f26 (diff) |
tcp: improve builtin http server
Additionally:
- remove opaques from stream_session_t
- ensure first segment manager is only used once per app.
Change-Id: I143d1fdb8effc88815ef969b78122ba3ac29e06e
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/application.c')
-rw-r--r-- | src/vnet/session/application.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c index bc837bb2939..25a4efa50aa 100644 --- a/src/vnet/session/application.c +++ b/src/vnet/session/application.c @@ -225,15 +225,17 @@ application_alloc_segment_manager (application_t * app) { segment_manager_t *sm = 0; - if (app->first_segment_manager != (u32) ~ 0) + if (app->first_segment_manager != (u32) ~ 0 + && app->first_segment_manager_in_use == 0) { sm = segment_manager_get (app->first_segment_manager); + app->first_segment_manager_in_use = 1; return sm; } sm = segment_manager_new (); - if (segment_manager_init (sm, &app->sm_properties, 0)) - return 0; + sm->properties = &app->sm_properties; + return sm; } @@ -301,7 +303,11 @@ application_stop_listen (application_t * srv, u64 handle) sm = segment_manager_get (*indexp); segment_manager_del (sm); - srv->first_segment_manager = ~0; + if (srv->first_segment_manager == *indexp) + { + srv->first_segment_manager_in_use = 0; + srv->first_segment_manager = ~0; + } hash_unset (srv->listeners_table, handle); listen_session_del (listener); |