summaryrefslogtreecommitdiffstats
path: root/src/plugins/mactime/builtins.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2022-02-01 13:17:13 -0800
committerDamjan Marion <dmarion@me.com>2022-02-02 10:35:23 +0000
commitbd8013ee8cf3522230f413cf2b7ec0b895cd5979 (patch)
treeca414f3d489ce2eab2ae196ab5ae12c2fdcacfe8 /src/plugins/mactime/builtins.c
parentd6eed1bb207291e4541f45f229d71358bfb35165 (diff)
http_static: add support for async tx from handlers
URL handlers can send data asynchronously if needed. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I89eae690cb26543479c7659b5dc46604cbb22eba
Diffstat (limited to 'src/plugins/mactime/builtins.c')
-rw-r--r--src/plugins/mactime/builtins.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/plugins/mactime/builtins.c b/src/plugins/mactime/builtins.c
index d039f7bff7f..c487d0375bf 100644
--- a/src/plugins/mactime/builtins.c
+++ b/src/plugins/mactime/builtins.c
@@ -14,8 +14,8 @@ mactime_ip_neighbor_copy (index_t ipni, void *ctx)
return (WALK_CONTINUE);
}
-static int
-handle_get_mactime (http_req_method_t reqtype, u8 *request, hss_session_t *hs)
+static hss_url_handler_rc_t
+handle_get_mactime (hss_url_handler_args_t *args)
{
mactime_main_t *mm = &mactime_main;
mactime_device_t *dp;
@@ -145,17 +145,16 @@ handle_get_mactime (http_req_method_t reqtype, u8 *request, hss_session_t *hs)
vec_free (macstring);
vec_free (pool_indices);
- hs->data = s;
- hs->data_offset = 0;
- hs->cache_pool_index = ~0;
- hs->free_data = 1;
- return 0;
+ args->data = s;
+ args->data_len = vec_len (s);
+ args->free_vec_data = 1;
+ return HSS_URL_HANDLER_OK;
}
void
mactime_url_init (vlib_main_t * vm)
{
- void (*fp) (void *, char *, int);
+ hss_register_url_fn fp;
/* Look up the builtin URL registration handler */
fp = vlib_get_plugin_symbol ("http_static_plugin.so",