From 3a9039eee3465bdd2772abc304658b2c0f9b1a6d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 14 Sep 2016 21:30:01 -0400 Subject: chaff only the current object size, not old ones --- Storage.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Storage.hs') diff --git a/Storage.hs b/Storage.hs index 40c0dd4..ded4bbf 100644 --- a/Storage.hs +++ b/Storage.hs @@ -145,13 +145,13 @@ storeChaff hn port = forever $ do -- Prefix "random chaff" to the name to avoid ever using a name -- that a real user might want to use. let sis = shareIdents testModeTunables (Name $ "random chaff:" <> randomname) (KeyFile "random") - mapConcurrently (go sis rng' (concat (repeat knownObjectSizes))) + mapConcurrently (go sis rng') [1..totalObjects (shareParams testModeTunables)] where server = networkStorage Nothing $ Server hn port - go _ _ [] _ = return () - go sis rng (s:sizes) n = do - let (b, rng') = cprgGenerate s rng + objsize = objectSize defaultTunables * shareOverhead defaultTunables + go sis rng n = do + let (b, rng') = cprgGenerate objsize rng let share = Share 0 (StorableObject b) let (is, sis') = nextShareIdents sis let i = S.toList is !! (n - 1) @@ -160,4 +160,4 @@ storeChaff hn port = forever $ do StoreSuccess -> putStr "+" _ -> putStr "!" hFlush stdout - go sis' rng' sizes n + go sis' rng' n -- cgit v1.2.3