blob: 8edaac4098926daaf0c4c915fa069e8fd75d5038 (
plain)
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
|
#ifndef BTPD_HTTP_H
#define BTPD_HTTP_H
struct http;
enum http_status {
HRES_OK,
HRES_FAIL,
HRES_CANCEL
};
struct http_res {
enum http_status res;
long code;
const char *errmsg;
char *content;
size_t length;
};
int http_get(struct http **ret,
void (*cb)(struct http *, struct http_res *, void *),
void *arg,
const char *fmt, ...);
void http_cancel(struct http *http);
int http_succeeded(struct http_res *res);
long http_server_busy_time(const char *url, long s);
void http_init(void);
#endif
|