Originally, the server code used the regular idle detection mechanism to determine when to close connection. However, this caused issues with long transactions such as large AXFRs. Now the connection will not timeout while in transaction which means a broken connection can cause a transaction to hang for a long time. We need a way to determine this case.
See the discussion on #399 for some more information.