Skip to content

Commit 1ab717e

Browse files
committed
update:match xengine v9
1 parent 153aff6 commit 1ab717e

File tree

11 files changed

+40
-37
lines changed

11 files changed

+40
-37
lines changed

README.en.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ c c++ SOCKS5代理服务 HTTP Tunnel隧道代理服务 tcp转发服务
77
c c++ Socks5 Proxy Service,HTTP Tunnel Proxy Service,tcp forward service
88

99
## Notice
10-
Starting from 2024.11.15, the compiled release version will only be released on github.
10+
the compiled release version will only be released on github.
1111

1212
#### Software Architecture
1313
the software developed based on xengine,using c/c++ development
@@ -27,7 +27,7 @@ this software support following features
2727
## install
2828

2929
#### XEngine Evn
30-
you must install XEngine,need V8.15 or above,install XEngine can be refer to xengine Readme docment
30+
you must install XEngine,need V9.x or above,install XEngine can be refer to xengine Readme docment
3131
GITEE:https://gitee.com/xyry/libxengine
3232
GITHUB:https://github.com/libxengine/xengine
3333

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
只要仓库不是在暂停状态,那么就会有人一直维护和开发,请放心使用
55

66
## 注意
7-
自2024.11.15起.编译发布版本将只在github上面发布.
7+
编译发布版本将只在github上面发布.
88

99
## 介绍
1010
c c++ SOCKS5代理服务 HTTP Tunnel隧道代理服务 tcp转发服务
@@ -27,7 +27,7 @@ c c++ Socks5 Proxy Service,HTTP Tunnel Proxy Service,tcp forward service
2727
## 安装教程
2828

2929
#### XEngine环境
30-
必须安装XEngine,版本需要V8.15或者以上版本,安装XEngine可以参考其Readme文档
30+
必须安装XEngine,版本需要V9.x或者以上版本,安装XEngine可以参考其Readme文档
3131
GITEE:https://gitee.com/xyry/libxengine
3232
GITHUB:https://github.com/libxengine/xengine
3333

XEngine_Source/XEngine_ModuleSession/ModuleSession_Forward/ModuleSession_Forward.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ bool CModuleSession_Forward::ModuleSession_Forward_List(SESSION_FORWARD*** pppSt
112112
{
113113
*pInt_Count = stl_MapSession.size() - 1; //减去自己
114114
}
115-
BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_ListUser, *pInt_Count, sizeof(SESSION_FORWARD));
115+
BaseLib_Memory_Malloc((XPPPMEM)pppSt_ListUser, *pInt_Count, sizeof(SESSION_FORWARD));
116116
//遍历
117117
auto stl_MapIterator = stl_MapSession.begin();
118118
for (int i = 0; stl_MapIterator != stl_MapSession.end(); stl_MapIterator++, i++)

