input/curl: create the request_headers list only once
This commit is contained in:
parent
0bfbe6771e
commit
ba4f1da466
@ -166,8 +166,6 @@ CurlInputStream::FreeEasy() noexcept
|
|||||||
|
|
||||||
delete request;
|
delete request;
|
||||||
request = nullptr;
|
request = nullptr;
|
||||||
|
|
||||||
request_headers.Clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -350,6 +348,7 @@ CurlInputStream::CurlInputStream(EventLoop &event_loop, const char *_url,
|
|||||||
CURL_RESUME_AT),
|
CURL_RESUME_AT),
|
||||||
icy(new IcyMetaDataParser())
|
icy(new IcyMetaDataParser())
|
||||||
{
|
{
|
||||||
|
request_headers.Append("Icy-Metadata: 1");
|
||||||
}
|
}
|
||||||
|
|
||||||
CurlInputStream::~CurlInputStream() noexcept
|
CurlInputStream::~CurlInputStream() noexcept
|
||||||
@ -383,16 +382,12 @@ CurlInputStream::InitEasy()
|
|||||||
|
|
||||||
request->SetOption(CURLOPT_SSL_VERIFYPEER, verify_peer ? 1l : 0l);
|
request->SetOption(CURLOPT_SSL_VERIFYPEER, verify_peer ? 1l : 0l);
|
||||||
request->SetOption(CURLOPT_SSL_VERIFYHOST, verify_host ? 2l : 0l);
|
request->SetOption(CURLOPT_SSL_VERIFYHOST, verify_host ? 2l : 0l);
|
||||||
|
request->SetOption(CURLOPT_HTTPHEADER, request_headers.Get());
|
||||||
request_headers.Clear();
|
|
||||||
request_headers.Append("Icy-Metadata: 1");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CurlInputStream::StartRequest()
|
CurlInputStream::StartRequest()
|
||||||
{
|
{
|
||||||
request->SetOption(CURLOPT_HTTPHEADER, request_headers.Get());
|
|
||||||
|
|
||||||
request->Start();
|
request->Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user