BUG/MAJOR: lua/socket: resources not detroyed when the socket is aborted
authorThierry FOURNIER <thierry.fournier@ozon.io>
Sun, 16 Jul 2017 18:48:54 +0000 (20:48 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 18 Jul 2017 04:41:33 +0000 (06:41 +0200)
commitb13b20a19aacb039a33f886e38a181b00c9a6d41
treea6ee26689bcb629fceb0950cfeb5f68c37aa2865
parent75d0208009c3189b5d10793e08f27dd62a76c3ae
BUG/MAJOR: lua/socket: resources not detroyed when the socket is aborted

In some cases, the socket is misused. The user can open socket and never
close it, or open the socket and close it without sending data. This
causes resources leak on all resources associated to the stream (buffer,
spoe, ...)

This is caused by the stream_shutdown function which is called outside
of the stream execution process. Sometimes, the shtudown is required
while the stream is not started, so the cleanup is ignored.

This patch change the shutdown mode of the session. Now if the session is
no longer used and the Lua want to destroy it, it just set a destroy flag
and the session kill itself.

This patch should be backported in 1.6 and 1.7
include/types/applet.h
src/hlua.c