Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Commit

Permalink
Merge pull request #238 from nono/close_sockets
Browse files Browse the repository at this point in the history
Improve the fix for sockets in CLOSE_WAIT
  • Loading branch information
nono committed Feb 5, 2016
2 parents 17eeb3f + 02e5bd6 commit 28872b3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions server/controllers/applications.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ getPathForStaticApp = (appName, path, root, callback) ->
callback lockedpath(root).join path

forwardRequest = (req, res, errTemplate, next) ->
connectionClosed = false
req.on 'close', -> connectionClosed = true
res.on 'close', -> connectionClosed = true
appName = req.params.name
shouldStart = -1 is req.url.indexOf 'socket.io'
appManager.ensureStarted appName, shouldStart, (err, result) ->
if connectionClosed
if not res.connection or res.connection.destroyed
return
else if err?
error = new Error err.msg
Expand Down

0 comments on commit 28872b3

Please sign in to comment.