Avoid running annex.http-headers-command more than once.
This commit is contained in:
parent
98cc34c211
commit
2ec07bc29f
11 changed files with 31 additions and 28 deletions
|
@ -207,7 +207,8 @@ downloadTorrentFile u = do
|
|||
misctmp <- fromRepo gitAnnexTmpMiscDir
|
||||
withTmpFileIn misctmp "torrent" $ \f h -> do
|
||||
liftIO $ hClose h
|
||||
ok <- Url.withUrlOptions $ Url.download u f
|
||||
ok <- Url.withUrlOptions $
|
||||
liftIO . Url.download u f
|
||||
when ok $
|
||||
liftIO $ renameFile f torrent
|
||||
return ok
|
||||
|
|
|
@ -683,7 +683,7 @@ checkKeyUrl :: Git.Repo -> CheckPresent
|
|||
checkKeyUrl r k = do
|
||||
showChecking r
|
||||
us <- getWebUrls k
|
||||
anyM (\u -> withUrlOptions $ checkBoth u (keySize k)) us
|
||||
anyM (\u -> withUrlOptions $ liftIO . checkBoth u (keySize k)) us
|
||||
|
||||
getWebUrls :: Key -> Annex [URLString]
|
||||
getWebUrls key = filter supported <$> getUrls key
|
||||
|
|
|
@ -248,8 +248,7 @@ tryGitConfigRead autoinit r
|
|||
return $ Right r'
|
||||
Left l -> return $ Left l
|
||||
|
||||
geturlconfig = do
|
||||
uo <- Url.getUrlOptions
|
||||
geturlconfig = Url.withUrlOptions $ \uo -> do
|
||||
v <- liftIO $ withTmpFile "git-annex.tmp" $ \tmpfile h -> do
|
||||
hClose h
|
||||
let url = Git.repoLocation r ++ "/config"
|
||||
|
|
|
@ -108,7 +108,7 @@ checkKey' key us = firsthit us (Right False) $ \u -> do
|
|||
case downloader of
|
||||
YoutubeDownloader -> youtubeDlCheck u'
|
||||
_ -> do
|
||||
Url.withUrlOptions $ catchMsgIO .
|
||||
Url.withUrlOptions $ liftIO . catchMsgIO .
|
||||
Url.checkBoth u' (keySize key)
|
||||
where
|
||||
firsthit [] miss _ = return miss
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue