添加ext_len处理
This commit is contained in:
parent
72b2b79e58
commit
1804cbea7d
@ -133,7 +133,7 @@ void GCListener::ForwardTargetConnMsg(f8::MsgHdr& hdr)
|
|||||||
head->msgid = hdr.msgid;
|
head->msgid = hdr.msgid;
|
||||||
head->seqid = hdr.seqid;
|
head->seqid = hdr.seqid;
|
||||||
head->magic_code = f8::MAGIC_CODE;
|
head->magic_code = f8::MAGIC_CODE;
|
||||||
head->rpc_error_code = 0;
|
head->ext_len = hdr.buflen >> 16;
|
||||||
if (hdr.buflen > 0) {
|
if (hdr.buflen > 0) {
|
||||||
memmove(buff + sizeof(f8::PackHead), hdr.buf, hdr.buflen);
|
memmove(buff + sizeof(f8::PackHead), hdr.buf, hdr.buflen);
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include <a8/timer.h>
|
#include <a8/timer.h>
|
||||||
#include "app.h"
|
#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)
|
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;
|
unsigned int offset = 0;
|
||||||
while (recv_bufflen_ - offset >= sizeof(f8::WSProxyPackHead_S)) {
|
while (recv_bufflen_ - offset >= sizeof(f8::WSProxyPackHead_S)) {
|
||||||
f8::WSProxyPackHead_S* p = (f8::WSProxyPackHead_S*) &recv_buff_[offset];
|
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 (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;
|
break;
|
||||||
}
|
}
|
||||||
App::Instance()->AddSocketMsg(SF_TargetServer,
|
App::Instance()->AddSocketMsg(SF_TargetServer,
|
||||||
@ -167,8 +168,8 @@ void TargetConn::on_socketread(a8::TcpClient* sender, char* buf, unsigned int le
|
|||||||
p->msgid,
|
p->msgid,
|
||||||
p->seqid,
|
p->seqid,
|
||||||
&recv_buff_[offset + sizeof(f8::WSProxyPackHead_S)],
|
&recv_buff_[offset + sizeof(f8::WSProxyPackHead_S)],
|
||||||
p->packlen);
|
real_len);
|
||||||
offset += sizeof(f8::WSProxyPackHead_S) + p->packlen;
|
offset += sizeof(f8::WSProxyPackHead_S) + real_len;
|
||||||
} else {
|
} else {
|
||||||
warning = true;
|
warning = true;
|
||||||
offset++;
|
offset++;
|
||||||
|
2
third_party/framework
vendored
2
third_party/framework
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 7af5d3b84aeaa84a2979c24db9db5ed5a43cea2d
|
Subproject commit 366eeab6832866357dec147004b99a0c95e7ad8f
|
Loading…
x
Reference in New Issue
Block a user