]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_http_websocket.c: Continue reading after ping/pong
authorNickolay Shmyrev <nshmyrev@alphacephei.com>
Mon, 22 Jun 2020 17:16:15 +0000 (19:16 +0200)
committerGeorge Joseph <gjoseph@digium.com>
Tue, 7 Jul 2020 14:34:12 +0000 (09:34 -0500)
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

res/res_http_websocket.c

index 2baf9177c57f0f96e27e5f1093ee1f4632b10119..b5d50e6b9649ea88f4d7065f004339ca5b24235e 100644 (file)
@@ -1452,6 +1452,12 @@ int AST_OPTIONAL_API_NAME(ast_websocket_read_string)
                        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;
                }