summaryrefslogtreecommitdiff
path: root/src/libtipidee/tipidee_log_resource.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-10-18 13:07:23 +0000
committerLaurent Bercot <ska@appnovation.com>2023-10-18 13:07:23 +0000
commit1a7e3d00588725da3d8764fa9d624bc8611be070 (patch)
tree65d28b52bd1d4ccdbeb418d4d681b1999ed46b7a /src/libtipidee/tipidee_log_resource.c
parent24fb88dbb023ae08adc9989bf19e0c6c569a6607 (diff)
downloadtipidee-1a7e3d00588725da3d8764fa9d624bc8611be070.tar.xz
Add infrastructure for custom error files
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libtipidee/tipidee_log_resource.c')
-rw-r--r--src/libtipidee/tipidee_log_resource.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libtipidee/tipidee_log_resource.c b/src/libtipidee/tipidee_log_resource.c
index b730612..75196b0 100644
--- a/src/libtipidee/tipidee_log_resource.c
+++ b/src/libtipidee/tipidee_log_resource.c
@@ -6,9 +6,9 @@
#include <tipidee/log.h>
-void tipidee_log_resource (uint32_t v, tipidee_rql const *rql, char const *docroot, char const *file, tipidee_resattr const *ra)
+void tipidee_log_resource (uint32_t v, tipidee_rql const *rql, char const *file, tipidee_resattr const *ra, char const *infopath)
{
- char const *a[8] = { PROG, ": info:" } ;
+ char const *a[10] = { PROG, ": info:" } ;
size_t m = 2 ;
if (!(v & TIPIDEE_LOG_RESOURCE)) return ;
if (v & TIPIDEE_LOG_HOSTASPREFIX)
@@ -16,11 +16,14 @@ void tipidee_log_resource (uint32_t v, tipidee_rql const *rql, char const *docro
a[m++] = " host " ;
a[m++] = rql->uri.host ;
}
- a[m++] = " resource docroot " ;
- a[m++] = docroot ;
- a[m++] = " file " ;
+ a[m++] = " resource " ;
a[m++] = file ;
a[m++] = " type " ;
a[m++] = ra->iscgi ? ra->isnph ? "nph" : "cgi" : ra->content_type ;
+ if (ra->iscgi && infopath)
+ {
+ a[m++] = " path_info /" ;
+ a[m++] = infopath ;
+ }
strerr_warnv(a, m) ;
}