forked from yaoweibin/nginx_tcp_proxy_module
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ngx_tcp_session.h
71 lines (45 loc) · 1.77 KB
/
ngx_tcp_session.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef _NGX_TCP_SESSION_H_INCLUDED_
#define _NGX_TCP_SESSION_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_event.h>
#include <ngx_event_connect.h>
#include <ngx_tcp.h>
typedef struct ngx_tcp_session_s {
uint32_t signature; /* "TCP" */
ngx_pool_t *pool;
ngx_connection_t *connection;
ngx_tcp_upstream_t *upstream;
ngx_str_t out;
ngx_buf_t *buffer;
void **ctx;
void **main_conf;
void **srv_conf;
ngx_resolver_ctx_t *resolver_ctx;
ngx_tcp_cleanup_t *cleanup;
time_t start_sec;
ngx_msec_t start_msec;
off_t bytes_read;
off_t bytes_write;
unsigned quit:1;
ngx_str_t *addr_text;
ngx_str_t host;
} ngx_tcp_session_t;
typedef void (*ngx_tcp_cleanup_pt)(void *data);
struct ngx_tcp_cleanup_s {
ngx_tcp_cleanup_pt handler;
void *data;
ngx_tcp_cleanup_t *next;
};
void ngx_tcp_init_connection(ngx_connection_t *c);
void ngx_tcp_send(ngx_event_t *wev);
ngx_int_t ngx_tcp_read_command(ngx_tcp_session_t *s, ngx_connection_t *c);
void ngx_tcp_auth(ngx_tcp_session_t *s, ngx_connection_t *c);
void ngx_tcp_close_connection(ngx_connection_t *c);
void ngx_tcp_session_internal_server_error(ngx_tcp_session_t *s);
u_char *ngx_tcp_log_error(ngx_log_t *log, u_char *buf, size_t len);
void ngx_tcp_finalize_session(ngx_tcp_session_t *s);
ngx_tcp_cleanup_t * ngx_tcp_cleanup_add(ngx_tcp_session_t *s, size_t size);
ngx_int_t ngx_tcp_access_handler(ngx_tcp_session_t *s);
ngx_int_t ngx_tcp_log_handler(ngx_tcp_session_t *s);
#endif