Skip to content

Update websocket code to more fully support the RFC

Brandon Carpenter qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest7 patches 4 repliesIn review
  2. v26 patches 14 repliesSuperseded
  3. v11 patch 4 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7io: Always remove an old channel watch before adding a new oneui/vnc-auth-vencrypt.c ui/vnc-ws.c ui/vnc.c+13 -00 replies
2/7io: Small updates in preparation for websocket changesio/channel-websock.c+18 -440 replies
3/7io: Add support for fragmented websocket binary framesinclude/io/channel-websock.h io/channel-websock.c+19 -80 replies
4/7io: Allow empty websocket payloadio/channel-websock.c+30 -320 replies
5/7io: Ignore websocket PING and PONG framesio/channel-websock.c+17 -40 replies
6/7io: Reply to ping framesinclude/io/channel-websock.h io/channel-websock.c+44 -210 replies
7/7io: Attempt to send websocket close messages to clientio/channel-websock.c+62 -30 replies

Reviews trailers per patch

1 of 7 patches has a Reviewed-by or Acked-by.

PatchPaolo BonziniDaniel P. Berrange
1/7R-b R-b
2/7
3/7
4/7
5/7
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [Qemu-devel] [PATCH v3 0/7] Update websocket code to more fully support the RFC

We've been experiencing issues where the qemu websocket server closes connections from noVNC clients for no apparent reason. Debugging shows that certain web browsers are injecting ping and pong frames when the connection becomes idle. Some browsers send those frames without a payload, which also is causing closure. This patch series addresses these issues by making the websocket server more conformant to RFC 6455 - The WebSocket Protocol.

Remembering the opcode is sufficient for handling fragmented frames from the client, which may be introduced by an intermediary server/proxy. Respond to pings and ignore pongs rather than close the connection as many browsers use ping/pong to test an idle connection. Close connections according to the RFC, including providing a reason code and message to aid debugging of unexpected disconnects. Empty payloads should not cause a disconnect.

While updating the websocket code, several other bugs were discovered for which patches are also included early in the set.

Brandon Carpenter (7):
io: Always remove an old channel watch before adding a new one
io: Small updates in preparation for websocket changes
io: Add support for fragmented websocket binary frames
io: Allow empty websocket payload
io: Ignore websocket PING and PONG frames
io: Reply to ping frames
io: Attempt to send websocket close messages to client

 include/io/channel-websock.h |   2 +
 io/channel-websock.c         | 282 +++++++++++++++++++++++++++----------------
 ui/vnc-auth-vencrypt.c       |   3 +
 ui/vnc-ws.c                  |   6 +
 ui/vnc.c                     |   4 +
 5 files changed, 194 insertions(+), 103 deletions(-)
Signature · 12 lines
2.14.1


-- 


CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is 
for the sole use of the intended recipient(s) and may contain proprietary, 
confidential or privileged information or otherwise be protected by law. 
Any unauthorized review, use, disclosure or distribution is prohibited. If 
you are not the intended recipient, please notify the sender and destroy 
all copies and the original message.