snapframework/snap-server — pull request #20 by jaspervdj (2012-01-31 17:26:02+00:00)
Title: Catch abrupt SSL connection termination

I decided to handle this through a pull request because there might be some discussion.

This is mostly related to WebSockets and other long-living connections over SSL. When the user closes the browser, the `HsOpenSSL` library throws a `ConnectionAbruptlyTerminated`. Without this patch, this exception bubbles up to the thread handling the connection, which is then killed. This is obviously a bad thing for handlers which still need to do some cleanup work after the connection is closed (e.g. the WebSockets library).