summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-02-24 22:00:25 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-02-24 22:00:25 -0400
commit9f9f1decca4a06d81ce97b64ef1a06fda3b8efad (patch)
tree1f207862430497549281d510837dfcd9782f69af /Remote
parentba6f7e1e38063e4b338d6a7537b575411193b2b6 (diff)
add UrlOptions sum type
Diffstat (limited to 'Remote')
-rw-r--r--Remote/Git.hs8
-rw-r--r--Remote/Web.hs6
2 files changed, 5 insertions, 9 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index f3aa2b7f1..d7385ef31 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -184,11 +184,10 @@ tryGitConfigRead r
Left l -> return $ Left l
geturlconfig = do
- (headers, options) <- getHttpHeadersOptions
- ua <- Url.getUserAgent
+ uo <- Url.getUrlOptions
v <- liftIO $ withTmpFile "git-annex.tmp" $ \tmpfile h -> do
hClose h
- ifM (Url.downloadQuiet (Git.repoLocation r ++ "/config") headers options tmpfile ua)
+ ifM (Url.downloadQuiet (Git.repoLocation r ++ "/config") tmpfile uo)
( pipedconfig "git" [Param "config", Param "--null", Param "--list", Param "--file", File tmpfile]
, return $ Left undefined
)
@@ -261,8 +260,7 @@ inAnnex rmt key
r = repo rmt
checkhttp = do
showChecking r
- (headers, options) <- getHttpHeadersOptions
- ifM (anyM (\u -> Url.withUserAgent $ Url.checkBoth u headers options (keySize key)) (keyUrls rmt key))
+ ifM (Url.withUrlOptions $ \uo -> anyM (\u -> Url.checkBoth u (keySize key) uo) (keyUrls rmt key))
( return $ Right True
, return $ Left "not found"
)
diff --git a/Remote/Web.hs b/Remote/Web.hs
index d41b12b6a..ddd1fc1cc 100644
--- a/Remote/Web.hs
+++ b/Remote/Web.hs
@@ -14,7 +14,6 @@ import Types.Remote
import qualified Git
import qualified Git.Construct
import Annex.Content
-import Config
import Config.Cost
import Logs.Web
import Types.Key
@@ -117,9 +116,8 @@ checkKey' key us = firsthit us (Right False) $ \u -> do
return $ Left "quvi support needed for this url"
#endif
DefaultDownloader -> do
- (headers, options) <- getHttpHeadersOptions
- Url.withUserAgent $ catchMsgIO .
- Url.checkBoth u' headers options (keySize key)
+ Url.withUrlOptions $ catchMsgIO .
+ Url.checkBoth u' (keySize key)
where
firsthit [] miss _ = return miss
firsthit (u:rest) _ a = do