From 45d0d731ebf900af6cbaaa3e7f66f5aa38f54307 Mon Sep 17 00:00:00 2001 From: Kazuho Oku Date: Mon, 22 Dec 2014 07:26:02 +0900 Subject: [PATCH] fill-in `data_stat` after copying the request entity into the temporary file --- src/nghttp.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/nghttp.cc b/src/nghttp.cc index 1aac801a..3670bfff 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -2120,6 +2120,11 @@ int run(char **uris, int n) { 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 { data_fd = open(config.datafile.c_str(), O_RDONLY | O_BINARY);