1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-08-02 07:43:09 +00:00

Add MAX_DIR_OBJECT macro

This commit is contained in:
杨赫然 2022-11-15 17:39:12 +08:00
parent 87e17f20c9
commit 7326aaca9d

View File

@ -1503,6 +1503,8 @@ out:
return ret; return ret;
} }
#define MAX_DIR_OBJECT 1000
typedef struct CalResult { typedef struct CalResult {
int num; int num;
GList *results; GList *results;
@ -1533,7 +1535,7 @@ get_fs_id_list_recursive (SeafRepo *repo,
for (ptr = root->entries; ptr; ptr = ptr->next) { for (ptr = root->entries; ptr; ptr = ptr->next) {
dent = ptr->data; dent = ptr->data;
if (result->num < 10) { if (result->num < MAX_DIR_OBJECT) {
if (S_ISDIR(dent->mode)) { if (S_ISDIR(dent->mode)) {
ret = get_fs_id_list_recursive (repo, dent->id, result); ret = get_fs_id_list_recursive (repo, dent->id, result);
if (ret < 0) { if (ret < 0) {