on master help sign in
removing dead code. (#437)

Credit should go to @soenkehahn.

commita027567934458028ec579b17b8734d516e490cc9 authorKazu Yamamoto <kazu@iij.ad.jp> dateTue 13 Oct 2015, 17:13 (11 years ago) parent0a24ae8
3 files changed+2−17
warp/Network/Wai/Handler/Warp/Conduit.hs−5 warp/Network/Wai/Handler/Warp/Response.hs+2−7 warp/Network/Wai/Handler/Warp/Run.hs−5
warp/Network/Wai/Handler/Warp/Conduit.hs−5
@@ -64,11 +64,6 @@ readISource (ISource src ref) = do
6464 assert (count' == 0) $ I.writeIORef ref count'
6565 return x
6666
67−-- | Extract the underlying @Source@ from an @IsolatedBSSource@, which will not
68−-- perform any more isolation.
69−isourceDone :: ISource -> Source
70−isourceDone (ISource src _) = src
71−
7267----------------------------------------------------------------
7368
7469data CSource = CSource !Source !(I.IORef ChunkState)
warp/Network/Wai/Handler/Warp/Response.hs+2−7
@@ -9,7 +9,6 @@ module Network.Wai.Handler.Warp.Response (
99 , sanitizeHeaderValue -- for testing
1010 , fileRange -- for testing
1111 , warpVersion
12− , defaultServerValue
1312 , addDate
1413 , addServer
1514 , hasBody
@@ -31,7 +30,6 @@ import qualified Data.ByteString as S
3130import qualified Data.ByteString.Char8 as S8
3231import Data.ByteString.Builder (byteString, Builder)
3332import Data.ByteString.Builder.Extra (flush)
34−import qualified Data.ByteString.Char8 as B (pack)
3533import qualified Data.CaseInsensitive as CI
3634import Data.Function (on)
3735import Data.List (deleteBy)
@@ -395,12 +393,9 @@ addDate dc rspidxhdr hdrs = case rspidxhdr ! idxDate of
395393warpVersion :: String
396394warpVersion = showVersion Paths_warp.version
397395
398−defaultServerValue :: HeaderValue
399−defaultServerValue = B.pack $ "Warp/" ++ warpVersion
400−
401396addServer :: HeaderValue -> IndexedHeader -> H.ResponseHeaders -> H.ResponseHeaders
402−addServer defaultServerValue' rspidxhdr hdrs = case rspidxhdr ! idxServer of
403− Nothing -> (H.hServer, defaultServerValue') : hdrs
397+addServer serverName rspidxhdr hdrs = case rspidxhdr ! idxServer of
398+ Nothing -> (H.hServer, serverName) : hdrs
404399 _ -> hdrs
405400
406401----------------------------------------------------------------
warp/Network/Wai/Handler/Warp/Run.hs−5
@@ -370,11 +370,6 @@ type ServeConnection = Connection
370370 -> Settings
371371 -> IO ()
372372
373−-- Serve an HTTP\/2-aware application, rejecting clients that attempt to use an
374−-- older protocol version.
375−serveHTTP2Only :: HTTP2Application -> ServeConnection
376−serveHTTP2Only = error "serveHTTP2Only not implemented"
377−
378373-- Serve an HTTP\/2-unaware Application to a connection over any HTTP version.
379374serveDefault :: Application -> ServeConnection
380375serveDefault app = serveHTTP2 (promoteApplication app) app