[MINOR] call session->do_log() for logging
In order to avoid having to call per-protocol logging function directly
from session.c, it's better to assign the logging function when the session
is created. This also eliminates a test when the function is needed, and
opens the way to more complete logging functions.
diff --git a/src/client.c b/src/client.c
index 78387a1..8e8dc53 100644
--- a/src/client.c
+++ b/src/client.c
@@ -206,6 +206,11 @@
else
s->logs.logwait = p->to_log;
+ if (s->logs.logwait & LW_REQ)
+ s->do_log = http_sess_log;
+ else
+ s->do_log = tcp_sess_log;
+
s->logs.accept_date = date; /* user-visible date for logging */
s->logs.tv_accept = now; /* corrected date for internal use */
tv_zero(&s->logs.tv_request);
@@ -276,7 +281,7 @@
/* we have the client ip */
if (s->logs.logwait & LW_CLIP)
if (!(s->logs.logwait &= ~LW_CLIP))
- tcp_sess_log(s);
+ s->do_log(s);
}
else if (s->cli_addr.ss_family == AF_INET) {
char pn[INET_ADDRSTRLEN], sn[INET_ADDRSTRLEN];