fill-in `data_stat` after copying the request entity into the temporary file

This commit is contained in:
Kazuho Oku 2014-12-22 07:26:02 +09:00
parent 125f62b71e
commit 45d0d731eb
1 changed files with 5 additions and 0 deletions

View File

@ -2120,6 +2120,11 @@ int run(char **uris, int n) {
return 1; return 1;
} }
} }
if (fstat(data_fd, &data_stat) == -1) {
close(data_fd);
std::cerr << "[ERROR] Could not stat temporary file" << std::endl;
return 1;
}
} }
} else { } else {
data_fd = open(config.datafile.c_str(), O_RDONLY | O_BINARY); data_fd = open(config.datafile.c_str(), O_RDONLY | O_BINARY);