diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2023-10-18 13:07:23 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2023-10-18 13:07:23 +0000 |
commit | 1a7e3d00588725da3d8764fa9d624bc8611be070 (patch) | |
tree | 65d28b52bd1d4ccdbeb418d4d681b1999ed46b7a /src/include | |
parent | 24fb88dbb023ae08adc9989bf19e0c6c569a6607 (diff) | |
download | tipidee-1a7e3d00588725da3d8764fa9d624bc8611be070.tar.xz |
Add infrastructure for custom error files
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/tipidee/conf.h | 1 | ||||
-rw-r--r-- | src/include/tipidee/log.h | 2 | ||||
-rw-r--r-- | src/include/tipidee/response.h | 10 |
3 files changed, 10 insertions, 3 deletions
diff --git a/src/include/tipidee/conf.h b/src/include/tipidee/conf.h index abc8313..d0b8fb0 100644 --- a/src/include/tipidee/conf.h +++ b/src/include/tipidee/conf.h @@ -40,5 +40,6 @@ extern unsigned int tipidee_conf_get_argv (tipidee_conf const *, char const *, c extern char const *tipidee_conf_get_docroot (tipidee_conf const *, tipidee_uri const *, uint16_t) ; extern int tipidee_conf_get_redirection (tipidee_conf const *, char const *, size_t, char const *, tipidee_redirection *) ; extern char const *tipidee_conf_get_content_type (tipidee_conf const *, char const *) ; +extern char const *tipidee_conf_get_errorfile (tipidee_conf const *, char const *, unsigned int) ; #endif diff --git a/src/include/tipidee/log.h b/src/include/tipidee/log.h index 7453bb7..bf3b812 100644 --- a/src/include/tipidee/log.h +++ b/src/include/tipidee/log.h @@ -39,7 +39,7 @@ extern void tipidee_log_start (uint32_t, char const *, char const *) ; extern void tipidee_log_exit (uint32_t, unsigned int) ; extern void tipidee_log_request (uint32_t, tipidee_rql const *, tipidee_headers const *, stralloc *) ; -extern void tipidee_log_resource (uint32_t, tipidee_rql const *, char const *, char const *, tipidee_resattr const *) ; +extern void tipidee_log_resource (uint32_t, tipidee_rql const *, char const *, tipidee_resattr const *, char const *) ; extern void tipidee_log_answer (uint32_t, tipidee_rql const *, unsigned int, uint64_t) ; #define tipidee_log_debug(v, ...) do { if ((v) & TIPIDEE_LOG_DEBUG) strerr_warn(PROG, ": debug: ", __VA_ARGS__) ; } while (0) diff --git a/src/include/tipidee/response.h b/src/include/tipidee/response.h index d969d9c..3850970 100644 --- a/src/include/tipidee/response.h +++ b/src/include/tipidee/response.h @@ -3,11 +3,13 @@ #ifndef TIPIDEE_RESPONSE_H #define TIPIDEE_RESPONSE_H -#include <sys/stat.h> +#include <skalibs/bsdsnowflake.h> + #include <stddef.h> #include <stdint.h> #include <skalibs/gccattributes.h> +#include <skalibs/stat.h> #include <skalibs/buffer.h> #include <skalibs/strerr.h> #include <skalibs/tai.h> @@ -31,7 +33,11 @@ extern size_t tipidee_response_header_lastmodified (char *, size_t, struct stat extern size_t tipidee_response_header_common_put (buffer *, uint32_t, tain const *) ; #define tipidee_response_header_common_put_g(b, options) tipidee_response_header_common_put(b, (options), &STAMP) -extern size_t tipidee_response_error (buffer *, tipidee_rql const *, unsigned int, char const *, char const *, uint32_t) ; +size_t tipidee_response_file (buffer *, tipidee_rql const *, unsigned int, char const *, struct stat const *, char const *, uint32_t, tain const *) ; +#define tipidee_response_file_g(b, rql, status, reason, st, ct, options) tipidee_response_file(b, rql, status, reason, st, ct, (options), &STAMP) + +extern size_t tipidee_response_error_nofile (buffer *, tipidee_rql const *, unsigned int, char const *, char const *, uint32_t, tain const *) ; +#define tipidee_response_error_nofile_g(b, rql, status, reason, text, options) tipidee_response_error_nofile(b, rql, status, reason, text, (options), &STAMP) extern tipidee_response_header_builtin const *tipidee_response_header_builtin_table ; extern char const *tipidee_response_header_builtin_search (char const *) ; |