packages feed

quic 0.1.16 → 0.1.17

raw patch · 7 files changed

+33/−20 lines, 7 filesdep ~networkPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: network

API changes (from Hackage documentation)

- Network.QUIC.Internal: [outputQ1] :: Connection -> OutputQ1
- Network.QUIC.Internal: putOutput1 :: Connection -> Output -> IO ()
- Network.QUIC.Internal: sendFrames1 :: Connection -> EncryptionLevel -> [Frame] -> IO ()
- Network.QUIC.Internal: type OutputQ1 = TBQueue Output
+ Network.QUIC.Internal: [outputQLim] :: Connection -> OutputQLim
+ Network.QUIC.Internal: outputLimit :: Int
+ Network.QUIC.Internal: putOutputLim :: Connection -> Output -> IO ()
+ Network.QUIC.Internal: sendFramesLim :: Connection -> EncryptionLevel -> [Frame] -> IO ()
+ Network.QUIC.Internal: type OutputQLim = TBQueue Output
- Network.QUIC.Internal: Connection :: ConnState -> DebugLogger -> QLogger -> Hooks -> ~Send -> ~Recv -> RecvQ -> ~IORef UDPSocket -> IORef (IO ()) -> ThreadId -> Rate -> IORef RoleInfo -> IORef VersionInfo -> VersionInfo -> Parameters -> IORef CIDDB -> IORef Parameters -> TVar CIDDB -> InputQ -> CryptoQ -> OutputQ -> OutputQ1 -> MigrationQ -> Shared -> IORef Int -> IORef (IO ()) -> IORef PacketNumber -> IORef StreamTable -> TVar Concurrency -> TVar Concurrency -> IORef Concurrency -> IORef Concurrency -> TVar TxFlow -> IORef RxFlow -> TVar MigrationState -> IORef Microseconds -> TVar Int -> TVar Int -> TVar Bool -> Array EncryptionLevel (TVar [ReceivedPacket]) -> IOArray EncryptionLevel Cipher -> IOArray EncryptionLevel Coder -> IOArray Bool Coder1RTT -> IOArray EncryptionLevel Protector -> IORef (Bool, PacketNumber) -> IORef Negotiated -> IORef AuthCIDs -> IORef AuthCIDs -> IORef (IO ()) -> Buffer -> SizedBuffer -> Buffer -> LDCC -> Connection
+ Network.QUIC.Internal: Connection :: ConnState -> DebugLogger -> QLogger -> Hooks -> ~Send -> ~Recv -> RecvQ -> ~IORef UDPSocket -> IORef (IO ()) -> ThreadId -> Rate -> IORef RoleInfo -> IORef VersionInfo -> VersionInfo -> Parameters -> IORef CIDDB -> IORef Parameters -> TVar CIDDB -> InputQ -> CryptoQ -> OutputQ -> OutputQLim -> MigrationQ -> Shared -> IORef Int -> IORef (IO ()) -> IORef PacketNumber -> IORef StreamTable -> TVar Concurrency -> TVar Concurrency -> IORef Concurrency -> IORef Concurrency -> TVar TxFlow -> IORef RxFlow -> TVar MigrationState -> IORef Microseconds -> TVar Int -> TVar Int -> TVar Bool -> Array EncryptionLevel (TVar [ReceivedPacket]) -> IOArray EncryptionLevel Cipher -> IOArray EncryptionLevel Coder -> IOArray Bool Coder1RTT -> IOArray EncryptionLevel Protector -> IORef (Bool, PacketNumber) -> IORef Negotiated -> IORef AuthCIDs -> IORef AuthCIDs -> IORef (IO ()) -> Buffer -> SizedBuffer -> Buffer -> LDCC -> Connection

Files

