Fix connection_life_time broken by authentication_timeout
authorYugo Nagata <nagata@sraoss.co.jp>
Wed, 4 Jan 2017 05:20:24 +0000 (14:20 +0900)
committerYugo Nagata <nagata@sraoss.co.jp>
Wed, 4 Jan 2017 06:50:13 +0000 (15:50 +0900)
commit59526585ff5980bd7f773b5b6b05eabf7e336ed2
tree765d799e637151c5a3cdf467ce006a256c3d311c
parent388e9c1550c001ec6837d0869db72c473ef6c823
Fix connection_life_time broken by authentication_timeout

When authentication_timeout is enabled,
connection_life_time could never be expired, because
alarm(0) is called at reading start-up packet.

When there only one connection pool is used, this
problem doesn't occur because the signal handler
for connection_life_time is always set at the end
of the session. However, if more than one connection
pools exist, the handler isn't set but only the time
to colse the connection is calculated.

To fix it, when authentication_timeout is enabled,
save the signal handler for conneciont_life_time
and the remaining time, and undo the handler when
authentication_timeout is disabled.
src/context/pool_process_context.c
src/include/context/pool_process_context.h
src/protocol/child.c
src/protocol/pool_connection_pool.c