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

2017-09-21 Thread Brandon Carpenter
Cool. Thanks for helping me through the process and for the great feedback. -- Brandon Carpenter | Software Engineer Cypherpath, Inc. 400 Columbia Point Drive Ste 101 | Richland, Washington USA Office: (650) 713-3060 On Thu, Sep 21, 2017 at 2:55 AM, Daniel P. Berrange wrote: On Wed, Sep 20

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

2017-09-20 Thread Brandon Carpenter
socket in various ways to help exercise the different code paths. I would be happy to post it here to help test the changes. Thanks, -- Brandon Carpenter | Software Engineer Cypherpath, Inc. 400 Columbia Point Drive Ste 101 | Richland, Washington USA Office: (650) 713-3060 On Tue, Sep 12, 2017 at 8

[Qemu-devel] [PATCH v3 4/7] io: Allow empty websocket payload

2017-09-12 Thread Brandon Carpenter
Some browsers send pings/pongs with no payload, so allow empty payloads instead of closing the connection. Signed-off-by: Brandon Carpenter --- io/channel-websock.c | 62 +--- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/io

Re: [Qemu-devel] [PATCH v2 6/6] io: Reply to ping frames

2017-09-12 Thread Brandon Carpenter
126 bytes, , limiting the total message size to 132 bytes. This is enforced in qio_channel_websock_decode_header(). If anything larger is sent in a control message, including pings, the connection is immediately closed. -- Brandon Carpenter | Software Engineer Cypherpath, Inc. 400 Columbia Point

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

2017-09-12 Thread Brandon Carpenter
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 fragm

[Qemu-devel] [PATCH v3 7/7] io: Attempt to send websocket close messages to client

2017-09-12 Thread Brandon Carpenter
Make a best effort attempt to close websocket connections according to the RFC. Sends the close message, as room permits in the socket buffer, and immediately closes the socket. Signed-off-by: Brandon Carpenter --- io/channel-websock.c | 65

[Qemu-devel] [PATCH v3 3/7] io: Add support for fragmented websocket binary frames

2017-09-12 Thread Brandon Carpenter
Allows fragmented binary frames by saving the previous opcode. Handles the case where an intermediary (i.e., web proxy) fragments frames originally sent unfragmented by the client. Signed-off-by: Brandon Carpenter --- include/io/channel-websock.h | 1 + io/channel-websock.c | 26

[Qemu-devel] [PATCH v3 6/7] io: Reply to ping frames

2017-09-12 Thread Brandon Carpenter
Add an immediate ping reply (pong) to the outgoing stream when a ping is received. Unsolicited pongs are ignored. Signed-off-by: Brandon Carpenter --- include/io/channel-websock.h | 1 + io/channel-websock.c | 64 +--- 2 files changed, 44

[Qemu-devel] [PATCH v3 2/7] io: Small updates in preparation for websocket changes

2017-09-12 Thread Brandon Carpenter
Gets rid of unnecessary bit shifting and performs proper EOF checking to avoid a large number of repeated calls to recvmsg() when a client abruptly terminates a connection (bug fix). Signed-off-by: Brandon Carpenter --- io/channel-websock.c | 62

[Qemu-devel] [PATCH v3 1/7] io: Always remove an old channel watch before adding a new one

2017-09-12 Thread Brandon Carpenter
Also set saved handle to zero when removing without adding a new watch. Signed-off-by: Brandon Carpenter Reviewed-by: Paolo Bonzini Reviewed-by: Daniel P. Berrange --- ui/vnc-auth-vencrypt.c | 3 +++ ui/vnc-ws.c| 6 ++ ui/vnc.c | 4 3 files changed, 13

[Qemu-devel] [PATCH v3 5/7] io: Ignore websocket PING and PONG frames

2017-09-12 Thread Brandon Carpenter
Keep pings and gratuitous pongs generated by web browsers from killing websocket connections. Signed-off-by: Brandon Carpenter --- io/channel-websock.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/io/channel-websock.c b/io/channel-websock.c index

Re: [Qemu-devel] [PATCH v2 6/6] io: Reply to ping frames

2017-09-11 Thread Brandon Carpenter
iant closing of websocket connections, which I must have lost during a rebase. Should I submit v3 of the patch series or just add those patches to this thread? Thank you, -- Brandon Carpenter | Software Engineer Cypherpath, Inc. 400 Columbia Point Drive Ste 101 | Richland, Washington USA Office:

Re: [Qemu-devel] [PATCH v2 6/6] io: Reply to ping frames

2017-09-11 Thread Brandon Carpenter
if (ioc->opcode & QIO_CHANNEL_WEBSOCK_CONTROL_OPCODE_MASK) { return QIO_CHANNEL_ERR_BLOCK; } payload_len = ioc->encinput.offset - (ioc->encinput.offset % 4); -- Brandon Carpenter | Software Engineer Cypherpath, Inc. 400 Columbia Point Driv

Re: [Qemu-devel] [PATCH v2 6/6] io: Reply to ping frames

