]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: spoe: don't create a dummy listener for outgoing connections
authorWilly Tarreau <w@1wt.eu>
Thu, 22 Dec 2016 14:59:02 +0000 (15:59 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 22 Dec 2016 22:26:37 +0000 (23:26 +0100)
commit5820a3669031b2f4de58577953ed3135aaaa1f62
tree9deb8e9f3e45ba620e72089964d5e7661715a6bc
parenta12dde04e00330e309aefe7822b8429eb2843944
MEDIUM: spoe: don't create a dummy listener for outgoing connections

The code currently creates a listener only to ensure that sess->li is
properly populated, and to retrieve the frontend (which is also available
directly from the session).

It turns out that the current infrastructure (for a large part) already
supports not having any listener on a session (since Lua does the same),
except for the following places which were not yet converted :

  - session_count_new() : used by session_accept_fd, ie never for spoe
  - session_accept_fd() : never used here, an applet initiates the session
  - session_prepare_log_prefix() : embryonic sessions only, thus unused
  - session_kill_embryonic() : same
  - conn_complete_session() : same
  - build_log_line() for fields %cp, %fp and %ft : unused here but may change
  - http_wait_for_request() and subsequent functions : unused here

Thus for now it's as safe to run SPOE without listener as it is for Lua,
and this was an obstacle against some cleanups of the listener code. The
places above should be plugged so that it becomes save over the long term
as well.

An alternative in the future might be to create a dummy listener that
outgoing connections could use just to avoid keeping a null here.
src/flt_spoe.c