]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] tell the compiler that debug more is unlikely to happen
authorWilly Tarreau <w@1wt.eu>
Sat, 28 Apr 2007 21:26:14 +0000 (23:26 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 29 Apr 2007 11:44:48 +0000 (13:44 +0200)
In process_session(), add unlikely() around debug code.

src/proto_http.c

index 492d8b81a93a3d7ffdfee874124e67e0e28339c6..4c58e5e216c14fb23475a16363fe608809905ddd 100644 (file)
@@ -544,7 +544,7 @@ int process_session(struct task *t)
                //fprintf(stderr,"after_srv:cli=%d, srv=%d\n", s->cli_state, s->srv_state);
        } while (fsm_resync);
 
-       if (s->cli_state != CL_STCLOSE || s->srv_state != SV_STCLOSE) {
+       if (likely(s->cli_state != CL_STCLOSE || s->srv_state != SV_STCLOSE)) {
                s->req->flags &= BF_CLEAR_READ & BF_CLEAR_WRITE;
                s->rep->flags &= BF_CLEAR_READ & BF_CLEAR_WRITE;
 
@@ -573,7 +573,8 @@ int process_session(struct task *t)
                s->be->beconn--;
        actconn--;
     
-       if ((global.mode & MODE_DEBUG) && (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))) {
+       if (unlikely((global.mode & MODE_DEBUG) &&
+                    (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE)))) {
                int len;
                len = sprintf(trash, "%08x:%s.closed[%04x:%04x]\n",
                              s->uniq_id, s->be->id,