#ifndef STREAM_ROUTE_H #define STREAM_ROUTE_H #include #include #include #include "compat.h" #include "stream_sniff.h" struct worker; struct route; struct event_base; struct evconnlistener; struct stream_route_ctx { struct event_base *accept_base; struct worker_pool *worker_pool; const struct route *route; struct evconnlistener *listener; }; typedef struct conn_s { struct worker *owner; const struct route *route; struct bufferevent *client; struct bufferevent *upstream; struct sockaddr_storage peer_addr; socklen_t peer_addr_len; struct stream_sniff sniff; bool upstream_connected; bool close_after_client_eof; bool close_client_after_drain; uint64_t activity_seq; uint64_t idle_check_seq; struct event *idle_ev; } conn_t; int start_stream_route( struct event_base *accept_base, struct worker_pool *wpool, const struct route *r, struct stream_route_ctx *ctx); void stop_stream_route_listener(struct stream_route_ctx *ctx); void free_stream_route(struct stream_route_ctx *ctx); #endif