@@ -264,6 +264,10 @@ fork :: Settings
264 -> InternalInfo0
264 -> InternalInfo0
266fork set mkConn addr app counter ii0 = settingsFork set $ \ unmask ->
266fork set mkConn addr app counter ii0 = settingsFork set $ \ unmask ->
267+ -- Call the user-supplied on exception code if any
268+ -- exceptions are thrown.
269+ handle (settingsOnException set Nothing) .
267 -- Allocate a new IORef indicating whether the connection has been
271 -- Allocate a new IORef indicating whether the connection has been
268 -- closed, to avoid double-freeing a connection
272 -- closed, to avoid double-freeing a connection
269 withClosedRef $ \ref ->
273 withClosedRef $ \ref ->
@@ -292,10 +296,6 @@ fork set mkConn addr app counter ii0 = settingsFork set $ \ unmask ->
292 -- in the case of all exceptions, so it is safe to one
296 -- in the case of all exceptions, so it is safe to one
293 -- again allow async exceptions.
297 -- again allow async exceptions.
294 in unmask .
298 in unmask .
295− -- Call the user-supplied on exception code if any
296− -- exceptions are thrown.
297− handle (settingsOnException set Nothing) .
299 -- Call the user-supplied code for connection open and close events
299 -- Call the user-supplied code for connection open and close events
300 bracket (onOpen addr) (onClose addr) $ \goingon ->
300 bracket (onOpen addr) (onClose addr) $ \goingon ->