Commits

jmesquita committed 6be2e7a

Prevent closing an already closed connection which would raise an untreated exception.

Comments (0)

Files changed (1)

geventwebsocket/handler.py

             self.application(self.environ, lambda s, h: [])
         finally:
             del self.server.clients[self.client_address]
-            self.websocket.close()
+            if not self.websocket.closed:
+                self.websocket.close()
 
     def run_application(self):
         if (hasattr(self.server, 'pre_start_hook')