]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: stream-int: implement a very simplistic idle connection manager
authorWilly Tarreau <w@1wt.eu>
Mon, 16 Dec 2013 23:00:28 +0000 (00:00 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 16 Dec 2013 23:00:28 +0000 (00:00 +0100)
commit2737562e43dfdffb0b8155f00feda7af8f7553ea
tree1c447d2908996368412058f48070e04779a14c3d
parent4bfa4228dc82f8f96bc517364fd900bdc5095f0a
MEDIUM: stream-int: implement a very simplistic idle connection manager

Idle connections are not monitored right now. So if a server closes after
a response without advertising it, it won't be detected until a next
request wants to use the connection. This is a bit problematic because
it unnecessarily maintains file descriptors and sockets in an idle
state.

This patch implements a very simple idle connection manager for the stream
interface. It presents itself as an I/O callback. The HTTP engine enables
it when it recycles a connection. If a close or an error is detected on the
underlying socket, it tries to drain as much data as possible from the socket,
detect the close and responds with a close as well, then detaches from the
stream interface.
include/proto/stream_interface.h
src/proto_http.c
src/stream_interface.c