diff --git a/client/FileManager.cpp b/client/FileManager.cpp index 9a1df55..71659e3 100644 --- a/client/FileManager.cpp +++ b/client/FileManager.cpp @@ -514,7 +514,6 @@ int CFileManager::SendToken(BYTE bToken) bool CFileManager::UploadToRemote(LPBYTE lpBuffer) { - if (lpBuffer[lstrlen((char *)lpBuffer) - 1] == '\\') { FixedUploadList((char *)lpBuffer); diff --git a/client/IOCPClient.cpp b/client/IOCPClient.cpp index 564cb6c..776fd2d 100644 --- a/client/IOCPClient.cpp +++ b/client/IOCPClient.cpp @@ -279,7 +279,9 @@ VOID IOCPClient::OnServerReceiving(char* szBuffer, ULONG ulLength) else break; } - }catch(...) { } + }catch(...) { + printf("[ERROR] OnServerReceiving catch an error \n"); + } } diff --git a/client/Manager.cpp b/client/Manager.cpp index b97fd81..e26541e 100644 --- a/client/Manager.cpp +++ b/client/Manager.cpp @@ -35,7 +35,9 @@ int CManager::Send(LPBYTE lpData, UINT nSize) try { nRet = m_ClientObject->OnServerSending((char*)lpData, nSize); - }catch(...){}; + }catch(...){ + printf("[ERROR] CManager::Send catch an error \n"); + }; return nRet; } diff --git a/client/zlib.lib b/client/zlib.lib index 04cb894..4ab49f4 100644 Binary files a/client/zlib.lib and b/client/zlib.lib differ diff --git a/server/2015Remote/2015RemoteDlg.cpp b/server/2015Remote/2015RemoteDlg.cpp index ae13ccd..a39f5d5 100644 --- a/server/2015Remote/2015RemoteDlg.cpp +++ b/server/2015Remote/2015RemoteDlg.cpp @@ -998,7 +998,9 @@ LRESULT CMy2015RemoteDlg::OnUserToOnlineList(WPARAM wParam, LPARAM lParam) AddList(strIP,strAddr,strPCName,strOS,strCPU,strVideo,strPing,ContextObject); return S_OK; - }catch(...){} + }catch(...){ + OutputDebugStringA("[ERROR] OnUserToOnlineList catch an error \n"); + } return -1; } diff --git a/server/2015Remote/FileManagerDlg.cpp b/server/2015Remote/FileManagerDlg.cpp index 3bac396..fcbb524 100644 --- a/server/2015Remote/FileManagerDlg.cpp +++ b/server/2015Remote/FileManagerDlg.cpp @@ -921,11 +921,29 @@ void CFileManagerDlg::OnReceiveComplete() switch (m_pContext->m_DeCompressionBuffer.GetBuffer(0)[0]) { case TOKEN_FILE_LIST: // 文件列表 - FixedRemoteFileList + try + { + FixedRemoteFileList ( - m_pContext->m_DeCompressionBuffer.GetBuffer(0), - m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1 + m_pContext->m_DeCompressionBuffer.GetBuffer(0), + m_pContext->m_DeCompressionBuffer.GetBufferLen() - 1 ); + } + catch (CMemoryException* e) + { + OutputDebugStringA("[ERROR] CMemoryException\n"); + } + catch (CFileException* e) + { + OutputDebugStringA("[ERROR] CFileException\n"); + } + catch (CException* e) + { + OutputDebugStringA("[ERROR] CException\n"); + } + catch (...) { + OutputDebugStringA("[ERROR] Other exception\n"); + } break; case TOKEN_FILE_SIZE: // 传输文件时的第一个数据包,文件大小,及文件名 CreateLocalRecvFile(); @@ -2092,7 +2110,6 @@ void CFileManagerDlg::SendFileData() ReadFile(hFile, lpBuffer + nHeadLength, nNumberOfBytesToRead, &nNumberOfBytesRead, NULL); CloseHandle(hFile); - if (nNumberOfBytesRead > 0) { int nPacketSize = nNumberOfBytesRead + nHeadLength; diff --git a/server/2015Remote/IOCPServer.cpp b/server/2015Remote/IOCPServer.cpp index 46f081d..2bf1841 100644 --- a/server/2015Remote/IOCPServer.cpp +++ b/server/2015Remote/IOCPServer.cpp @@ -510,6 +510,7 @@ BOOL IOCPServer::OnClientReceiving(PCONTEXT_OBJECT ContextObject, DWORD dwTrans PostRecv(ContextObject); //投递新的接收数据的请求 }catch(...) { + OutputDebugStringA("[ERROR] OnClientReceiving catch an error \n"); ContextObject->InCompressedBuffer.ClearBuffer(); ContextObject->InDeCompressedBuffer.ClearBuffer(); @@ -572,7 +573,9 @@ VOID IOCPServer::OnClientPreSending(CONTEXT_OBJECT* ContextObject, PBYTE szBuffe RemoveStaleContext(ContextObject); SAFE_DELETE(OverlappedPlus); } - }catch(...){} + }catch(...){ + OutputDebugStringA("[ERROR] OnClientPreSending catch an error \n"); + } } BOOL IOCPServer::OnClientPostSending(CONTEXT_OBJECT* ContextObject,ULONG ulCompletedLength) @@ -603,7 +606,9 @@ BOOL IOCPServer::OnClientPostSending(CONTEXT_OBJECT* ContextObject,ULONG ulCompl SAFE_DELETE(OverlappedPlus); } } - }catch(...){} + }catch(...){ + OutputDebugStringA("[ERROR] OnClientPostSending catch an error \n"); + } return FALSE; } diff --git a/server/2015Remote/zlib.lib b/server/2015Remote/zlib.lib index 2da77dd..4ab49f4 100644 Binary files a/server/2015Remote/zlib.lib and b/server/2015Remote/zlib.lib differ