summaryrefslogtreecommitdiff
path: root/proxy.h
blob: d0533e0e4b56a282079cdf5d1a367843355508bf (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
#ifndef fooproxyhfoo
#define fooproxyhfoo

struct server_proxy {
	struct connection client_conn;
	struct uring_task_buf clientbuf;
	struct uring_task clienttask;
	uint64_t client_bytes;
	int cfd;

	struct connection server_conn;
	struct uring_task_buf serverbuf;
	struct uring_task servertask;
	uint64_t server_bytes;
	int sfd;
	
	time_t begin;
	unsigned next_remote;
	struct uring_task task;
	struct server *server;
	struct list_head list;
};

void proxy_refdump(struct server_proxy *proxy);

void proxy_delete(struct cfg *cfg, struct server_proxy *proxy);

struct server_proxy *proxy_new(struct cfg *cfg, struct server *server, struct saddr *client, int fd);

#endif