Skip to content

Commit

Permalink
Merge pull request #933 from kazu-yamamoto/revert-emfile
Browse files Browse the repository at this point in the history
Revert "allowing eMFILE in acceptNewConnection."
  • Loading branch information
kazu-yamamoto authored Jun 14, 2023
2 parents 92215b2 + 75a4ee9 commit 5b6f9ed
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions warp/Network/Wai/Handler/Warp/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Control.Exception (allowInterrupt)
import qualified Data.ByteString as S
import Data.IORef (newIORef, readIORef)
import Data.Streaming.Network (bindPortTCP)
import Foreign.C.Error (Errno(..), eCONNABORTED, eMFILE)
import Foreign.C.Error (Errno(..), eCONNABORTED)
import GHC.IO.Exception (IOException(..), IOErrorType(..))
import Network.Socket (Socket, close, withSocketsDo, SockAddr, setSocketOption, SocketOption(..))
#if MIN_VERSION_network(3,1,1)
Expand Down Expand Up @@ -277,11 +277,9 @@ acceptConnection set getConnMaker app counter ii = do
case ex of
Right x -> return $ Just x
Left e -> do
let getErrno (Errno cInt) = cInt
eConnAborted = getErrno eCONNABORTED
eMfile = getErrno eMFILE
merrno = ioe_errno e
if merrno == Just eConnAborted || merrno == Just eMfile
let eConnAborted = getErrno eCONNABORTED
getErrno (Errno cInt) = cInt
if ioe_errno e == Just eConnAborted
then acceptNewConnection
else do
settingsOnException set Nothing $ toException e
Expand Down

0 comments on commit 5b6f9ed

Please sign in to comment.