[Asterisk-code-review] res http websocket: respond to CLOSE opcode (asterisk[16])

Jeremy Lainé asteriskteam at digium.com
Tue Jan 15 13:49:03 CST 2019


Jeremy Lainé has posted comments on this change. ( https://gerrit.asterisk.org/10861 )

Change subject: res_http_websocket: respond to CLOSE opcode
......................................................................


Patch Set 2:

Looking at the code some more I think that all control frames (PING, PONG, CLOSE) need an early exit in the code to ensure we don't continue into the defragmentation code. 

- the PING opcode handling doesn't do this, it only exits if we fail to send a PONG response. If we successfully send our response, the code will happily stuff the PING's payload into session->payload, possibly corrupting a data frame.

- there is no explicit PONG handling, so it will happily corrupt data frames too.

- the CLOSE opcode handling I added does exit.

I think control frame handling should also either not return a payload at all (since *payload will be pointing at a temporary buffer) or use something like a separate session->control_payload.


-- 
To view, visit https://gerrit.asterisk.org/10861
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-MessageType: comment
Gerrit-Change-Id: Icb1b60205fc77ee970ddc91d1f545671781344cf
Gerrit-Change-Number: 10861
Gerrit-PatchSet: 2
Gerrit-Owner: Jeremy Lainé <jeremy.laine at m4x.org>
Gerrit-Reviewer: Friendly Automation (1000185)
Gerrit-Reviewer: Jeremy Lainé <jeremy.laine at m4x.org>
Gerrit-Reviewer: Joshua C. Colp <jcolp at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-Comment-Date: Tue, 15 Jan 2019 19:49:03 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190115/e3d1767c/attachment.html>


More information about the asterisk-code-review mailing list