It is not guaranteed that the backend connection has an owner. It is set when
the connection is created. But when the connection is moved in a server idle
list, the connection owner is set to NULL and may never be set again. On the
other hand, when a mux is created or when a CS is attached, the session is
always defined. The H1 stream always keep a reference on it when it is
created. Thus, when a bad message is captured we should not rely on the
connection owner to retrieve the session. Instead we should get it from the H1
stream.
static void h1_capture_bad_message(struct h1c *h1c, struct h1s *h1s,
struct h1m *h1m, struct buffer *buf)
{
- struct session *sess = h1c->conn->owner;
+ struct session *sess = h1s->sess;
struct proxy *proxy = h1c->px;
struct proxy *other_end;
union error_snapshot_ctx ctx;