summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincentHanquez <>2017-03-20 22:43:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2017-03-20 22:43:00 (GMT)
commit7ea7389cf1db8898830b162c994ce15c8f2cff74 (patch)
treec50c0a9bd4f691f40880a80dbd6f7817adf5297a
parente798a9ef80c65d229d6f61e58350db36466ad0d0 (diff)
version 0.2.8HEAD0.2.8master
-rw-r--r--Network/Connection.hs4
-rw-r--r--connection.cabal2
2 files changed, 4 insertions, 2 deletions
diff --git a/Network/Connection.hs b/Network/Connection.hs
index a36a952..63a6ab0 100644
--- a/Network/Connection.hs
+++ b/Network/Connection.hs
@@ -368,10 +368,12 @@ throwEOF conn loc =
-- | Close a connection.
connectionClose :: Connection -> IO ()
connectionClose = withBackend backendClose
- where backendClose (ConnectionTLS ctx) = TLS.bye ctx >> TLS.contextClose ctx
+ where backendClose (ConnectionTLS ctx) = ignoreIOExc (TLS.bye ctx) `E.finally` TLS.contextClose ctx
backendClose (ConnectionSocket sock) = N.close sock
backendClose (ConnectionStream h) = hClose h
+ ignoreIOExc action = action `E.catch` \(_ :: E.IOException) -> return ()
+
-- | Activate secure layer using the parameters specified.
--
-- This is typically used to negociate a TLS channel on an already
diff --git a/connection.cabal b/connection.cabal
index 58fa685..5f828d2 100644
--- a/connection.cabal
+++ b/connection.cabal
@@ -1,5 +1,5 @@
Name: connection
-Version: 0.2.7
+Version: 0.2.8
Description:
Simple network library for all your connection need.
.