read a consistent amount from pointer file

A few places were reading the max symlink size of a pointer file,
then passing tp parseLinkTargetOrPointer. Which is fine currently, but
to support pointer files with lines of data after the pointer, enough
has to be read that parseLinkTargetOrPointer can be assured of seeing
enough of that data to know if it's correctly formatted.

Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
Joey Hess 2022-02-23 12:38:35 -04:00
parent 4cd9325c2c
commit 5b373a9dd2
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 12 additions and 12 deletions

View file

@ -62,7 +62,7 @@ clean file = do
let conv b l = (B.concat (map pktLineToByteString l), b)
(b, readcomplete) <-
either (conv False) (conv True)
<$> liftIO (readUntilFlushPktOrSize unpaddedMaxPointerSz)
<$> liftIO (readUntilFlushPktOrSize maxPointerSz)
let passthrough
| readcomplete = liftIO $ respondFilterRequest b