Commit 7e3a01d1 authored by Paweł Wegner's avatar Paweł Wegner
Browse files

ListDirectoryRequest fix.

parent 1d56d86f
......@@ -37,6 +37,7 @@ ListDirectoryRequest::ListDirectoryRequest(std::shared_ptr<CloudProvider> p,
set_resolver([this](Request*) {
std::string page_token;
std::vector<IItem::Pointer> result;
bool failure = false;
do {
std::stringstream output_stream;
int code = sendRequest(
......@@ -51,10 +52,10 @@ ListDirectoryRequest::ListDirectoryRequest(std::shared_ptr<CloudProvider> p,
if (callback_) callback_->receivedItem(t);
result.push_back(t);
}
}
} while (!page_token.empty());
if (callback_) callback_->done(result);
} else
failure = true;
} while (!page_token.empty() && !failure);
if (!failure && callback_) callback_->done(result);
return result;
});
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment