mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-27 14:30:19 +00:00
This commit is contained in:
parent
848950a0c0
commit
a26b9ca8af
27
src/allmydata/web/_autobahn_1151.py
Normal file
27
src/allmydata/web/_autobahn_1151.py
Normal file
@ -0,0 +1,27 @@
|
||||
"""
|
||||
Implement a work-around for <https://github.com/crossbario/autobahn-python/issues/1151>.
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import (
|
||||
print_function,
|
||||
unicode_literals,
|
||||
absolute_import,
|
||||
division,
|
||||
)
|
||||
|
||||
|
||||
from autobahn.websocket.protocol import WebSocketProtocol
|
||||
_originalConnectionLost = WebSocketProtocol._connectionLost
|
||||
|
||||
def _connectionLost(self, reason):
|
||||
if self.openHandshakeTimeoutCall is not None:
|
||||
self.openHandshakeTimeoutCall.cancel()
|
||||
self.openHandshakeTimeoutCall = None
|
||||
return _originalConnectionLost(self, reason)
|
||||
|
||||
def patch():
|
||||
"""
|
||||
Monkey-patch the proposed fix into place.
|
||||
"""
|
||||
WebSocketProtocol._connectionLost = _connectionLost
|
@ -18,6 +18,11 @@ from twisted.web.resource import (
|
||||
Resource,
|
||||
)
|
||||
|
||||
# Hotfix work-around https://github.com/crossbario/autobahn-python/issues/1151
|
||||
from . import _autobahn_1151
|
||||
_autobahn_1151.patch()
|
||||
del _autobahn_1151
|
||||
|
||||
|
||||
class TokenAuthenticatedWebSocketServerProtocol(WebSocketServerProtocol):
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user