]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: proto_reverse_connect: fix FD leak on connection error
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 29 Sep 2023 14:04:21 +0000 (16:04 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 29 Sep 2023 16:02:36 +0000 (18:02 +0200)
commit6118590e9526c826b5087d9a6f6788e98574210a
treecaff0f4d371a64a629d4eec6b23087cb2a427595
parentb3dcd59f8d0c519b66e028ee8de7f12a0095e251
BUG/MINOR: proto_reverse_connect: fix FD leak on connection error

Listener using "rev@" address is responsible to setup connection and
reverse it using a server instance. If an error occured before reversal
is completed, proper freeing must be taken care of by the listener as no
session exists for this.

Currently, there is two locations where a connection is freed on error
before reversal inside reverse_connect protocol. Both of these were
incomplete as several function must be used to ensure connection is
properly freed. This commit fixes this by reusing the same cleaning
mechanism used inside H2 multiplexer.

One of the biggest drawback before this patch was that connection FD was
not properly removed from fdtab which caused a file-descriptor leak.

No need to backport this.
src/proto_reverse_connect.c