]> git.kaiwu.me - haproxy.git/commit
MAJOR: stream: don't initialize the stream anymore in stream_accept
authorWilly Tarreau <w@1wt.eu>
Sat, 4 Apr 2015 16:08:21 +0000 (18:08 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 6 Apr 2015 09:37:32 +0000 (11:37 +0200)
commit02a0c0e407da00fe1b847b8c0276f1742bb8d3c4
tree2fc7f3d2d24e1730bd3bab576f8ff4a5cb48bfdc
parent5ecb069c58472ff8fc8a6757affb0474eb19e716
MAJOR: stream: don't initialize the stream anymore in stream_accept

The function now only initializes a session, calls the tcp req connection
rules, and calls stream_complete() to finish initialization. If a handshake
is needed, it is done without allocating the stream at all.

Temporarily, in order to limit the amount of changes, the task allocated
is put into sess->task, and it is used by the connection for the handshake
or is offered to the stream. At this point we set the relation between
sess/task/conn this way :

        orig -- sess  <-- context
         |       ^ +- task -+  |
         v       |          v  |
        conn -- owner       task

The task must not remain in the session and ultimately it is planned to
remove this task pointer from the session because it can be found by
having conn->owner = task, and looping back from sess to conn, and to
find the session from the connection via the task.
include/types/session.h
src/stream.c