From d8e4705dd443a7622049ca6733a35df3c0f59ebe Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 24 Oct 2017 21:38:35 +0200 Subject: [PATCH] input/curl: move the range buffer to the stack From the CURLOPT_RANGE documentation: "The application does not have to keep the string around after setting this option." --- src/input/plugins/CurlInputPlugin.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/input/plugins/CurlInputPlugin.cxx b/src/input/plugins/CurlInputPlugin.cxx index 27b335381..141956c03 100644 --- a/src/input/plugins/CurlInputPlugin.cxx +++ b/src/input/plugins/CurlInputPlugin.cxx @@ -64,7 +64,6 @@ static const size_t CURL_RESUME_AT = 384 * 1024; struct CurlInputStream final : public AsyncInputStream, CurlResponseHandler { /* some buffers which were passed to libcurl, which we have too free */ - char range[32]; CurlSlist request_headers; CurlRequest *request = nullptr; @@ -398,6 +397,7 @@ CurlInputStream::SeekInternal(offset_type new_offset) /* send the "Range" header */ if (offset > 0) { + char range[32]; #ifdef WIN32 // TODO: what can we use on Windows to format 64 bit? sprintf(range, "%lu-", (long)offset);