aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-04-04 08:27:58 -0700
committerDave Barach <openvpp@barachs.net>2019-04-04 19:08:17 +0000
commita154017cf5469d27b30c43d9f2b6144d1f286dd9 (patch)
treea87174b2cf362e31ed3de1aac8dd1b209b19654f /src
parent282a3cb7265346e1299c9401b35730b80f4b506b (diff)
session: fix http server rpc to main
Change-Id: I3e3820da5a9de97070bceecd3ea53b5351654319 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vnet/session-apps/http_server.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/vnet/session-apps/http_server.c b/src/vnet/session-apps/http_server.c
index 11940e361b0..ccbe711c76a 100644
--- a/src/vnet/session-apps/http_server.c
+++ b/src/vnet/session-apps/http_server.c
@@ -445,7 +445,8 @@ alloc_http_process (http_server_args * args)
/* Save the args (pointer) in the node runtime */
save_args = vlib_node_get_runtime_data (vm, n->index);
- *save_args = args;
+ *save_args = clib_mem_alloc (sizeof (*args));
+ clib_memcpy_fast (*save_args, args, sizeof (*args));
vlib_start_process (vm, n->runtime_index);
}
@@ -481,7 +482,7 @@ session_rx_request (http_session_t * hs)
static int
http_server_rx_callback (session_t * s)
{
- http_server_args *args;
+ http_server_args args;
http_session_t *hs;
int rv;
@@ -496,17 +497,17 @@ http_server_rx_callback (session_t * s)
return rv;
/* send the command to a new/recycled vlib process */
- args = clib_mem_alloc (sizeof (*args));
- args->hs_index = hs->session_index;
- args->thread_index = hs->thread_index;
+ args.hs_index = hs->session_index;
+ args.thread_index = hs->thread_index;
http_server_sessions_reader_unlock ();
- /* Send an RPC request via the thread-0 input node */
+ /* Send RPC request to main thread */
if (vlib_get_thread_index () != 0)
- session_send_rpc_evt_to_thread (0, alloc_http_process_callback, args);
+ vlib_rpc_call_main_thread (alloc_http_process_callback, (u8 *) & args,
+ sizeof (args));
else
- alloc_http_process (args);
+ alloc_http_process (&args);
return 0;
}