-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathhttp2.h
30 lines (18 loc) · 760 Bytes
/
http2.h
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
#ifndef DNS_OVER_HTTPS_CLIENT_HTTP2_H
#define DNS_OVER_HTTPS_CLIENT_HTTP2_H
#include <nghttp2/nghttp2.h>
#include "client.h"
#define HTTP2_ALPN "h2"
typedef struct {
nghttp2_nv *nv;
size_t nvlen;
} http2_headers_t;
http2_headers_t *http2_headers_create();
void http2_add_header(http2_headers_t *headers, char *name, char *valuefmt, ...);
void http2_headers_free(http2_headers_t *headers);
void doh_http2_init_client(doh_client_t *client);
void doh_http2_io(doh_client_t *client);
void doh_http2_reset_session(doh_client_t *client);
int doh_http2_submit_request(nghttp2_session *session, http2_headers_t *headers, nghttp2_data_provider *dpr,
struct iovec *msg, void *ptr);
#endif //DNS_OVER_HTTPS_CLIENT_HTTP2_H