diff options
Diffstat (limited to 'common/curl_request.hpp')
-rw-r--r-- | common/curl_request.hpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/common/curl_request.hpp b/common/curl_request.hpp deleted file mode 100644 index b85782500a..0000000000 --- a/common/curl_request.hpp +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef LLMR_COMMON_CURL_REQUEST -#define LLMR_COMMON_CURL_REQUEST - -#include <string> -#include <functional> -#include <memory> - -#include <llmr/util/noncopyable.hpp> - -// Forward definition. -typedef void CURL; -typedef struct uv_work_s uv_work_t; -typedef struct uv_check_s uv_check_t; - -namespace llmr { -namespace platform { - -struct Response; - -class Request : public std::enable_shared_from_this<Request>, private util::noncopyable { -public: - Request(const std::string &url, - std::function<void(Response *)> background_function, - std::function<void()> foreground_callback); - ~Request(); - -public: - static void work_cb(uv_work_t *work); - static void after_work_cb(uv_work_t *work, int status); - - -public: - const std::string url; - const std::function<void(Response *)> background_function; - const std::function<void()> foreground_callback; - std::unique_ptr<Response> res; - CURL *curl = nullptr; - bool cancelled = false; - - uv_check_t *check = nullptr; -}; -} -} - -#endif |