GET from proxied special remote

Working, but lots of room for improvement...

Without streaming, so there is a delay before download begins as the
file is retreived from the special remote.

And when resuming it retrieves the whole file from the special remote
*again*.

Also, if the special remote throws an exception, currently it
shows as "protocol error".
This commit is contained in:
Joey Hess 2024-06-28 15:32:00 -04:00
parent 158d7bc933
commit 2e5af38f86
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 86 additions and 20 deletions

View file

@ -241,10 +241,10 @@ runNet runst conn runner f = case f of
Right b -> runner (next b)
Left e -> return $ Left $
ProtoFailureException e
P2PHandleTMVar mv ->
P2PHandleTMVar mv ->
liftIO (atomically (takeTMVar mv)) >>= \case
Left b -> runner (next b)
Right _m -> return $ Left $
Right _ -> return $ Left $
ProtoFailureMessage "protocol error"
CheckAuthToken _u t next -> do
let authed = connCheckAuth conn t