forked from love2d/lua-https
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCurlClient.h
More file actions
39 lines (29 loc) · 841 Bytes
/
CurlClient.h
File metadata and controls
39 lines (29 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
#include "../common/config.h"
#ifdef HTTPS_BACKEND_CURL
#include <curl/curl.h>
#include "../common/HTTPSClient.h"
#include "../common/LibraryLoader.h"
class CurlClient : public HTTPSClient
{
public:
virtual bool valid() const override;
virtual HTTPSClient::Reply request(const HTTPSClient::Request &req) override;
private:
static struct Curl
{
Curl();
~Curl();
LibraryLoader::handle *handle;
bool loaded;
decltype(&curl_global_cleanup) global_cleanup;
decltype(&curl_easy_init) easy_init;
decltype(&curl_easy_cleanup) easy_cleanup;
decltype(&curl_easy_setopt) easy_setopt;
decltype(&curl_easy_perform) easy_perform;
decltype(&curl_easy_getinfo) easy_getinfo;
decltype(&curl_slist_append) slist_append;
decltype(&curl_slist_free_all) slist_free_all;
} curl;
};
#endif // HTTPS_BACKEND_CURL