aboutsummaryrefslogtreecommitdiff
path: root/backends/networking/curl/curljsonrequest.cpp
diff options
context:
space:
mode:
authorAlexander Tkachev2016-05-26 19:02:55 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commitf4547f44df32ce1f49a6a36df083e7703751adcd (patch)
treea69e2f703a42348d9766ad128bb88b2c169719ad /backends/networking/curl/curljsonrequest.cpp
parent62ccf1f902100febfb1be02b67e84a6e4938ebbf (diff)
downloadscummvm-rg350-f4547f44df32ce1f49a6a36df083e7703751adcd.tar.gz
scummvm-rg350-f4547f44df32ce1f49a6a36df083e7703751adcd.tar.bz2
scummvm-rg350-f4547f44df32ce1f49a6a36df083e7703751adcd.zip
CLOUD: Add RequestIdPair struct
Can be used with Callback<T> (means it's still type safe). It's used to pass not only Request id to user's callback, but also a value user wanted. void *data field is removed from RequestInfo.
Diffstat (limited to 'backends/networking/curl/curljsonrequest.cpp')
-rw-r--r--backends/networking/curl/curljsonrequest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/backends/networking/curl/curljsonrequest.cpp b/backends/networking/curl/curljsonrequest.cpp
index 21c0a0f644..11eeb2904a 100644
--- a/backends/networking/curl/curljsonrequest.cpp
+++ b/backends/networking/curl/curljsonrequest.cpp
@@ -31,7 +31,7 @@
namespace Networking {
-CurlJsonRequest::CurlJsonRequest(Common::BaseCallback<> *cb, const char *url):
+CurlJsonRequest::CurlJsonRequest(DataCallback cb, const char *url):
CurlRequest(cb, url), _contentsStream(DisposeAfterUse::YES) {}
CurlJsonRequest::~CurlJsonRequest() {}
@@ -75,7 +75,7 @@ bool CurlJsonRequest::handle() {
if (_stream->httpResponseCode() != 200)
debug("%s", contents);
Common::JSONValue *json = Common::JSON::parse(contents);
- (*_callback)(json); //potential memory leak, free it in your callbacks!
+ (*_callback)(RequestDataPair(_id, json)); //potential memory leak, free it in your callbacks!
}
return true;
}