aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session-apps
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session-apps')
-rw-r--r--src/vnet/session-apps/echo_server.c21
-rw-r--r--src/vnet/session-apps/http_server.c8
-rw-r--r--src/vnet/session-apps/proxy.c8
3 files changed, 19 insertions, 18 deletions
diff --git a/src/vnet/session-apps/echo_server.c b/src/vnet/session-apps/echo_server.c
index 024ffa66f96..0d0350819c9 100644
--- a/src/vnet/session-apps/echo_server.c
+++ b/src/vnet/session-apps/echo_server.c
@@ -245,7 +245,6 @@ static session_cb_vft_t echo_server_session_cb_vft = {
.session_disconnect_callback = echo_server_session_disconnect_callback,
.session_connected_callback = echo_server_session_connected_callback,
.add_segment_callback = echo_server_add_segment_callback,
- .redirect_connect_callback = echo_server_redirect_connect_callback,
.builtin_server_rx_callback = echo_server_rx_callback,
.session_reset_callback = echo_server_session_reset_callback
};
@@ -387,7 +386,7 @@ echo_server_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
u8 server_uri_set = 0, *appns_id = 0;
u64 tmp, appns_flags = 0, appns_secret = 0;
char *default_uri = "tcp://0.0.0.0/1234";
- int rv;
+ int rv, is_stop = 0;
esm->no_echo = 0;
esm->fifo_size = 64 << 10;
@@ -431,11 +430,29 @@ echo_server_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
appns_flags |= APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
else if (unformat (input, "secret %lu", &appns_secret))
;
+ else if (unformat (input, "stop"))
+ is_stop = 1;
else
return clib_error_return (0, "failed: unknown input `%U'",
format_unformat_error, input);
}
+ if (is_stop)
+ {
+ if (esm->app_index == (u32) ~ 0)
+ {
+ clib_warning ("server not running");
+ return clib_error_return (0, "failed: server not running");
+ }
+ rv = echo_server_detach ();
+ if (rv)
+ {
+ clib_warning ("failed: detach");
+ return clib_error_return (0, "failed: server detach %d", rv);
+ }
+ return 0;
+ }
+
vnet_session_enable_disable (vm, 1 /* turn on TCP, etc. */ );
if (!server_uri_set)
diff --git a/src/vnet/session-apps/http_server.c b/src/vnet/session-apps/http_server.c
index 07eaab4c1ae..eeb755b0fc4 100644
--- a/src/vnet/session-apps/http_server.c
+++ b/src/vnet/session-apps/http_server.c
@@ -471,19 +471,11 @@ http_server_add_segment_callback (u32 client_index, const ssvm_private_t * sp)
return -1;
}
-static int
-http_server_redirect_connect_callback (u32 client_index, void *mp)
-{
- clib_warning ("called...");
- return -1;
-}
-
static session_cb_vft_t http_server_session_cb_vft = {
.session_accept_callback = http_server_session_accept_callback,
.session_disconnect_callback = http_server_session_disconnect_callback,
.session_connected_callback = http_server_session_connected_callback,
.add_segment_callback = http_server_add_segment_callback,
- .redirect_connect_callback = http_server_redirect_connect_callback,
.builtin_server_rx_callback = http_server_rx_callback,
.session_reset_callback = http_server_session_reset_callback
};
diff --git a/src/vnet/session-apps/proxy.c b/src/vnet/session-apps/proxy.c
index 2fdb63f1780..1cbacdbc894 100644
--- a/src/vnet/session-apps/proxy.c
+++ b/src/vnet/session-apps/proxy.c
@@ -146,13 +146,6 @@ proxy_add_segment_callback (u32 client_index, const ssvm_private_t * sp)
}
static int
-proxy_redirect_connect_callback (u32 client_index, void *mp)
-{
- clib_warning ("called...");
- return -1;
-}
-
-static int
proxy_rx_callback (stream_session_t * s)
{
u32 max_dequeue;
@@ -239,7 +232,6 @@ static session_cb_vft_t proxy_session_cb_vft = {
.session_disconnect_callback = proxy_disconnect_callback,
.session_connected_callback = proxy_connected_callback,
.add_segment_callback = proxy_add_segment_callback,
- .redirect_connect_callback = proxy_redirect_connect_callback,
.builtin_server_rx_callback = proxy_rx_callback,
.session_reset_callback = proxy_reset_callback
};