MEDIUM: session: factor out duplicated code for conn_complete_session
authorWilly Tarreau <w@1wt.eu>
Fri, 15 Sep 2017 08:06:28 +0000 (10:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 Sep 2017 09:49:52 +0000 (11:49 +0200)
commit0c4ed35225080118466e574ff310c8b37a308496
treec064982ae0856ba75f1fce78df0e0a9fe555f04f
parenteaa7e44ad749f0ff689f4cf07f762abcf20d1d6c
MEDIUM: session: factor out duplicated code for conn_complete_session

session_accept_fd() may either successfully complete a session creation,
or defer it to conn_complete_session() depending of whether a handshake
remains to be performed or not. The problem is that all the code after
the handshake was duplicated between the two functions.

This patch make session_accept_fd() synchronously call
conn_complete_session() to finish the session creation. It is only needed
to check if the session's task has to be released or not at the end, which
is fairly minimal. This way there is now a single place where the sessions
are created.
src/session.c