summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRobert Bielik <robert.bielik@dirac.com>2020-01-28 07:43:09 +0100
committerGarrett D'Amore <garrett@damore.org>2020-01-27 22:43:09 -0800
commit2545add6240145b419357b9260ae5e8c0d95ba6c (patch)
tree155ae2ccfc4c720df7206c7fc81f68531624bc35 /include
parent9414a69a9575564d04022aef9bd898028e52bf09 (diff)
downloadnng-2545add6240145b419357b9260ae5e8c0d95ba6c.tar.gz
nng-2545add6240145b419357b9260ae5e8c0d95ba6c.tar.bz2
nng-2545add6240145b419357b9260ae5e8c0d95ba6c.zip
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
Diffstat (limited to 'include')
-rw-r--r--include/nng/supplemental/http/http.h9
1 files changed, 9 insertions, 0 deletions
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. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2020 Dirac Research <robert.bielik@dirac.com>
//
// 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