Bug issue with upgrading http to websocket

# Creating a websocket creation
2018-02-04 13:01:58,975 - DEBUG - http_protocol - Upgraded connection ['127.0.0.1', 39558] to WebSocket
2018-02-04 13:01:59,010 - DEBUG - ws_protocol - WebSocket ['127.0.0.1', 39558] open and established
[2018/02/04 13:01:59] WebSocket CONNECT /test/ [127.0.0.1:39558]
2018-02-04 13:01:59,010 - DEBUG - ws_protocol - WebSocket ['127.0.0.1', 39558] accepted by application

# ...after 60 seconds (the default value of --http_timeout
2018-02-04 13:02:59,944 - DEBUG - http_protocol - HTTP 503 response started for ['127.0.0.1', 39558]
2018-02-04 13:02:59,945 - DEBUG - http_protocol - HTTP close for ['127.0.0.1', 39558]
2018-02-04 13:02:59,945 - DEBUG - http_protocol - HTTP response complete for ['127.0.0.1', 39558]
[2018/02/04 13:02:59] HTTP GET /test/ 503 [60.97, 127.0.0.1:39558]
2018-02-04 13:02:59,950 - DEBUG - ws_protocol - WebSocket closed for ['127.0.0.1', 39558]
[2018/02/04 13:02:59] WebSocket DISCONNECT /test/ [127.0.0.1:39558]
This commit is contained in:
tsiaGeorge 2018-02-04 14:19:14 +01:00 committed by GitHub
parent 6eeb280e1b
commit d9f10e3618
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -117,6 +117,9 @@ class WebRequest(http.Request):
data += self.content.read() data += self.content.read()
protocol.dataReceived(data) protocol.dataReceived(data)
# Remove our HTTP reply channel association # Remove our HTTP reply channel association
# FIXME: Something wrong is happening here.
# http protocol won't remove after upgrade to protocol websocket,
# which results to http timeout and disconnect websocket.
logger.debug("Upgraded connection %s to WebSocket", self.client_addr) logger.debug("Upgraded connection %s to WebSocket", self.client_addr)
# Resume the producer so we keep getting data, if it's available as a method # Resume the producer so we keep getting data, if it's available as a method
self.channel._networkProducer.resumeProducing() self.channel._networkProducer.resumeProducing()