From 2545add6240145b419357b9260ae5e8c0d95ba6c Mon Sep 17 00:00:00 2001 From: Robert Bielik Date: Tue, 28 Jan 2020 07:43:09 +0100 Subject: Add possibility to explicitly set a tree handler as exclusive (#1158) - Default tree handler behavior is now non-exclusive - Add 'longest uri first' ordering for http handlers --- include/nng/supplemental/http/http.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/nng/supplemental/http/http.h b/include/nng/supplemental/http/http.h index cdd9b25f..a2d67be4 100644 --- a/include/nng/supplemental/http/http.h +++ b/include/nng/supplemental/http/http.h @@ -1,6 +1,7 @@ // // Copyright 2020 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV +// Copyright 2020 Dirac Research // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -372,6 +373,14 @@ NNG_DECL int nng_http_handler_collect_body(nng_http_handler *, bool, size_t); // called for an exact path match. NNG_DECL int nng_http_handler_set_tree(nng_http_handler *); +// nng_http_handler_set_tree_exclusive indicates that the handler is being +// registered for a heirarchical tree *exclusively*, rather than just a single +// path, so it will be called for all child paths supplied. By default the +// handler is only called for an exact path match. Exclusive means that any +// other handler on a conflicting path will induce an address conflict error +// when added to a server. +NNG_DECL int nng_http_handler_set_tree_exclusive(nng_http_handler *); + // nng_http_handler_set_data is used to store additional data, along with // a possible clean up routine. (The clean up is a custom de-allocator and // will be called with the supplied data as an argument, when the handler -- cgit v1.2.3-70-g09d2