From c95e3dc065be71bc66dd3b7b3f7b208f541e9341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Thu, 25 Feb 2021 14:21:36 -0300 Subject: [PATCH] storage/plugins/CurlStorage: don't use glibc extension in ParseTimePoint. %Z is a glibc extension to strptime, and is a no-op there, due to the mapping between timezone names and their definition (especially when the name comes from a different machine) being ambiguous / impossible. Time in HTTP headers is guaranteed to be UTC. Passing an unknown format to strptime() implementations that don't support it will generally cause them to return NULL, which will lead to ParseTimePoint throwing an exception and ParseTimeStamp using an unnecessary fallback. Since the timezone name goes at the end of the string, we don't need to use %Z to skip it (could be an issue in a different time stamp format), so simply removing %Z works best. --- NEWS | 2 ++ src/storage/plugins/CurlStorage.cxx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 47e7f1be4..35fba5b78 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ ver 0.22.7 (not yet released) * decoder - ffmpeg: fix build problem with FFmpeg 3.4 +* storage + - curl: don't use glibc extension ver 0.22.6 (2021/02/16) * fix missing tags on songs in queue diff --git a/src/storage/plugins/CurlStorage.cxx b/src/storage/plugins/CurlStorage.cxx index c986a8a49..731f7e7b9 100644 --- a/src/storage/plugins/CurlStorage.cxx +++ b/src/storage/plugins/CurlStorage.cxx @@ -193,7 +193,7 @@ ParseTimeStamp(const char *s) { try { // TODO: make this more robust - return ParseTimePoint(s, "%a, %d %b %Y %T %Z"); + return ParseTimePoint(s, "%a, %d %b %Y %T"); } catch (...) { return std::chrono::system_clock::time_point::min(); }