@@ -21,7 +21,7 @@ import Network (sClose, Socket)
21import Network.Socket (accept, withSocketsDo, SockAddr(SockAddrInet, SockAddrInet6))
21import Network.Socket (accept, withSocketsDo, SockAddr(SockAddrInet, SockAddrInet6))
22import qualified Network.Socket.ByteString as Sock
22import qualified Network.Socket.ByteString as Sock
23import Network.Wai
23import Network.Wai
24−import Network.Wai.HTTP2 (Http2Application)
24+import Network.Wai.HTTP2 (HTTP2Application)
25import Network.Wai.Handler.Warp.Buffer
25import Network.Wai.Handler.Warp.Buffer
26import Network.Wai.Handler.Warp.Counter
26import Network.Wai.Handler.Warp.Counter
27import qualified Network.Wai.Handler.Warp.Date as D
27import qualified Network.Wai.Handler.Warp.Date as D
@@ -69,7 +69,7 @@ allowInterrupt :: IO ()
69allowInterrupt = unblock $ return ()
69allowInterrupt = unblock $ return ()
72−-- Composition over two arguments at once; used for runHttp2\*.
72+-- Composition over two arguments at once; used for runHTTP2\*.
73(.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d
73(.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d
74f .: g = curry $ f . uncurry g
74f .: g = curry $ f . uncurry g
@@ -78,10 +78,10 @@ f .: g = curry $ f . uncurry g
78run :: Port -> Application -> IO ()
78run :: Port -> Application -> IO ()
79run port = runServe port . serveDefault
79run port = runServe port . serveDefault
81−-- | Serve an 'Http2Application' and an 'Application' together on the given
81+-- | Serve an 'HTTP2Application' and an 'Application' together on the given
83−runHttp2 :: Port -> Http2Application -> Application -> IO ()
83+runHTTP2 :: Port -> HTTP2Application -> Application -> IO ()
84−runHttp2 port = runServe port .: serveHttp2
84+runHTTP2 port = runServe port .: serveHTTP2
86-- | The generalized form of 'run'.
86-- | The generalized form of 'run'.
87runServe :: Port -> ServeConnection -> IO ()
87runServe :: Port -> ServeConnection -> IO ()
@@ -96,8 +96,8 @@ runEnv :: Port -> Application -> IO ()
96runEnv port = runServeEnv port . serveDefault
96runEnv port = runServeEnv port . serveDefault
98-- | The HTTP\/2-aware form of 'runEnv'.
98-- | The HTTP\/2-aware form of 'runEnv'.
99−runHttp2Env :: Port -> Http2Application -> Application -> IO ()
99+runHTTP2Env :: Port -> HTTP2Application -> Application -> IO ()
100−runHttp2Env port = runServeEnv port .: serveHttp2
100+runHTTP2Env port = runServeEnv port .: serveHTTP2
102-- | The generalized form of 'runEnv'.
102-- | The generalized form of 'runEnv'.
103runServeEnv :: Port -> ServeConnection -> IO ()
103runServeEnv :: Port -> ServeConnection -> IO ()
@@ -119,8 +119,8 @@ runSettings :: Settings -> Application -> IO ()
119runSettings set = runServeSettings set . serveDefault
119runSettings set = runServeSettings set . serveDefault
121-- | The HTTP\/2-aware form of 'runSettings'.
121-- | The HTTP\/2-aware form of 'runSettings'.
122−runHttp2Settings :: Settings -> Http2Application -> Application -> IO ()
122+runHTTP2Settings :: Settings -> HTTP2Application -> Application -> IO ()
123−runHttp2Settings set = runServeSettings set .: serveHttp2
123+runHTTP2Settings set = runServeSettings set .: serveHTTP2
125-- | The generalized form of 'runSettings'.
125-- | The generalized form of 'runSettings'.
126runServeSettings :: Settings -> ServeConnection -> IO ()
126runServeSettings :: Settings -> ServeConnection -> IO ()
@@ -147,13 +147,13 @@ runSettingsSocket :: Settings -> Socket -> Application -> IO ()
147runSettingsSocket set socket = runServeSettingsSocket set socket . serveDefault
147runSettingsSocket set socket = runServeSettingsSocket set socket . serveDefault
149-- | The HTTP\/2-aware form of 'runSettingsSocket'.
149-- | The HTTP\/2-aware form of 'runSettingsSocket'.
150−runHttp2SettingsSocket :: Settings
150+runHTTP2SettingsSocket :: Settings
151 -> Socket
151 -> Socket
152− -> Http2Application
152+ -> HTTP2Application
153 -> Application
153 -> Application
155−runHttp2SettingsSocket set socket =
155+runHTTP2SettingsSocket set socket =
156− runServeSettingsSocket set socket .: serveHttp2
156+ runServeSettingsSocket set socket .: serveHTTP2
158-- | The generalized form of 'runSettingsSocket'.
158-- | The generalized form of 'runSettingsSocket'.
159runServeSettingsSocket :: Settings -> Socket -> ServeConnection -> IO ()
159runServeSettingsSocket :: Settings -> Socket -> ServeConnection -> IO ()
@@ -369,17 +369,17 @@ type ServeConnection = Connection
370-- Serve an HTTP\/2-aware application, rejecting clients that attempt to use an
370-- Serve an HTTP\/2-aware application, rejecting clients that attempt to use an
371-- older protocol version.
371-- older protocol version.
372−serveHttp2Only :: Http2Application -> ServeConnection
372+serveHTTP2Only :: HTTP2Application -> ServeConnection
373−serveHttp2Only = error "serveHttp2Only not implemented"
373+serveHTTP2Only = error "serveHTTP2Only not implemented"
375-- Serve an HTTP\/2-unaware Application to a connection over any HTTP version.
375-- Serve an HTTP\/2-unaware Application to a connection over any HTTP version.
376serveDefault :: Application -> ServeConnection
376serveDefault :: Application -> ServeConnection
377−serveDefault = flip serveHttp2 <*> promoteApplication
377+serveDefault = flip serveHTTP2 <*> promoteApplication
379-- Serve an HTTP\/2-aware application over HTTP\/2 or a backup 'Application'
379-- Serve an HTTP\/2-aware application over HTTP\/2 or a backup 'Application'
380-- over HTTP\/1.1 or HTTP\/1.
380-- over HTTP\/1.1 or HTTP\/1.
381−serveHttp2 :: Http2Application -> Application -> ServeConnection
381+serveHTTP2 :: HTTP2Application -> Application -> ServeConnection
382−serveHttp2 app2 app conn ii origAddr transport settings = do
382+serveHTTP2 app2 app conn ii origAddr transport settings = do
383 -- fixme: Upgrading to HTTP/2 should be supported.
383 -- fixme: Upgrading to HTTP/2 should be supported.
384 (h2,bs) <- if isHTTP2 transport then
384 (h2,bs) <- if isHTTP2 transport then
385 return (True, "")
385 return (True, "")