diff --git a/src/proto_http.c b/src/proto_http.c index 2ce67869d..16b2f075d 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -3126,7 +3126,9 @@ int process_srv(struct session *t) } #endif /* if the user wants to log as soon as possible, without counting - bytes from the server, then this is the right moment. */ + * bytes from the server, then this is the right moment. We have + * to temporarily assign bytes_out to log what we currently have. + */ if (t->fe->to_log && !(t->logs.logwait & LW_BYTES)) { t->logs.t_close = t->logs.t_data; /* to get a valid end date */ t->logs.bytes_out = txn->rsp.eoh; @@ -3134,6 +3136,7 @@ int process_srv(struct session *t) http_sess_log(t); else tcp_sess_log(t); + t->logs.bytes_out = 0; } /* Note: we must not try to cheat by jumping directly to DATA,