Send a closure code with the backpressure close

This commit is contained in:
Andrew Godwin 2016-07-06 11:49:43 -07:00
parent 0f1b0b85b6
commit d9ba4c500a

View File

@ -101,7 +101,8 @@ class WebSocketProtocol(WebSocketServerProtocol):
# so drop the connection.
self.muted = True
logger.warn("WebSocket force closed for %s due to backpressure", self.reply_channel)
self.sendClose()
# Send code 1013 "try again later" with close.
self.sendClose(code=1013)
else:
self.factory.log_action("websocket", "connected", {
"path": self.request.path,