BUILD: mux_fcgi: avoid aliasing of a const struct in traces
fcgi_trace() declares fconn as a const and casts its mbuf array to
(struct buffer*), which rightfully upsets some older compilers. Better
just declare it as a writable variable and get rid of the cast. It's
harmless anyway. This has been there since 2.1 with commit 5c0f859c2
("MINOR: mux-fcgi/trace: Register a new trace source with its events")
and doens't need to be backported though it would not harm either.
diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c
index ba3a546..fa9e3ad 100644
--- a/src/mux_fcgi.c
+++ b/src/mux_fcgi.c
@@ -425,7 +425,7 @@
const void *a1, const void *a2, const void *a3, const void *a4)
{
const struct connection *conn = a1;
- const struct fcgi_conn *fconn = conn ? conn->ctx : NULL;
+ struct fcgi_conn *fconn = conn ? conn->ctx : NULL;
const struct fcgi_strm *fstrm = a2;
const struct htx *htx = a3;
const size_t *val = a4;
@@ -482,8 +482,8 @@
(unsigned int)b_head_ofs(&fconn->dbuf), (unsigned int)b_size(&fconn->dbuf));
if (src->verbosity == FCGI_VERB_COMPLETE ||
(src->verbosity == FCGI_VERB_ADVANCED && (mask & (FCGI_EV_FCONN_SEND|FCGI_EV_TX_RECORD)))) {
- struct buffer *hmbuf = br_head((struct buffer *)fconn->mbuf);
- struct buffer *tmbuf = br_tail((struct buffer *)fconn->mbuf);
+ struct buffer *hmbuf = br_head(fconn->mbuf);
+ struct buffer *tmbuf = br_tail(fconn->mbuf);
chunk_appendf(&trace_buf, " .mbuf=[%u..%u|%u],h=[%u@%p+%u/%u],t=[%u@%p+%u/%u]",
br_head_idx(fconn->mbuf), br_tail_idx(fconn->mbuf), br_size(fconn->mbuf),