From: Nickolay Shmyrev Date: Mon, 22 Jun 2020 17:16:15 +0000 (+0200) Subject: res_http_websocket.c: Continue reading after ping/pong X-Git-Tag: 18.0.0-rc1~51 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7163efd934b75a39c766313ec2eec05c1439dbf0;p=thirdparty%2Fasterisk.git 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 --- diff --git a/res/res_http_websocket.c b/res/res_http_websocket.c index 5d14ac6889..fdcb0d9a93 100644 --- a/res/res_http_websocket.c +++ b/res/res_http_websocket.c @@ -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; }