Skip to content

Commit

Permalink
Merge pull request #83 from scrive/patch-force-timeout
Browse files Browse the repository at this point in the history
Do not forceTimeOut when a threadGroup has been set
  • Loading branch information
stepcut authored May 8, 2024
2 parents aa2f47a + 314aa12 commit 59864dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Happstack/Server/Internal/Listen.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE BangPatterns, CPP, ScopedTypeVariables #-}
module Happstack.Server.Internal.Listen(listen, listen',listenOn,listenOnIPv4) where

import Data.Maybe (isNothing)
import Happstack.Server.Internal.Types (Conf(..), Request, Response)
import Happstack.Server.Internal.Handler (request)
import Happstack.Server.Internal.Socket (acceptLite)
Expand Down Expand Up @@ -118,7 +119,7 @@ listen' s conf hand = do
infi :: IO ()
infi = loop `catchSome` pe >> infi

infi `finally` (Socket.close s >> forceTimeoutAll tm)
infi `finally` (Socket.close s >> when (isNothing $ threadGroup conf) (forceTimeoutAll tm))

{--
#ifndef mingw32_HOST_OS
Expand Down

0 comments on commit 59864dd

Please sign in to comment.