Improve error message if replay cannot find the replay file.

This commit is contained in:
Eric Harding committed 2017-09-28 17:04:29 -04:00
1 parent ef5b862339
commit 85e775f510
1 file changed
+3 -2
+3 -2
View File
@@ -72,8 +72,9 @@ bool download_file_if_newer(const string& host, const string& path, const string
tm modtm = boost::initialized_value;
const char* rfc_1123_fmt = "%a, %d %b %Y %H:%M:%S %Z";
time_t modified = 0;
if (download.good()) {
stringstream ss(download.headers().at("Last-Modified"));
const std::string last_modified_key = "Last-Modified";
if (download.good() && download.headers().find(last_modified_key) != download.headers().end()) {
stringstream ss(download.headers().at(last_modified_key));
ss >> std::get_time(&modtm, rfc_1123_fmt);
modified = mktime(&modtm);
}