From f41d4b15ee74498f0f4249f8edbc373270cab1fc Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sat, 28 Apr 2007 23:26:14 +0200 Subject: [PATCH] [MINOR] tell the compiler that debug more is unlikely to happen In process_session(), add unlikely() around debug code. --- src/proto_http.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/proto_http.c b/src/proto_http.c index 492d8b81a..4c58e5e21 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -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,