Skip to content

Commit

Permalink
Merge pull request #1219 from benoitc/fix/socket-destroy-recursion
Browse files Browse the repository at this point in the history
fix infinite recursion when destroying sockets
  • Loading branch information
tilgovi committed Mar 13, 2016
2 parents d4e1abd + e46dda7 commit 527dd7a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gunicorn/sock.py
Expand Up @@ -54,11 +54,15 @@ def bind(self, sock):
sock.bind(self.cfg_addr)

def close(self):
if self.sock is None:
return

try:
self.sock.close()
except socket.error as e:
self.log.info("Error while closing socket %s", str(e))
del self.sock

self.sock = None


class TCPSocket(BaseSocket):
Expand Down

0 comments on commit 527dd7a

Please sign in to comment.