]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] add an analyser state in struct session
authorWilly Tarreau <w@1wt.eu>
Sun, 7 Dec 2008 13:37:09 +0000 (14:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 7 Dec 2008 13:37:09 +0000 (14:37 +0100)
It will be very convenient to have an analyser state in the session.
It will always be initialized to zero. The analysers can make use of
it, but must reset it to zero when they leave.

include/types/session.h
src/client.c

index 83d0a455f7df45bd5c8fed555cc912f9de82d6c0..d37d2ebf65d1ed2eb5178eac348e7a4b980450c3 100644 (file)
@@ -174,6 +174,7 @@ struct session {
        struct server *prev_srv;                /* the server the was running on, after a redispatch, otherwise NULL */
        struct pendconn *pend_pos;              /* if not NULL, points to the position in the pending queue */
        struct http_txn txn;                    /* current HTTP transaction being processed. Should become a list. */
+       int ana_state;                          /* analyser state, used by analysers, always set to zero between them */
        struct {
                int logwait;                    /* log fields waiting to be collected : LW_* */
                struct timeval accept_date;     /* date of the accept() in user date */
index 65ffdaae64f5d89c95c20b4e9f8b2fa9cf9e3784..d3cf47dbde650b1d0e557ab4ee8ac2814d621884 100644 (file)
@@ -171,6 +171,7 @@ int event_accept(int fd) {
                }
 
                s->cli_state = CL_STDATA;
+               s->ana_state = 0;  /* analysers may change it but must reset it upon exit */
                s->req = s->rep = NULL; /* will be allocated later */
 
                s->si[0].state = s->si[0].prev_state = SI_ST_EST;