addurl: Register transfer so the webapp can see it.

* addurl: Register transfer so the webapp can see it.
* addurl: Automatically retry downloads that fail, as long as some
  additional content was downloaded.
This commit is contained in:
Joey Hess 2013-04-11 16:14:17 -04:00
parent 9bbd31b276
commit 1eb3fff787
3 changed files with 31 additions and 4 deletions

View file

@ -51,6 +51,7 @@ transferPollerThread = namedThread "TransferPoller" $ do
maybe noop (newsize t info . bytesComplete) mi
newsize t info sz
| bytesComplete info /= sz && isJust sz =
| bytesComplete info /= sz && isJust sz = do
liftIO $ print ("alterTransferInfo called", sz)
alterTransferInfo t $ \i -> i { bytesComplete = sz }
| otherwise = noop