Revert #242 and improve security when sending files to client

This commit is contained in:
yuanyuanxiang
2025-12-28 14:39:52 +01:00
parent 2d274aab4d
commit 473af822cc
10 changed files with 111 additions and 40 deletions

View File

@@ -35,3 +35,7 @@ int FileBatchTransferWorker(const std::vector<std::string>& files, const std::st
int RecvFileChunk(char* buf, size_t len, void* user, OnFinish f, const std::string& hash, const std::string& hmac);
uint8_t* ScaleBitmap(uint8_t* dst, const uint8_t* src, int srcW, int srcH, int dstW, int dstH);
std::vector<std::string> PreprocessFilesSimple(const std::vector<std::string>& inputFiles);
std::vector<char> BuildMultiStringPath(const std::vector<std::string>& paths);

View File

@@ -103,9 +103,11 @@ public:
writeToFile(logEntry);
}
}
#ifndef _WINDOWS
#ifdef _DEBUG
#ifndef _WINDOWS
printf("%s", logEntry.c_str());
#else
OutputDebugStringA(logEntry.c_str());
#endif
#endif
cv.notify_one(); // 通知写线程
@@ -260,8 +262,6 @@ inline const char* getFileName(const char* path)
#define Mprintf(format, ...) Logger::getInstance().log(getFileName(skCrypt(__FILE__)), __LINE__, skCrypt(format), __VA_ARGS__)
#endif
#endif // _WIN32
inline void Log(const char* message)
{
return Logger::getInstance().log(NULL, 0, "%s", message);
@@ -276,3 +276,5 @@ inline void Logf(const char* file, int line, const char* format, ...)
va_end(args);
return Logger::getInstance().log(getFileName(file), line, "%s", message);
}
#endif // _WIN32