aboutsummaryrefslogtreecommitdiff
path: root/backends/networking
diff options
context:
space:
mode:
authorAlexander Tkachev2019-11-02 04:49:50 +0700
committerEugene Sandulenko2019-11-05 01:47:00 +0100
commitbc63abd3e198a07ae6af093ae5c472379b86a9aa (patch)
tree9f6776d69121bed46b62fcbc780db6a4172615ea /backends/networking
parent2acb8e22154b621424827d8602badc93507db576 (diff)
downloadscummvm-rg350-bc63abd3e198a07ae6af093ae5c472379b86a9aa.tar.gz
scummvm-rg350-bc63abd3e198a07ae6af093ae5c472379b86a9aa.tar.bz2
scummvm-rg350-bc63abd3e198a07ae6af093ae5c472379b86a9aa.zip
NETWORKING: Add CurlRequest::wait()
Diffstat (limited to 'backends/networking')
-rw-r--r--backends/networking/curl/curlrequest.cpp6
-rw-r--r--backends/networking/curl/curlrequest.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/backends/networking/curl/curlrequest.cpp b/backends/networking/curl/curlrequest.cpp
index f7d169cdca..887ba86c6e 100644
--- a/backends/networking/curl/curlrequest.cpp
+++ b/backends/networking/curl/curlrequest.cpp
@@ -148,4 +148,10 @@ NetworkReadStreamResponse CurlRequest::execute() {
const NetworkReadStream *CurlRequest::getNetworkReadStream() const { return _stream; }
+void CurlRequest::wait(int spinlockDelay) {
+ while (state() == Networking::PROCESSING) {
+ g_system->delayMillis(spinlockDelay);
+ }
+}
+
} // End of namespace Networking
diff --git a/backends/networking/curl/curlrequest.h b/backends/networking/curl/curlrequest.h
index 75fb787f86..f8d71c4828 100644
--- a/backends/networking/curl/curlrequest.h
+++ b/backends/networking/curl/curlrequest.h
@@ -93,6 +93,9 @@ public:
/** Returns Request's NetworkReadStream. */
const NetworkReadStream *getNetworkReadStream() const;
+
+ /** Waits for Request to be processed. Should be called after Request is put into ConnMan. */
+ void wait(int spinlockDelay = 5);
};
} // End of namespace Networking