From 735db74b900d1e0a0654ca03983cd91cea36f41e Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Mon, 23 May 2016 12:21:45 +0600 Subject: CLOUD: Add DropboxStorage::listDirectory sketch It doesn't support any "has_more", doesn't call user's callback and just prints JSON instead of parsing in into an array of files. I believe it would become DropboxListDirectoryRequest in the next commit. --- backends/networking/curl/curljsonrequest.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'backends/networking/curl') diff --git a/backends/networking/curl/curljsonrequest.cpp b/backends/networking/curl/curljsonrequest.cpp index 702de22f46..805852ea0a 100644 --- a/backends/networking/curl/curljsonrequest.cpp +++ b/backends/networking/curl/curljsonrequest.cpp @@ -70,10 +70,12 @@ bool CurlJsonRequest::handle() { if (_stream->eos()) { if (_stream->httpResponseCode() != 200) - warning("HTTP response code is not 200 OK"); + warning("HTTP response code is not 200 OK (it's %d)", _stream->httpResponseCode()); if (_callback) { - char *contents = getPreparedContents(); + char *contents = getPreparedContents(); + if (_stream->httpResponseCode() != 200) + debug("%s", contents); Common::JSONValue *json = Common::JSON::parse(contents); (*_callback)(json); //potential memory leak, free it in your callbacks! } -- cgit v1.2.3