Make file_upload_handler stop early when low disk space

This commit is contained in:
Rytis Slatkevičius 2020-09-28 21:17:15 +03:00 committed by GitHub
parent 24548b00cc
commit a75d29e55b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -59,6 +59,8 @@ using std::string;
#define ERR_TRANSIENT true
#define ERR_PERMANENT false
#define FUH_MIN_FREE_SPACE 1e9
char this_filename[256];
string variety = "";
double start_time();
@ -462,7 +464,7 @@ bool volume_full(char* path) {
double total, avail;
int retval = get_filesystem_info(total, avail, path);
if (retval) return false;
if (avail<1e6) {
if (avail < FUH_MIN_FREE_SPACE) {
return true;
}
return false;