http p2p proxy is now largely working
This commit is contained in:
parent
b391756b32
commit
cc1da2d516
6 changed files with 180 additions and 87 deletions
|
@ -116,11 +116,14 @@ serveGet st su apiver (B64Key k) cu bypass baf startat sec auth = do
|
|||
validityv <- liftIO newEmptyTMVarIO
|
||||
finalv <- liftIO newEmptyTMVarIO
|
||||
annexworker <- liftIO $ async $ inAnnexWorker st $ do
|
||||
let storer _offset len = sendContentWith $ \bs -> do
|
||||
liftIO $ atomically $ putTMVar bsv (len, bs)
|
||||
liftIO $ atomically $ takeTMVar endv
|
||||
liftIO $ signalFullyConsumedByteString $
|
||||
connOhdl $ serverP2PConnection conn
|
||||
let storer _offset len = sendContentWith $ \bs -> liftIO $ do
|
||||
atomically $ putTMVar bsv (len, bs)
|
||||
atomically $ takeTMVar endv
|
||||
case serverP2PConnection conn of
|
||||
Just c ->
|
||||
signalFullyConsumedByteString $
|
||||
connOhdl c
|
||||
Nothing -> noop
|
||||
return $ \v -> do
|
||||
liftIO $ atomically $ putTMVar validityv v
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue