fix slowloris timeout in hashing resume of download of large file
Hash the data that is already present in the file before connecting to the http server.
This commit is contained in:
parent
0594338a78
commit
10f2c23fd7
4 changed files with 33 additions and 36 deletions
|
@ -234,16 +234,12 @@ resumeVerifyFromOffset
|
|||
-> IO MeterUpdate
|
||||
resumeVerifyFromOffset o incrementalverifier meterupdate h
|
||||
| o /= 0 = do
|
||||
p' <- case incrementalverifier of
|
||||
Just iv -> do
|
||||
go iv o
|
||||
return offsetmeterupdate
|
||||
_ -> return offsetmeterupdate
|
||||
maybe noop (`go` o) incrementalverifier
|
||||
-- Make sure the handle is seeked to the offset.
|
||||
-- (Reading the file probably left it there
|
||||
-- when that was done, but let's be sure.)
|
||||
hSeek h AbsoluteSeek o
|
||||
return p'
|
||||
return offsetmeterupdate
|
||||
| otherwise = return meterupdate
|
||||
where
|
||||
offsetmeterupdate = offsetMeterUpdate meterupdate (toBytesProcessed o)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue