summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-11 13:05:00 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-11 13:05:00 -0400
commite55273da750678b4aa2dd6257a5ca7d8de81c755 (patch)
tree5808d49703687ec5ad695b459233bb1b9d8073f3 /Remote
parent108372d7ca8159264a046992a4467d2460add529 (diff)
url size fixes
addurl: Improve message when adding url with wrong size to existing file. Before the message suggested the url didn't exist. Fixed handling of URL keys that have no recorded size. Before, if the key has no size, the url also had to not declare any size, which was unlikely and wrong, or it was taken to not exist. This probably would mostly affect keys that were added to the annex with addurl --relaxed.
Diffstat (limited to 'Remote')
-rw-r--r--Remote/Git.hs2
-rw-r--r--Remote/Web.hs2
2 files changed, 2 insertions, 2 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index e8ab57281..4cdedd064 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -241,7 +241,7 @@ inAnnex r key
where
checkhttp headers = do
showChecking r
- ifM (anyM (\u -> Url.withUserAgent $ Url.check u headers (keySize key)) (keyUrls r key))
+ ifM (anyM (\u -> Url.withUserAgent $ Url.checkBoth u headers (keySize key)) (keyUrls r key))
( return $ Right True
, return $ Left "not found"
)
diff --git a/Remote/Web.hs b/Remote/Web.hs
index af60beee0..ce420b24d 100644
--- a/Remote/Web.hs
+++ b/Remote/Web.hs
@@ -118,7 +118,7 @@ checkKey' key us = firsthit us (Right False) $ \u -> do
#endif
DefaultDownloader -> do
headers <- getHttpHeaders
- Right <$> Url.withUserAgent (Url.check u' headers $ keySize key)
+ Right <$> Url.withUserAgent (Url.checkBoth u' headers $ keySize key)
where
firsthit [] miss _ = return miss
firsthit (u:rest) _ a = do