diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-06-15 12:50:03 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-06-15 13:39:29 -0700 |
| commit | 5ecea06b1f39a93735e8b2f711b125d0b1a84d16 (patch) | |
| tree | 843c699c3618328856c0b373a4b49b75205bf234 /src/supplemental/http/http_public.c | |
| parent | 16088417694de3d3300ae8429c20e944128d3f52 (diff) | |
| download | nng-5ecea06b1f39a93735e8b2f711b125d0b1a84d16.tar.gz nng-5ecea06b1f39a93735e8b2f711b125d0b1a84d16.tar.bz2 nng-5ecea06b1f39a93735e8b2f711b125d0b1a84d16.zip | |
fixes #539 Feature request: customizable http error page
Diffstat (limited to 'src/supplemental/http/http_public.c')
| -rw-r--r-- | src/supplemental/http/http_public.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/supplemental/http/http_public.c b/src/supplemental/http/http_public.c index 40d4a19c..94e51ed0 100644 --- a/src/supplemental/http/http_public.c +++ b/src/supplemental/http/http_public.c @@ -676,6 +676,34 @@ nng_http_server_del_handler(nng_http_server *srv, nng_http_handler *h) } int +nng_http_server_set_error_page( + nng_http_server *srv, uint16_t code, const char *body) +{ +#ifdef NNG_SUPP_HTTP + return (nni_http_server_set_error_page(srv, code, body)); +#else + NNI_ARG_UNUSED(srv); + NNI_ARG_UNUSED(code); + NNI_ARG_UNUSED(body); + return (NNG_ENOTSUP); +#endif +} + +int +nng_http_server_set_error_file( + nng_http_server *srv, uint16_t code, const char *path) +{ +#ifdef NNG_SUPP_HTTP + return (nni_http_server_set_error_file(srv, code, path)); +#else + NNI_ARG_UNUSED(srv); + NNI_ARG_UNUSED(code); + NNI_ARG_UNUSED(path); + return (NNG_ENOTSUP); +#endif +} + +int nng_http_server_set_tls(nng_http_server *srv, struct nng_tls_config *cfg) { #if defined(NNG_SUPP_HTTP) && defined(NNG_SUPP_TLS) @@ -700,6 +728,19 @@ nng_http_server_get_tls(nng_http_server *srv, struct nng_tls_config **cfgp) } int +nng_http_server_res_error(nng_http_server *srv, nng_http_res *res) +{ +#ifdef NNG_SUPP_HTTP + return (nni_http_server_res_error(srv, res)); +#else + NNI_ARG_UNUSED(srv); + NNI_ARG_UNUSED(res); + NNI_ARG_UNUSED(code); + return (NNG_ENOTSUP); +#endif +} + +int nng_http_hijack(nng_http_conn *conn) { #ifdef NNG_SUPP_HTTP |