XEngine_Source/XEngine_ModuleSession/ModuleSession_Socks/ModuleSession_Socks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ bool CModuleSession_Socks::ModuleSession_Socks_GetList(XPPPMEM xpppMem, int* pIn
249249
st_Locker.lock_shared();
250250

251251
*pInt_Count = stl_MapClients.size();
252-
BaseLib_OperatorMemory_Malloc(xpppMem, *pInt_Count, nSize);
252+
BaseLib_Memory_Malloc(xpppMem, *pInt_Count, nSize);
253253

254254
unordered_map<tstring, RFCPROTOCOL_SOCKS5CLIENT*>::const_iterator stl_MapIterator = stl_MapClients.begin();
255255
for (int i = 0; stl_MapIterator != stl_MapClients.end(); stl_MapIterator++, i++)
@@ -379,7 +379,7 @@ bool CModuleSession_Socks::ModuleSession_Socks_List(XCHAR*** ppptszClientList, i
379379
*pInt_ListCount = stl_MapClients.size();
380380
if (NULL != ppptszClientList)
381381
{
382-
BaseLib_OperatorMemory_Malloc((XPPPMEM)ppptszClientList, stl_MapClients.size(), 128);
382+
BaseLib_Memory_Malloc((XPPPMEM)ppptszClientList, stl_MapClients.size(), 128);
383383
auto stl_MapIterator = stl_MapClients.begin();
384384
for (int i = 0; stl_MapIterator != stl_MapClients.end(); stl_MapIterator++)
385385
{

XEngine_Source/XEngine_ModuleSession/ModuleSession_Tunnel/ModuleSession_Tunnel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ bool CModuleSession_Tunnel::ModuleSession_Tunnel_GetList(XPPPMEM xpppMem, int* p
261261
st_Locker.lock_shared();
262262

263263
*pInt_Count = stl_MapClient.size();
264-
BaseLib_OperatorMemory_Malloc(xpppMem, *pInt_Count, nSize);
264+
BaseLib_Memory_Malloc(xpppMem, *pInt_Count, nSize);
265265
unordered_map<tstring, PROXYTUNNEL_CLIENTINFO*>::const_iterator stl_MapIterator = stl_MapClient.begin();
266266
for (int i = 0; stl_MapIterator != stl_MapClient.end(); stl_MapIterator++, i++)
267267
{
@@ -375,7 +375,7 @@ bool CModuleSession_Tunnel::ModuleSession_Tunnel_List(XCHAR*** ppptszClientList,
375375
*pInt_ListCount = stl_MapClient.size();
376376
if (NULL != ppptszClientList)
377377
{
378-
BaseLib_OperatorMemory_Malloc((XPPPMEM)ppptszClientList, stl_MapClient.size(), 128);
378+
BaseLib_Memory_Malloc((XPPPMEM)ppptszClientList, stl_MapClient.size(), 128);
379379
auto stl_MapIterator = stl_MapClient.begin();
380380
for (int i = 0; stl_MapIterator != stl_MapClient.end(); stl_MapIterator++)
381381
{

XEngine_Source/XEngine_ServiceApp/XEngine_ForwardTask.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ XHTHREAD CALLBACK XEngine_Forward_Thread(XPVOID lParam)
3434
if (HelpComponents_Datas_GetMemoryEx(xhForwardPacket, ppSt_ListClient[i]->tszClientAddr, &ptszMsgBuffer, &nMsgLen, &st_ProtocolHdr))
3535
{
3636
XEngine_Forward_Handle(ppSt_ListClient[i]->tszClientAddr, ptszMsgBuffer, nMsgLen, &st_ProtocolHdr);
37-
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
37+
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
3838
}
3939
}
40-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListClient, nListCount);
40+
BaseLib_Memory_Free((XPPPMEM)&ppSt_ListClient, nListCount);
4141
}
4242
return 0;
4343
}
@@ -87,7 +87,7 @@ bool XEngine_Forward_Handle(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int n
8787
pSt_ProtocolHdr->unOperatorCode = XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_FORWARD_LISTREP;
8888
ModuleSession_Forward_List(&ppSt_ListUser, &nListCount, lpszClientAddr);
8989
ModuleProtocol_Packet_ForwardList(tszSDBuffer, &nSDLen, pSt_ProtocolHdr, &ppSt_ListUser, nListCount);
90-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListUser, nListCount);
90+
BaseLib_Memory_Free((XPPPMEM)&ppSt_ListUser, nListCount);
9191
XEngine_Network_Send(lpszClientAddr, tszSDBuffer, nSDLen, XENGINE_CLIENT_NETTYPE_FORWARD);
9292
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("Forward客户端:%s,请求可用转发列表成功"), lpszClientAddr);
9393
}
@@ -130,7 +130,7 @@ bool XEngine_Forward_Handle(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int n
130130
//匿名绑定,请求连接
131131
int nPort = 0;
132132
XNETHANDLE xhClient = 0;
133-
BaseLib_OperatorIPAddr_SegAddr(tszDstAddr, &nPort);
133+
APIAddr_IPAddr_SegAddr(tszDstAddr, &nPort);
134134
if (!XClient_TCPSelect_InsertEx(xhForwardClient, &xhClient, tszDstAddr, nPort))
135135
{
136136
pSt_ProtocolHdr->wReserve = 500;
@@ -183,5 +183,5 @@ void CALLBACK XEngine_Forward_CBRecv(XHANDLE xhToken, XNETHANDLE xhClient, XSOCK
183183
break;
184184
}
185185
}
186-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ClientList, nListCount);
186+
BaseLib_Memory_Free((XPPPMEM)&ppSt_ClientList, nListCount);
187187
}

XEngine_Source/XEngine_ServiceApp/XEngine_Hdr.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ using namespace std;
3131
#include <XEngine_Include/XEngine_Core/NetCore_Error.h>
3232
#include <XEngine_Include/XEngine_Core/ManagePool_Define.h>
3333
#include <XEngine_Include/XEngine_Core/ManagePool_Error.h>
34-
#include <XEngine_Include/XEngine_Core/OPenSsl_Define.h>
35-
#include <XEngine_Include/XEngine_Core/OPenSsl_Error.h>
34+
#include <XEngine_Include/XEngine_Core/Cryption_Define.h>
35+
#include <XEngine_Include/XEngine_Core/Cryption_Error.h>
3636
#include <XEngine_Include/XEngine_NetHelp/XSocket_Define.h>
3737
#include <XEngine_Include/XEngine_NetHelp/XSocket_Error.h>
3838
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Define.h>
3939
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Error.h>
40+
#include <XEngine_Include/XEngine_NetHelp/APIAddr_Define.h>
41+
#include <XEngine_Include/XEngine_NetHelp/APIAddr_Error.h>
4042
#include <XEngine_Include/XEngine_HelpComponents/XLog_Define.h>
4143
#include <XEngine_Include/XEngine_HelpComponents/XLog_Error.h>
4244
#include <XEngine_Include/XEngine_HelpComponents/Packets_Define.h>
@@ -138,9 +140,10 @@ typedef struct
138140
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib.lib")
139141
#pragma comment(lib,"XEngine_Core/XEngine_Core.lib")
140142
#pragma comment(lib,"XEngine_Core/XEngine_ManagePool.lib")
141-
#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl.lib")
143+
#pragma comment(lib,"XEngine_Core/XEngine_Cryption.lib")
142144
#pragma comment(lib,"XEngine_Client/XClient_Socket.lib")
143145
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIHelp.lib")
146+
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIAddr.lib")
144147
#pragma comment(lib,"XEngine_NetHelp/NetHelp_XSocket.lib")
145148
#pragma comment(lib,"XEngine_HelpComponents/HelpComponents_XLog.lib")
146149
#pragma comment(lib,"XEngine_HelpComponents/HelpComponents_Packets.lib")

XEngine_Source/XEngine_ServiceApp/XEngine_Network.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void XEngine_Network_Close(LPCXSTR lpszClientAddr, int nIPProto, int nCloseType)
128128
break;
129129
}
130130
}
131-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ClientList, nListCount);
131+
BaseLib_Memory_Free((XPPPMEM)&ppSt_ClientList, nListCount);
132132
ModuleSession_Socks_Delete(lpszClientAddr);
133133
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("SOCKS客户端:%s,离开服务器,离开类型;%d"), lpszClientAddr, nCloseType);
134134
}
@@ -159,7 +159,7 @@ void XEngine_Network_Close(LPCXSTR lpszClientAddr, int nIPProto, int nCloseType)
159159
break;
160160
}
161161
}
162-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ClientList, nListCount);
162+
BaseLib_Memory_Free((XPPPMEM)&ppSt_ClientList, nListCount);
163163
ModuleSession_Tunnel_Delete(lpszClientAddr);
164164
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("Tunnel客户端:%s,离开服务器,离开类型;%d"), lpszClientAddr, nCloseType);
165165
}

