Skip to content

Commit

Permalink
Merge PR yesodweb#831
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Feb 2, 2022
2 parents 60ebed4 + 14fadc8 commit 2c3287e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions warp/Network/Wai/Handler/Warp/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import UnliftIO (toException)
import qualified Data.ByteString as S
import Data.IORef (newIORef, readIORef)
import Data.Streaming.Network (bindPortTCP)
import Foreign.C.Error (Errno(..), eCONNABORTED)
import Foreign.C.Error (Errno(..), eCONNABORTED, eMFILE)
import GHC.IO.Exception (IOException(..), IOErrorType(..))
import Network.Socket (Socket, close, accept, withSocketsDo, SockAddr, setSocketOption, SocketOption(..))
#if MIN_VERSION_network(3,1,1)
Expand Down Expand Up @@ -269,9 +269,11 @@ acceptConnection set getConnMaker app counter ii = do
case ex of
Right x -> return $ Just x
Left e -> do
let eConnAborted = getErrno eCONNABORTED
getErrno (Errno cInt) = cInt
if ioe_errno e == Just eConnAborted
let getErrno (Errno cInt) = cInt
eConnAborted = getErrno eCONNABORTED
eMfile = getErrno eMFILE
merrno = ioe_errno e
if merrno == Just eConnAborted || merrno == Just eMfile
then acceptNewConnection
else do
settingsOnException set Nothing $ toException e
Expand Down

0 comments on commit 2c3287e

Please sign in to comment.