fix serveGet hang

This came down to SendBytes waiting on the waitv. Nothing ever filled
it.

Only Annex.Proxy needs the waitv, and it handles filling it. So make it
optional.
This commit is contained in:
Joey Hess 2024-07-11 07:46:52 -04:00
parent 80fb5445b5
commit 3b37b9e53f
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 34 additions and 45 deletions

View file

@ -107,23 +107,16 @@ runLocal runst runner a = case a of
ProtoFailureMessage "Transfer failed"
let consumer' b ti = do
validator <- consumer b
liftIO $ print "got validator"
indicatetransferred ti
liftIO $ print "indicatetransferred ti done"
return validator
runner getb >>= \case
Left e -> giveup $ describeProtoFailure e
Right b -> checktransfer (\ti -> Right <$> consumer' b ti) fallback >>= \case
Left e -> return (Left e)
Right validator -> do
liftIO $ print "running validity check"
Right validator ->
runner validitycheck >>= \case
Right v -> do
liftIO $ print ("calling validator 1", v)
Right <$> validator v
_ -> do
liftIO $ print "calling validator nothing"
Right <$> validator Nothing
Right v -> Right <$> validator v
_ -> Right <$> validator Nothing
case v of
Left e -> return $ Left $ ProtoFailureException e
Right (Left e) -> return $ Left e