ChangeLog.md view
@@ -1,3 +1,11 @@+## 0.1.17++- Garding the new_connection_id attack.++## 0.1.16++- Using tls v2.0.+ ## 0.1.15  - Support customizing ClientHooks and ServerHooks config from tls
Network/QUIC/Connection/Misc.hs view
@@ -26,7 +26,7 @@     readMinIdleTimeout,     setMinIdleTimeout,     sendFrames,-    sendFrames1,+    sendFramesLim,     closeConnection,     abortConnection, ) where@@ -176,8 +176,8 @@ sendFrames :: Connection -> EncryptionLevel -> [Frame] -> IO () sendFrames conn lvl frames = putOutput conn $ OutControl lvl frames $ return () -sendFrames1 :: Connection -> EncryptionLevel -> [Frame] -> IO ()-sendFrames1 conn lvl frames = putOutput1 conn $ OutControl lvl frames $ return ()+sendFramesLim :: Connection -> EncryptionLevel -> [Frame] -> IO ()+sendFramesLim conn lvl frames = putOutputLim conn $ OutControl lvl frames $ return ()  -- | Closing a connection with/without a transport error. --   Internal threads should use this.
Network/QUIC/Connection/Queue.hs view
@@ -31,14 +31,17 @@ putOutput :: Connection -> Output -> IO () putOutput conn out = atomically $ writeTQueue (outputQ conn) out -putOutput1 :: Connection -> Output -> IO ()-putOutput1 conn out = atomically $ do-    ok <- isEmptyTBQueue (outputQ1 conn)+outputLimit :: Int+outputLimit = 10++putOutputLim :: Connection -> Output -> IO ()+putOutputLim conn out = atomically $ do+    len <- fromIntegral <$> lengthTBQueue (outputQLim conn)     -- unless ok, the frames are intentionally dropped.-    when ok $ writeTBQueue (outputQ1 conn) out+    when (len < outputLimit) $ writeTBQueue (outputQLim conn) out  takeOutput1STM :: Connection -> STM Output-takeOutput1STM conn = readTBQueue (outputQ1 conn)+takeOutput1STM conn = readTBQueue (outputQLim conn)  ---------------------------------------------------------------- 
Network/QUIC/Connection/Types.hs view
@@ -217,7 +217,7 @@       inputQ :: InputQ     , cryptoQ :: CryptoQ     , outputQ :: OutputQ-    , outputQ1 :: OutputQ1+    , outputQLim :: OutputQLim     , migrationQ :: MigrationQ     , shared :: Shared     , delayedAckCount :: IORef Int@@ -417,7 +417,7 @@ type InputQ = TQueue Input type CryptoQ = TQueue Crypto type OutputQ = TQueue Output-type OutputQ1 = TBQueue Output+type OutputQLim = TBQueue Output type MigrationQ = TQueue ReceivedPacket  ----------------------------------------------------------------
Network/QUIC/Receiver.hs view
@@ -255,7 +255,7 @@         Nothing -> do             when (isInitiated conn sid) $                 closeConnection StreamStateError "No such stream for STOP_SENDING"-        Just _strm -> sendFrames conn lvl [ResetStream sid err 0]+        Just _strm -> sendFramesLim conn lvl [ResetStream sid err 0] processFrame _ _ (CryptoF _ "") = return () processFrame conn lvl (CryptoF off cdat) = do     when (lvl == RTT0Level) $@@ -373,7 +373,7 @@         closeConnection FrameEncodingError "NEW_CONNECTION_ID parameter error"     when (rpt >= 1) $ do         seqNums <- setPeerCIDAndRetireCIDs conn rpt-        sendFrames conn RTT1Level $ map RetireConnectionID seqNums+        sendFramesLim conn RTT1Level $ map RetireConnectionID seqNums processFrame conn RTT1Level (RetireConnectionID sn) = do     mcidInfo <- retireMyCID conn sn     case mcidInfo of@@ -383,7 +383,7 @@                 unregister <- getUnregister conn                 unregister cid processFrame conn RTT1Level (PathChallenge dat) =-    sendFrames1 conn RTT1Level [PathResponse dat]+    sendFramesLim conn RTT1Level [PathResponse dat] processFrame conn RTT1Level (PathResponse dat) =     -- RTT0Level falls intentionally     checkResponse conn dat
Network/QUIC/Types/Frame.hs view
@@ -107,9 +107,11 @@ inFlight _                    = True  rateControled :: Frame -> Bool-rateControled ResetStream{}   = True-rateControled StopSending{}   = True-rateControled PathChallenge{} = True-rateControled PathResponse{}  = True-rateControled _               = False+rateControled ResetStream{}        = True+rateControled StopSending{}        = True+rateControled PathChallenge{}      = True+rateControled PathResponse{}       = True+rateControled NewConnectionID{}    = True+rateControled RetireConnectionID{} = True+rateControled _                    = False {- FOURMOLU_ENABLE -}
quic.cabal view
@@ -1,6 +1,6 @@ cabal-version:      >=1.10 name:               quic-version:            0.1.16+version:            0.1.17 license:            BSD3 license-file:       LICENSE maintainer:         kazu@iij.ad.jp@@ -139,7 +139,7 @@         stm >= 2.5 && < 2.6,         data-default-class >= 0.1.2 && < 0.2,         fast-logger >= 3.2.2 && < 3.3,-        unix-time >= 0.4.11 && < 0.5,+        unix-time >= 0.4.12 && < 0.5,         iproute >= 1.7.12 && < 1.8,         network >= 3.1.4 && < 3.2,         network-byte-order >= 0.1.7 && < 0.2,