Skip to content

Commit b84de25

Browse files
committed
fixed:bucket name is incorrect
1 parent b448678 commit b84de25

File tree

6 files changed

+98
-9
lines changed

6 files changed

+98
-9
lines changed

XEngine_Source/StorageModule_Protocol/Protocol_Packet/Protocol_StoragePacket.cpp

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,45 @@ bool CProtocol_StoragePacket::Protocol_StoragePacket_Action(XCHAR* ptszMsgBuffer
520520
memcpy(ptszMsgBuffer, st_JsonRoot.toStyledString().c_str(), *pInt_MsgLen);
521521
return true;
522522
}
523-
524-
bool CProtocol_StoragePacket::Protocol_StoragePacket_Propfind(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XCHAR*** ppptszListFile, int nFileCount)
523+
/********************************************************************
524+
函数名称:Protocol_StoragePacket_Propfind
525+
函数功能:propfind协议打包处理函数
526+
参数.一:ptszMsgBuffer
527+
In/Out:Out
528+
类型:字符指针
529+
可空:N
530+
意思:输出打好包的XML数据
531+
参数.二:pInt_MsgLen
532+
In/Out:Out
533+
类型:整数型指针
534+
可空:N
535+
意思:输出大小
536+
参数.三:ppptszListFile
537+
In/Out:In
538+
类型:三级指针
539+
可空:N
540+
意思:输入打包的文件列表
541+
参数.四:nFileCount
542+
In/Out:In
543+
类型:整数型
544+
可空:N
545+
意思:输入列表个数
546+
参数.五:lpszBucketPath
547+
In/Out:In
548+
类型:常量字符指针
549+
可空:N
550+
意思:输入BUCKET名称
551+
参数.六:lpszBucketKey
552+
In/Out:In
553+
类型:常量字符指针
554+
可空:N
555+
意思:输入BUCKET的KEY
556+
返回值
557+
类型:逻辑型
558+
意思:是否成功
559+
备注:
560+
*********************************************************************/
561+
bool CProtocol_StoragePacket::Protocol_StoragePacket_Propfind(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XCHAR*** ppptszListFile, int nFileCount, LPCXSTR lpszBucketPath, LPCXSTR lpszBucketKey)
525562
{
526563
Protocol_IsErrorOccur = false;
527564

@@ -556,8 +593,17 @@ bool CProtocol_StoragePacket::Protocol_StoragePacket_Propfind(XCHAR* ptszMsgBuff
556593
XMLElement* pSt_XMLResponse = m_XMLDocument.NewElement("d:response");
557594
pSt_XMLRoot->InsertEndChild(pSt_XMLResponse);
558595
//文件
596+
XCHAR tszSourceStr[128] = {};
597+
XCHAR tszDestStr[128] = {};
598+
XCHAR tszFileAlis[MAX_PATH] = {};
599+
_tcsxcpy(tszFileAlis, (*ppptszListFile)[i] + 1);
600+
601+
APIHelp_Api_UrlStr(tszSourceStr, (*ppptszListFile)[i]);
602+
APIHelp_Api_UrlStr(tszDestStr, (*ppptszListFile)[i]);
603+
604+
APIHelp_Api_UrlChange(tszFileAlis, lpszBucketPath + 2, lpszBucketKey);
559605
XMLElement* pSt_XMLhref = m_XMLDocument.NewElement("d:href");
560-
pSt_XMLhref->SetText((*ppptszListFile)[i] + 1);
606+
pSt_XMLhref->SetText(tszFileAlis);
561607
pSt_XMLResponse->InsertEndChild(pSt_XMLhref);
562608
//属性
563609
XMLElement* pSt_XMLPropstat = m_XMLDocument.NewElement("d:propstat");

XEngine_Source/StorageModule_Protocol/Protocol_Packet/Protocol_StoragePacket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ class CProtocol_StoragePacket
2525
bool Protocol_StoragePacket_REQFile(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, LPCXSTR lpszFileName = NULL, LPCXSTR lpszFileHash = NULL, XNETHANDLE xhToken = 0);
2626
bool Protocol_StoragePacket_Action(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XNETHANDLE xhToken, XENGINE_ACTIONINFO* pSt_ActionInfo);
2727
public:
28-
bool Protocol_StoragePacket_Propfind(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XCHAR*** ppptszListFile, int nFileCount);
28+
bool Protocol_StoragePacket_Propfind(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XCHAR*** ppptszListFile, int nFileCount, LPCXSTR lpszBucketPath, LPCXSTR lpszBucketKey);
2929
};

XEngine_Source/StorageModule_Protocol/StorageProtocol_Define.h

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,5 +516,42 @@ extern "C" bool Protocol_StoragePacket_REQFile(XCHAR * ptszMsgBuffer, int* pInt_
516516
备注:
517517
*********************************************************************/
518518
extern "C" bool Protocol_StoragePacket_Action(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XNETHANDLE xhToken, XENGINE_ACTIONINFO* pSt_ActionInfo);
519-
520-
extern "C" bool Protocol_StoragePacket_Propfind(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XCHAR*** ppptszListFile, int nFileCount);
519+
/********************************************************************
520+
函数名称:Protocol_StoragePacket_Propfind
521+
函数功能:propfind协议打包处理函数
522+
参数.一:ptszMsgBuffer
523+
In/Out:Out
524+
类型:字符指针
525+
可空:N
526+
意思:输出打好包的XML数据
527+
参数.二:pInt_MsgLen
528+
In/Out:Out
529+
类型:整数型指针
530+
可空:N
531+
意思:输出大小
532+
参数.三:ppptszListFile
533+
In/Out:In
534+
类型:三级指针
535+
可空:N
536+
意思:输入打包的文件列表
537+
参数.四:nFileCount
538+
In/Out:In
539+
类型:整数型
540+
可空:N
541+
意思:输入列表个数
542+
参数.五:lpszBucketPath
543+
In/Out:In
544+
类型:常量字符指针
545+
可空:N
546+
意思:输入BUCKET名称
547+
参数.六:lpszBucketKey
548+
In/Out:In
549+
类型:常量字符指针
550+
可空:N
551+
意思:输入BUCKET的KEY
552+
返回值
553+
类型:逻辑型
554+
意思:是否成功
555+
备注:
556+
*********************************************************************/
557+
extern "C" bool Protocol_StoragePacket_Propfind(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XCHAR*** ppptszListFile, int nFileCount, LPCXSTR lpszBucketPath, LPCXSTR lpszBucketKey);

XEngine_Source/StorageModule_Protocol/pch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ extern "C" bool Protocol_StoragePacket_Action(XCHAR * ptszMsgBuffer, int* pInt_M
8888
{
8989
return m_StoragePacket.Protocol_StoragePacket_Action(ptszMsgBuffer, pInt_MsgLen, xhToken, pSt_ActionInfo);
9090
}
91-
extern "C" bool Protocol_StoragePacket_Propfind(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XCHAR*** ppptszListFile, int nFileCount)
91+
extern "C" bool Protocol_StoragePacket_Propfind(XCHAR* ptszMsgBuffer, int* pInt_MsgLen, XCHAR*** ppptszListFile, int nFileCount, LPCXSTR lpszBucketPath, LPCXSTR lpszBucketKey)
9292
{
93-
return m_StoragePacket.Protocol_StoragePacket_Propfind(ptszMsgBuffer, pInt_MsgLen, ppptszListFile, nFileCount);
93+
return m_StoragePacket.Protocol_StoragePacket_Propfind(ptszMsgBuffer, pInt_MsgLen, ppptszListFile, nFileCount, lpszBucketPath, lpszBucketKey);
9494
}

XEngine_Source/StorageModule_Protocol/pch.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ using namespace tinyxml2;
4545
#include "../StorageModule_Config/Config_Error.h"
4646
#include "../StorageModule_Session/Session_Define.h"
4747
#include "../StorageModule_Database/Database_Define.h"
48+
#include "../StorageModule_APIHelp/APIHelp_Define.h"
49+
#include "../StorageModule_APIHelp/APIHelp_Error.h"
4850
#include "StorageProtocol_Define.h"
4951
#include "StorageProtocol_Error.h"
5052
/********************************************************************
@@ -68,17 +70,21 @@ extern XLONG Protocol_dwErrorCode;
6870
#ifdef _WIN64
6971
#pragma comment(lib,"../x64/Debug/jsoncpp")
7072
#pragma comment(lib,"../x64/Debug/tinyxml2")
73+
#pragma comment(lib,"../x64/Debug/StorageModule_APIHelp.lib")
7174
#else
7275
#pragma comment(lib,"../Debug/jsoncpp")
7376
#pragma comment(lib,"../Debug/tinyxml2")
77+
#pragma comment(lib,"../Debug/StorageModule_APIHelp.lib")
7478
#endif
7579
#else
7680
#ifdef _WIN64
7781
#pragma comment(lib,"../x64/Release/jsoncpp")
7882
#pragma comment(lib,"../x64/Release/tinyxml2")
83+
#pragma comment(lib,"../x64/Release/StorageModule_APIHelp.lib")
7984
#else
8085
#pragma comment(lib,"../Release/jsoncpp")
8186
#pragma comment(lib,"../Release/tinyxml2")
87+
#pragma comment(lib,"../Release/StorageModule_APIHelp.lib")
8288
#endif
8389
#endif
8490
#endif

XEngine_Source/XEngine_StorageApp/StorageApp_Webdav.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ bool XEngine_Task_HttpWebdav(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int
119119
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("WEBDAV客户端:%s,处理WEBDAV协议PROPFIND方法失败,文件没有找到,URL:%s"), lpszClientAddr, pSt_HTTPParam->tszHttpUri);
120120
return false;
121121
}
122-
Protocol_StoragePacket_Propfind(tszRVBuffer, &nRVLen, &pptszListFile, nListCount);
122+
Protocol_StoragePacket_Propfind(tszRVBuffer, &nRVLen, &pptszListFile, nListCount, st_StorageBucket.tszFilePath, st_StorageBucket.tszBuckKey);
123123
nRVLen -= 1;
124124

125125
st_HDRParam.nHttpCode = 207;

0 commit comments

Comments
 (0)