Igor Sysoev | 9e51181 | 2004-08-31 19:05:39 +0000 | [diff] [blame] | 1 | |
| 2 | #include <ngx_config.h> |
| 3 | #include <ngx_core.h> |
| 4 | #include <ngx_event.h> |
Igor Sysoev | 59cf56c | 2004-09-07 15:29:22 +0000 | [diff] [blame] | 5 | #include <ngx_imap.h> |
| 6 | |
| 7 | |
| 8 | static char *ngx_imap_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); |
Igor Sysoev | 9e51181 | 2004-08-31 19:05:39 +0000 | [diff] [blame] | 9 | |
| 10 | |
| 11 | static ngx_command_t ngx_imap_commands[] = { |
| 12 | |
| 13 | { ngx_string("imap"), |
| 14 | NGX_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS, |
| 15 | ngx_imap_block, |
| 16 | 0, |
| 17 | 0, |
| 18 | NULL }, |
| 19 | |
| 20 | ngx_null_command |
| 21 | }; |
| 22 | |
| 23 | |
| 24 | static ngx_core_module_t ngx_imap_module_ctx = { |
| 25 | ngx_string("imap"), |
| 26 | NULL, |
| 27 | NULL |
| 28 | }; |
| 29 | |
| 30 | |
| 31 | ngx_module_t ngx_imap_module = { |
| 32 | NGX_MODULE, |
| 33 | &ngx_imap_module_ctx, /* module context */ |
| 34 | ngx_imap_commands, /* module directives */ |
| 35 | NGX_CORE_MODULE, /* module type */ |
| 36 | NULL, /* init module */ |
Igor Sysoev | 59cf56c | 2004-09-07 15:29:22 +0000 | [diff] [blame] | 37 | NULL /* init process */ |
Igor Sysoev | 9e51181 | 2004-08-31 19:05:39 +0000 | [diff] [blame] | 38 | }; |
Igor Sysoev | 59cf56c | 2004-09-07 15:29:22 +0000 | [diff] [blame] | 39 | |
| 40 | |
| 41 | static char *ngx_imap_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
| 42 | { |
| 43 | ngx_listening_t *ls; |
| 44 | |
| 45 | /* STUB */ |
| 46 | |
| 47 | ls = ngx_listening_inet_stream_socket(cf, 0, 8110); |
| 48 | if (ls == NULL) { |
| 49 | return NGX_CONF_ERROR; |
| 50 | } |
| 51 | |
| 52 | ls->backlog = -1; |
Igor Sysoev | 2e6ba93 | 2004-09-09 15:40:48 +0000 | [diff] [blame] | 53 | ls->addr_ntop = 1; |
Igor Sysoev | 59cf56c | 2004-09-07 15:29:22 +0000 | [diff] [blame] | 54 | ls->handler = ngx_imap_init_connection; |
| 55 | ls->pool_size = 16384; |
| 56 | /* ls->post_accept_timeout = 0; */ |
| 57 | ls->log = cf->cycle->new_log; |
| 58 | |
| 59 | /* */ |
| 60 | |
| 61 | return NGX_CONF_OK; |
| 62 | } |