From 1804cbea7d94d70b93650262edfe3150c8bcb9df Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 1 Jun 2019 16:36:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0ext=5Flen=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/wsproxy/GCListener.cc | 2 +- server/wsproxy/target_conn.cc | 9 +++++---- third_party/framework | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/server/wsproxy/GCListener.cc b/server/wsproxy/GCListener.cc index 0832aed..0734db0 100644 --- a/server/wsproxy/GCListener.cc +++ b/server/wsproxy/GCListener.cc @@ -133,7 +133,7 @@ void GCListener::ForwardTargetConnMsg(f8::MsgHdr& hdr) head->msgid = hdr.msgid; head->seqid = hdr.seqid; head->magic_code = f8::MAGIC_CODE; - head->rpc_error_code = 0; + head->ext_len = hdr.buflen >> 16; if (hdr.buflen > 0) { memmove(buff + sizeof(f8::PackHead), hdr.buf, hdr.buflen); } diff --git a/server/wsproxy/target_conn.cc b/server/wsproxy/target_conn.cc index e5c1ea4..209359b 100644 --- a/server/wsproxy/target_conn.cc +++ b/server/wsproxy/target_conn.cc @@ -10,7 +10,7 @@ #include #include "app.h" -const int PACK_MAX = 1024 * 64; +const int PACK_MAX = 1024 * 64 * 2; void TargetConn::Init(int instance_id, const std::string& remote_ip, int remote_port) { @@ -157,8 +157,9 @@ void TargetConn::on_socketread(a8::TcpClient* sender, char* buf, unsigned int le unsigned int offset = 0; while (recv_bufflen_ - offset >= sizeof(f8::WSProxyPackHead_S)) { f8::WSProxyPackHead_S* p = (f8::WSProxyPackHead_S*) &recv_buff_[offset]; + int real_len = p->packlen + (p->ext_len << 16); if (p->magic_code == f8::MAGIC_CODE) { - if (recv_bufflen_ - offset < sizeof(f8::WSProxyPackHead_S) + p->packlen) { + if (recv_bufflen_ - offset < sizeof(f8::WSProxyPackHead_S) + real_len) { break; } App::Instance()->AddSocketMsg(SF_TargetServer, @@ -167,8 +168,8 @@ void TargetConn::on_socketread(a8::TcpClient* sender, char* buf, unsigned int le p->msgid, p->seqid, &recv_buff_[offset + sizeof(f8::WSProxyPackHead_S)], - p->packlen); - offset += sizeof(f8::WSProxyPackHead_S) + p->packlen; + real_len); + offset += sizeof(f8::WSProxyPackHead_S) + real_len; } else { warning = true; offset++; diff --git a/third_party/framework b/third_party/framework index 7af5d3b..366eeab 160000 --- a/third_party/framework +++ b/third_party/framework @@ -1 +1 @@ -Subproject commit 7af5d3b84aeaa84a2979c24db9db5ed5a43cea2d +Subproject commit 366eeab6832866357dec147004b99a0c95e7ad8f