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

Sean Bright asteriskteam at digium.com
Tue Jan 15 08:49:04 CST 2019


Sean Bright has posted comments on this change. ( https://gerrit.asterisk.org/10861 )

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


Patch Set 2:

So there are two WebSocket bugs that this fixes:

1) We weren't unmasking the close frame payload
2) We aren't echoing the status code in our own close frame

On the other hand, the fact that the connection isn't closing when the WebSocket callback read loop exits is a separate bug and I don't think that this is the appropriate way to resolve it. You will note that if you run your test-ws.py script specifying 'echo' as the subprotocol, the connection is closed as expected (ignoring that the wrong status code is echoed back to the client).

The idle check in res_pjsip_transport_management is keeping a reference to the transport which, when released, allows the transport to be shutdown. This only happens when the scheduler fires ~32 seconds after the connection is established. What we should do is cancel the scheduled task and release the transport reference there, which would allow for immediate closure.


-- 
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 14:49:04 +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/63db45fc/attachment.html>


More information about the asterisk-code-review mailing list