Skip to content

Commit d475391

Browse files
committed
fixed:upload rewrite flag is not work
1 parent f82357c commit d475391

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

XEngine_Source/StorageModule_Session/Session_Stroage/Session_UPStroage.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,13 @@ bool CSession_UPStroage::Session_UPStroage_Insert(LPCXSTR lpszClientAddr, LPCXST
171171
}
172172
else
173173
{
174+
if ((0 == _xtaccess(lpszFileDir, 0)) && !bRewrite)
175+
{
176+
Session_IsErrorOccur = true;
177+
Session_dwErrorCode = ERROR_STORAGE_MODULE_SESSION_REWRITE;
178+
return false;
179+
}
180+
174181
st_Client.st_StorageInfo.pSt_File = _xtfopen(lpszFileDir, _X("wb"));
175182
if (NULL == st_Client.st_StorageInfo.pSt_File)
176183
{

XEngine_Source/XEngine_StorageApp/StorageApp_UPLoader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ bool XEngine_Task_HttpUPLoader(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, in
259259
if (!Session_UPStroage_Insert(lpszClientAddr, st_StorageBucket.tszBuckKey, tszFileDir, nPosCount, st_StorageBucket.st_PermissionFlags.bRewrite, nPosStart, nPosEnd))
260260
{
261261
st_HDRParam.bIsClose = true;
262-
st_HDRParam.nHttpCode = 404;
262+
st_HDRParam.nHttpCode = 500;
263263

264264
HttpProtocol_Server_SendMsgEx(xhUPHttp, tszSDBuffer, &nSDLen, &st_HDRParam);
265265
XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPUPLOADER);

0 commit comments

Comments
 (0)