2017-09-11 Thread Brandon Carpenter
er(ioc, + QIO_CHANNEL_WEBSOCK_OPCODE_PONG, &ioc->encinput); + } } /* pong frames are ignored */ if (payload_len) { -- Brandon Carpenter | Software Engineer Cypherpath, Inc. 400 Columbia Point Drive Ste 101 | Richland, Washington USA Office: (650) 713-3060 -- CONFIDENTIALITY NOTI

Re: [Qemu-devel] [PATCH v2 0/6] Update websocket code to more fully support the RFC

2017-09-08 Thread Brandon Carpenter
My apologies. I read that document before submitting the patch, but there was a lot to take in. Would you like me to resend the patch without the references? -- Brandon Carpenter | Software Engineer Cypherpath, Inc. 400 Columbia Point Drive Ste 101 | Richland, Washington USA Office: (650) 713

[Qemu-devel] [PATCH v2 0/6] Update websocket code to more fully support the RFC

2017-09-08 Thread Brandon Carpenter
While updating the websocket code, several other bugs were discovered for which patches are also included early in the set. Brandon Carpenter (6): io: Always remove an old channel watch before adding a new one io: Small updates in preparation for websocket changes io: Add support for fragm

[Qemu-devel] [PATCH v2 5/6] io: Ignore websocket PING and PONG frames

2017-09-08 Thread Brandon Carpenter
Keep pings and gratuitous pongs generated by web browsers from killing websocket connections. Signed-off-by: Brandon Carpenter --- io/channel-websock.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/io/channel-websock.c b/io/channel-websock.c index

[Qemu-devel] [PATCH v2 2/6] io: Small updates in preparation for websocket changes

2017-09-08 Thread Brandon Carpenter
Gets rid of unnecessary bit shifting and performs proper EOF checking to avoid a large number of repeated calls to recvmsg() when a client abruptly terminates a connection (bug fix). Signed-off-by: Brandon Carpenter --- io/channel-websock.c | 62

[Qemu-devel] [PATCH v2 6/6] io: Reply to ping frames

2017-09-08 Thread Brandon Carpenter
Add an immediate ping reply (pong) to the outgoing stream when a ping is received. Unsolicited pongs are ignored. Signed-off-by: Brandon Carpenter --- io/channel-websock.c | 50 -- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/io

[Qemu-devel] [PATCH v2 3/6] io: Add support for fragmented websocket binary frames

2017-09-08 Thread Brandon Carpenter
Allows fragmented binary frames by saving the previous opcode. Handles the case where an intermediary (i.e., web proxy) fragments frames originally sent unfragmented by the client. Signed-off-by: Brandon Carpenter --- include/io/channel-websock.h | 1 + io/channel-websock.c | 26

[Qemu-devel] [PATCH v2 4/6] io: Allow empty websocket payload

2017-09-08 Thread Brandon Carpenter
Some browsers send pings/pongs with no payload, so allow empty payloads instead of closing the connection. Signed-off-by: Brandon Carpenter --- io/channel-websock.c | 62 +--- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/io

[Qemu-devel] [PATCH v2 1/6] io: Always remove an old channel watch before adding a new one

2017-09-08 Thread Brandon Carpenter
Also set saved handle to zero when removing without adding a new watch. Signed-off-by: Brandon Carpenter Reviewed-by: Paolo Bonzini Reviewed-by: Daniel P. Berrange --- ui/vnc-auth-vencrypt.c | 3 +++ ui/vnc-ws.c| 6 ++ ui/vnc.c | 4 3 files changed, 13

Re: [Qemu-devel] [PATCH] io: Always remove an old channel watch before adding a new one.

2017-09-08 Thread Brandon Carpenter
this patch in the cover letter? Thanks. -- Brandon Carpenter | Software Engineer Cypherpath, Inc. 400 Columbia Point Drive Ste 101 | Richland, Washington USA Office: (650) 713-3060 On Tue, Jul 25, 2017 at 1:36 AM, Daniel P. Berrange wrote: On Mon, Jul 24, 2017 at 11:15:44AM -0700, Br

Re: [Qemu-devel] [PATCH] io: Improve websocket support by becoming more RFC compliant.

2017-07-25 Thread Brandon Carpenter
Sure thing. I implemented it in multiple commits, but there was enough overlap in those commits that I thought it would require extra unnecessary work to review. But I also found an issue that needs fixed, so I need to resubmit anyway. -- Brandon Carpenter | Software Engineer Cypherpath, Inc

[Qemu-devel] [PATCH] io: Improve websocket support by becoming more RFC compliant.

2017-07-24 Thread Brandon Carpenter
the RFC, including providing reason code and message to aid debugging of unexpected disconnects. Empty payloads should not cause a disconnect. Signed-off-by: Brandon Carpenter --- include/io/channel-websock.h | 1 + io/channel-websock.c | 243

[Qemu-devel] [PATCH] io: Always remove an old channel watch before adding a new one.

2017-07-24 Thread Brandon Carpenter
Also set saved handle to zero when removing without adding a new watch. Signed-off-by: Brandon Carpenter --- ui/vnc-auth-vencrypt.c | 3 +++ ui/vnc-ws.c| 6 ++ ui/vnc.c | 4 3 files changed, 13 insertions(+) diff --git a/ui/vnc-auth-vencrypt.c b/ui/vnc-auth