You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.6 KiB

#include "base.h"
typedef enum {
/** unused */
/** waiting for new input after first request */
/** after the connect, the request is initialized */
/** loop in the read-request-header until the full header is received */
/** handle in main virtual request */
/** write remaining bytes from raw_out, mainvr finished (or not started) */
} connection_state_t;
struct connection {
guint idx; /** index in connection table */
server *srv;
worker *wrk;
connection_state_t state;
gboolean response_headers_sent, expect_100_cont;
chunkqueue *raw_in, *raw_out;
chunkqueue *in, *out; /* link to mainvr->in/out */
ev_io sock_watcher;
sock_addr remote_addr, local_addr;
GString *remote_addr_str, *local_addr_str;
gboolean is_ssl, keep_alive;
option_value *options;
vrequest *mainvr;
http_request_ctx req_parser_ctx;
struct log_t *log;
gint log_level;
/* Keep alive timeout data */
struct {
GList *link;
ev_tstamp timeout;
guint max_idle;
ev_timer watcher;
} keep_alive_data;
LI_API connection* connection_new(worker *wrk);
LI_API void connection_reset(connection *con);
LI_API void connection_reset_keep_alive(connection *con);
LI_API void connection_free(connection *con);
LI_API void connection_error(connection *con);
LI_API void connection_handle_direct(connection *con);
LI_API void connection_handle_indirect(connection *con, plugin *p);