summaryrefslogtreecommitdiffstats
path: root/scene/main/http_request.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main/http_request.cpp')
-rw-r--r--scene/main/http_request.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp
index ddc694f894..fa14ad5b3c 100644
--- a/scene/main/http_request.cpp
+++ b/scene/main/http_request.cpp
@@ -472,7 +472,7 @@ bool HTTPRequest::_update_connection() {
}
void HTTPRequest::_defer_done(int p_status, int p_code, const PackedStringArray &p_headers, const PackedByteArray &p_data) {
- call_deferred(SNAME("_request_done"), p_status, p_code, p_headers, p_data);
+ callable_mp(this, &HTTPRequest::_request_done).call_deferred(p_status, p_code, p_headers, p_data);
}
void HTTPRequest::_request_done(int p_status, int p_code, const PackedStringArray &p_headers, const PackedByteArray &p_data) {
@@ -503,7 +503,9 @@ void HTTPRequest::_notification(int p_what) {
void HTTPRequest::set_use_threads(bool p_use) {
ERR_FAIL_COND(get_http_client_status() != HTTPClient::STATUS_DISCONNECTED);
+#ifdef THREADS_ENABLED
use_threads.set_to(p_use);
+#endif
}
bool HTTPRequest::is_using_threads() const {
@@ -621,8 +623,6 @@ void HTTPRequest::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_downloaded_bytes"), &HTTPRequest::get_downloaded_bytes);
ClassDB::bind_method(D_METHOD("get_body_size"), &HTTPRequest::get_body_size);
- ClassDB::bind_method(D_METHOD("_request_done"), &HTTPRequest::_request_done);
-
ClassDB::bind_method(D_METHOD("set_timeout", "timeout"), &HTTPRequest::set_timeout);
ClassDB::bind_method(D_METHOD("get_timeout"), &HTTPRequest::get_timeout);