[Asterisk-code-review] res pjsip transport websocket: Don't assert on 0 length payl... (asterisk[16])

Friendly Automation asteriskteam at digium.com
Mon Jan 14 09:36:40 CST 2019


Friendly Automation has uploaded this change for review. ( https://gerrit.asterisk.org/10874


Change subject: res_pjsip_transport_websocket: Don't assert on 0 length payloads
......................................................................

res_pjsip_transport_websocket: Don't assert on 0 length payloads

When --enable-dev-mode is used, pjsip_tpmgr_receive_packet() will assert
if passed a payload length of 0, so treat empty frames as if we didn't
receive them.

Change-Id: I9c5fdccd89cc8d2f3ed7e3ee405ef0fc78178f48
---
M res/res_pjsip_transport_websocket.c
1 file changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/74/10874/1

diff --git a/res/res_pjsip_transport_websocket.c b/res/res_pjsip_transport_websocket.c
index 2abbf15..73268ea 100644
--- a/res/res_pjsip_transport_websocket.c
+++ b/res/res_pjsip_transport_websocket.c
@@ -396,7 +396,9 @@
 		}
 
 		if (opcode == AST_WEBSOCKET_OPCODE_TEXT || opcode == AST_WEBSOCKET_OPCODE_BINARY) {
-			ast_sip_push_task_wait_serializer(serializer, transport_read, &read_data);
+			if (read_data.payload_len) {
+				ast_sip_push_task_wait_serializer(serializer, transport_read, &read_data);
+			}
 		} else if (opcode == AST_WEBSOCKET_OPCODE_CLOSE) {
 			break;
 		}

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

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9c5fdccd89cc8d2f3ed7e3ee405ef0fc78178f48
Gerrit-Change-Number: 10874
Gerrit-PatchSet: 1
Gerrit-Owner: Friendly Automation (1000185)
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190114/7af3a2ca/attachment.html>


More information about the asterisk-code-review mailing list