This commit is contained in:
aozhiwei 2023-04-24 11:40:28 +08:00
parent 4677716f1f
commit 51b01f8e79
2 changed files with 5 additions and 7 deletions

View File

@ -5,6 +5,7 @@
#include "longsessionmgr.h"
#include "GCListener.h"
#include "longsession.h"
#include "kcpsession.h"
#include "ss_proto.pb.h"
@ -32,14 +33,12 @@ void DownStream::ForwardUpStreamMsg(f8::MsgHdr& hdr)
memmove(buff + sizeof(f8::PackHead), hdr.buf, hdr.buflen);
}
#ifdef USE_KCP
auto session = GetKcpSessionBySocketHandle(hdr.socket_handle);
auto session = LongSessionMgr::Instance()->GetSession(hdr.socket_handle);
if (session) {
session->SendClientMsg(buff, sizeof(f8::PackHead) + head->packlen);
session->GetKcpSession()->SendClientMsg(buff, sizeof(f8::PackHead) + head->packlen);
} else {
GCListener::Instance()->SendBuf(hdr.socket_handle, buff, sizeof(f8::PackHead) + head->packlen);
}
#else
GCListener::Instance()->SendBuf(hdr.socket_handle, buff, sizeof(f8::PackHead) + head->packlen);
#endif
free(buff);
}

View File

@ -17,5 +17,4 @@ class DownStream
private:
int socket_handle_ = a8::INVALID_SOCKET_HANDLE;
std::weak_ptr<UpStream> up_;
int type_ = 0;
};