[Asterisk-code-review] res_http_websocket.c: Continue reading after ping/pong (asterisk[17])

George Joseph asteriskteam at digium.com
Tue Jul 7 09:34:14 CDT 2020


George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/14644 )

Change subject: res_http_websocket.c: Continue reading after ping/pong
......................................................................

res_http_websocket.c: Continue reading after ping/pong

Do not return error if the client received ping frame
while looking for a string and just wait for another frame.

ASTERISK-28958 #close

Change-Id: I4d06b4827bd71e56cbaafc011ffdcef9f0332922
---
M res/res_http_websocket.c
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/res/res_http_websocket.c b/res/res_http_websocket.c
index 2baf917..b5d50e6 100644
--- a/res/res_http_websocket.c
+++ b/res/res_http_websocket.c
@@ -1452,6 +1452,12 @@
 			return -1;
 		}
 
+		if (opcode == AST_WEBSOCKET_OPCODE_PING) {
+			/* Try read again, we have sent pong already */
+			fragmented = 1;
+			continue;
+		}
+
 		if (opcode == AST_WEBSOCKET_OPCODE_CONTINUATION) {
 			continue;
 		}

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

Gerrit-Project: asterisk
Gerrit-Branch: 17
Gerrit-Change-Id: I4d06b4827bd71e56cbaafc011ffdcef9f0332922
Gerrit-Change-Number: 14644
Gerrit-PatchSet: 2
Gerrit-Owner: Nickolay V. Shmyrev <nshmyrev at alphacephei.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200707/b2889d95/attachment.html>


More information about the asterisk-code-review mailing list