Parcourir la source

Z991239-6383 #comment feat: 删除无用的代码

Signed-Off-By: commit-hook
刘文涛80174520 il y a 2 mois
Parent
commit
19ae4f7da9
2 fichiers modifiés avec 5 ajouts et 79 suppressions
  1. 5 45
      Module/mod_upload/upload.cpp
  2. 0 34
      Module/mod_upload/upload.h

+ 5 - 45
Module/mod_upload/upload.cpp

@@ -1,12 +1,12 @@
 #include "stdafx.h"
 #include "SpBase.h"
-#include "SpIni.h"
+//#include "SpIni.h"
 #include "upload.h"
-#include <memutil.h>
+//#include <memutil.h>
 #include <fileutil.h>
-#include <array.h>
-#include <string>
-#include "sstream"
+//#include <array.h>
+//#include <string>
+//#include "sstream"
 #ifdef RVC_OS_WIN
 
 #include "XZip.h"
@@ -31,46 +31,6 @@ using namespace std;
 
 #endif // RVC_OS_WIN
 
-static int check_zero_ref(const char *path)
-{
-#ifdef RVC_OS_WIN
-	HANDLE hFile = CreateFileA(path,
-		GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); // try open
-	if (hFile != INVALID_HANDLE_VALUE) {
-		CloseHandle(hFile);
-		return TRUE;
-	}
-	else {
-        //LogWarn(Severity_Low, Error_Unexpect, LOG_WARN_UPLOAD_SCANFILE_LOCK_ERROR, CSimpleStringA::Format("check_zero_ref is fail:%s",path).GetData());
-		DWORD dwRet = GetLastError();
-		return FALSE;
-	}
-#else
-	//后期改为linux真正的文件锁,现在来看,暂时用不着
-	FILE* fp = fopen(path, "rb");
-	if (fp != NULL) {
-		fclose(fp);
-		return true;
-	}
-	else
-	{
-	    //Dbg("try open file fail :%s",path);
-		//LogWarn(Severity_Low, Error_Unexpect, LOG_WARN_UPLOAD_SCANFILE_LOCK_ERROR, CSimpleStringA::Format("check_zero_ref is fail:%s",path).GetData());
-		return false;
-	}
-#endif // RVC_OS_WIN
-}
-
-
-
-
-
-
-	
-
-
-
-
 
 #ifdef RVC_OS_WIN
 

+ 0 - 34
Module/mod_upload/upload.h

@@ -13,40 +13,6 @@
 #include <iostream>
 #endif
 
-typedef struct file_t file_t;
-typedef struct upload_dir_t upload_dir_t;
-
-struct file_t 
-{
-	struct list_head entry;
-	char *path;
-	char *name;
-	unsigned int create_time;//距离2000年1月1日的流逝的秒数
-	unsigned int length;
-	upload_dir_t *owner;
-};
-
-#define UPLOAD_FLAG_AUTODELETE	0x01
-#define UPLOAD_FLAG_MOVEPATH	0x02
-#define UPLOAD_FLAG_ZIP			0x04
-
-// from ini config
-struct upload_dir_t {
-	struct list_head entry;
-	char *name;
-	char *path;
-	int flags;//自动删除|移动|压缩
-	char *movepath;	
-	struct list_head candidate_list;//需要上传文件的集合
-	int silent_time; // sec
-	int child_count_limitation;
-	int fileCount;//增加lwt 当前文件的个数
-	int fileLenSum;//文件总长度 单位是k
-};
-
-
-
-
 #ifdef RVC_OS_WIN
 
 #else