@@ -137,7 +137,7 @@ static void XEngine_FTPUPload_Thread(xstring lpszClientAddr, xstring lpszFileNam
137137 }
138138 else
139139 {
140- pSt_File = _xfopenA (lpszFileName.c_str (), _X (" wb" ));
140+ pSt_File = _xtfopen (lpszFileName.c_str (), _X (" wb" ));
141141 if (NULL == pSt_File)
142142 {
143143 APIHelp_Port_Free (nPort);
@@ -162,9 +162,13 @@ static void XEngine_FTPUPload_Thread(xstring lpszClientAddr, xstring lpszFileNam
162162 continue ;
163163 }
164164
165- if (XENGINE_NETCORE_TCP_SELECT_EVENT_LEAVE == dwEvent)
165+ if (XENGINE_NETCORE_TCP_SELECT_EVENT_LOGIN == dwEvent)
166166 {
167- XLOG_PRINT (xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR , _X (" FTP客户端:%s,请求上传文件失败,获取网络事件,用户:%s 离开" ), lpszClientAddr.c_str (), tszClientAddr);
167+ XLOG_PRINT (xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO , _X (" FTP客户端:%s,请求上传文件,传输用户:%s 进入" ), lpszClientAddr.c_str (), tszClientAddr);
168+ }
169+ else if (XENGINE_NETCORE_TCP_SELECT_EVENT_LEAVE == dwEvent)
170+ {
171+ XLOG_PRINT (xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO , _X (" FTP客户端:%s,请求上传文件,传输用户:%s 离开" ), lpszClientAddr.c_str (), tszClientAddr);
168172 break ;
169173 }
170174 else if (XENGINE_NETCORE_TCP_SELECT_EVENT_RECV == dwEvent)
@@ -200,7 +204,7 @@ static void XEngine_FTPUPload_Thread(xstring lpszClientAddr, xstring lpszFileNam
200204 {
201205 Database_File_FileInsert (&st_ProtocolFile, st_StorageBucket.st_PermissionFlags .bRewrite );
202206 }
203- XLOG_PRINT (xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO , _X (" FTP客户端:%s 请求上传文件完毕, 插入数据库完毕" ), lpszClientAddr.c_str ());
207+ XLOG_PRINT (xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO , _X (" FTP客户端:%s 请求上传文件完毕, 插入数据库完毕,BucketName:%s,Table:%s,Path:%s%s,Hash:%s,Size:%lld " ), lpszClientAddr.c_str (), st_ProtocolFile. tszBuckKey , st_ProtocolFile. tszTableName , st_ProtocolFile. st_ProtocolFile . tszFilePath , st_ProtocolFile. st_ProtocolFile . tszFileName , st_ProtocolFile. st_ProtocolFile . tszFileHash , st_ProtocolFile. st_ProtocolFile . nFileSize );
204208 }
205209 // 通知
206210 int nSDLen = 1024 ;
@@ -402,7 +406,7 @@ bool XEngine_Task_FTP(LPCXSTR lpszClientAddr, XENGINE_KEYVALUE *pSt_KeyValue, in
402406 _xstprintf (tszFileName, _X (" %s%s" ), tszFilePath, tszAlisPath);
403407 BaseLib_String_FixPath (tszFileName, 1 );
404408
405- if (tszFileName[_tcsxlen (tszFileName)] != ' \\ ' && tszFileName[_tcsxlen (tszFileName)] != ' /' )
409+ if (tszFileName[_tcsxlen (tszFileName) - 1 ] != ' \\ ' && tszFileName[_tcsxlen (tszFileName) - 1 ] != ' /' )
406410 {
407411 _tcsxcat (tszFileName, _X (" \\ " ));
408412 }
@@ -445,7 +449,7 @@ bool XEngine_Task_FTP(LPCXSTR lpszClientAddr, XENGINE_KEYVALUE *pSt_KeyValue, in
445449 _xstprintf (tszFileName, _X (" %s%s" ), tszFilePath, tszAlisPath);
446450 BaseLib_String_FixPath (tszFileName, 1 );
447451
448- if (tszFileName[_tcsxlen (tszFileName)] != ' \\ ' && tszFileName[_tcsxlen (tszFileName)] != ' /' )
452+ if (tszFileName[_tcsxlen (tszFileName) - 1 ] != ' \\ ' && tszFileName[_tcsxlen (tszFileName) - 1 ] != ' /' )
449453 {
450454 _tcsxcat (tszFileName, _X (" \\ " ));
451455 }
@@ -495,7 +499,7 @@ bool XEngine_Task_FTP(LPCXSTR lpszClientAddr, XENGINE_KEYVALUE *pSt_KeyValue, in
495499 _xstprintf (tszFileName, _X (" %s%s" ), tszFilePath, tszAlisPath);
496500 BaseLib_String_FixPath (tszFileName, 1 );
497501
498- if (tszFileName[_tcsxlen (tszFileName)] != ' \\ ' && tszFileName[_tcsxlen (tszFileName)] != ' /' )
502+ if (tszFileName[_tcsxlen (tszFileName) - 1 ] != ' \\ ' && tszFileName[_tcsxlen (tszFileName) - 1 ] != ' /' )
499503 {
500504 _tcsxcat (tszFileName, _X (" \\ " ));
501505 }
@@ -569,7 +573,7 @@ bool XEngine_Task_FTP(LPCXSTR lpszClientAddr, XENGINE_KEYVALUE *pSt_KeyValue, in
569573 XCHAR tszFileName[XPATH_MAX ] = {};
570574 _xstprintf (tszFileName, _X (" %s%s" ), tszFilePath, tszAlisPath);
571575 BaseLib_String_FixPath (tszFileName, 1 );
572- if (tszFileName[_tcsxlen (tszFileName)] != ' \\ ' && tszFileName[_tcsxlen (tszFileName)] != ' /' )
576+ if (tszFileName[_tcsxlen (tszFileName) - 1 ] != ' \\ ' && tszFileName[_tcsxlen (tszFileName) - 1 ] != ' /' )
573577 {
574578 _tcsxcat (tszFileName, _X (" \\ " ));
575579 }
@@ -595,7 +599,7 @@ bool XEngine_Task_FTP(LPCXSTR lpszClientAddr, XENGINE_KEYVALUE *pSt_KeyValue, in
595599 XCHAR tszFileName[XPATH_MAX ] = {};
596600 _xstprintf (tszFileName, _X (" %s%s" ), tszFilePath, tszAlisPath);
597601 BaseLib_String_FixPath (tszFileName, 1 );
598- if (tszFileName[_tcsxlen (tszFileName)] != ' \\ ' && tszFileName[_tcsxlen (tszFileName)] != ' /' )
602+ if (tszFileName[_tcsxlen (tszFileName) - 1 ] != ' \\ ' && tszFileName[_tcsxlen (tszFileName) - 1 ] != ' /' )
599603 {
600604 _tcsxcat (tszFileName, _X (" \\ " ));
601605 }
@@ -672,7 +676,7 @@ bool XEngine_Task_FTP(LPCXSTR lpszClientAddr, XENGINE_KEYVALUE *pSt_KeyValue, in
672676 _xstprintf (tszFileName, _X (" %s%s" ), tszFilePath, tszAlisPath);
673677 BaseLib_String_FixPath (tszFileName, 1 );
674678
675- if (tszFileName[_tcsxlen (tszFileName)] != ' \\ ' && tszFileName[_tcsxlen (tszFileName)] != ' /' )
679+ if (tszFileName[_tcsxlen (tszFileName) - 1 ] != ' \\ ' && tszFileName[_tcsxlen (tszFileName) - 1 ] != ' /' )
676680 {
677681 _tcsxcat (tszFileName, _X (" \\ " ));
678682 }
0 commit comments