git-annex/Utility
Joey Hess 92136284b1
avoid hGetMetered 0 closing the handle
This is an edge case, which happened to be triggered by the P2P protocol
seeing DATA 0. When reading 0 bytes, getting an empty string does
not mean the handle has reached EOF.

I verified there was in fact a bug, where get of an empty file followed
by another file would get the empty file and then fail
with "handle is closed". This fixes it.

This commit was sponsored by Boyd Stephen Smith Jr. on Patreon.
2020-12-01 15:39:22 -04:00
..
Directory remove unused imports 2020-11-02 15:36:11 -04:00
DirWatcher explict export lists 2019-11-21 16:08:37 -04:00
Env fix a annex.pidlock issue 2020-06-17 15:30:59 -04:00
LockFile squash build warnings on windows 2020-11-23 14:00:17 -04:00
LockPool more RawFilePath conversion 2020-10-29 10:50:29 -04:00
Path add newtypes for QuickCheck to avoid LANG=C issues 2020-11-09 20:21:18 -04:00
Process squash build warnings on windows 2020-11-23 14:00:17 -04:00
Scheduled explict export lists 2019-11-23 11:24:10 -04:00
Tmp explict export lists 2019-11-23 11:24:10 -04:00
Aeson.hs switch MetaValue to ByteString and MetaField to Text 2019-01-07 14:18:24 -04:00
Android.hs explict export lists 2019-11-21 16:08:37 -04:00
Applicative.hs squelch tab warnings 2019-11-22 12:49:41 -04:00
Attoparsec.hs fix git ls-tree parser 2019-12-06 14:05:48 -04:00
AuthToken.hs comment typo 2019-01-03 00:22:05 -04:00
Base64.hs add newtypes for QuickCheck to avoid LANG=C issues 2020-11-09 20:21:18 -04:00
Batch.hs squash build warnings on windows 2020-11-23 14:00:17 -04:00
Bloom.hs remove many old version ifdefs 2019-07-05 15:09:37 -04:00
CoProcess.hs Revert "async exception safety for coprocesses" 2020-07-06 15:11:28 -04:00
CopyFile.hs convert to withCreateProcess for async exception safety 2020-06-04 15:45:52 -04:00
Daemon.hs Fix build on Windows 2020-11-19 12:33:00 -04:00
Data.hs explict export lists 2019-11-21 16:08:37 -04:00
DataUnits.hs adeiu, MissingH 2017-05-16 01:03:52 -04:00
DBus.hs explict export lists 2019-11-21 16:08:37 -04:00
DebugLocks.hs explict export lists 2019-11-21 16:08:37 -04:00
Directory.hs finish fixing removeLink on windows 2020-11-24 13:20:44 -04:00
DirWatcher.hs explict export lists 2019-11-21 16:08:37 -04:00
DiskFree.hs removed the old Android app 2018-10-13 01:41:11 -04:00
Dot.hs explict export lists 2019-11-21 16:08:37 -04:00
DottedVersion.hs more RawFilePath conversion 2020-10-29 12:03:50 -04:00
Env.hs explict export lists 2019-11-21 16:08:37 -04:00
Exception.hs Revert "async exception safety for coprocesses" 2020-07-06 15:11:28 -04:00
FileMode.hs finish fixing removeLink on windows 2020-11-24 13:20:44 -04:00
FileSize.hs finish fixing removeLink on windows 2020-11-24 13:20:44 -04:00
FileSystemEncoding.hs squash remaining build warnings on windows 2020-11-24 12:35:09 -04:00
Format.hs add a formatContainsVar function 2020-05-19 15:35:00 -04:00
FreeDesktop.hs use System.Directory not Utility.Directory 2016-09-22 11:34:55 -04:00
GitLFS.hs Build with the git-lfs library when available 2020-06-22 11:21:25 -04:00
Glob.hs adeiu, MissingH 2017-05-16 01:03:52 -04:00
Gpg.hs squash build warnings on windows 2020-11-23 14:00:17 -04:00
Hash.hs split up quickcheck tests for hashes and macs 2020-03-02 14:34:48 -04:00
HtmlDetect.hs explict export lists 2019-11-21 16:08:37 -04:00
HttpManagerRestricted.hs Build with the http-client-restricted library when available 2020-06-22 11:31:31 -04:00
HumanNumber.hs explict export lists 2019-11-21 16:08:37 -04:00
HumanTime.hs avoid using MonadFail in ParseDuration 2020-08-15 15:53:35 -04:00
InodeCache.hs convert getFileSize to RawFilePath 2020-11-05 11:32:57 -04:00
IPAddress.hs annex.security.allowed-ip-addresses ports syntax 2020-02-25 15:45:52 -04:00
libkqueue.c update my email address and homepage url 2015-01-21 12:50:09 -04:00
libkqueue.h fix prototype 2012-06-19 01:57:19 -04:00
LinuxMkLibs.hs more RawFilePath conversion 2020-10-29 10:50:29 -04:00
LockFile.hs use lock pools throughout git-annex 2015-05-19 14:09:52 -04:00
LockPool.hs Fix shared lock file FD leak. 2016-03-01 15:31:39 -04:00
LogFile.hs explict export lists 2019-11-21 16:08:37 -04:00
Lsof.hs convert to withCreateProcess for async exception safety 2020-06-04 12:44:09 -04:00
MagicWormhole.hs converted reads from stderr to use hGetLineUntilExitOrEOF 2020-11-19 16:21:17 -04:00
Matcher.hs import --no-content: Check annex.largefiles 2020-09-28 13:28:57 -04:00
MD5.hs use filepath-bytestring for annex object manipulations 2019-12-11 15:25:07 -04:00
Metered.hs avoid hGetMetered 0 closing the handle 2020-12-01 15:39:22 -04:00
Misc.hs ByteString Ref continued 2020-04-07 11:54:27 -04:00
Monad.hs explict export lists 2019-11-21 16:08:37 -04:00
Mounts.hs removed the old Android app 2018-10-13 01:41:11 -04:00
MoveFile.hs finish fixing removeLink on windows 2020-11-24 13:20:44 -04:00
Network.hs explict export lists 2019-11-21 16:08:37 -04:00
NotificationBroadcaster.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
OptParse.hs explict export lists 2019-11-21 16:08:37 -04:00
OSX.hs explict export lists 2019-11-21 16:08:37 -04:00
PartialPrelude.hs explict export lists 2019-11-21 16:08:37 -04:00
Path.hs fix build on windows 2020-11-10 11:21:03 -04:00
Percentage.hs update my email address and homepage url 2015-01-21 12:50:09 -04:00
PID.hs explict export lists 2019-11-21 16:08:37 -04:00
Process.hs avoid throwing exception when the handle is closed 2020-11-18 15:10:35 -04:00
QuickCheck.hs add newtypes for QuickCheck to avoid LANG=C issues 2020-11-09 20:21:18 -04:00
RawFilePath.hs squash build warnings on windows 2020-11-23 14:00:17 -04:00
ResourcePool.hs check-attr resource pool 2020-04-21 11:05:57 -04:00
Rsync.hs Parse youtube-dl progress output 2020-09-29 17:53:48 -04:00
SafeCommand.hs add newtypes for QuickCheck to avoid LANG=C issues 2020-11-09 20:21:18 -04:00
Scheduled.hs add dropFromEnd 2018-11-23 11:24:05 -04:00
Shell.hs explict export lists 2019-11-23 11:24:10 -04:00
ShellEscape.hs add newtypes for QuickCheck to avoid LANG=C issues 2020-11-09 20:21:18 -04:00
SimpleProtocol.hs remove redundant imports 2020-06-22 11:05:34 -04:00
Split.hs reword comment 2019-11-27 16:38:18 -04:00
SshConfig.hs more RawFilePath conversion 2020-11-05 18:45:37 -04:00
SshHost.hs avoid the dashed ssh hostname class of security holes 2017-08-17 22:11:31 -04:00
Su.hs explict export lists 2019-11-21 16:08:37 -04:00
SystemDirectory.hs Fix build with directory-1.3. 2016-12-20 15:23:59 -04:00
Tense.hs explict export lists 2019-11-23 11:24:10 -04:00
ThreadLock.hs explict export lists 2019-11-23 11:24:10 -04:00
ThreadScheduler.hs explict export lists 2019-11-23 11:24:10 -04:00
TimeStamp.hs explict export lists 2019-11-23 11:24:10 -04:00
TList.hs further change to support dlist-1.0 2020-08-05 10:37:14 -04:00
Tmp.hs finish fixing removeLink on windows 2020-11-24 13:20:44 -04:00
Tor.hs more RawFilePath conversion 2020-11-05 18:45:37 -04:00
Touch.hs fix build on windows 2020-11-16 09:31:45 -04:00
Tuple.hs explict export lists 2019-11-23 11:24:10 -04:00
Url.hs preserve other headers when adding resume header 2020-11-19 14:45:22 -04:00
UserInfo.hs removed the old Android app 2018-10-13 01:41:11 -04:00
Verifiable.hs add newtypes for QuickCheck to avoid LANG=C issues 2020-11-09 20:21:18 -04:00
WebApp.hs squash remaining build warnings on windows 2020-11-24 12:35:09 -04:00
Yesod.hs remove many old version ifdefs 2019-07-05 15:09:37 -04:00