1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Adds timeout property for httprequest

This commit is contained in:
Zak
2019-07-04 16:17:52 +03:00
parent f5f7244a2b
commit 5fe5c4e8f1
2 changed files with 49 additions and 1 deletions

View File

@@ -35,6 +35,7 @@
#include "core/os/file_access.h"
#include "core/os/thread.h"
#include "node.h"
#include "scene/main/timer.h"
class HTTPRequest : public Node {
@@ -53,7 +54,8 @@ public:
RESULT_REQUEST_FAILED,
RESULT_DOWNLOAD_FILE_CANT_OPEN,
RESULT_DOWNLOAD_FILE_WRITE_ERROR,
RESULT_REDIRECT_LIMIT_REACHED
RESULT_REDIRECT_LIMIT_REACHED,
RESULT_TIMEOUT
};
@@ -92,6 +94,8 @@ private:
int max_redirects;
int timeout;
void _redirect_request(const String &p_new_url);
bool _handle_response(bool *ret_value);
@@ -128,6 +132,13 @@ public:
void set_max_redirects(int p_max);
int get_max_redirects() const;
Timer *timer;
void set_timeout(int p_timeout);
int get_timeout();
void _timeout();
int get_downloaded_bytes() const;
int get_body_size() const;