diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2023-12-04 07:22:53 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2023-12-04 07:22:53 +0000 |
commit | e3c075c72d6b7b64c869b4cb0c0ff128b1d084cd (patch) | |
tree | dcb810bb5aa6a853672c6d8e749df508a2ae4e53 | |
parent | 691c9878f41d6646af38f417b23dfc72644a8c96 (diff) | |
download | tipidee-e3c075c72d6b7b64c869b4cb0c0ff128b1d084cd.tar.gz tipidee-e3c075c72d6b7b64c869b4cb0c0ff128b1d084cd.tar.xz tipidee-e3c075c72d6b7b64c869b4cb0c0ff128b1d084cd.zip |
Use wallclock time for Date header in responses
Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r-- | package/deps.mak | 13 | ||||
-rw-r--r-- | src/include/tipidee/response.h | 8 | ||||
-rw-r--r-- | src/libtipidee/deps-lib/tipidee | 5 | ||||
-rw-r--r-- | src/libtipidee/tipidee_response_error_nofile_G.c | 12 | ||||
-rw-r--r-- | src/libtipidee/tipidee_response_file_G.c | 12 | ||||
-rw-r--r-- | src/libtipidee/tipidee_response_header_date_G.c | 12 | ||||
-rw-r--r-- | src/libtipidee/tipidee_response_header_writeall_G.c | 12 | ||||
-rw-r--r-- | src/libtipidee/tipidee_response_header_writemerge_G.c | 12 | ||||
-rw-r--r-- | src/tipideed/cgi.c | 2 | ||||
-rw-r--r-- | src/tipideed/options.c | 2 | ||||
-rw-r--r-- | src/tipideed/regular.c | 6 | ||||
-rw-r--r-- | src/tipideed/responses.c | 10 | ||||
-rw-r--r-- | src/tipideed/trace.c | 2 |
13 files changed, 93 insertions, 15 deletions
diff --git a/package/deps.mak b/package/deps.mak index e4a8166..9ef8eed 100644 --- a/package/deps.mak +++ b/package/deps.mak @@ -37,17 +37,22 @@ src/libtipidee/tipidee_headers_search.o src/libtipidee/tipidee_headers_search.lo src/libtipidee/tipidee_log_answer.o src/libtipidee/tipidee_log_answer.lo: src/libtipidee/tipidee_log_answer.c src/include/tipidee/log.h src/libtipidee/tipidee_log_exit.o src/libtipidee/tipidee_log_exit.lo: src/libtipidee/tipidee_log_exit.c src/include/tipidee/log.h src/libtipidee/tipidee_log_request.o src/libtipidee/tipidee_log_request.lo: src/libtipidee/tipidee_log_request.c src/include/tipidee/headers.h src/include/tipidee/log.h src/include/tipidee/method.h -src/libtipidee/tipidee_log_resource.o src/libtipidee/tipidee_log_resource.lo: src/libtipidee/tipidee_log_resource.c src/include/tipidee/log.h +src/libtipidee/tipidee_log_resource.o src/libtipidee/tipidee_log_resource.lo: src/libtipidee/tipidee_log_resource.c src/include/tipidee/log.h src/include/tipidee/resattr.h src/libtipidee/tipidee_log_start.o src/libtipidee/tipidee_log_start.lo: src/libtipidee/tipidee_log_start.c src/include/tipidee/log.h src/libtipidee/tipidee_method.o src/libtipidee/tipidee_method.lo: src/libtipidee/tipidee_method.c src/include/tipidee/method.h src/libtipidee/tipidee_response_error_nofile.o src/libtipidee/tipidee_response_error_nofile.lo: src/libtipidee/tipidee_response_error_nofile.c src/include/tipidee/method.h src/include/tipidee/response.h +src/libtipidee/tipidee_response_error_nofile_G.o src/libtipidee/tipidee_response_error_nofile_G.lo: src/libtipidee/tipidee_response_error_nofile_G.c src/include/tipidee/response.h src/libtipidee/tipidee_response_file.o src/libtipidee/tipidee_response_file.lo: src/libtipidee/tipidee_response_file.c src/include/tipidee/conf.h src/include/tipidee/method.h src/include/tipidee/response.h src/include/tipidee/rql.h src/include/tipidee/util.h +src/libtipidee/tipidee_response_file_G.o src/libtipidee/tipidee_response_file_G.lo: src/libtipidee/tipidee_response_file_G.c src/include/tipidee/response.h src/libtipidee/tipidee_response_header_date.o src/libtipidee/tipidee_response_header_date.lo: src/libtipidee/tipidee_response_header_date.c src/include/tipidee/response.h +src/libtipidee/tipidee_response_header_date_G.o src/libtipidee/tipidee_response_header_date_G.lo: src/libtipidee/tipidee_response_header_date_G.c src/include/tipidee/response.h src/libtipidee/tipidee_response_header_date_fmt.o src/libtipidee/tipidee_response_header_date_fmt.lo: src/libtipidee/tipidee_response_header_date_fmt.c src/include/tipidee/response.h src/libtipidee/tipidee_response_header_lastmodified.o src/libtipidee/tipidee_response_header_lastmodified.lo: src/libtipidee/tipidee_response_header_lastmodified.c src/include/tipidee/response.h src/libtipidee/tipidee_response_header_preparebuiltin.o src/libtipidee/tipidee_response_header_preparebuiltin.lo: src/libtipidee/tipidee_response_header_preparebuiltin.c src/include/tipidee/response.h src/libtipidee/tipidee_response_header_writeall.o src/libtipidee/tipidee_response_header_writeall.lo: src/libtipidee/tipidee_response_header_writeall.c src/include/tipidee/response.h +src/libtipidee/tipidee_response_header_writeall_G.o src/libtipidee/tipidee_response_header_writeall_G.lo: src/libtipidee/tipidee_response_header_writeall_G.c src/include/tipidee/response.h src/libtipidee/tipidee_response_header_writemerge.o src/libtipidee/tipidee_response_header_writemerge.lo: src/libtipidee/tipidee_response_header_writemerge.c src/include/tipidee/headers.h src/include/tipidee/response.h +src/libtipidee/tipidee_response_header_writemerge_G.o src/libtipidee/tipidee_response_header_writemerge_G.lo: src/libtipidee/tipidee_response_header_writemerge_G.c src/include/tipidee/response.h src/libtipidee/tipidee_response_status.o src/libtipidee/tipidee_response_status.lo: src/libtipidee/tipidee_response_status.c src/include/tipidee/response.h src/libtipidee/tipidee_rql_read.o src/libtipidee/tipidee_rql_read.lo: src/libtipidee/tipidee_rql_read.c src/include/tipidee/method.h src/include/tipidee/rql.h src/include/tipidee/uri.h src/libtipidee/tipidee_uri_parse.o src/libtipidee/tipidee_uri_parse.lo: src/libtipidee/tipidee_uri_parse.c src/include/tipidee/uri.h @@ -68,12 +73,12 @@ tipidee-config: src/config/tipidee-config.o src/config/util.o src/config/node.o tipidee-config-preprocess: EXTRA_LIBS := -lskarnet tipidee-config-preprocess: src/config/tipidee-config-preprocess.o ifeq ($(strip $(STATIC_LIBS_ARE_PIC)),) -libtipidee.a.xyzzy: src/libtipidee/tipidee_conf_free.o src/libtipidee/tipidee_conf_get.o src/libtipidee/tipidee_conf_get_argv.o src/libtipidee/tipidee_conf_get_content_type.o src/libtipidee/tipidee_conf_get_errorfile.o src/libtipidee/tipidee_conf_get_redirection.o src/libtipidee/tipidee_conf_get_resattr.o src/libtipidee/tipidee_conf_get_resattr1.o src/libtipidee/tipidee_conf_get_responseheaders.o src/libtipidee/tipidee_conf_get_string.o src/libtipidee/tipidee_conf_get_uint32.o src/libtipidee/tipidee_conf_init.o src/libtipidee/tipidee_headers_get_content_length.o src/libtipidee/tipidee_headers_init.o src/libtipidee/tipidee_headers_parse.o src/libtipidee/tipidee_headers_search.o src/libtipidee/tipidee_log_answer.o src/libtipidee/tipidee_log_exit.o src/libtipidee/tipidee_log_resource.o src/libtipidee/tipidee_log_request.o src/libtipidee/tipidee_log_start.o src/libtipidee/tipidee_method.o src/libtipidee/tipidee_response_error_nofile.o src/libtipidee/tipidee_response_file.o src/libtipidee/tipidee_response_header_date.o src/libtipidee/tipidee_response_header_date_fmt.o src/libtipidee/tipidee_response_header_lastmodified.o src/libtipidee/tipidee_response_header_preparebuiltin.o src/libtipidee/tipidee_response_header_writeall.o src/libtipidee/tipidee_response_header_writemerge.o src/libtipidee/tipidee_response_status.o src/libtipidee/tipidee_rql_read.o src/libtipidee/tipidee_uri_parse.o src/libtipidee/tipidee_util_chunked_read.o src/libtipidee/tipidee_util_defaulttext.o src/libtipidee/tipidee_util_httpdate.o +libtipidee.a.xyzzy: src/libtipidee/tipidee_conf_free.o src/libtipidee/tipidee_conf_get.o src/libtipidee/tipidee_conf_get_argv.o src/libtipidee/tipidee_conf_get_content_type.o src/libtipidee/tipidee_conf_get_errorfile.o src/libtipidee/tipidee_conf_get_redirection.o src/libtipidee/tipidee_conf_get_resattr.o src/libtipidee/tipidee_conf_get_resattr1.o src/libtipidee/tipidee_conf_get_responseheaders.o src/libtipidee/tipidee_conf_get_string.o src/libtipidee/tipidee_conf_get_uint32.o src/libtipidee/tipidee_conf_init.o src/libtipidee/tipidee_headers_get_content_length.o src/libtipidee/tipidee_headers_init.o src/libtipidee/tipidee_headers_parse.o src/libtipidee/tipidee_headers_search.o src/libtipidee/tipidee_log_answer.o src/libtipidee/tipidee_log_exit.o src/libtipidee/tipidee_log_resource.o src/libtipidee/tipidee_log_request.o src/libtipidee/tipidee_log_start.o src/libtipidee/tipidee_method.o src/libtipidee/tipidee_response_error_nofile.o src/libtipidee/tipidee_response_error_nofile_G.o src/libtipidee/tipidee_response_file.o src/libtipidee/tipidee_response_file_G.o src/libtipidee/tipidee_response_header_date.o src/libtipidee/tipidee_response_header_date_G.o src/libtipidee/tipidee_response_header_date_fmt.o src/libtipidee/tipidee_response_header_lastmodified.o src/libtipidee/tipidee_response_header_preparebuiltin.o src/libtipidee/tipidee_response_header_writeall.o src/libtipidee/tipidee_response_header_writeall_G.o src/libtipidee/tipidee_response_header_writemerge.o src/libtipidee/tipidee_response_header_writemerge_G.o src/libtipidee/tipidee_response_status.o src/libtipidee/tipidee_rql_read.o src/libtipidee/tipidee_uri_parse.o src/libtipidee/tipidee_util_chunked_read.o src/libtipidee/tipidee_util_defaulttext.o src/libtipidee/tipidee_util_httpdate.o else -libtipidee.a.xyzzy: src/libtipidee/tipidee_conf_free.lo src/libtipidee/tipidee_conf_get.lo src/libtipidee/tipidee_conf_get_argv.lo src/libtipidee/tipidee_conf_get_content_type.lo src/libtipidee/tipidee_conf_get_errorfile.lo src/libtipidee/tipidee_conf_get_redirection.lo src/libtipidee/tipidee_conf_get_resattr.lo src/libtipidee/tipidee_conf_get_resattr1.lo src/libtipidee/tipidee_conf_get_responseheaders.lo src/libtipidee/tipidee_conf_get_string.lo src/libtipidee/tipidee_conf_get_uint32.lo src/libtipidee/tipidee_conf_init.lo src/libtipidee/tipidee_headers_get_content_length.lo src/libtipidee/tipidee_headers_init.lo src/libtipidee/tipidee_headers_parse.lo src/libtipidee/tipidee_headers_search.lo src/libtipidee/tipidee_log_answer.lo src/libtipidee/tipidee_log_exit.lo src/libtipidee/tipidee_log_resource.lo src/libtipidee/tipidee_log_request.lo src/libtipidee/tipidee_log_start.lo src/libtipidee/tipidee_method.lo src/libtipidee/tipidee_response_error_nofile.lo src/libtipidee/tipidee_response_file.lo src/libtipidee/tipidee_response_header_date.lo src/libtipidee/tipidee_response_header_date_fmt.lo src/libtipidee/tipidee_response_header_lastmodified.lo src/libtipidee/tipidee_response_header_preparebuiltin.lo src/libtipidee/tipidee_response_header_writeall.lo src/libtipidee/tipidee_response_header_writemerge.lo src/libtipidee/tipidee_response_status.lo src/libtipidee/tipidee_rql_read.lo src/libtipidee/tipidee_uri_parse.lo src/libtipidee/tipidee_util_chunked_read.lo src/libtipidee/tipidee_util_defaulttext.lo src/libtipidee/tipidee_util_httpdate.lo +libtipidee.a.xyzzy: src/libtipidee/tipidee_conf_free.lo src/libtipidee/tipidee_conf_get.lo src/libtipidee/tipidee_conf_get_argv.lo src/libtipidee/tipidee_conf_get_content_type.lo src/libtipidee/tipidee_conf_get_errorfile.lo src/libtipidee/tipidee_conf_get_redirection.lo src/libtipidee/tipidee_conf_get_resattr.lo src/libtipidee/tipidee_conf_get_resattr1.lo src/libtipidee/tipidee_conf_get_responseheaders.lo src/libtipidee/tipidee_conf_get_string.lo src/libtipidee/tipidee_conf_get_uint32.lo src/libtipidee/tipidee_conf_init.lo src/libtipidee/tipidee_headers_get_content_length.lo src/libtipidee/tipidee_headers_init.lo src/libtipidee/tipidee_headers_parse.lo src/libtipidee/tipidee_headers_search.lo src/libtipidee/tipidee_log_answer.lo src/libtipidee/tipidee_log_exit.lo src/libtipidee/tipidee_log_resource.lo src/libtipidee/tipidee_log_request.lo src/libtipidee/tipidee_log_start.lo src/libtipidee/tipidee_method.lo src/libtipidee/tipidee_response_error_nofile.lo src/libtipidee/tipidee_response_error_nofile_G.lo src/libtipidee/tipidee_response_file.lo src/libtipidee/tipidee_response_file_G.lo src/libtipidee/tipidee_response_header_date.lo src/libtipidee/tipidee_response_header_date_G.lo src/libtipidee/tipidee_response_header_date_fmt.lo src/libtipidee/tipidee_response_header_lastmodified.lo src/libtipidee/tipidee_response_header_preparebuiltin.lo src/libtipidee/tipidee_response_header_writeall.lo src/libtipidee/tipidee_response_header_writeall_G.lo src/libtipidee/tipidee_response_header_writemerge.lo src/libtipidee/tipidee_response_header_writemerge_G.lo src/libtipidee/tipidee_response_status.lo src/libtipidee/tipidee_rql_read.lo src/libtipidee/tipidee_uri_parse.lo src/libtipidee/tipidee_util_chunked_read.lo src/libtipidee/tipidee_util_defaulttext.lo src/libtipidee/tipidee_util_httpdate.lo endif libtipidee.so.xyzzy: EXTRA_LIBS := -lskarnet -libtipidee.so.xyzzy: src/libtipidee/tipidee_conf_free.lo src/libtipidee/tipidee_conf_get.lo src/libtipidee/tipidee_conf_get_argv.lo src/libtipidee/tipidee_conf_get_content_type.lo src/libtipidee/tipidee_conf_get_errorfile.lo src/libtipidee/tipidee_conf_get_redirection.lo src/libtipidee/tipidee_conf_get_resattr.lo src/libtipidee/tipidee_conf_get_resattr1.lo src/libtipidee/tipidee_conf_get_responseheaders.lo src/libtipidee/tipidee_conf_get_string.lo src/libtipidee/tipidee_conf_get_uint32.lo src/libtipidee/tipidee_conf_init.lo src/libtipidee/tipidee_headers_get_content_length.lo src/libtipidee/tipidee_headers_init.lo src/libtipidee/tipidee_headers_parse.lo src/libtipidee/tipidee_headers_search.lo src/libtipidee/tipidee_log_answer.lo src/libtipidee/tipidee_log_exit.lo src/libtipidee/tipidee_log_resource.lo src/libtipidee/tipidee_log_request.lo src/libtipidee/tipidee_log_start.lo src/libtipidee/tipidee_method.lo src/libtipidee/tipidee_response_error_nofile.lo src/libtipidee/tipidee_response_file.lo src/libtipidee/tipidee_response_header_date.lo src/libtipidee/tipidee_response_header_date_fmt.lo src/libtipidee/tipidee_response_header_lastmodified.lo src/libtipidee/tipidee_response_header_preparebuiltin.lo src/libtipidee/tipidee_response_header_writeall.lo src/libtipidee/tipidee_response_header_writemerge.lo src/libtipidee/tipidee_response_status.lo src/libtipidee/tipidee_rql_read.lo src/libtipidee/tipidee_uri_parse.lo src/libtipidee/tipidee_util_chunked_read.lo src/libtipidee/tipidee_util_defaulttext.lo src/libtipidee/tipidee_util_httpdate.lo +libtipidee.so.xyzzy: src/libtipidee/tipidee_conf_free.lo src/libtipidee/tipidee_conf_get.lo src/libtipidee/tipidee_conf_get_argv.lo src/libtipidee/tipidee_conf_get_content_type.lo src/libtipidee/tipidee_conf_get_errorfile.lo src/libtipidee/tipidee_conf_get_redirection.lo src/libtipidee/tipidee_conf_get_resattr.lo src/libtipidee/tipidee_conf_get_resattr1.lo src/libtipidee/tipidee_conf_get_responseheaders.lo src/libtipidee/tipidee_conf_get_string.lo src/libtipidee/tipidee_conf_get_uint32.lo src/libtipidee/tipidee_conf_init.lo src/libtipidee/tipidee_headers_get_content_length.lo src/libtipidee/tipidee_headers_init.lo src/libtipidee/tipidee_headers_parse.lo src/libtipidee/tipidee_headers_search.lo src/libtipidee/tipidee_log_answer.lo src/libtipidee/tipidee_log_exit.lo src/libtipidee/tipidee_log_resource.lo src/libtipidee/tipidee_log_request.lo src/libtipidee/tipidee_log_start.lo src/libtipidee/tipidee_method.lo src/libtipidee/tipidee_response_error_nofile.lo src/libtipidee/tipidee_response_error_nofile_G.lo src/libtipidee/tipidee_response_file.lo src/libtipidee/tipidee_response_file_G.lo src/libtipidee/tipidee_response_header_date.lo src/libtipidee/tipidee_response_header_date_G.lo src/libtipidee/tipidee_response_header_date_fmt.lo src/libtipidee/tipidee_response_header_lastmodified.lo src/libtipidee/tipidee_response_header_preparebuiltin.lo src/libtipidee/tipidee_response_header_writeall.lo src/libtipidee/tipidee_response_header_writeall_G.lo src/libtipidee/tipidee_response_header_writemerge.lo src/libtipidee/tipidee_response_header_writemerge_G.lo src/libtipidee/tipidee_response_status.lo src/libtipidee/tipidee_rql_read.lo src/libtipidee/tipidee_uri_parse.lo src/libtipidee/tipidee_util_chunked_read.lo src/libtipidee/tipidee_util_defaulttext.lo src/libtipidee/tipidee_util_httpdate.lo tipideed: EXTRA_LIBS := -lskarnet tipideed: src/tipideed/tipideed.o src/tipideed/cgi.o src/tipideed/harden.o src/tipideed/options.o src/tipideed/regular.o src/tipideed/responses.o src/tipideed/send_file.o src/tipideed/trace.o libtipidee.a.xyzzy INTERNAL_LIBS := diff --git a/src/include/tipidee/response.h b/src/include/tipidee/response.h index ea0e835..31b8df4 100644 --- a/src/include/tipidee/response.h +++ b/src/include/tipidee/response.h @@ -28,19 +28,27 @@ struct tipidee_response_header_s extern size_t tipidee_response_status (buffer *, tipidee_rql const *, unsigned int, char const *) ; extern size_t tipidee_response_header_date_fmt (char *, size_t, tain const *) ; + extern size_t tipidee_response_header_date (char *, size_t, tain const *) ; +extern size_t tipidee_response_header_date_G (char *, size_t) ; #define tipidee_response_header_date_g(buf, max) tipidee_response_header_date(buf, (max), &STAMP) + extern size_t tipidee_response_header_lastmodified (char *, size_t, struct stat const *) ; extern size_t tipidee_response_header_writeall (buffer *, tipidee_response_header const *, uint32_t, uint32_t, tain const *) ; +extern size_t tipidee_response_header_writeall_G (buffer *, tipidee_response_header const *, uint32_t, uint32_t) ; #define tipidee_response_header_writeall_g(b, rhdr, rhdrn, options) tipidee_response_header_writeall(b, rhdr, rhdrn, (options), &STAMP) + extern size_t tipidee_response_header_writemerge (buffer *, tipidee_response_header const *, uint32_t, tipidee_headers const *, uint32_t, tain const *) ; +extern size_t tipidee_response_header_writemerge_G (buffer *, tipidee_response_header const *, uint32_t, tipidee_headers const *, uint32_t) ; #define tipidee_response_header_writemerge_g(b, rhdr, rhdrn, hdr, options) tipidee_response_header_writemerge(b, rhdr, rhdrn, hdr, (options), &STAMP) size_t tipidee_response_file (buffer *, tipidee_rql const *, unsigned int, char const *, struct stat const *, char const *, tipidee_response_header const *, uint32_t, uint32_t, tain const *) ; +size_t tipidee_response_file_G (buffer *, tipidee_rql const *, unsigned int, char const *, struct stat const *, char const *, tipidee_response_header const *, uint32_t, uint32_t) ; #define tipidee_response_file_g(b, rql, status, reason, st, ct, rhdr, rhdrn, options) tipidee_response_file(b, rql, status, reason, st, ct, rhdr, rhdrn, (options), &STAMP) extern size_t tipidee_response_error_nofile (buffer *, tipidee_rql const *, unsigned int, char const *, char const *, tipidee_response_header const *, uint32_t, uint32_t, tain const *) ; +extern size_t tipidee_response_error_nofile_G (buffer *, tipidee_rql const *, unsigned int, char const *, char const *, tipidee_response_header const *, uint32_t, uint32_t) ; #define tipidee_response_error_nofile_g(b, rql, status, reason, text, rhdr, rhdrn, options) tipidee_response_error_nofile(b, rql, status, reason, text, rhdr, rhdrn, (options), &STAMP) extern int tipidee_response_header_preparebuiltin (tipidee_response_header *, uint32_t, char const *, size_t) ; diff --git a/src/libtipidee/deps-lib/tipidee b/src/libtipidee/deps-lib/tipidee index d71ef89..985be7e 100644 --- a/src/libtipidee/deps-lib/tipidee +++ b/src/libtipidee/deps-lib/tipidee @@ -21,13 +21,18 @@ tipidee_log_request.o tipidee_log_start.o tipidee_method.o tipidee_response_error_nofile.o +tipidee_response_error_nofile_G.o tipidee_response_file.o +tipidee_response_file_G.o tipidee_response_header_date.o +tipidee_response_header_date_G.o tipidee_response_header_date_fmt.o tipidee_response_header_lastmodified.o tipidee_response_header_preparebuiltin.o tipidee_response_header_writeall.o +tipidee_response_header_writeall_G.o tipidee_response_header_writemerge.o +tipidee_response_header_writemerge_G.o tipidee_response_status.o tipidee_rql_read.o tipidee_uri_parse.o diff --git a/src/libtipidee/tipidee_response_error_nofile_G.c b/src/libtipidee/tipidee_response_error_nofile_G.c new file mode 100644 index 0000000..d7239cc --- /dev/null +++ b/src/libtipidee/tipidee_response_error_nofile_G.c @@ -0,0 +1,12 @@ +/* ISC license. */ + +#include <skalibs/tai.h> + +#include <tipidee/response.h> + +size_t tipidee_response_error_nofile_G (buffer *b, tipidee_rql const *rql, unsigned int status, char const *reason, char const *text, tipidee_response_header const *rhdr, uint32_t rhdrn, uint32_t options) +{ + tain wstamp ; + tain_wallclock_read(&wstamp) ; + return tipidee_response_error_nofile(b, rql, status, reason, text, rhdr, rhdrn, options, &wstamp) ; +} diff --git a/src/libtipidee/tipidee_response_file_G.c b/src/libtipidee/tipidee_response_file_G.c new file mode 100644 index 0000000..8c08c98 --- /dev/null +++ b/src/libtipidee/tipidee_response_file_G.c @@ -0,0 +1,12 @@ +/* ISC license. */ + +#include <skalibs/tai.h> + +#include <tipidee/response.h> + +size_t tipidee_response_file_G (buffer *b, tipidee_rql const *rql, unsigned int status, char const *reason, struct stat const *st, char const *ct, tipidee_response_header const *rhdr, uint32_t rhdrn, uint32_t options) +{ + tain wstamp ; + tain_wallclock_read(&wstamp) ; + return tipidee_response_file(b, rql, status, reason, st, ct, rhdr, rhdrn, options, &wstamp) ; +} diff --git a/src/libtipidee/tipidee_response_header_date_G.c b/src/libtipidee/tipidee_response_header_date_G.c new file mode 100644 index 0000000..6d06d81 --- /dev/null +++ b/src/libtipidee/tipidee_response_header_date_G.c @@ -0,0 +1,12 @@ +/* ISC license. */ + +#include <skalibs/tai.h> + +#include <tipidee/response.h> + +size_t tipidee_response_header_date_G (char *s, size_t max) +{ + tain wstamp ; + tain_wallclock_read(&wstamp) ; + return tipidee_response_header_date(s, max, &wstamp) ; +} diff --git a/src/libtipidee/tipidee_response_header_writeall_G.c b/src/libtipidee/tipidee_response_header_writeall_G.c new file mode 100644 index 0000000..b448395 --- /dev/null +++ b/src/libtipidee/tipidee_response_header_writeall_G.c @@ -0,0 +1,12 @@ +/* ISC license. */ + +#include <skalibs/tai.h> + +#include <tipidee/response.h> + +size_t tipidee_response_header_writeall_G (buffer *b, tipidee_response_header const *rhdr, uint32_t rhdrn, uint32_t options) +{ + tain wstamp ; + tain_wallclock_read(&wstamp) ; + return tipidee_response_header_writeall(b, rhdr, rhdrn, options, &wstamp) ; +} diff --git a/src/libtipidee/tipidee_response_header_writemerge_G.c b/src/libtipidee/tipidee_response_header_writemerge_G.c new file mode 100644 index 0000000..78a7526 --- /dev/null +++ b/src/libtipidee/tipidee_response_header_writemerge_G.c @@ -0,0 +1,12 @@ +/* ISC license. */ + +#include <skalibs/tai.h> + +#include <tipidee/response.h> + +size_t tipidee_response_header_writemerge_G (buffer *b, tipidee_response_header const *rhdr, uint32_t rhdrn, tipidee_headers const *hdr, uint32_t options) +{ + tain wstamp ; + tain_wallclock_read(&wstamp) ; + return tipidee_response_header_writemerge(b, rhdr, rhdrn, hdr, options, &wstamp) ; +} diff --git a/src/tipideed/cgi.c b/src/tipideed/cgi.c index 3319099..12b2155 100644 --- a/src/tipideed/cgi.c +++ b/src/tipideed/cgi.c @@ -323,7 +323,7 @@ static inline int process_cgi_output (tipidee_rql *rql, char const *docroot, tip } tipidee_response_status(buffer_1, rql, status, reason) ; - tipidee_response_header_writemerge_g(buffer_1, g.rhdr, g.rhdrn, hdr, !g.cont) ; + tipidee_response_header_writemerge_G(buffer_1, g.rhdr, g.rhdrn, hdr, !g.cont) ; { char fmt[SIZE_FMT] ; fmt[size_fmt(fmt, rbodylen)] = 0 ; diff --git a/src/tipideed/options.c b/src/tipideed/options.c index ce25a81..0ecbb6f 100644 --- a/src/tipideed/options.c +++ b/src/tipideed/options.c @@ -15,7 +15,7 @@ int respond_options (tipidee_rql const *rql, uint32_t flags) { tain deadline ; tipidee_response_status(buffer_1, rql, 200, "OK") ; - tipidee_response_header_writeall_g(buffer_1, g.rhdr, g.rhdrn, 0) ; + tipidee_response_header_writeall_G(buffer_1, g.rhdr, g.rhdrn, 0) ; buffer_putsnoflush(buffer_1, "Content-Length: 0\r\nAllow: GET, HEAD") ; if (flags & 1) buffer_putsnoflush(buffer_1, ", POST") ; buffer_putnoflush(buffer_1, "\r\n\r\n", 4) ; diff --git a/src/tipideed/regular.c b/src/tipideed/regular.c index 2228f92..67fba35 100644 --- a/src/tipideed/regular.c +++ b/src/tipideed/regular.c @@ -22,7 +22,7 @@ int respond_regular (tipidee_rql const *rql, char const *docroot, char const *fn if (rql->m == TIPIDEE_METHOD_HEAD) { tain deadline ; - tipidee_response_file_g(buffer_1, rql, 200, "OK", st, ra->content_type, g.rhdr, g.rhdrn, 2 | !g.cont) ; + tipidee_response_file_G(buffer_1, rql, 200, "OK", st, ra->content_type, g.rhdr, g.rhdrn, 2 | !g.cont) ; tipidee_log_answer(g.logv, rql, 200, st->st_size) ; tain_add_g(&deadline, &g.writetto) ; if (!buffer_timed_flush_g(buffer_1, &deadline)) @@ -40,7 +40,7 @@ int respond_regular (tipidee_rql const *rql, char const *docroot, char const *fn } else die500sys(rql, 111, docroot, "open ", fn) ; } - tipidee_response_file_g(buffer_1, rql, 200, "OK", st, ra->content_type, g.rhdr, g.rhdrn, 2 | !g.cont) ; + tipidee_response_file_G(buffer_1, rql, 200, "OK", st, ra->content_type, g.rhdr, g.rhdrn, 2 | !g.cont) ; tipidee_log_answer(g.logv, rql, 200, st->st_size) ; send_file(fd, st->st_size, fn) ; fd_close(fd) ; @@ -53,7 +53,7 @@ int respond_304 (tipidee_rql const *rql, char const *fn, struct stat const *st) tain deadline ; char fmt[128] ; tipidee_response_status(buffer_1, rql, 304, "Not Modified") ; - tipidee_response_header_writeall_g(buffer_1, g.rhdr, g.rhdrn, !g.cont) ; + tipidee_response_header_writeall_G(buffer_1, g.rhdr, g.rhdrn, !g.cont) ; { size_t l = tipidee_response_header_lastmodified(fmt, 128, st) ; if (l) buffer_putnoflush(buffer_1, fmt, l) ; diff --git a/src/tipideed/responses.c b/src/tipideed/responses.c index 2f1df9d..ad53351 100644 --- a/src/tipideed/responses.c +++ b/src/tipideed/responses.c @@ -24,7 +24,7 @@ void response_error_early (tipidee_rql const *rql, unsigned int status, char const *reason, char const *text, uint32_t options) { tain deadline ; - tipidee_response_error_nofile_g(buffer_1, rql, status, reason, text, g.rhdr, g.rhdrn, options & 1 || !g.cont) ; + tipidee_response_error_nofile_G(buffer_1, rql, status, reason, text, g.rhdr, g.rhdrn, options & 1 || !g.cont) ; tain_add_g(&deadline, &g.writetto) ; if (!buffer_timed_flush_g(buffer_1, &deadline)) strerr_diefu1sys(111, "write to stdout") ; @@ -88,7 +88,7 @@ void response_error (tipidee_rql const *rql, char const *docroot, unsigned int s } else { - tipidee_response_file_g(buffer_1, rql, status, dt.reason, &st, tipidee_conf_get_content_type(&g.conf, g.sa.s + salen + g.cwdlen + 1), g.rhdr, g.rhdrn, options) ; + tipidee_response_file_G(buffer_1, rql, status, dt.reason, &st, tipidee_conf_get_content_type(&g.conf, g.sa.s + salen + g.cwdlen + 1), g.rhdr, g.rhdrn, options) ; tipidee_log_answer(g.logv, rql, status, st.st_size) ; send_file(fd, st.st_size, g.sa.s + salen + g.cwdlen + 1) ; fd_close(fd) ; @@ -100,7 +100,7 @@ void response_error (tipidee_rql const *rql, char const *docroot, unsigned int s g.sa.len = salen ; } - tipidee_response_error_nofile_g(buffer_1, rql, status, dt.reason, dt.text, g.rhdr, g.rhdrn, options & 1 || !g.cont) ; + tipidee_response_error_nofile_G(buffer_1, rql, status, dt.reason, dt.text, g.rhdr, g.rhdrn, options & 1 || !g.cont) ; tipidee_log_answer(g.logv, rql, status, 0) ; tain_add_g(&deadline, &g.writetto) ; if (!buffer_timed_flush_g(buffer_1, &deadline)) @@ -126,7 +126,7 @@ void exit_405_ (tipidee_rql const *rql, uint32_t options) { tain deadline ; tipidee_response_status(buffer_1, rql, 405, "Method Not Allowed") ; - tipidee_response_header_writeall_g(buffer_1, g.rhdr, g.rhdrn, 1) ; + tipidee_response_header_writeall_G(buffer_1, g.rhdr, g.rhdrn, 1) ; buffer_putsnoflush(buffer_1, "Allow: GET, HEAD") ; if (options & 1) buffer_putsnoflush(buffer_1, ", POST") ; buffer_putnoflush(buffer_1, "\r\n\r\n", 4) ; @@ -143,7 +143,7 @@ void respond_30x (tipidee_rql const *rql, tipidee_redirection const *rd) static char const *const reason[4] = { "Temporary Redirect", "Permanent Redirect", "Found", "Moved Permanently" } ; tain deadline ; tipidee_response_status(buffer_1, rql, status[rd->type], reason[rd->type]) ; - tipidee_response_header_writeall_g(buffer_1, g.rhdr, g.rhdrn, 0) ; + tipidee_response_header_writeall_G(buffer_1, g.rhdr, g.rhdrn, 0) ; buffer_putsnoflush(buffer_1, "Content-Length: 0\r\nLocation: ") ; buffer_putsnoflush(buffer_1, rd->location) ; if (rd->sub) buffer_putsnoflush(buffer_1, rd->sub) ; diff --git a/src/tipideed/trace.c b/src/tipideed/trace.c index 0e2ccac..1186675 100644 --- a/src/tipideed/trace.c +++ b/src/tipideed/trace.c @@ -19,7 +19,7 @@ int respond_trace (tipidee_rql const *rql, tipidee_headers const *hdr) size_t cl = 0 ; char fmt[SIZE_FMT] ; tipidee_response_status(buffer_1, rql, 200, "OK") ; - tipidee_response_header_writeall_g(buffer_1, g.rhdr, g.rhdrn, 0) ; + tipidee_response_header_writeall_G(buffer_1, g.rhdr, g.rhdrn, 0) ; buffer_putsnoflush(buffer_1, "Content-Type: message/http\r\nContent-Length: ") ; cl += strlen(tipidee_method_tostr(rql->m)) + 1; if (rql->uri.host) cl += 7 + rql->uri.https + strlen(rql->uri.host) ; |