@@ -124,7 +124,7 @@ runSettingsConnectionMaker :: Settings -> IO (IO Connection, SockAddr) -> Applic
124124runSettingsConnectionMaker x y =
125125 runSettingsConnectionMakerSecure x (go y)
126126 where
127− go = fmap (first (fmap (, False)))
127+ go = fmap (first (fmap (, TCP)))
128128
129129----------------------------------------------------------------
130130
@@ -132,7 +132,7 @@ runSettingsConnectionMaker x y =
132132-- which will return 'Connection'.
133133--
134134-- Since 2.1.4
135−runSettingsConnectionMakerSecure :: Settings -> IO (IO (Connection, Bool), SockAddr) -> Application -> IO ()
135+runSettingsConnectionMakerSecure :: Settings -> IO (IO (Connection, Transport), SockAddr) -> Application -> IO ()
136136runSettingsConnectionMakerSecure set getConnMaker app = do
137137 settingsBeforeMainLoop set
138138 counter <- newCounter
@@ -169,7 +169,7 @@ onE set mreq e = case fromException e of
169169--
170170-- Our approach is explained in the comments below.
171171acceptConnection :: Settings
172− -> IO (IO (Connection, Bool), SockAddr)
172+ -> IO (IO (Connection, Transport), SockAddr)
173173 -> Application
174174 -> D.DateCache
175175 -> Maybe F.MutableFdCache
@@ -220,7 +220,7 @@ acceptConnection set getConnMaker app dc fc tm counter = do
220220-- Fork a new worker thread for this connection maker, and ask for a
221221-- function to unmask (i.e., allow async exceptions to be thrown).
222222fork :: Settings
223− -> IO (Connection, Bool)
223+ -> IO (Connection, Transport)
224224 -> SockAddr
225225 -> Application
226226 -> D.DateCache
@@ -239,7 +239,7 @@ fork set mkConn addr app dc fc tm counter = settingsFork set $ \ unmask ->
239239 -- We grab the connection before registering timeouts since the
240240 -- timeouts will be useless during connection creation, due to the
241241 -- fact that async exceptions are still masked.
242− bracket mkConn closeConn $ \(conn0, isSecure') ->
242+ bracket mkConn closeConn $ \(conn0, transport) ->
243243
244244 -- We need to register a timeout handler for this thread, and
245245 -- cancel that handler as soon as we exit.
@@ -260,9 +260,9 @@ fork set mkConn addr app dc fc tm counter = settingsFork set $ \ unmask ->
260260
261261 -- Actually serve this connection.
262262 -- bracket with closeConn above ensures the connection is closed.
263− when goingon $ serveConnection conn ii addr isSecure' set app
263+ when goingon $ serveConnection conn ii addr transport set app
264264 where
265− closeConn (conn, _isSecure) = connClose conn
265+ closeConn (conn, _transport) = connClose conn
266266
267267 onOpen adr = increase counter >> settingsOnOpen set adr
268268 onClose adr _ = decrease counter >> settingsOnClose set adr
@@ -270,11 +270,11 @@ fork set mkConn addr app dc fc tm counter = settingsFork set $ \ unmask ->
270270serveConnection :: Connection
271271 -> InternalInfo
272272 -> SockAddr
273− -> Bool -- ^ is secure?
273+ -> Transport
274274 -> Settings
275275 -> Application
276276 -> IO ()
277−serveConnection conn ii origAddr isSecure' settings app = do
277+serveConnection conn ii origAddr transport settings app = do
278278 istatus <- newIORef False
279279 src <- mkSource (connSource conn th istatus)
280280 addr <- getProxyProtocolAddr src
@@ -338,7 +338,7 @@ serveConnection conn ii origAddr isSecure' settings app = do
338338
339339 http1 addr istatus src = do
340340 (req', mremainingRef, idxhdr) <- recvRequest settings conn ii addr src
341− let req = req' { isSecure = isSecure' }
341+ let req = req' { isSecure = isTransportSecure transport }
342342 keepAlive <- processRequest istatus src req mremainingRef idxhdr
343343 `E.catch` \e -> do
344344 -- Call the user-supplied exception handlers, passing the request.