move the p2phttp server state map into a data type

This commit is contained in:
Joey Hess 2024-11-21 12:24:14 -04:00
parent d7ed99a55f
commit 6bdf4a85fb
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 38 additions and 32 deletions

View file

@ -110,9 +110,12 @@ seek o = getAnnexWorkerPool $ \workerpool ->
where
go workerpool servinguuids acquireconn = liftIO $ do
authenv <- getAuthEnv
st <- mkP2PHttpServerState acquireconn workerpool $
st <- mkPerRepoServerState acquireconn workerpool $
mkGetServerMode authenv o
let mst = M.fromList $ zip servinguuids (repeat st)
let mst = P2PHttpServerState
{ servedRepos = M.fromList $
zip servinguuids (repeat st)
}
let settings = Warp.setPort port $ Warp.setHost host $
Warp.defaultSettings
case (certFileOption o, privateKeyFileOption o) of