annotate src/imap/ngx_imap.h @ 136:3656228c0b56 NGINX_0_3_15

nginx 0.3.15 *) Feature: the new 444 code of the "return" directive to close connection. *) Feature: the "so_keepalive" directive in IMAP/POP3 proxy. *) Bugfix: if there are unclosed connection nginx now calls abort() only on gracefull quit and active "debug_points" directive.
author Igor Sysoev <http://sysoev.ru>
date Wed, 07 Dec 2005 00:00:00 +0300
parents 91372f004adf
children 3689cd4e3228
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
1
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
2 /*
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
3 * Copyright (C) Igor Sysoev
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
4 */
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
5
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
6
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
7 #ifndef _NGX_IMAP_H_INCLUDED_
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
8 #define _NGX_IMAP_H_INCLUDED_
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
9
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
10
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
11 #include <ngx_config.h>
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
12 #include <ngx_core.h>
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
13 #include <ngx_event.h>
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
14 #include <ngx_event_connect.h>
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
15
88
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
16 #if (NGX_IMAP_SSL)
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
17 #include <ngx_imap_ssl_module.h>
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
18 #endif
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
19
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
20
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
21
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
22 typedef struct {
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
23 void **main_conf;
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
24 void **srv_conf;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
25 } ngx_imap_conf_ctx_t;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
26
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
27
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
28 typedef struct {
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
29 ngx_array_t servers; /* ngx_imap_core_srv_conf_t */
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
30 } ngx_imap_core_main_conf_t;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
31
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
32
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
33 #define NGX_IMAP_POP3_PROTOCOL 0
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
34 #define NGX_IMAP_IMAP_PROTOCOL 1
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
35
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
36 typedef struct {
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
37 ngx_msec_t timeout;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
38
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
39 size_t imap_client_buffer_size;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
40
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
41 ngx_uint_t protocol;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
42
136
3656228c0b56 nginx 0.3.15
Igor Sysoev <http://sysoev.ru>
parents: 132
diff changeset
43 ngx_flag_t so_keepalive;
3656228c0b56 nginx 0.3.15
Igor Sysoev <http://sysoev.ru>
parents: 132
diff changeset
44
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
45 ngx_str_t pop3_capability;
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
46 ngx_str_t pop3_starttls_capability;
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
47 ngx_str_t imap_capability;
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
48 ngx_str_t imap_starttls_capability;
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
49 ngx_str_t imap_starttls_only_capability;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
50
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
51 ngx_array_t pop3_capabilities;
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
52 ngx_array_t imap_capabilities;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
53
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
54 /* server ctx */
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
55 ngx_imap_conf_ctx_t *ctx;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
56 } ngx_imap_core_srv_conf_t;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
57
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
58
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
59 typedef struct {
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
60 void *(*create_main_conf)(ngx_conf_t *cf);
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
61 char *(*init_main_conf)(ngx_conf_t *cf, void *conf);
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
62
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
63 void *(*create_srv_conf)(ngx_conf_t *cf);
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
64 char *(*merge_srv_conf)(ngx_conf_t *cf, void *prev,
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
65 void *conf);
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
66 } ngx_imap_module_t;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
67
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
68
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
69 typedef enum {
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
70 ngx_imap_start = 0,
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
71 ngx_imap_login,
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
72 ngx_imap_user,
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
73 ngx_imap_passwd,
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
74 } ngx_imap_state_e;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
75
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
77 typedef enum {
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
78 ngx_pop3_start = 0,
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
79 ngx_pop3_user,
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
80 ngx_pop3_passwd
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
81 } ngx_po3_state_e;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
82
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
83
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
84 typedef struct {
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
85 ngx_peer_connection_t upstream;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
86 ngx_buf_t *buffer;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
87 } ngx_imap_proxy_ctx_t;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
88
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
89
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
90 typedef struct {
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
91 uint32_t signature; /* "IMAP" */
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
92
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
93 ngx_connection_t *connection;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
94
88
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
95 ngx_str_t out;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
96 ngx_buf_t *buffer;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
97
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
98 void **ctx;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
99 void **main_conf;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
100 void **srv_conf;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
101
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
102 ngx_imap_proxy_ctx_t *proxy;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
103
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
104 ngx_uint_t imap_state;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
105
88
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
106 unsigned blocked:1;
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
107 unsigned quit:1;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
108 unsigned protocol:1;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
109 unsigned quoted:1;
92
45945fa8b8ba nginx 0.2.0
Igor Sysoev <http://sysoev.ru>
parents: 90
diff changeset
110 unsigned backslash:1;
45945fa8b8ba nginx 0.2.0
Igor Sysoev <http://sysoev.ru>
parents: 90
diff changeset
111 unsigned no_sync_literal:1;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
112
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
113 ngx_str_t login;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
114 ngx_str_t passwd;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
115
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
116 ngx_str_t tag;
88
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
117 ngx_str_t tagged_line;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
118
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
119 ngx_uint_t command;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
120 ngx_array_t args;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
121
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
122 ngx_uint_t login_attempt;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
123
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
124 /* used to parse IMAP/POP3 command */
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
125
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
126 ngx_uint_t state;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
127 u_char *cmd_start;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
128 u_char *arg_start;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
129 u_char *arg_end;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
130 ngx_uint_t literal_len;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
131 } ngx_imap_session_t;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
132
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
133
90
71c46860eb55 nginx 0.1.45
Igor Sysoev <http://sysoev.ru>
parents: 88
diff changeset
134 typedef struct {
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
135 ngx_str_t *client;
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
136 ngx_imap_session_t *session;
90
71c46860eb55 nginx 0.1.45
Igor Sysoev <http://sysoev.ru>
parents: 88
diff changeset
137 } ngx_imap_log_ctx_t;
71c46860eb55 nginx 0.1.45
Igor Sysoev <http://sysoev.ru>
parents: 88
diff changeset
138
71c46860eb55 nginx 0.1.45
Igor Sysoev <http://sysoev.ru>
parents: 88
diff changeset
139
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
140 #define NGX_POP3_USER 1
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
141 #define NGX_POP3_PASS 2
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
142 #define NGX_POP3_CAPA 3
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
143 #define NGX_POP3_QUIT 4
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
144 #define NGX_POP3_NOOP 5
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
145 #define NGX_POP3_STLS 6
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
146 #define NGX_POP3_APOP 7
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
147 #define NGX_POP3_STAT 8
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
148 #define NGX_POP3_LIST 9
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
149 #define NGX_POP3_RETR 10
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
150 #define NGX_POP3_DELE 11
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
151 #define NGX_POP3_RSET 12
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
152 #define NGX_POP3_TOP 13
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
153 #define NGX_POP3_UIDL 14
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
154
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
155
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
156 #define NGX_IMAP_LOGIN 1
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
157 #define NGX_IMAP_LOGOUT 2
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
158 #define NGX_IMAP_CAPABILITY 3
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
159 #define NGX_IMAP_NOOP 4
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
160 #define NGX_IMAP_STARTTLS 5
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
161
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
162 #define NGX_IMAP_NEXT 6
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
163
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
164
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
165 #define NGX_IMAP_PARSE_INVALID_COMMAND 20
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
166
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
167
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
168 #define NGX_IMAP_MODULE 0x50414D49 /* "IMAP" */
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
169
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
170 #define NGX_IMAP_MAIN_CONF 0x02000000
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
171 #define NGX_IMAP_SRV_CONF 0x04000000
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
172
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
173
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
174 #define NGX_IMAP_MAIN_CONF_OFFSET offsetof(ngx_imap_conf_ctx_t, main_conf)
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
175 #define NGX_IMAP_SRV_CONF_OFFSET offsetof(ngx_imap_conf_ctx_t, srv_conf)
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
176
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
177
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
178 #define ngx_imap_get_module_ctx(s, module) (s)->ctx[module.ctx_index]
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
179 #define ngx_imap_set_ctx(s, c, module) s->ctx[module.ctx_index] = c;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
180 #define ngx_imap_delete_ctx(s, module) s->ctx[module.ctx_index] = NULL;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
181
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
182
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
183 #define ngx_imap_get_module_main_conf(s, module) \
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
184 (s)->main_conf[module.ctx_index]
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
185 #define ngx_imap_get_module_srv_conf(s, module) (s)->srv_conf[module.ctx_index]
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
186
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
187
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
188 void ngx_imap_init_connection(ngx_connection_t *c);
88
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
189 void ngx_imap_send(ngx_event_t *wev);
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
190 void ngx_imap_auth_state(ngx_event_t *rev);
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
191 void ngx_pop3_auth_state(ngx_event_t *rev);
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
192 void ngx_imap_close_connection(ngx_connection_t *c);
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
193 void ngx_imap_session_internal_server_error(ngx_imap_session_t *s);
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
194
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
195 ngx_int_t ngx_imap_parse_command(ngx_imap_session_t *s);
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
196 ngx_int_t ngx_pop3_parse_command(ngx_imap_session_t *s);
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
197
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
198
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
199 /* STUB */
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
200 void ngx_imap_proxy_init(ngx_imap_session_t *s, ngx_peers_t *peers);
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
201 void ngx_imap_auth_http_init(ngx_imap_session_t *s);
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
202 /**/
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
203
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
204
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
205 extern ngx_uint_t ngx_imap_max_module;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
206 extern ngx_module_t ngx_imap_core_module;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
207
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
208
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
209 #endif /* _NGX_IMAP_H_INCLUDED_ */