fix build with old http-client versions

This commit is contained in:
Joey Hess 2017-08-17 11:00:48 -04:00
parent cd4c97156e
commit 0a2f7c261f
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 6 additions and 8 deletions

View file

@ -23,7 +23,7 @@ import qualified Data.Map as M
import Data.Char
import Network.Socket (HostName)
import Network.HTTP.Conduit (Manager, newManager)
import Network.HTTP.Client (managerResponseTimeout, responseStatus, responseBody, RequestBody(..))
import Network.HTTP.Client (responseStatus, responseBody, RequestBody(..))
import Network.HTTP.Types
import Control.Monad.Trans.Resource
import Control.Monad.Catch
@ -50,13 +50,6 @@ import Annex.Content
import Annex.Url (withUrlOptions)
import Utility.Url (checkBoth, managerSettings, closeManager)
#if MIN_VERSION_http_client(0,5,0)
import Network.HTTP.Client (responseTimeoutNone)
#else
responseTimeoutNone :: Maybe Int
responseTimeoutNone = Nothing
#endif
type BucketName = String
remote :: RemoteType

View file

@ -50,6 +50,11 @@ closeManager :: Manager -> IO ()
closeManager _ = return ()
#endif
#if ! MIN_VERSION_http_client(0,5,0)
responseTimeoutNone :: Maybe Int
responseTimeoutNone = Nothing
#endif
managerSettings :: ManagerSettings
#if MIN_VERSION_http_conduit(2,1,7)
managerSettings = tlsManagerSettings