Disable http-client's default 30 second response timeout when HEADing an url to check if it exists. Some web servers take quite a long time to answer a HEAD request.

This commit is contained in:
Joey Hess 2017-08-15 13:56:12 -04:00
parent e5109468e2
commit 69dcb08d7a
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 32 additions and 3 deletions

View file

@ -441,13 +441,11 @@ withS3HandleMaybe c gc u a = do
Just creds -> do
awscreds <- liftIO $ genCredentials creds
let awscfg = AWS.Configuration AWS.Timestamp awscreds debugMapper
bracketIO (newManager httpcfg) closeManager $ \mgr ->
bracketIO (newManager managerSettings) closeManager $ \mgr ->
a $ Just $ S3Handle mgr awscfg s3cfg
Nothing -> a Nothing
where
s3cfg = s3Configuration c
httpcfg = managerSettings
{ managerResponseTimeout = responseTimeoutNone }
s3Configuration :: RemoteConfig -> S3.S3Configuration AWS.NormalQuery
s3Configuration c = cfg