warp 3.2.1 → 3.2.2
raw patch · 4 files changed
+14/−7 lines, 4 files
Files
- ChangeLog.md +6/−1
- Network/Wai/Handler/Warp/HTTP2/Sender.hs +1/−1
- Network/Wai/Handler/Warp/SendFile.hs +6/−4
- warp.cabal +1/−1
ChangeLog.md view
@@ -1,3 +1,8 @@+## 3.2.2++* Throwing errno for pread [#499](https://github.com/yesodweb/wai/issues/499).+* Makeing compilable on Windows [#505](https://github.com/yesodweb/wai/issues/505).+ ## 3.2.1 * Add back `warpVersion`@@ -10,7 +15,7 @@ * The performance of HTTP/2 was drastically improved. Now the performance of HTTP/2 is almost the same as that of HTTP/1.1. * The logic to handle files in HTTP/2 is now identical to that in HTTP/1.1. * Internal stuff was removed from the Network.Wai.Handler.Warp module according to [the plan](http://www.yesodweb.com/blog/2015/06/cleaning-up-warp-apis).- + ## 3.1.12 * Setting lower bound for auto-update [#495](https://github.com/yesodweb/wai/issues/495)
Network/Wai/Handler/Warp/HTTP2/Sender.hs view
@@ -296,7 +296,7 @@ (start, bytes) <- fileStartEnd path mpart -- fixme: how to close Handle? GC does it at this moment. hdl <- IO.openBinaryFile path IO.ReadMode- IO.hSeek h IO.AbsoluteSeek start+ IO.hSeek hdl IO.AbsoluteSeek start len <- IO.hGetBufSome hdl datBuf (mini room bytes) let bytes' = bytes - fromIntegral len -- fixme: connWriteBuffer connBufferSize
Network/Wai/Handler/Warp/SendFile.hs view
@@ -9,7 +9,7 @@ #endif ) where -import Control.Monad (void)+import Control.Monad (void, when) import Data.ByteString (ByteString) import qualified Data.ByteString as BS import Network.Socket (Socket)@@ -17,7 +17,6 @@ import Network.Wai.Handler.Warp.Types #ifdef WINDOWS-import Control.Monad (when) import Data.ByteString.Internal (ByteString(..)) import Foreign.ForeignPtr (newForeignPtr_) import Foreign.Ptr (plusPtr)@@ -27,6 +26,7 @@ import Control.Applicative ((<$>)) # endif import Control.Exception+import Foreign.C.Error (throwErrno) import Foreign.C.Types import Foreign.Ptr (Ptr, castPtr, plusPtr) import Network.Sendfile@@ -143,8 +143,10 @@ loop fd (len - n') (off + n') positionRead :: Fd -> Buffer -> BufSize -> Integer -> IO Int-positionRead fd buf siz off =- fromIntegral <$> c_pread fd (castPtr buf) (fromIntegral siz) (fromIntegral off)+positionRead fd buf siz off = do+ bytes <- fromIntegral <$> c_pread fd (castPtr buf) (fromIntegral siz) (fromIntegral off)+ when (bytes < 0) $ throwErrno "positionRead"+ return bytes foreign import ccall unsafe "pread" c_pread :: Fd -> Ptr CChar -> ByteCount -> FileOffset -> IO CSsize
warp.cabal view
@@ -1,5 +1,5 @@ Name: warp-Version: 3.2.1+Version: 3.2.2 Synopsis: A fast, light-weight web server for WAI applications. License: MIT License-file: LICENSE