summaryrefslogtreecommitdiff
path: root/src/libtipidee/tipidee_log_request.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libtipidee/tipidee_log_request.c')
-rw-r--r--src/libtipidee/tipidee_log_request.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/libtipidee/tipidee_log_request.c b/src/libtipidee/tipidee_log_request.c
index 666297d..a789ca5 100644
--- a/src/libtipidee/tipidee_log_request.c
+++ b/src/libtipidee/tipidee_log_request.c
@@ -11,8 +11,8 @@
void tipidee_log_request (uint32_t v, tipidee_rql const *rql, char const *referrer, char const *ua, stralloc *sa)
{
- char const *a[14] = { "info: request " } ;
- size_t m = 1 ;
+ char const *a[16] = { PROG, ": info:" } ;
+ size_t m = 2 ;
size_t start = sa->len ;
size_t refpos = start, uapos = start ;
if (!(v & TIPIDEE_LOG_REQUEST)) return ;
@@ -27,9 +27,18 @@ void tipidee_log_request (uint32_t v, tipidee_rql const *rql, char const *referr
uapos = sa->len ;
if (!string_quotes(sa, ua) || !stralloc_0(sa)) goto err ;
}
+ if (v & TIPIDEE_LOG_HOSTASPREFIX)
+ {
+ a[m++] = " host " ;
+ a[m++] = rql->uri.host ;
+ }
+ a[m++] = " request " ;
a[m++] = tipidee_method_tostr(rql->m) ;
- a[m++] = " host " ;
- a[m++] = rql->uri.host ;
+ if (!(v & TIPIDEE_LOG_HOSTASPREFIX))
+ {
+ a[m++] = " host " ;
+ a[m++] = rql->uri.host ;
+ }
a[m++] = " path " ;
a[m++] = sa->s + start ;
if (rql->uri.query)