curryer-rpc 0.5.1 → 0.5.2
raw patch · 4 files changed
+32/−31 lines, 4 filesdep ~crypton-x509dep ~crypton-x509-storedep ~crypton-x509-systemPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: crypton-x509, crypton-x509-store, crypton-x509-system, streamly, streamly-bytestring, streamly-core
API changes (from Hackage documentation)
- Network.RPC.Curryer.StreamlyTLS: tlsReader :: Context -> Unfold IO Socket Word8
Files
- Changelog.markdown +4/−0
- curryer-rpc.cabal +9/−9
- src/Network/RPC/Curryer/Server.hs +18/−17
- src/Network/RPC/Curryer/StreamlyTLS.hs +1/−5
Changelog.markdown view
@@ -1,3 +1,7 @@+# v0.5.2 (2026-08-24)++* upgrade to streamly 0.11+ # v0.5.1 (2026-01-14) * switch to crypton-asn1-types and upgrade crypton modules to fix compilation error
curryer-rpc.cabal view
@@ -1,5 +1,5 @@ Name: curryer-rpc-Version: 0.5.1+Version: 0.5.2 License: PublicDomain Build-Type: Simple Homepage: https://github.com/agentm/curryer@@ -22,10 +22,10 @@ Build-Depends: base >= 4.12 && <= 4.21 , winery , bytestring- , streamly == 0.10.1- , streamly-core >= 0.2.2+ , streamly == 0.11.1+ , streamly-core >= 0.3.1 -- includes critical fix for pinned arrays- , streamly-bytestring >= 0.2.2+ , streamly-bytestring >= 0.2.3 , network , exceptions , async@@ -42,9 +42,9 @@ , tls >= 2.1.12 , data-default , streaming-commons- , crypton-x509-store >= 1.6.11- , crypton-x509-system >= 1.6.7- , crypton-x509 >= 1.7.7+ , crypton-x509-store >= 1.8.0+ , crypton-x509-system >= 1.8.0+ , crypton-x509 >= 1.8.0 , crypton-asn1-types >= 0.4.1 , unix >= 2.8.0.0 Hs-Source-Dirs: ./src@@ -71,9 +71,9 @@ , network , async , stm- , streamly-core >= 0.1.0+ , streamly-core , bytestring- , streamly-bytestring >= 0.2.1+ , streamly-bytestring , directory , process , filepath
src/Network/RPC/Curryer/Server.hs view
@@ -4,12 +4,17 @@ module Network.RPC.Curryer.Server where import qualified Streamly.Data.Stream.Prelude as SP import Streamly.Data.Stream as Stream hiding (foldr)-import Streamly.Internal.Data.Array (pinnedCreateOf)- import Streamly.Network.Socket as SSock+import Streamly.Data.Parser as P+import qualified Streamly.Data.Stream.Prelude as P+import qualified Streamly.External.ByteString as StreamlyBS+import Streamly.Data.Stream.Prelude as Stream hiding (foldr)+import Streamly.Internal.Data.Binary.Parser (word32be)+import qualified Streamly.Data.Array as A+import Streamly.Data.Fold as FL hiding (foldr)+ import Network.Socket as Socket import Network.Socket.ByteString as Socket-import Streamly.Data.Parser as P import Codec.Winery import Codec.Winery.Internal (varInt, decodeVarInt, getBytes) import GHC.Generics@@ -22,13 +27,6 @@ import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as BSL import qualified Data.ByteString.FastBuilder as BB-import Streamly.Data.Fold as FL hiding (foldr)---import qualified Streamly.Internal.Data.Stream.IsStream as P-import qualified Streamly.Data.Stream.Prelude as P-import qualified Streamly.External.ByteString as StreamlyBS-import Streamly.Data.Stream.Prelude as Stream hiding (foldr)-import Streamly.Internal.Data.Binary.Parser (word32be)-import qualified Streamly.Data.Unfold as UF import qualified Data.Binary as B import qualified Data.UUID as UUIDBase import qualified Data.UUID.V4 as UUIDBase@@ -249,7 +247,7 @@ if c == 0 then pure mempty else do- ps <- P.takeEQ c (pinnedCreateOf c)+ ps <- P.takeEQ c (A.createOf c) -- traceShowM ("envelopeP read bytes", c) let !bs = StreamlyBS.fromArray ps -- traceShowM ("unoptimized bs")@@ -484,14 +482,17 @@ drainSocketMessages :: SocketContext -> EnvelopeHandler -> IO () drainSocketMessages sockCtx envelopeHandler = do- - let socketReader :: UF.Unfold IO Socket Word8- socketReader = case sockCtx of- UnencryptedSocketContext{} -> SSock.reader++ let byteStream :: Stream IO Word8+ byteStream = case sockCtx of+ UnencryptedSocketContext{} ->+ SP.unfold SSock.reader sock EncryptedSocketContext _lsock tlsCtx ->- STLS.tlsReader tlsCtx+ SP.unfold (STLS.chunkTLSReader tlsCtx) sock+ & SP.concatMap A.read sock = lockless (lockingSocket sockCtx)- SP.unfold socketReader sock+ + byteStream & P.parseMany envelopeP & SP.catRights & SP.parMapM (SP.ordered False) envelopeHandler
src/Network/RPC/Curryer/StreamlyTLS.hs view
@@ -6,7 +6,6 @@ --import Control.Monad.IO.Class --import Streamly.Network.Socket (SockSpec) --import Control.Concurrent (MVar, putMVar)-import qualified Streamly.Data.Array as A import Streamly.Internal.Data.Unfold (Unfold(..)) import Streamly.External.ByteString (toArray) import Streamly.Data.Array (Array)@@ -127,10 +126,7 @@ takeMVar var #endif --tlsReader :: TLS.Context -> UF.Unfold IO Socket Word8-tlsReader ctx = UF.many A.reader (chunkTLSReader ctx)- + -- | Read from TLS socket as soon as it is created. chunkTLSReader :: TLS.Context -> UF.Unfold IO Socket (Array Word8) chunkTLSReader ctx = Unfold step inject