Skip to content

Commit 5ccde20

Browse files
committed
delete:DBModule_MQData_List function for dbmoudle
1 parent 520ce28 commit 5ccde20

File tree

6 files changed

+8
-155
lines changed

6 files changed

+8
-155
lines changed

XEngine_Source/MQCore_DBModule/DBModule_Define.h

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -129,35 +129,6 @@ extern "C" bool DBModule_MQData_Query(XENGINE_DBMESSAGEQUEUE* pSt_DBInfo);
129129
*********************************************************************/
130130
extern "C" bool DBModule_MQData_Modify(XENGINE_DBMESSAGEQUEUE* pSt_DBInfo);
131131
/********************************************************************
132-
函数名称:DBModule_MQData_List
133-
函数功能:枚举指定主题序列号后的数据
134-
参数.一:lpszQueueName
135-
In/Out:In
136-
类型:常量字符指针
137-
可空:N
138-
意思:输入要处理的主题
139-
参数.二:nSerial
140-
In/Out:In
141-
类型:整数型
142-
可空:N
143-
意思:输入主题序列号
144-
参数.三:pppSt_DBMessage
145-
In/Out:Out
146-
类型:三级指针
147-
可空:N
148-
意思:输出数据队列信息
149-
参数.四:pInt_ListCount
150-
In/Out:Out
151-
类型:整数型
152-
可空:N
153-
意思:输出数据队列大小
154-
返回值
155-
类型:逻辑型
156-
意思:是否成功
157-
备注:
158-
*********************************************************************/
159-
extern "C" bool DBModule_MQData_List(LPCXSTR lpszQueueName, __int64x nSerial, XENGINE_DBMESSAGEQUEUE*** pppSt_DBMessage, int* pInt_ListCount);
160-
/********************************************************************
161132
函数名称:DBModule_MQData_GetSerial
162133
函数功能:获取序列号
163134
参数.一:lpszName

XEngine_Source/MQCore_DBModule/DBModule_MQData/DBModule_MQData.cpp

Lines changed: 0 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -273,122 +273,6 @@ bool CDBModule_MQData::DBModule_MQData_Modify(XENGINE_DBMESSAGEQUEUE* pSt_DBInfo
273273
return true;
274274
}
275275
/********************************************************************
276-
函数名称:DBModule_MQData_List
277-
函数功能:枚举指定主题序列号后的数据
278-
参数.一:lpszQueueName
279-
In/Out:In
280-
类型:常量字符指针
281-
可空:N
282-
意思:输入要处理的主题
283-
参数.二:nSerial
284-
In/Out:In
285-
类型:整数型
286-
可空:N
287-
意思:输入主题序列号
288-
参数.三:pppSt_DBMessage
289-
In/Out:Out
290-
类型:三级指针
291-
可空:N
292-
意思:输出数据队列信息
293-
参数.四:pInt_ListCount
294-
In/Out:Out
295-
类型:整数型
296-
可空:N
297-
意思:输出数据队列大小
298-
返回值
299-
类型:逻辑型
300-
意思:是否成功
301-
备注:
302-
*********************************************************************/
303-
bool CDBModule_MQData::DBModule_MQData_List(LPCXSTR lpszQueueName, __int64x nSerial, XENGINE_DBMESSAGEQUEUE*** pppSt_DBMessage, int* pInt_ListCount)
304-
{
305-
DBModule_IsErrorOccur = false;
306-
307-
if (NULL == lpszQueueName)
308-
{
309-
DBModule_IsErrorOccur = true;
310-
DBModule_dwErrorCode = ERROR_XENGINE_MQCORE_DATABASE_PARAMENT;
311-
return false;
312-
}
313-
//查询
314-
XNETHANDLE xhTable = 0;
315-
__int64u nllLine = 0;
316-
__int64u nllRow = 0;
317-
318-
XCHAR tszSQLStatement[1024];
319-
memset(tszSQLStatement, '\0', sizeof(tszSQLStatement));
320-
//名称为,消息名为必填
321-
_xstprintf(tszSQLStatement, _X("SELECT * FROM `%s` WHERE nQueueSerial >= %lld"), lpszQueueName, nSerial);
322-
if (!DataBase_MySQL_ExecuteQuery(xhDBSQL, &xhTable, tszSQLStatement, &nllLine, &nllRow))
323-
{
324-
DBModule_IsErrorOccur = true;
325-
DBModule_dwErrorCode = DataBase_GetLastError();
326-
return false;
327-
}
328-
if (nllLine <= 0)
329-
{
330-
DBModule_IsErrorOccur = true;
331-
DBModule_dwErrorCode = ERROR_XENGINE_MQCORE_DATABASE_EMPTY;
332-
return false;
333-
}
334-
*pInt_ListCount = (int)nllLine;
335-
BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_DBMessage, (int)nllLine, sizeof(XENGINE_DBMESSAGEQUEUE));
336-
for (__int64u i = 0; i < nllLine; i++)
337-
{
338-
XCHAR** pptszResult = DataBase_MySQL_GetResult(xhDBSQL, xhTable);
339-
XLONG* pInt_Length = DataBase_MySQL_GetLength(xhDBSQL, xhTable);
340-
341-
int nPos = 1;
342-
if (NULL != pptszResult[nPos])
343-
{
344-
_tcsxcpy((*pppSt_DBMessage)[i]->tszUserName, pptszResult[nPos]);
345-
}
346-
nPos++;
347-
if (NULL != pptszResult[nPos])
348-
{
349-
_tcsxcpy((*pppSt_DBMessage)[i]->tszQueueName, pptszResult[nPos]);
350-
}
351-
nPos++;
352-
if (NULL != pptszResult[nPos])
353-
{
354-
(*pppSt_DBMessage)[i]->nQueueSerial = _ttxoll(pptszResult[nPos]);
355-
}
356-
nPos++;
357-
if (NULL != pptszResult[nPos])
358-
{
359-
_tcsxcpy((*pppSt_DBMessage)[i]->tszQueueLeftTime, pptszResult[nPos]);
360-
}
361-
nPos++;
362-
if (NULL != pptszResult[nPos])
363-
{
364-
_tcsxcpy((*pppSt_DBMessage)[i]->tszQueuePublishTime, pptszResult[nPos]);
365-
}
366-
nPos++;
367-
if (NULL != pptszResult[nPos])
368-
{
369-
(*pppSt_DBMessage)[i]->nMsgLen = pInt_Length[nPos];
370-
memcpy((*pppSt_DBMessage)[i]->tszMsgBuffer, pptszResult[nPos], (*pppSt_DBMessage)[i]->nMsgLen);
371-
}
372-
nPos++;
373-
if (NULL != pptszResult[nPos])
374-
{
375-
(*pppSt_DBMessage)[i]->byMsgType = _ttxoi(pptszResult[nPos]);
376-
}
377-
nPos++;
378-
if (NULL != pptszResult[nPos])
379-
{
380-
(*pppSt_DBMessage)[i]->nMsgAttr = _ttxoi(pptszResult[nPos]);
381-
}
382-
nPos++;
383-
if (NULL != pptszResult[nPos])
384-
{
385-
_tcsxcpy((*pppSt_DBMessage)[i]->tszQueueCreateTime, pptszResult[nPos]);
386-
}
387-
}
388-
DataBase_MySQL_FreeResult(xhDBSQL, xhTable);
389-
return true;
390-
}
391-
/********************************************************************
392276
函数名称:DBModule_MQData_GetSerial
393277
函数功能:获取序列号
394278
参数.一:lpszName

XEngine_Source/MQCore_DBModule/DBModule_MQData/DBModule_MQData.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class CDBModule_MQData
2222
bool DBModule_MQData_Insert(XENGINE_DBMESSAGEQUEUE* pSt_DBInfo);
2323
bool DBModule_MQData_Query(XENGINE_DBMESSAGEQUEUE* pSt_DBInfo);
2424
bool DBModule_MQData_Modify(XENGINE_DBMESSAGEQUEUE* pSt_DBInfo);
25-
bool DBModule_MQData_List(LPCXSTR lpszQueueName, __int64x nSerial, XENGINE_DBMESSAGEQUEUE*** pppSt_DBMessage, int* pInt_ListCount);
2625
bool DBModule_MQData_GetSerial(LPCXSTR lpszName, __int64x* pInt_DBCount, XENGINE_DBMESSAGEQUEUE* pSt_DBStart, XENGINE_DBMESSAGEQUEUE* pSt_DBEnd);
2726
bool DBModule_MQData_CreateTable(LPCXSTR lpszQueueName);
2827
bool DBModule_MQData_DeleteTable(LPCXSTR lpszQueueName);

XEngine_Source/MQCore_DBModule/MQCore_DBModule.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ EXPORTS
88
DBModule_MQData_Insert
99
DBModule_MQData_Query
1010
DBModule_MQData_Modify
11-
DBModule_MQData_List
1211
DBModule_MQData_GetSerial
1312
DBModule_MQData_CreateTable
1413
DBModule_MQData_DeleteTable

XEngine_Source/MQCore_DBModule/pch.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ extern "C" bool DBModule_MQData_Modify(XENGINE_DBMESSAGEQUEUE * pSt_DBInfo)
5151
{
5252
return m_DBData.DBModule_MQData_Modify(pSt_DBInfo);
5353
}
54-
extern "C" bool DBModule_MQData_List(LPCXSTR lpszQueueName, __int64x nSerial, XENGINE_DBMESSAGEQUEUE * **pppSt_DBMessage, int* pInt_ListCount)
55-
{
56-
return m_DBData.DBModule_MQData_List(lpszQueueName, nSerial, pppSt_DBMessage, pInt_ListCount);
57-
}
5854
extern "C" bool DBModule_MQData_GetSerial(LPCXSTR lpszName, __int64x * pInt_DBCount, XENGINE_DBMESSAGEQUEUE * pSt_DBStart, XENGINE_DBMESSAGEQUEUE * pSt_DBEnd)
5955
{
6056
return m_DBData.DBModule_MQData_GetSerial(lpszName, pInt_DBCount, pSt_DBStart, pSt_DBEnd);

XEngine_Source/XEngine_MQServiceApp/MQService_TCPTask.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,16 @@ bool MessageQueue_TCP_Handle(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, LPCXSTR lpszC
298298
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("%s客户端:%s,请求失败,用户没有通过验证"), lpszClientType, lpszClientAddr);
299299
return false;
300300
}
301-
memcpy(&st_MQProtocol, lpszMsgBuffer, sizeof(XENGINE_PROTOCOL_XMQ));
302-
//如果没有填充消息,那就使用默认
303-
if (0 == _tcsxlen(st_MQProtocol.tszMQKey))
301+
if (nMsgLen >= sizeof(XENGINE_PROTOCOL_XMQ))
304302
{
305-
_tcsxcpy(st_MQProtocol.tszMQKey, st_ServiceCfg.tszTopic);
303+
memcpy(&st_MQProtocol, lpszMsgBuffer, sizeof(XENGINE_PROTOCOL_XMQ));
304+
//如果没有填充消息,那就使用默认
305+
if (0 == _tcsxlen(st_MQProtocol.tszMQKey))
306+
{
307+
_tcsxcpy(st_MQProtocol.tszMQKey, st_ServiceCfg.tszTopic);
308+
}
306309
}
310+
307311
if (XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REQPOST == pSt_ProtocolHdr->unOperatorCode)
308312
{
309313
pSt_ProtocolHdr->unOperatorCode = XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REPPOST;

0 commit comments

Comments
 (0)