]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: session: mark the handshake as complete earlier
authorWilly Tarreau <w@1wt.eu>
Mon, 5 Nov 2012 23:14:25 +0000 (00:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Nov 2012 21:09:08 +0000 (22:09 +0100)
There is a small waste of CPU cycles when no handshake is required on an
accepted connection, because we had to perform one call to conn_fd_handler()
to mark the connection CONNECTED and to call process_session() again to say
that nothing happened.

By marking the connection CONNECTED when there is no pending handshake, we
avoid this extra call to process_session().

src/session.c

index 04eee61722b1870e27addc71ed0a4d3afe8b893b..6bb44f021afd305b7d5a6e428d7f315236bd7fc7 100644 (file)
@@ -210,7 +210,8 @@ int session_accept(struct listener *l, int cfd, struct sockaddr_storage *addr)
                return 1;
        }
 
-       /* OK let's complete session initialization */
+       /* OK let's complete session initialization since there is no handshake */
+       s->si[0].conn->flags |= CO_FL_CONNECTED;
        ret = session_complete(s);
        if (ret > 0)
                return ret;