stack-1.9.3: The Haskell Tool Stack

Safe HaskellNone
LanguageHaskell2010

Network.HTTP.Download.Verified

Synopsis

Documentation

verifiedDownload Source #

Arguments

:: HasRunner env 
=> DownloadRequest 
-> Path Abs File

destination

-> (Maybe Integer -> ConduitM ByteString Void (RIO env) ())

custom hook to observe progress

-> RIO env Bool

Whether a download was performed

Copied and extended version of Network.HTTP.Download.download.

Has the following additional features: * Verifies that response content-length header (if present) matches expected length * Limits the download to (close to) the expected # of bytes * Verifies that the expected # bytes were downloaded (not too few) * Verifies md5 if response includes content-md5 header * Verifies the expected hashes

Throws VerifiedDownloadException. Throws IOExceptions related to file system operations. Throws HttpException.

recoveringHttp :: forall env a. HasRunner env => RetryPolicy -> RIO env a -> RIO env a Source #

data DownloadRequest Source #

A request together with some checks to perform.

drRetryPolicyDefault :: RetryPolicy Source #

Default to retrying seven times with exponential backoff starting from one hundred milliseconds.

This means the tries will occur after these delays if necessary:

  • 0.1s
  • 0.2s
  • 0.4s
  • 0.8s
  • 1.6s
  • 3.2s
  • 6.4s