1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-09 19:29:03 +00:00
This commit is contained in:
feiniks
2025-02-24 10:04:20 +08:00
committed by GitHub
4 changed files with 7 additions and 9 deletions

View File

@@ -28,7 +28,6 @@ var (
Host string Host string
Port uint32 Port uint32
MaxUploadSize uint64 MaxUploadSize uint64
MaxDownloadDirSize uint64
FsIdListRequestTimeout int64 FsIdListRequestTimeout int64
// Block size for indexing uploaded files // Block size for indexing uploaded files
FixedBlockSize uint64 FixedBlockSize uint64
@@ -73,7 +72,6 @@ var (
func initDefaultOptions() { func initDefaultOptions() {
Host = "0.0.0.0" Host = "0.0.0.0"
Port = 8082 Port = 8082
MaxDownloadDirSize = 100 * (1 << 20)
FixedBlockSize = 1 << 23 FixedBlockSize = 1 << 23
MaxIndexingThreads = 1 MaxIndexingThreads = 1
WebTokenExpireTime = 7200 WebTokenExpireTime = 7200
@@ -161,7 +159,7 @@ func parseFileServerSection(section *ini.Section) {
if key, err := section.GetKey("max_upload_size"); err == nil { if key, err := section.GetKey("max_upload_size"); err == nil {
size, err := key.Uint() size, err := key.Uint()
if err == nil { if err == nil {
MaxUploadSize = uint64(size) * (1 << 20) MaxUploadSize = uint64(size) * 1000000
} }
} }
if key, err := section.GetKey("max_indexing_threads"); err == nil { if key, err := section.GetKey("max_indexing_threads"); err == nil {

View File

@@ -69,15 +69,15 @@ MAX_UPLOAD_FILE_SIZE = None # Defaults to no limit
try: try:
max_upload_size_mb = int(get_fileserver_option('max_upload_size', 0)) max_upload_size_mb = int(get_fileserver_option('max_upload_size', 0))
if max_upload_size_mb > 0: if max_upload_size_mb > 0:
MAX_UPLOAD_FILE_SIZE = max_upload_size_mb * (2 ** 20) MAX_UPLOAD_FILE_SIZE = max_upload_size_mb * 1000000
except ValueError: except ValueError:
pass pass
MAX_DOWNLOAD_DIR_SIZE = 100 * (2 ** 20) # Default max size of a downloadable dir MAX_DOWNLOAD_DIR_SIZE = 100 * 1000000 # Default max size of a downloadable dir
try: try:
max_download_dir_size_mb = int(get_fileserver_option('max_download_dir_size', 0)) max_download_dir_size_mb = int(get_fileserver_option('max_download_dir_size', 0))
if max_download_dir_size_mb > 0: if max_download_dir_size_mb > 0:
MAX_DOWNLOAD_DIR_SIZE = max_download_dir_size_mb * (2 ** 20) MAX_DOWNLOAD_DIR_SIZE = max_download_dir_size_mb * 1000000
except ValueError: except ValueError:
pass pass

View File

@@ -241,7 +241,7 @@ check_tmp_file_list (GList *tmp_files, int *error_code)
max_upload_size = seaf_cfg_manager_get_config_int64 (seaf->cfg_mgr, "fileserver", max_upload_size = seaf_cfg_manager_get_config_int64 (seaf->cfg_mgr, "fileserver",
"max_upload_size"); "max_upload_size");
if (max_upload_size > 0) if (max_upload_size > 0)
max_upload_size = max_upload_size * ((gint64)1 << 20); max_upload_size = max_upload_size * 1000000;
else else
max_upload_size = -1; max_upload_size = -1;

View File

@@ -16,7 +16,7 @@
#define MAX_ZIP_THREAD_NUM 5 #define MAX_ZIP_THREAD_NUM 5
#define SCAN_PROGRESS_INTERVAL 24 * 3600 // 1 day #define SCAN_PROGRESS_INTERVAL 24 * 3600 // 1 day
#define PROGRESS_TTL 5 * 3600 // 5 hours #define PROGRESS_TTL 5 * 3600 // 5 hours
#define DEFAULT_MAX_DOWNLOAD_DIR_SIZE 100 * ((gint64)1 << 20) /* 100MB */ #define DEFAULT_MAX_DOWNLOAD_DIR_SIZE 100 * 1000000 /* 100MB */
typedef struct ZipDownloadMgrPriv { typedef struct ZipDownloadMgrPriv {
pthread_mutex_t progress_lock; pthread_mutex_t progress_lock;
@@ -471,7 +471,7 @@ validate_download_size (DownloadObj *obj, GError **error)
max_download_dir_size = seaf_cfg_manager_get_config_int64 (seaf->cfg_mgr, "fileserver", max_download_dir_size = seaf_cfg_manager_get_config_int64 (seaf->cfg_mgr, "fileserver",
"max_download_dir_size"); "max_download_dir_size");
if (max_download_dir_size > 0) if (max_download_dir_size > 0)
max_download_dir_size = max_download_dir_size * ((gint64)1 << 20); max_download_dir_size = max_download_dir_size * 1000000;
else else
max_download_dir_size = DEFAULT_MAX_DOWNLOAD_DIR_SIZE; max_download_dir_size = DEFAULT_MAX_DOWNLOAD_DIR_SIZE;