fixed a small bug.

This commit is contained in:
JasonYang 2020-10-21 21:47:28 +08:00 committed by GitHub
parent c2e91051ab
commit a386fcd58b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -149,10 +149,13 @@ class WebSockifyRequestHandler(WebSocketRequestHandlerMixIn, SimpleHTTPRequestHa
while self.send_parts:
# Send pending frames
try:
self.request.sendmsg(self.send_parts.pop(0))
# send the first frame.
self.request.sendmsg(self.send_parts[0])
except WebSocketWantWriteError:
self.print_traffic("<.")
return True
# pop the first frame. I think `self.send_parts.pop()` is incorrect. because the frame does not sended.
self.send_parts.pop(0)
self.print_traffic("<")
return False