mirror of
https://github.com/typeable/wai.git
synced 2025-01-07 14:51:40 +03:00
add warp-debug flag
for not it prints out the stat exception
This commit is contained in:
parent
8a0776a581
commit
f001b4eb96
@ -215,7 +215,11 @@ sendRsp :: Connection
|
||||
sendRsp conn ver s0 hs0 restore (RspFile path mPart mRange hook) = restore $ do
|
||||
ex <- fileRange s0 hs path mPart mRange
|
||||
case ex of
|
||||
Left _ -> sendRsp conn ver s2 hs2 id (RspBuilder body True)
|
||||
Left _ex -> do
|
||||
#ifdef WARP_DEBUG
|
||||
print _ex
|
||||
#endif
|
||||
sendRsp conn ver s2 hs2 id (RspBuilder body True)
|
||||
Right (s, hs1, beg, len) -> do
|
||||
lheader <- composeHeader ver s hs1
|
||||
connSendFile conn path beg len hook [lheader]
|
||||
|
@ -31,6 +31,10 @@ Flag allow-sendfilefd
|
||||
Description: Allow use of sendfileFd (not available on GNU/kFreeBSD)
|
||||
Default: True
|
||||
|
||||
Flag warp-debug
|
||||
Description: print debug output. not suitable for production
|
||||
Default: False
|
||||
|
||||
Library
|
||||
Build-Depends: base >= 3 && < 5
|
||||
, array
|
||||
@ -77,6 +81,9 @@ Library
|
||||
Network.Wai.Handler.Warp.Types
|
||||
Paths_warp
|
||||
Ghc-Options: -Wall
|
||||
|
||||
if flag(warp-debug)
|
||||
Cpp-Options: -DWARP_DEBUG
|
||||
if (os(linux) || os(freebsd) || os(darwin)) && flag(allow-sendfilefd)
|
||||
Cpp-Options: -DSENDFILEFD
|
||||
Build-Depends: hashable
|
||||
|
Loading…
Reference in New Issue
Block a user