diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-01-17 05:49:14 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-01-17 05:50:04 -0800 |
| commit | 6d74a90b72c80edbd58d8b2b29105e749bdfc28e (patch) | |
| tree | ea2a2fcabc3ef81ac0859ecef1ab9c7f4ab88f2b /include | |
| parent | 98b0d432dfeaa811cdfe20adb60ea899d61947b9 (diff) | |
| download | nng-6d74a90b72c80edbd58d8b2b29105e749bdfc28e.tar.gz nng-6d74a90b72c80edbd58d8b2b29105e749bdfc28e.tar.bz2 nng-6d74a90b72c80edbd58d8b2b29105e749bdfc28e.zip | |
http: handler API clean ups
Diffstat (limited to 'include')
| -rw-r--r-- | include/nng/http.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/include/nng/http.h b/include/nng/http.h index 1ff541ac..e4c578a6 100644 --- a/include/nng/http.h +++ b/include/nng/http.h @@ -242,20 +242,21 @@ NNG_DECL void nng_http_handler_free(nng_http_handler *); // nng_http_handler_alloc_file creates a "file" based handler, that // serves up static content from the given file path. The content-type -// supplied is determined from the file name using a simple built-in map. -NNG_DECL nng_err nng_http_handler_alloc_file( - nng_http_handler **, const char *, const char *); +// is taken from the 3rd argument, unless that is NULL, in which case +// it is determined from the file name using a simple built-in map. +NNG_DECL nng_err nng_http_handler_file( + nng_http_handler **, const char *, const char *, const char *); // nng_http_handler_alloc_static creates a static-content handler. // The last argument is the content-type, which may be NULL (in which case // "application/octet-stream" is assumed.) -NNG_DECL nng_err nng_http_handler_alloc_static( +NNG_DECL nng_err nng_http_handler_static( nng_http_handler **, const char *, const void *, size_t, const char *); // nng_http_handler_alloc_redirect creates an HTTP redirect handler. // The status is given, along with the new URL. If the status is 0, // then 301 will be used instead. -NNG_DECL nng_err nng_http_handler_alloc_redirect( +NNG_DECL nng_err nng_http_handler_redirect( nng_http_handler **, const char *, nng_http_status, const char *); // nng_http_handler_alloc_file creates a "directory" based handler, that @@ -264,7 +265,7 @@ NNG_DECL nng_err nng_http_handler_alloc_redirect( // directory content, otherwise a suitable error page is returned (the server // does not generate index pages automatically.) The content-type for // files is determined from the file name using a simple built-in map. -NNG_DECL nng_err nng_http_handler_alloc_directory( +NNG_DECL nng_err nng_http_handler_directory( nng_http_handler **, const char *, const char *); // nng_http_handler_set_method sets the method that the handler will be |
