incremental verification for web special remote
Except when configuration makes curl be used. It did not seem worth
trying to tail the file when curl is downloading.
But when an interrupted download is resumed, it does not read the whole
existing file to hash it. Same reason discussed in
commit 7eb3742e4b
; that could take a long
time with no progress being displayed. And also there's an open http
request, which needs to be consumed; taking a long time to hash the file
might cause it to time out.
Also in passing implemented it for git and external special remotes when
downloading from the web. Several others like S3 are within striking
distance now as well.
Sponsored-by: Dartmouth College's DANDI project
This commit is contained in:
parent
88b63a43fa
commit
d154e7022e
15 changed files with 101 additions and 67 deletions
13
Annex/Url.hs
13
Annex/Url.hs
|
@ -34,6 +34,7 @@ module Annex.Url (
|
|||
import Annex.Common
|
||||
import qualified Annex
|
||||
import qualified Utility.Url as U
|
||||
import Utility.Hash (IncrementalVerifier)
|
||||
import Utility.IPAddress
|
||||
#ifdef WITH_HTTP_CLIENT_RESTRICTED
|
||||
import Network.HTTP.Client.Restricted
|
||||
|
@ -172,15 +173,15 @@ checkBoth url expected_size uo =
|
|||
Right r -> return r
|
||||
Left err -> warning err >> return False
|
||||
|
||||
download :: MeterUpdate -> U.URLString -> FilePath -> U.UrlOptions -> Annex Bool
|
||||
download meterupdate url file uo =
|
||||
liftIO (U.download meterupdate url file uo) >>= \case
|
||||
download :: MeterUpdate -> Maybe IncrementalVerifier -> U.URLString -> FilePath -> U.UrlOptions -> Annex Bool
|
||||
download meterupdate iv url file uo =
|
||||
liftIO (U.download meterupdate iv url file uo) >>= \case
|
||||
Right () -> return True
|
||||
Left err -> warning err >> return False
|
||||
|
||||
download' :: MeterUpdate -> U.URLString -> FilePath -> U.UrlOptions -> Annex (Either String ())
|
||||
download' meterupdate url file uo =
|
||||
liftIO (U.download meterupdate url file uo)
|
||||
download' :: MeterUpdate -> Maybe IncrementalVerifier -> U.URLString -> FilePath -> U.UrlOptions -> Annex (Either String ())
|
||||
download' meterupdate iv url file uo =
|
||||
liftIO (U.download meterupdate iv url file uo)
|
||||
|
||||
exists :: U.URLString -> U.UrlOptions -> Annex Bool
|
||||
exists url uo = liftIO (U.exists url uo) >>= \case
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue