mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-08-31 23:19:36 +00:00
Support loading configuration from database.
This commit is contained in:
@@ -241,6 +241,7 @@ check_tmp_file_list (GList *tmp_files, int *error_code)
|
||||
char *tmp_file;
|
||||
SeafStat st;
|
||||
gint64 total_size = 0;
|
||||
gint64 max_upload_size;
|
||||
|
||||
for (ptr = tmp_files; ptr; ptr = ptr->next) {
|
||||
tmp_file = ptr->data;
|
||||
@@ -253,9 +254,15 @@ check_tmp_file_list (GList *tmp_files, int *error_code)
|
||||
|
||||
total_size += (gint64)st.st_size;
|
||||
}
|
||||
|
||||
if (seaf->http_server->max_upload_size != -1 &&
|
||||
total_size > seaf->http_server->max_upload_size) {
|
||||
/* default is MB */
|
||||
max_upload_size = seaf_cfg_manager_get_config_int64 (seaf->cfg_mgr, "fileserver",
|
||||
"max_upload_size");
|
||||
if (max_upload_size > 0)
|
||||
max_upload_size = max_upload_size * ((gint64)1 << 20);
|
||||
else
|
||||
max_upload_size = -1;
|
||||
|
||||
if (max_upload_size > 0 && total_size > max_upload_size) {
|
||||
seaf_debug ("[upload] File size is too large.\n");
|
||||
*error_code = ERROR_SIZE;
|
||||
return FALSE;
|
||||
|
Reference in New Issue
Block a user