]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: log: add a new LW_XPRT flag to pin the transport layer
authorWilly Tarreau <w@1wt.eu>
Fri, 12 Oct 2012 16:01:49 +0000 (18:01 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 12 Oct 2012 18:30:51 +0000 (20:30 +0200)
This flag will have to be set on log tags which require transport layer
information. They will prevent the conn_xprt_close() call from releasing
the transport layer too early.

include/types/log.h
src/session.c

index 02243260bfdaa9fe0bba6a1f3501d1c2568f9f31..70dc9faf5a2f2fdd46e251afb44d9df1df573e89 100644 (file)
@@ -131,6 +131,7 @@ struct logformat_node {
 #define LW_RSPHDR      2048    /* response header(s) */
 #define LW_BCKIP       4096    /* backend IP */
 #define LW_FRTIP       8192    /* frontend IP */
+#define LW_XPRT                16384   /* transport layer information (eg: SSL) */
 
 struct logsrv {
        struct list list;
index 7c218bf80315f77d108d98a4a9e301966000b170..85171037bbb188364063ae43f79d95e29e36a4a2 100644 (file)
@@ -488,6 +488,10 @@ int session_complete(struct session *s)
                goto out_free_rep;
        }
 
+       /* if logs require transport layer information, note it on the connection */
+       if (s->logs.logwait & LW_XPRT)
+               s->si[0].conn.flags |= CO_FL_XPRT_TRACKED;
+
        /* we want the connection handler to notify the stream interface about updates. */
        s->si[0].conn.flags |= CO_FL_WAKE_DATA;