summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-02-24 21:29:37 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-02-24 21:29:37 -0400
commitb6fb2e3a3384d2b9a92002aaf26c0c0d535ee4d3 (patch)
tree9dca4e7d6168983ebc0497672c4bdf6de7a82f31 /Remote
parentd2ff4e12d0ae0d32263e258ea7c2a283d1d92149 (diff)
Make annex.web-options be used in several places that call curl.
Diffstat (limited to 'Remote')
-rw-r--r--Remote/Git.hs16
-rw-r--r--Remote/Web.hs4
2 files changed, 10 insertions, 10 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index d714cfec5..f3aa2b7f1 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -158,9 +158,7 @@ tryGitConfigRead r
| haveconfig r' -> return r'
| otherwise -> configlist_failed
Left _ -> configlist_failed
- | Git.repoIsHttp r = do
- headers <- getHttpHeaders
- store $ geturlconfig headers
+ | Git.repoIsHttp r = store geturlconfig
| Git.GCrypt.isEncrypted r = handlegcrypt =<< getConfigMaybe (remoteConfig r "uuid")
| Git.repoIsUrl r = return r
| otherwise = store $ safely $ onLocal r $ do
@@ -185,11 +183,12 @@ tryGitConfigRead r
return $ Right r'
Left l -> return $ Left l
- geturlconfig headers = do
+ geturlconfig = do
+ (headers, options) <- getHttpHeadersOptions
ua <- Url.getUserAgent
v <- liftIO $ withTmpFile "git-annex.tmp" $ \tmpfile h -> do
hClose h
- ifM (Url.downloadQuiet (Git.repoLocation r ++ "/config") headers [] tmpfile ua)
+ ifM (Url.downloadQuiet (Git.repoLocation r ++ "/config") headers options tmpfile ua)
( pipedconfig "git" [Param "config", Param "--null", Param "--list", Param "--file", File tmpfile]
, return $ Left undefined
)
@@ -255,14 +254,15 @@ tryGitConfigRead r
-}
inAnnex :: Remote -> Key -> Annex (Either String Bool)
inAnnex rmt key
- | Git.repoIsHttp r = checkhttp =<< getHttpHeaders
+ | Git.repoIsHttp r = checkhttp
| Git.repoIsUrl r = checkremote
| otherwise = checklocal
where
r = repo rmt
- checkhttp headers = do
+ checkhttp = do
showChecking r
- ifM (anyM (\u -> Url.withUserAgent $ Url.checkBoth u headers (keySize key)) (keyUrls rmt key))
+ (headers, options) <- getHttpHeadersOptions
+ ifM (anyM (\u -> Url.withUserAgent $ Url.checkBoth u headers options (keySize key)) (keyUrls rmt key))
( return $ Right True
, return $ Left "not found"
)
diff --git a/Remote/Web.hs b/Remote/Web.hs
index 2863d9d5e..d41b12b6a 100644
--- a/Remote/Web.hs
+++ b/Remote/Web.hs
@@ -117,9 +117,9 @@ checkKey' key us = firsthit us (Right False) $ \u -> do
return $ Left "quvi support needed for this url"
#endif
DefaultDownloader -> do
- headers <- getHttpHeaders
+ (headers, options) <- getHttpHeadersOptions
Url.withUserAgent $ catchMsgIO .
- Url.checkBoth u' headers (keySize key)
+ Url.checkBoth u' headers options (keySize key)
where
firsthit [] miss _ = return miss
firsthit (u:rest) _ a = do