From f93c9872e3d8f162f66937121d3d12893d216c14 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 25 Sep 2019 14:13:36 +0800 Subject: [PATCH] =?UTF-8?q?websocketsession=E6=B7=BB=E5=8A=A0=E9=98=B2?= =?UTF-8?q?=E5=BE=A1=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a8/websocketsession.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/a8/websocketsession.cc b/a8/websocketsession.cc index c3aae61..e6081c1 100644 --- a/a8/websocketsession.cc +++ b/a8/websocketsession.cc @@ -212,16 +212,20 @@ namespace a8 Close(); return; } + if (opcode != BINARY_MODE) { + Close(); + return; + } if (!is_final_frame) { + Close(); return; } bool is_masked = (mask_payloadlen & 0x80) == 0x80; - if (opcode != BINARY_MODE) { + if (!is_masked) { + Close(); return; } - assert(opcode == BINARY_MODE); - assert(is_masked); unsigned char payloadlen = mask_payloadlen & 0x7F; unsigned int framelen = 0;