XEngine_Source/XEngine_ServiceApp/XEngine_ServiceApp.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ LONG WINAPI Coredump_ExceptionFilter(EXCEPTION_POINTERS* pExceptionPointers)
8383
static int i = 0;
8484
XCHAR tszFileStr[MAX_PATH] = {};
8585
XCHAR tszTimeStr[128] = {};
86-
BaseLib_OperatorTime_TimeToStr(tszTimeStr);
86+
BaseLib_Time_TimeToStr(tszTimeStr);
8787
_xstprintf(tszFileStr, _X("./XEngine_Coredump/dumpfile_%s_%d.dmp"), tszTimeStr, i++);
8888

8989
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_FATAL, _X("主程序:软件崩溃,写入dump:%s"), tszFileStr);
@@ -139,10 +139,10 @@ int main(int argc, char** argv)
139139
HelpComponents_XLog_SetLogPriority(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO);
140140
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化日志系统成功"));
141141

142-
BaseLib_OperatorVer_XGetStu(&st_VERXEngine);
142+
BaseLib_Version_XGetStu(&st_VERXEngine);
143143
if (st_VERXEngine.nVerCore < 8 || st_VERXEngine.nVerMain < 39)
144144
{
145-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,当前XEngine:%s 版本过低,无法正常使用"), BaseLib_OperatorVer_XNumberStr());
145+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,当前XEngine:%s 版本过低,无法正常使用"), BaseLib_Version_XNumberStr());
146146
goto XENGINE_SERVICEAPP_EXIT;
147147
}
148148

