aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorPeter BozsoĢ2016-06-11 11:34:24 +0200
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commitbad2ec3ef4326593f3eac90af8b847062e2554cd (patch)
treec34225862769b11a0e4f85eaa79aa437f06ad886 /backends
parenta966de42a97dff932b6292f5021b7eb278310d1d (diff)
downloadscummvm-rg350-bad2ec3ef4326593f3eac90af8b847062e2554cd.tar.gz
scummvm-rg350-bad2ec3ef4326593f3eac90af8b847062e2554cd.tar.bz2
scummvm-rg350-bad2ec3ef4326593f3eac90af8b847062e2554cd.zip
CLOUD: Fix initialization of NetworkReadStream
"networkreadstream.cpp:51:2: error: delegating constructors are permitted only in C++11"
Diffstat (limited to 'backends')
-rw-r--r--backends/networking/curl/networkreadstream.cpp16
-rw-r--r--backends/networking/curl/networkreadstream.h1
2 files changed, 13 insertions, 4 deletions
diff --git a/backends/networking/curl/networkreadstream.cpp b/backends/networking/curl/networkreadstream.cpp
index ccfb3d5a29..d761cbb5aa 100644
--- a/backends/networking/curl/networkreadstream.cpp
+++ b/backends/networking/curl/networkreadstream.cpp
@@ -47,11 +47,11 @@ static size_t curlHeadersCallback(char *d, size_t n, size_t l, void *p) {
return 0;
}
-NetworkReadStream::NetworkReadStream(const char *url, curl_slist *headersList, Common::String postFields, bool uploading, bool usingPatch):
- NetworkReadStream(url, headersList, (byte *)postFields.c_str(), postFields.size(), uploading, usingPatch, false) {}
+void NetworkReadStream::init(const char *url, curl_slist *headersList, byte *buffer, uint32 bufferSize, bool uploading, bool usingPatch, bool post) {
+ _eos = _requestComplete = false;
+ _sendingContentsBuffer = nullptr;
+ _sendingContentsSize = _sendingContentsPos = 0;
-NetworkReadStream::NetworkReadStream(const char *url, curl_slist *headersList, byte *buffer, uint32 bufferSize, bool uploading, bool usingPatch, bool post):
- _easy(0), _eos(false), _requestComplete(false), _sendingContentsBuffer(nullptr), _sendingContentsSize(0), _sendingContentsPos(0) {
_easy = curl_easy_init();
curl_easy_setopt(_easy, CURLOPT_WRITEFUNCTION, curlDataCallback);
curl_easy_setopt(_easy, CURLOPT_WRITEDATA, this); //so callback can call us
@@ -80,6 +80,14 @@ NetworkReadStream::NetworkReadStream(const char *url, curl_slist *headersList, b
ConnMan.registerEasyHandle(_easy);
}
+NetworkReadStream::NetworkReadStream(const char *url, curl_slist *headersList, Common::String postFields, bool uploading, bool usingPatch) {
+ init(url, headersList, (byte *)postFields.c_str(), postFields.size(), uploading, usingPatch, false);
+}
+
+NetworkReadStream::NetworkReadStream(const char *url, curl_slist *headersList, byte *buffer, uint32 bufferSize, bool uploading, bool usingPatch, bool post) {
+ init(url, headersList, buffer, bufferSize, uploading, usingPatch, post);
+}
+
NetworkReadStream::~NetworkReadStream() {
if (_easy)
curl_easy_cleanup(_easy);
diff --git a/backends/networking/curl/networkreadstream.h b/backends/networking/curl/networkreadstream.h
index 991fdb346d..7a9d9ff0d1 100644
--- a/backends/networking/curl/networkreadstream.h
+++ b/backends/networking/curl/networkreadstream.h
@@ -39,6 +39,7 @@ class NetworkReadStream: public Common::MemoryReadWriteStream {
uint32 _sendingContentsSize;
uint32 _sendingContentsPos;
Common::String _responseHeaders;
+ void init(const char *url, curl_slist *headersList, byte *buffer, uint32 bufferSize, bool uploading, bool usingPatch, bool post);
public:
NetworkReadStream(const char *url, curl_slist *headersList, Common::String postFields, bool uploading = false, bool usingPatch = false);