Skip to content

Commit b1914ad

Browse files
committed
modify:http error code use protocol common hdr file
1 parent 7a4eade commit b1914ad

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

XEngine_Source/XEngine_MQServiceApp/MQService_HttpTask.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ bool MessageQueue_Http_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST
6666
HttpProtocol_ServerHelp_GetParament(pSt_HTTPParam->tszHttpUri, &ppSt_ListUrl, &nUrlCount);
6767
if (nUrlCount < 1)
6868
{
69-
ProtocolModule_Packet_Http(tszPKTBuffer, &nPKTLen, 400, "url parament is incorrent");
69+
ProtocolModule_Packet_Http(tszPKTBuffer, &nPKTLen, ERROR_XENGINE_MESSAGE_HTTP_PARAMENT, "url parament is incorrent");
7070
XEngine_MQXService_Send(lpszClientAddr, tszPKTBuffer, nPKTLen, XENGINE_MQAPP_NETTYPE_HTTP);
7171
return false;
7272
}
@@ -93,7 +93,7 @@ bool MessageQueue_Http_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST
9393
//获取在线用户 http://127.0.0.1:5202/api?function=get&method=online&type=0
9494
if (3 != nUrlCount)
9595
{
96-
ProtocolModule_Packet_Http(tszPKTBuffer, &nPKTLen, 400, "url parament is incorrent");
96+
ProtocolModule_Packet_Http(tszPKTBuffer, &nPKTLen, ERROR_XENGINE_MESSAGE_HTTP_PARAMENT, "url parament is incorrent");
9797
XEngine_MQXService_Send(lpszClientAddr, tszPKTBuffer, nPKTLen, XENGINE_MQAPP_NETTYPE_HTTP);
9898
return false;
9999
}

XEngine_Source/XEngine_MQServiceApp/MQService_TCPTask.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ bool MessageQueue_TCP_Handle(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, LPCXSTR lpszC
692692
{
693693
if (pSt_ProtocolHdr->byIsReply)
694694
{
695-
pSt_ProtocolHdr->wReserve = ERROR_XENGINE_MESSAGE_XMQ_CREATEKEY;
695+
pSt_ProtocolHdr->wReserve = ERROR_XENGINE_MESSAGE_XMQ_EXISTED;
696696
ProtocolModule_Packet_Common(nNetType, pSt_ProtocolHdr, &st_MQProtocol, tszSDBuffer, &nSDLen);
697697
XEngine_MQXService_Send(lpszClientAddr, tszSDBuffer, nSDLen, nNetType);
698698
}

XEngine_Source/XQueue_ProtocolHdr.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@
8181
#define ERROR_XENGINE_MESSAGE_XMQ_QUERYOWNER 0x2015 //查询所有者失败
8282
#define ERROR_XENGINE_MESSAGE_XMQ_MODIFYTOPIC 0x2016 //修改主题失败
8383
#define ERROR_XENGINE_MESSAGE_XMQ_MODIFYMSG 0x2017 //修改消息失败
84+
85+
#define ERROR_XENGINE_MESSAGE_HTTP_PARAMENT 0x3001 //HTTP请求参数错误
8486
///////////////////////////////////////////////////////////////////////////
8587
// 导出的数据结构
8688
///////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)