network-control 0.1.1 → 0.1.2
raw patch · 3 files changed
+15/−7 lines, 3 files
Files
- Changelog.md +5/−0
- Network/Control/Flow.hs +9/−6
- network-control.cabal +1/−1
Changelog.md view
@@ -1,5 +1,10 @@ # Revision history for network-control +## 0.1.2++* introducing a minimum size for window update+ [#5](https://github.com/kazu-yamamoto/network-control/pull/5)+ ## 0.1.1 * Change defaultMaxData
Network/Control/Flow.hs view
@@ -120,8 +120,9 @@ -- | When an application consumed received data, this function should -- be called to update 'rxfConsumed'. If the available buffer size--- is less than the half of the total buffer size.--- the representation of window size update is returned.+-- is less than the half of the total buffer size AND window size update+-- is greater than 1/8 of the the total buffer size,+-- the representation of the window size update is returned. -- -- @ -- Example:@@ -162,15 +163,14 @@ -> (RxFlow, Maybe Int) -- ^ 'Just' if the size should be informed to the peer. maybeOpenRxWindow consumed fct flow@RxFlow{..}- | available < threshold =- let rxfLimit' = consumed' + rxfBufSize- flow' =+ | available < threshold && winUpdate > minSize =+ let flow' = flow { rxfConsumed = consumed' , rxfLimit = rxfLimit' } update = case fct of- FCTWindowUpdate -> rxfLimit' - rxfLimit+ FCTWindowUpdate -> winUpdate FCTMaxData -> rxfLimit' in (flow', Just update) | otherwise =@@ -179,7 +179,10 @@ where available = rxfLimit - rxfReceived threshold = rxfBufSize `unsafeShiftR` 1+ minSize = rxfBufSize `unsafeShiftR` 3 consumed' = rxfConsumed + consumed+ rxfLimit' = consumed' + rxfBufSize+ winUpdate = rxfLimit' - rxfLimit -- | Checking if received data is acceptable against the -- current window.
network-control.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: network-control-version: 0.1.1+version: 0.1.2 license: BSD-3-Clause license-file: LICENSE maintainer: kazu@iij.ad.jp