Skip to content

Commit

Permalink
storage/curl: unescape file names from PROPFIND
Browse files Browse the repository at this point in the history
This is the last missing piece for MusicPlayerDaemon#662
  • Loading branch information
MaxKellermann committed Oct 15, 2019
1 parent f038645 commit 0b94358
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/storage/plugins/CurlStorage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ class BlockingHttpRequest : protected CurlResponseHandler {
std::rethrow_exception(postponed_error);
}

CURL *GetEasy() noexcept {
return request.Get();
}

protected:
void SetDone() {
assert(!done);
Expand Down Expand Up @@ -277,6 +281,7 @@ class PropfindOperation : BlockingHttpRequest, CommonExpatParser {
// TODO: send request body
}

using BlockingHttpRequest::GetEasy;
using BlockingHttpRequest::Wait;

protected:
Expand Down Expand Up @@ -524,10 +529,7 @@ class HttpListDirectoryOperation final : public PropfindOperation {
if (escaped_name.IsNull())
return;

// TODO: unescape
const auto name = escaped_name;

entries.emplace_front(std::string(name.data, name.size));
entries.emplace_front(CurlUnescape(GetEasy(), escaped_name));

auto &info = entries.front().info;
info = StorageFileInfo(r.collection
Expand Down

0 comments on commit 0b94358

Please sign in to comment.