]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: http: use conn_init() to reinitialize the server connection
authorWilly Tarreau <w@1wt.eu>
Mon, 14 Oct 2013 21:46:46 +0000 (23:46 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 9 Dec 2013 14:40:23 +0000 (15:40 +0100)
It's safer and easier to proceed using this function which sets all
the required fields.

src/proto_http.c

index af96f4119dfdb77c42ef9189941273eeff810081..61ce7bab51e40abbd8aa77e497aa405ffc8abcd5 100644 (file)
@@ -4292,12 +4292,10 @@ void http_end_txn_clean_session(struct session *s)
        s->target = NULL;
 
        /* reinitialize the connection to the server */
+       conn_init(s->req->cons->conn);
+
        s->req->cons->state     = s->req->cons->prev_state = SI_ST_INI;
        s->req->cons->end = NULL;
-       s->req->cons->conn->obj_type = OBJ_TYPE_CONN;
-       s->req->cons->conn->t.sock.fd = -1; /* just to help with debugging */
-       s->req->cons->conn->flags = CO_FL_NONE;
-       s->req->cons->conn->err_code = CO_ER_NONE;
        s->req->cons->err_type  = SI_ET_NONE;
        s->req->cons->conn_retries = 0;  /* used for logging too */
        s->req->cons->exp       = TICK_ETERNITY;