extend/ranch — pull request #27 by fishcakez (2013-01-23 00:25:49+00:00)
Title: Fix race condition setting max connections from an integer to infinity

Race condition:
*Async accept sends {accept, Socket} to acceptor
*A process calls ranch_listener:set_max_connections(_, infinity)
*Listener calls ranch_server:remove_connection_counter(self())
*Ets object is deleted and {set_max_conns, infinity} sent to acceptors
*Acceptor receives {accept, Socket} and calls ranch_listener:add_connection/2
*Acceptor fails with badarg because ets object doesn't exist anymore
*Listener receives {add_connection, ConnPid} and (incorrectly) starts monitoring it

This prevents both the acceptor failing and the listener incorrectly adding monitors