MINOR: log: Always access the stream-int via the conn-stream
To be able to move the stream-interface from the stream to the conn-stream,
all access to the SI is done via the conn-stream. This patch is limited to
the log part.
diff --git a/src/log.c b/src/log.c
index 2c8d20b..3e20c1c 100644
--- a/src/log.c
+++ b/src/log.c
@@ -2102,7 +2102,7 @@
break;
case LOG_FMT_CLIENTIP: // %ci
- addr = (s ? si_src(&s->si[0]) : sess_src(sess));
+ addr = (s ? si_src(cs_si(s->csf)) : sess_src(sess));
if (addr)
ret = lf_ip(tmplog, (struct sockaddr *)addr, dst + maxsize - tmplog, tmp);
else
@@ -2115,7 +2115,7 @@
break;
case LOG_FMT_CLIENTPORT: // %cp
- addr = (s ? si_src(&s->si[0]) : sess_src(sess));
+ addr = (s ? si_src(cs_si(s->csf)) : sess_src(sess));
if (addr) {
/* sess->listener is always defined when the session's owner is an inbound connections */
if (addr->ss_family == AF_UNIX)
@@ -2133,7 +2133,7 @@
break;
case LOG_FMT_FRONTENDIP: // %fi
- addr = (s ? si_dst(&s->si[0]) : sess_dst(sess));
+ addr = (s ? si_dst(cs_si(s->csf)) : sess_dst(sess));
if (addr)
ret = lf_ip(tmplog, (struct sockaddr *)addr, dst + maxsize - tmplog, tmp);
else
@@ -2146,7 +2146,7 @@
break;
case LOG_FMT_FRONTENDPORT: // %fp
- addr = (s ? si_dst(&s->si[0]) : sess_dst(sess));
+ addr = (s ? si_dst(cs_si(s->csf)) : sess_dst(sess));
if (addr) {
/* sess->listener is always defined when the session's owner is an inbound connections */
if (addr->ss_family == AF_UNIX)
@@ -2602,9 +2602,9 @@
case LOG_FMT_RETRIES: // %rq
if (s_flags & SF_REDISP)
LOGCHAR('+');
- ret = ltoa_o(((s && s->si[1].conn_retries > 0)
- ? (be->conn_retries - s->si[1].conn_retries)
- : ((s && s->si[1].state != SI_ST_INI) ? be->conn_retries : 0)),
+ ret = ltoa_o(((s && cs_si(s->csb)->conn_retries > 0)
+ ? (be->conn_retries - cs_si(s->csb)->conn_retries)
+ : ((s && cs_si(s->csb)->state != SI_ST_INI) ? be->conn_retries : 0)),
tmplog, dst + maxsize - tmplog);
if (ret == NULL)
goto out;
@@ -3066,7 +3066,7 @@
err = (s->flags & SF_REDISP) ||
((s->flags & SF_ERR_MASK) > SF_ERR_LOCAL) ||
(((s->flags & SF_ERR_MASK) == SF_ERR_NONE) &&
- (s->si[1].conn_retries != s->be->conn_retries)) ||
+ (cs_si(s->csb)->conn_retries != s->be->conn_retries)) ||
((sess->fe->mode == PR_MODE_HTTP) && s->txn && s->txn->status >= 500);
if (!err && (sess->fe->options2 & PR_O2_NOLOGNORM))