You've already forked godot
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user