diff options
| -rw-r--r-- | docs/man/nng_http_handler_free.3http.adoc | 47 | ||||
| -rw-r--r-- | docs/ref/api/http.md | 15 | ||||
| -rw-r--r-- | docs/ref/xref.md | 1 |
3 files changed, 16 insertions, 47 deletions
diff --git a/docs/man/nng_http_handler_free.3http.adoc b/docs/man/nng_http_handler_free.3http.adoc deleted file mode 100644 index 0e1a5b1c..00000000 --- a/docs/man/nng_http_handler_free.3http.adoc +++ /dev/null @@ -1,47 +0,0 @@ -= nng_http_handler_free(3http) -// -// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> -// Copyright 2018 Capitar IT Group BV <info@capitar.com> -// -// This document is supplied under the terms of the MIT License, a -// copy of which should be located in the distribution where this -// file was obtained (LICENSE.txt). A copy of the license may also be -// found online at https://opensource.org/licenses/MIT. -// - -== NAME - -nng_http_handler_free - free HTTP server handler - -== SYNOPSIS - -[source, c] ----- -#include <nng/nng.h> -#include <nng/http.h> - -void nng_http_handler_free(nng_http_handler *h); ----- - -== DESCRIPTION - -The `nng_http_handler_free()` function frees an allocated HTTP server handler. - -IMPORTANT: It is an error to free a handler that is registered with a server. -Any handlers that are registered with servers are automatically freed -when the server itself is deallocated. - -== RETURN VALUES - -None. - -== ERRORS - -None. - -== SEE ALSO - -[.text-left] -xref:nng_http_handler_alloc.3http.adoc[nng_http_handler_alloc(3http)], -xref:nng_http_server_add_handler.3http.adoc[nng_http_server_add_handler(3http)], -xref:nng.7.adoc[nng(7)] diff --git a/docs/ref/api/http.md b/docs/ref/api/http.md index 05821cbc..c02881d5 100644 --- a/docs/ref/api/http.md +++ b/docs/ref/api/http.md @@ -644,6 +644,21 @@ sent, if possible, and the connection will be closed. The _aio_ may be scheduled for deferred completion using the [`nng_aio_start`]. +### Freeing Handler + +```c +void nng_http_handler_free(nng_http_handler *h); +``` + +The {{i:`nng_http_handler_free`}} function frees an allocated HTTP server handler. +Normally there is no reason to call this function, because the handler is freed with +the server it was registered with. + +> [!IMPORTANT] +> It is an error to free a handler that is registered with a server. +> Any handlers that are registered with servers are automatically freed +> when the server itself is deallocated. + ### Serving Directories and Files ```c diff --git a/docs/ref/xref.md b/docs/ref/xref.md index 33c83b2b..e8aa03ea 100644 --- a/docs/ref/xref.md +++ b/docs/ref/xref.md @@ -306,6 +306,7 @@ [`nng_http_write_all`]: ../api/http.md#direct-read-and-write [`nng_http_handler`]: ../api/http.md#handlers [`nng_http_handler_alloc`]: ../api/http.md#handlers +[`nng_http_handler_free`]: ../api/http.md#freeing-handler [`nng_http_write_response`]: ../api/http.md#sending-the-response-explicitly [`nng_http_handler_collect_body`]: ../api/http.md#collecting-request-body [`nng_http_handler_set_host`]: ../api/http.md#filtering-byt-host |
