git-annex/P2P
Joey Hess e95747a149
fix handling of corrupted data received from git remote
Recover from corrupted content being received from a git remote due eg to a
wire error, by deleting the temporary file when it fails to verify. This
prevents a retry from failing again.

Reversion introduced in version 8.20210903, when incremental verification
was added.

Only the git remote seems to be affected, although it is certianly
possible that other remotes could later have the same issue. This only
affects things passed to getViaTmp that return (False, UnVerified) due to
verification failing. As far as getViaTmp can tell, that could just as well
mean that the transfer failed in a way that would resume, so it cannot
delete the temp file itself. Remote.Git and P2P.Annex use getViaTmp internally,
while other remotes do not, which is why only it seems affected.

A better fix perhaps would be to improve the types of the callback
passed to getViaTmp, so that some other value could be used to indicate
the state where the transfer succeeded but verification failed.

Sponsored-by: Boyd Stephen Smith Jr.
2022-01-07 13:25:33 -04:00
..
Address.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Annex.hs fix handling of corrupted data received from git remote 2022-01-07 13:25:33 -04:00
Auth.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
IO.hs switch from hslogger to purpose-built Utility.Debug 2021-04-05 13:40:31 -04:00
Protocol.hs refactor 2021-08-18 13:19:02 -04:00