From 97553e635d2265ec4aad96b00b1fd72d98437f15 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 17 Jun 2019 18:28:52 +0200 Subject: RFC1123StrToTime: Accept const std::string& as first argument We are converting to std::string anyway by passing to istringstream, and this removes the need for .c_str() in callers. --- test/interactive-helper/aptwebserver.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/interactive-helper') diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc index 2243ccea9..0398a12b6 100644 --- a/test/interactive-helper/aptwebserver.cc +++ b/test/interactive-helper/aptwebserver.cc @@ -793,7 +793,7 @@ static void * handleClient(int const client, size_t const id) /*{{{*/ if (_config->FindB("aptwebserver::support::modified-since", true) == true && condition.empty() == false) { time_t cache; - if (RFC1123StrToTime(condition.c_str(), cache) == true && + if (RFC1123StrToTime(condition, cache) == true && cache >= data.ModificationTime()) { sendHead(log, client, 304, headers); @@ -821,7 +821,7 @@ static void * handleClient(int const client, size_t const id) /*{{{*/ if (_config->FindB("aptwebserver::support::if-range", true) == true) ifrange = LookupTag(*m, "If-Range", ""); bool validrange = (ifrange.empty() == true || - (RFC1123StrToTime(ifrange.c_str(), cache) == true && + (RFC1123StrToTime(ifrange, cache) == true && cache <= data.ModificationTime())); // FIXME: support multiple byte-ranges (APT clients do not do this) -- cgit v1.2.3-70-g09d2