1
This commit is contained in:
parent
4677716f1f
commit
51b01f8e79
@ -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);
|
||||
}
|
||||
|
||||
|
@ -17,5 +17,4 @@ class DownStream
|
||||
private:
|
||||
int socket_handle_ = a8::INVALID_SOCKET_HANDLE;
|
||||
std::weak_ptr<UpStream> up_;
|
||||
int type_ = 0;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user