@@ -11,7 +11,7 @@ import Control.Applicative ((<$>),(<*>))
1111import Control.Concurrent (forkIO)
1212import Control.Concurrent.STM
1313import Control.Exception (SomeException, bracket)
14−import Control.Monad (void)
14+import Control.Monad (void, forM_)
1515import Data.ByteString (ByteString)
1616import qualified Data.ByteString as BS
1717import Data.IntMap.Strict (IntMap, IntMap)
@@ -256,6 +256,11 @@ remove (StreamTable ref) k = atomicModifyIORef' ref $ \m ->
256256search :: StreamTable -> M.Key -> IO (Maybe Stream)
257257search (StreamTable ref) k = M.lookup k <$> readIORef ref
258258
259+updateAllStreamWindow :: (WindowSize -> WindowSize) -> StreamTable -> IO ()
260+updateAllStreamWindow adst (StreamTable ref) = do
261+ strms <- M.elems <$> readIORef ref
262+ forM_ strms $ \strm -> atomically $ modifyTVar (streamWindow strm) adst
263+
259264{-# INLINE forkAndEnqueueWhenReady #-}
260265forkAndEnqueueWhenReady :: IO () -> PriorityTree Output -> Output -> Manager -> IO ()
261266forkAndEnqueueWhenReady wait outQ out mgr = bracket setup teardown $ \_ ->