network-simple-tls 0.2.0 → 0.2.1
raw patch · 3 files changed
+49/−3 lines, 3 files
Files
- changelog.md +40/−0
- network-simple-tls.cabal +2/−2
- src/Network/Simple/TCP/TLS.hs +7/−1
+ changelog.md view
@@ -0,0 +1,40 @@+# Version 0.2.1++* Ensure that the Socket TLS backend always receive the expected number+ of bytes. This issue showed up as the following exception previously:++ Error_Packet "partial packet: expecting 100 bytes, got: 6"+++# Version 0.2.0++* Re-export `Socket`, `SockAddr`, `HostName` and `ServiceName` from+ `Network.Socket` at `Network.Simple.TCP.TLS`.++* Re-export `Context` from `Network.TLS` at `Network.Simple.TCP.TLS`.++* Generalize the `IO` monad by using `MonadIO` and `MonadCatch` (from+ the `exceptions` library).++* Added `makeClientContext`, `makeServerContext` and `useTlsThenClose`.++* Use `Socket` as a TLS backend instead of `Handle`.++* Drop dependency on `monad-random-api` in favour of `monad-random`.++* Dependency bumps.+++# Version 0.1.1.0++* Export 'Network.Socket.withSocketsDo' from 'Network.Simple.TCP.TLS'.+++# Version 0.1.0.1++* Dependency bumps.+++# Version 0.1.0.0++* First release.
network-simple-tls.cabal view
@@ -1,5 +1,5 @@ name: network-simple-tls-version: 0.2.0+version: 0.2.1 synopsis: Simple interface to TLS secured network sockets. description: Simple interface to TLS secured network sockets. homepage: https://github.com/k0001/network-simple-tls@@ -12,7 +12,7 @@ category: Network build-type: Simple cabal-version: >=1.8-extra-source-files: README.md PEOPLE+extra-source-files: README.md PEOPLE changelog.md source-repository head type: git
src/Network/Simple/TCP/TLS.hs view
@@ -528,4 +528,10 @@ -- | Makes an TLS context `T.Backend` from a `Socket`. socketBackend :: Socket -> T.Backend socketBackend sock = do- T.Backend (return ()) (S.closeSock sock) (NSB.sendAll sock) (NSB.recv sock)+ T.Backend (return ()) (S.closeSock sock) (NSB.sendAll sock) recvAll+ where+ recvAll = step B.empty+ where step !acc 0 = return acc+ step !acc n = do+ bs <- NSB.recv sock n+ step (acc `B.append` bs) (n - B.length bs)