summaryrefslogtreecommitdiff
path: root/src/tipideed/responses.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-10-24 12:38:53 +0000
committerLaurent Bercot <ska@appnovation.com>2023-10-24 12:38:53 +0000
commit305385e06f90ca3216e1aa4e43b20dd7d53c1222 (patch)
tree899d3460b511567889d5e5d78f77931af572b5fb /src/tipideed/responses.c
parent37d2f8cb438f68eaa1da8a56ea9ce5023091f128 (diff)
downloadtipidee-305385e06f90ca3216e1aa4e43b20dd7d53c1222.tar.xz
Make the switch to custom headers
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/tipideed/responses.c')
-rw-r--r--src/tipideed/responses.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tipideed/responses.c b/src/tipideed/responses.c
index 81b8315..8155b55 100644
--- a/src/tipideed/responses.c
+++ b/src/tipideed/responses.c
@@ -23,7 +23,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, 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") ;
@@ -79,7 +79,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), 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) ;
@@ -88,7 +88,7 @@ void response_error (tipidee_rql const *rql, char const *docroot, unsigned int s
}
}
- tipidee_response_error_nofile_g(buffer_1, rql, status, dt.reason, dt.text, 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))
@@ -112,7 +112,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_common_put_g(buffer_1, 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) ;
@@ -129,7 +129,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_common_put_g(buffer_1, 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) ;