Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
53 lines (39 loc) · 1.19 KB

File metadata and controls

53 lines (39 loc) · 1.19 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef _HTTPS_CLIENT_H_
#define _HTTPS_CLIENT_H_
#include <arpa/inet.h>
#include <curl/curl.h>
#include <ev.h>
#include <stdint.h>
#include "options.h"
// Callback type for receiving data when a transfer finishes.
typedef void (*https_response_cb)(void *data, uint8_t *buf, uint32_t buflen);
// Internal: Holds state on an individual transfer.
struct https_fetch_ctx {
CURL *curl;
https_response_cb cb;
void *cb_data;
uint8_t *buf;
uint32_t buflen;
struct https_fetch_ctx *next;
};
// Internal: Holds state on a socket watcher.
struct https_fd_watcher {
ev_io watcher;
struct https_fd_watcher *next;
};
// Holds state on the whole multiplexed CURL machine.
typedef struct {
struct ev_loop *loop;
CURLM *curlm;
struct https_fetch_ctx *fetches;
ev_timer timer;
ev_io fd[FD_SETSIZE]; // I'm lazy.
int still_running;
options_t *opt;
} https_client_t;
void https_client_init(https_client_t *c, options_t *opt, struct ev_loop *loop);
void https_client_fetch(https_client_t *c, const char *url,
struct curl_slist *resolv, https_response_cb cb,
void *data);
void https_client_cleanup(https_client_t *c);
#endif // _HTTPS_CLIENT_H_
Morty Proxy This is a proxified and sanitized view of the page, visit original site.