@@ -271,7 +271,7 @@ int main(int argc, char** argv)
271271
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,注册Forward网络事件成功"));
272272
//任务池
273273
THREADPOOL_PARAMENT** ppSt_ListParam;
274-
BaseLib_OperatorMemory_Malloc((XPPPMEM)&ppSt_ListParam, st_ServiceConfig.st_XMax.nForwardThread, sizeof(THREADPOOL_PARAMENT));
274+
BaseLib_Memory_Malloc((XPPPMEM)&ppSt_ListParam, st_ServiceConfig.st_XMax.nForwardThread, sizeof(THREADPOOL_PARAMENT));
275275
for (int i = 0; i < st_ServiceConfig.st_XMax.nForwardThread; i++)
276276
{
277277
int* pInt_Pos = new int;
@@ -319,7 +319,7 @@ int main(int argc, char** argv)
319319
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,信息报告给API服务器没有启用"));
320320
}
321321

322-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("所有服务成功启动,服务运行中,XEngine版本:%s%s,服务版本:%s,发行次数:%d。。。"), BaseLib_OperatorVer_XNumberStr(), BaseLib_OperatorVer_XTypeStr(), st_ServiceConfig.st_XVer.pStl_ListVer->front().c_str(), st_ServiceConfig.st_XVer.pStl_ListVer->size());
322+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("所有服务成功启动,服务运行中,XEngine版本:%s%s,服务版本:%s,发行次数:%d。。。"), BaseLib_Version_XNumberStr(), BaseLib_Version_XTypeStr(), st_ServiceConfig.st_XVer.pStl_ListVer->front().c_str(), st_ServiceConfig.st_XVer.pStl_ListVer->size());
323323

324324
while (true)
325325
{

XEngine_Source/XEngine_ServiceApp/XEngine_SocksTask.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ bool XEngine_SocksTask_Handle(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int
127127
{
128128
int nListCount = 0;
129129
XCHAR** ppszListAddr;
130-
ENUM_APIHELP_DOMAINTYPE enDomainType;
131-
APIHELP_DOMAIN st_APIUrl;
130+
ENUM_NETHELP_APIADDR_DOMAIN_TYPE enDomainType;
131+
APIADDR_DOMAIN st_APIUrl;
132132

133-
memset(&st_APIUrl, '\0', sizeof(APIHELP_DOMAIN));
133+
memset(&st_APIUrl, '\0', sizeof(APIADDR_DOMAIN));
134134

135-
APIHelp_Domain_GetInfo(tszClientAddr, &st_APIUrl, &enDomainType);
135+
APIAddr_Domain_GetInfo(tszClientAddr, &st_APIUrl, &enDomainType);
136136
memset(tszClientAddr, '\0', sizeof(tszClientAddr));
137137
if (_tcsxlen(st_APIUrl.tszSubDomain) > 0)
138138
{
@@ -150,7 +150,7 @@ bool XEngine_SocksTask_Handle(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int
150150
}
151151
memset(tszClientAddr, '\0', sizeof(tszClientAddr));
152152
_tcsxcpy(tszClientAddr, ppszListAddr[0]); //随便选择一个IP地址
153-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppszListAddr, nListCount);
153+
BaseLib_Memory_Free((XPPPMEM)&ppszListAddr, nListCount);
154154
if (!XClient_TCPSelect_InsertEx(xhSocksClient, &st_ProxyClient.xhClient, tszClientAddr, nPort))
155155
{
156156
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("SOCKS客户端:%s,创建客户端连接失败,连接到服务器:%s:%d,错误:%lX"), lpszClientAddr, tszClientAddr, nPort, XClient_GetLastError());
@@ -211,5 +211,5 @@ void CALLBACK XEngine_Socks_CBRecv(XHANDLE xhToken, XNETHANDLE xhClient, XSOCKET
211211
break;
212212
}
213213
}
214-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ClientList, nListCount);
214+
BaseLib_Memory_Free((XPPPMEM)&ppSt_ClientList, nListCount);
215215
}

0 commit comments

Comments
 (0)