From 40c1ea9b4cfff868a95e27bcbc77f629e18331c5 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Fri, 28 Sep 2018 09:29:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E7=BB=9F=E4=B8=80=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=BATEXT=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Http/HttpsSession.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Http/HttpsSession.h b/src/Http/HttpsSession.h index 140f300a..251c34bc 100644 --- a/src/Http/HttpsSession.h +++ b/src/Http/HttpsSession.h @@ -135,10 +135,12 @@ protected: _session->setOnBeforeSendCB([weakSelf](const Buffer::Ptr &buf){ auto strongSelf = weakSelf.lock(); if(strongSelf){ - bool mask_flag = strongSelf->_mask_flag; - strongSelf->_mask_flag = false; - strongSelf->WebSocketSplitter::encode(*strongSelf,(uint8_t *)buf->data(),buf->size()); - strongSelf->_mask_flag = mask_flag; + WebSocketHeader header; + header._fin = true; + header._reserved = 0; + header._opcode = WebSocketHeader::TEXT; + header._mask_flag = false; + strongSelf->WebSocketSplitter::encode(header,(uint8_t *)buf->data(),buf->size()); } return buf->size(); });