s 416 core/nginx.c ngx_int_t s; s 437 core/nginx.c s = ngx_atoi(v, p - v); s 438 core/nginx.c if (s == NGX_ERROR) { s 455 core/nginx.c ls->fd = (ngx_socket_t) s; s 1113 core/ngx_conf_file.c ngx_str_t *value, *s; s 1126 core/ngx_conf_file.c s = ngx_array_push(*a); s 1127 core/ngx_conf_file.c if (s == NULL) { s 1133 core/ngx_conf_file.c *s = value[1]; s 1137 core/ngx_conf_file.c return post->post_handler(cf, post, s); s 274 core/ngx_connection.c ngx_socket_t s; s 311 core/ngx_connection.c s = ngx_socket(ls[i].sockaddr->sa_family, ls[i].type, 0); s 313 core/ngx_connection.c if (s == -1) { s 319 core/ngx_connection.c if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, s 327 core/ngx_connection.c if (ngx_close_socket(s) == -1) { s 343 core/ngx_connection.c if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, s 356 core/ngx_connection.c if (ngx_nonblocking(s) == -1) { s 361 core/ngx_connection.c if (ngx_close_socket(s) == -1) { s 372 core/ngx_connection.c "bind() %V #%d ", &ls[i].addr_text, s); s 374 core/ngx_connection.c if (bind(s, ls[i].sockaddr, ls[i].socklen) == -1) { s 384 core/ngx_connection.c if (ngx_close_socket(s) == -1) { s 422 core/ngx_connection.c if (listen(s, ls[i].backlog) == -1) { s 427 core/ngx_connection.c if (ngx_close_socket(s) == -1) { s 438 core/ngx_connection.c ls[i].fd = s; s 704 core/ngx_connection.c ngx_get_connection(ngx_socket_t s, ngx_log_t *log) s 712 core/ngx_connection.c if (ngx_cycle->files && (ngx_uint_t) s >= ngx_cycle->files_n) { s 716 core/ngx_connection.c s, ngx_cycle->files_n); s 745 core/ngx_connection.c ngx_cycle->files[s] = c; s 755 core/ngx_connection.c c->fd = s; s 959 core/ngx_connection.c ngx_connection_local_sockaddr(ngx_connection_t *c, ngx_str_t *s, s 1007 core/ngx_connection.c if (s == NULL) { s 1011 core/ngx_connection.c s->len = ngx_sock_ntop(c->local_sockaddr, s->data, s->len, port); s 185 core/ngx_connection.h ngx_int_t ngx_connection_local_sockaddr(ngx_connection_t *c, ngx_str_t *s, s 189 core/ngx_connection.h ngx_connection_t *ngx_get_connection(ngx_socket_t s, ngx_log_t *log); s 64 core/ngx_inet.c u_char c, *zero, *digit, *s, *d; s 158 core/ngx_inet.c s = addr - 1; s 159 core/ngx_inet.c d = s + n; s 160 core/ngx_inet.c while (s >= zero) { s 161 core/ngx_inet.c *d-- = *s--; s 365 core/ngx_inet.c ngx_uint_t s, i; s 415 core/ngx_inet.c s = (shift > 8) ? 8 : shift; s 416 core/ngx_inet.c shift -= s; s 418 core/ngx_inet.c mask[i] = (u_char) (0 - (1 << (8 - s))); s 43 core/ngx_rbtree.h #define ngx_rbtree_init(tree, s, i) \ s 44 core/ngx_rbtree.h ngx_rbtree_sentinel_init(s); \ s 45 core/ngx_rbtree.h (tree)->root = s; \ s 46 core/ngx_rbtree.h (tree)->sentinel = s; \ s 157 core/ngx_regex.c ngx_regex_exec_array(ngx_array_t *a, ngx_str_t *s, ngx_log_t *log) s 167 core/ngx_regex.c n = ngx_regex_exec(re[i].regex, s, NULL, 0); s 176 core/ngx_regex.c n, s, re[i].name); s 47 core/ngx_regex.h #define ngx_regex_exec(re, s, captures, size) \ s 48 core/ngx_regex.h pcre_exec(re, NULL, (const char *) (s)->data, (s)->len, 0, 0, \ s 52 core/ngx_regex.h ngx_int_t ngx_regex_exec_array(ngx_array_t *a, ngx_str_t *s, ngx_log_t *log); s 1724 core/ngx_resolver.c u_char *p, *s; s 1777 core/ngx_resolver.c for (s = ctx->name.data + ctx->name.len - 1; s >= ctx->name.data; s--) { s 1778 core/ngx_resolver.c if (*s != '.') { s 1779 core/ngx_resolver.c *p = *s; s 2108 core/ngx_resolver.c ngx_socket_t s; s 2111 core/ngx_resolver.c s = ngx_socket(AF_INET, SOCK_DGRAM, 0); s 2113 core/ngx_resolver.c ngx_log_debug1(NGX_LOG_DEBUG_EVENT, &uc->log, 0, "UDP socket %d", s); s 2115 core/ngx_resolver.c if (s == -1) { s 2121 core/ngx_resolver.c c = ngx_get_connection(s, &uc->log); s 2124 core/ngx_resolver.c if (ngx_close_socket(s) == -1) { s 2132 core/ngx_resolver.c if (ngx_nonblocking(s) == -1) { s 2138 core/ngx_resolver.c if (ngx_close_socket(s) == -1) { s 2168 core/ngx_resolver.c "connect to %V, fd:%d #%d", &uc->server, s, c->number); s 2170 core/ngx_resolver.c rc = connect(s, uc->sockaddr, uc->socklen); s 158 core/ngx_slab.c size_t s; s 183 core/ngx_slab.c for (s = size - 1; s >>= 1; shift++) { /* void */ } s 337 core/ngx_slab.c s = 1 << shift; s 338 core/ngx_slab.c n = (1 << (ngx_pagesize_shift - shift)) / 8 / s; s 358 core/ngx_slab.c p = ((page - pool->pages) << ngx_pagesize_shift) + s * n; s 1059 core/ngx_string.c u_char *d, *s; s 1065 core/ngx_string.c s = src->data; s 1069 core/ngx_string.c *d++ = basis64[(s[0] >> 2) & 0x3f]; s 1070 core/ngx_string.c *d++ = basis64[((s[0] & 3) << 4) | (s[1] >> 4)]; s 1071 core/ngx_string.c *d++ = basis64[((s[1] & 0x0f) << 2) | (s[2] >> 6)]; s 1072 core/ngx_string.c *d++ = basis64[s[2] & 0x3f]; s 1074 core/ngx_string.c s += 3; s 1079 core/ngx_string.c *d++ = basis64[(s[0] >> 2) & 0x3f]; s 1082 core/ngx_string.c *d++ = basis64[(s[0] & 3) << 4]; s 1086 core/ngx_string.c *d++ = basis64[((s[0] & 3) << 4) | (s[1] >> 4)]; s 1087 core/ngx_string.c *d++ = basis64[(s[1] & 0x0f) << 2]; s 1155 core/ngx_string.c u_char *d, *s; s 1171 core/ngx_string.c s = src->data; s 1175 core/ngx_string.c *d++ = (u_char) (basis[s[0]] << 2 | basis[s[1]] >> 4); s 1176 core/ngx_string.c *d++ = (u_char) (basis[s[1]] << 4 | basis[s[2]] >> 2); s 1177 core/ngx_string.c *d++ = (u_char) (basis[s[2]] << 6 | basis[s[3]]); s 1179 core/ngx_string.c s += 4; s 1184 core/ngx_string.c *d++ = (u_char) (basis[s[0]] << 2 | basis[s[1]] >> 4); s 1188 core/ngx_string.c *d++ = (u_char) (basis[s[1]] << 4 | basis[s[2]] >> 2); s 1488 core/ngx_string.c u_char *d, *s, ch, c, decoded; s 1496 core/ngx_string.c s = *src; s 1503 core/ngx_string.c ch = *s++; s 1558 core/ngx_string.c *d++ = '%'; *d++ = *(s - 2); *d++ = *(s - 1); s 1593 core/ngx_string.c *d++ = '%'; *d++ = *(s - 2); *d++ = *(s - 1); s 1611 core/ngx_string.c *src = s; s 60 core/ngx_string.h #define ngx_strlen(s) strlen((const char *) s) s 361 event/modules/ngx_select_module.c ngx_socket_t s; s 363 event/modules/ngx_select_module.c for (s = 0; s <= max_fd; s++) { s 365 event/modules/ngx_select_module.c if (FD_ISSET(s, &master_read_fd_set) == 0) { s 371 event/modules/ngx_select_module.c if (getsockopt(s, SOL_SOCKET, SO_TYPE, &n, &len) == -1) { s 375 event/modules/ngx_select_module.c "invalid descriptor #%d in read fd_set", s); s 377 event/modules/ngx_select_module.c FD_CLR(s, &master_read_fd_set); s 381 event/modules/ngx_select_module.c for (s = 0; s <= max_fd; s++) { s 383 event/modules/ngx_select_module.c if (FD_ISSET(s, &master_write_fd_set) == 0) { s 389 event/modules/ngx_select_module.c if (getsockopt(s, SOL_SOCKET, SO_TYPE, &n, &len) == -1) { s 393 event/modules/ngx_select_module.c "invalid descriptor #%d in write fd_set", s); s 395 event/modules/ngx_select_module.c FD_CLR(s, &master_write_fd_set); s 353 event/modules/ngx_win32_select_module.c ngx_socket_t s; s 357 event/modules/ngx_win32_select_module.c s = master_read_fd_set.fd_array[i]; s 360 event/modules/ngx_win32_select_module.c if (getsockopt(s, SOL_SOCKET, SO_TYPE, (char *) &n, &len) == -1) { s 364 event/modules/ngx_win32_select_module.c "invalid descriptor #%d in read fd_set", s); s 366 event/modules/ngx_win32_select_module.c FD_CLR(s, &master_read_fd_set); s 372 event/modules/ngx_win32_select_module.c s = master_write_fd_set.fd_array[i]; s 375 event/modules/ngx_win32_select_module.c if (getsockopt(s, SOL_SOCKET, SO_TYPE, (char *) &n, &len) == -1) { s 379 event/modules/ngx_win32_select_module.c "invalid descriptor #%d in write fd_set", s); s 381 event/modules/ngx_win32_select_module.c FD_CLR(s, &master_write_fd_set); s 23 event/ngx_event_accept.c ngx_socket_t s; s 54 event/ngx_event_accept.c s = accept4(lc->fd, (struct sockaddr *) sa, &socklen, s 57 event/ngx_event_accept.c s = accept(lc->fd, (struct sockaddr *) sa, &socklen); s 60 event/ngx_event_accept.c s = accept(lc->fd, (struct sockaddr *) sa, &socklen); s 63 event/ngx_event_accept.c if (s == -1) { s 109 event/ngx_event_accept.c c = ngx_get_connection(s, ev->log); s 112 event/ngx_event_accept.c if (ngx_close_socket(s) == -1) { s 148 event/ngx_event_accept.c if (ngx_blocking(s) == -1) { s 158 event/ngx_event_accept.c if (ngx_nonblocking(s) == -1) { s 271 event/ngx_event_accept.c "*%d accept: %V fd:%d", c->number, &c->addr_text, s); s 20 event/ngx_event_connect.c ngx_socket_t s; s 29 event/ngx_event_connect.c s = ngx_socket(pc->sockaddr->sa_family, SOCK_STREAM, 0); s 31 event/ngx_event_connect.c ngx_log_debug1(NGX_LOG_DEBUG_EVENT, pc->log, 0, "socket %d", s); s 33 event/ngx_event_connect.c if (s == -1) { s 40 event/ngx_event_connect.c c = ngx_get_connection(s, pc->log); s 43 event/ngx_event_connect.c if (ngx_close_socket(s) == -1) { s 52 event/ngx_event_connect.c if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, s 61 event/ngx_event_connect.c if (ngx_nonblocking(s) == -1) { s 69 event/ngx_event_connect.c if (bind(s, pc->local->sockaddr, pc->local->socklen) == -1) { s 124 event/ngx_event_connect.c "connect to %V, fd:%d #%d", pc->name, s, c->number); s 126 event/ngx_event_connect.c rc = connect(s, pc->sockaddr, pc->socklen); s 188 event/ngx_event_connect.c if (ngx_blocking(s) == -1) { s 245 event/ngx_event_connect.c if (ngx_close_socket(s) == -1) { s 562 event/ngx_event_openssl.c char buf[129], *s, *d; s 573 event/ngx_event_openssl.c for (s = &buf[1], d = buf; *s; s++) { s 574 event/ngx_event_openssl.c if (*s == ' ' && *d == ' ') { s 578 event/ngx_event_openssl.c if (*s == LF || *s == CR) { s 582 event/ngx_event_openssl.c *++d = *s; s 1965 event/ngx_event_openssl.c ngx_ssl_get_protocol(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s) s 1967 event/ngx_event_openssl.c s->data = (u_char *) SSL_get_version(c->ssl->connection); s 1973 event/ngx_event_openssl.c ngx_ssl_get_cipher_name(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s) s 1975 event/ngx_event_openssl.c s->data = (u_char *) SSL_get_cipher_name(c->ssl->connection); s 1981 event/ngx_event_openssl.c ngx_ssl_get_session_id(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s) s 1996 event/ngx_event_openssl.c s->len = 2 * len; s 1997 event/ngx_event_openssl.c s->data = ngx_pnalloc(pool, 2 * len); s 1998 event/ngx_event_openssl.c if (s->data == NULL) { s 2006 event/ngx_event_openssl.c ngx_hex_dump(s->data, buf, len); s 2015 event/ngx_event_openssl.c ngx_ssl_get_raw_certificate(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s) s 2021 event/ngx_event_openssl.c s->len = 0; s 2041 event/ngx_event_openssl.c s->len = len; s 2043 event/ngx_event_openssl.c s->data = ngx_pnalloc(pool, len); s 2044 event/ngx_event_openssl.c if (s->data == NULL) { s 2048 event/ngx_event_openssl.c BIO_read(bio, s->data, len); s 2065 event/ngx_event_openssl.c ngx_ssl_get_certificate(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s) s 2077 event/ngx_event_openssl.c s->len = 0; s 2089 event/ngx_event_openssl.c s->len = len; s 2090 event/ngx_event_openssl.c s->data = ngx_pnalloc(pool, len); s 2091 event/ngx_event_openssl.c if (s->data == NULL) { s 2095 event/ngx_event_openssl.c p = s->data; s 2109 event/ngx_event_openssl.c ngx_ssl_get_subject_dn(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s) s 2116 event/ngx_event_openssl.c s->len = 0; s 2133 event/ngx_event_openssl.c s->len = len; s 2134 event/ngx_event_openssl.c s->data = ngx_pnalloc(pool, len); s 2135 event/ngx_event_openssl.c if (s->data == NULL) { s 2141 event/ngx_event_openssl.c ngx_memcpy(s->data, p, len); s 2151 event/ngx_event_openssl.c ngx_ssl_get_issuer_dn(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s) s 2158 event/ngx_event_openssl.c s->len = 0; s 2175 event/ngx_event_openssl.c s->len = len; s 2176 event/ngx_event_openssl.c s->data = ngx_pnalloc(pool, len); s 2177 event/ngx_event_openssl.c if (s->data == NULL) { s 2183 event/ngx_event_openssl.c ngx_memcpy(s->data, p, len); s 2193 event/ngx_event_openssl.c ngx_ssl_get_serial_number(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s) s 2199 event/ngx_event_openssl.c s->len = 0; s 2215 event/ngx_event_openssl.c s->len = len; s 2216 event/ngx_event_openssl.c s->data = ngx_pnalloc(pool, len); s 2217 event/ngx_event_openssl.c if (s->data == NULL) { s 2223 event/ngx_event_openssl.c BIO_read(bio, s->data, len); s 2232 event/ngx_event_openssl.c ngx_ssl_get_client_verify(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s) s 2237 event/ngx_event_openssl.c ngx_str_set(s, "FAILED"); s 2244 event/ngx_event_openssl.c ngx_str_set(s, "SUCCESS"); s 2247 event/ngx_event_openssl.c ngx_str_set(s, "NONE"); s 120 event/ngx_event_openssl.h ngx_str_t *s); s 122 event/ngx_event_openssl.h ngx_str_t *s); s 124 event/ngx_event_openssl.h ngx_str_t *s); s 126 event/ngx_event_openssl.h ngx_str_t *s); s 128 event/ngx_event_openssl.h ngx_str_t *s); s 130 event/ngx_event_openssl.h ngx_str_t *s); s 132 event/ngx_event_openssl.h ngx_str_t *s); s 134 event/ngx_event_openssl.h ngx_str_t *s); s 136 event/ngx_event_openssl.h ngx_str_t *s); s 889 event/ngx_event_pipe.c ngx_buf_t *s; s 896 event/ngx_event_pipe.c for (s = buf->shadow; !s->last_shadow; s = s->shadow) { /* void */ } s 901 event/ngx_event_pipe.c if (cl->buf == s) { s 200 http/modules/ngx_http_degradation_module.c ngx_str_t *value, s; s 206 http/modules/ngx_http_degradation_module.c s.len = value[1].len - 5; s 207 http/modules/ngx_http_degradation_module.c s.data = value[1].data + 5; s 209 http/modules/ngx_http_degradation_module.c dmcf->sbrk_size = ngx_parse_size(&s); s 2338 http/modules/ngx_http_fastcgi_module.c ngx_keyval_t *h, *s; s 2348 http/modules/ngx_http_fastcgi_module.c s = ngx_array_push(conf->params_source); s 2349 http/modules/ngx_http_fastcgi_module.c if (s == NULL) { s 2353 http/modules/ngx_http_fastcgi_module.c *s = *h; s 633 http/modules/ngx_http_geo_module.c ngx_uint_t h, i, s, e; s 642 http/modules/ngx_http_geo_module.c s = n & 0xffff; s 644 http/modules/ngx_http_geo_module.c s = 0; s 677 http/modules/ngx_http_geo_module.c if (s > (ngx_uint_t) range[i].end) { s 691 http/modules/ngx_http_geo_module.c range[i + 1].start = (u_short) s; s 698 http/modules/ngx_http_geo_module.c if (s == (ngx_uint_t) range[i].start s 710 http/modules/ngx_http_geo_module.c if (s > (ngx_uint_t) range[i].start s 734 http/modules/ngx_http_geo_module.c range[i + 1].start = (u_short) s; s 738 http/modules/ngx_http_geo_module.c range[i].end = (u_short) (s - 1); s 743 http/modules/ngx_http_geo_module.c if (s == (ngx_uint_t) range[i].start s 760 http/modules/ngx_http_geo_module.c range[i].start = (u_short) s; s 767 http/modules/ngx_http_geo_module.c if (s > (ngx_uint_t) range[i].start s 782 http/modules/ngx_http_geo_module.c range[i + 1].start = (u_short) s; s 786 http/modules/ngx_http_geo_module.c range[i].end = (u_short) (s - 1); s 791 http/modules/ngx_http_geo_module.c s = (ngx_uint_t) range[i].start; s 797 http/modules/ngx_http_geo_module.c h >> 8, h & 0xff, s >> 8, s & 0xff, s 810 http/modules/ngx_http_geo_module.c range->start = (u_short) s; s 828 http/modules/ngx_http_geo_module.c ngx_uint_t h, i, s, e, warn; s 839 http/modules/ngx_http_geo_module.c s = n & 0xffff; s 841 http/modules/ngx_http_geo_module.c s = 0; s 861 http/modules/ngx_http_geo_module.c if (s == (ngx_uint_t) range[i].start s 872 http/modules/ngx_http_geo_module.c if (s != (ngx_uint_t) range[i].start s 1317 http/modules/ngx_http_geo_module.c ngx_str_t s; s 1363 http/modules/ngx_http_geo_module.c s.len = r->value->len; s 1364 http/modules/ngx_http_geo_module.c s.data = r->value->data; s 1365 http/modules/ngx_http_geo_module.c hash = ngx_crc32_long(s.data, s.len); s 1367 http/modules/ngx_http_geo_module.c ngx_str_rbtree_lookup(&ctx->rbtree, &s, hash); s 590 http/modules/ngx_http_limit_req_module.c ngx_str_t *value, name, s; s 619 http/modules/ngx_http_limit_req_module.c s.len = value[i].data + value[i].len - p; s 620 http/modules/ngx_http_limit_req_module.c s.data = p; s 622 http/modules/ngx_http_limit_req_module.c size = ngx_parse_size(&s); s 726 http/modules/ngx_http_limit_req_module.c ngx_str_t *value, s; s 741 http/modules/ngx_http_limit_req_module.c s.len = value[i].len - 5; s 742 http/modules/ngx_http_limit_req_module.c s.data = value[i].data + 5; s 744 http/modules/ngx_http_limit_req_module.c lrcf->shm_zone = ngx_shared_memory_add(cf, &s, 0, s 119 http/modules/ngx_http_log_module.c ngx_array_t *flushes, ngx_array_t *ops, ngx_array_t *args, ngx_uint_t s); s 1044 http/modules/ngx_http_log_module.c ngx_array_t *ops, ngx_array_t *args, ngx_uint_t s) s 1056 http/modules/ngx_http_log_module.c for ( /* void */ ; s < args->nelts; s++) { s 1058 http/modules/ngx_http_log_module.c for (i = 0; i < value[s].len; i++) { s 1059 http/modules/ngx_http_log_module.c if (value[s].data[i] != '%') { s 1063 http/modules/ngx_http_log_module.c ch = value[s].data[i + 1]; s 1079 http/modules/ngx_http_log_module.c while (i < value[s].len) { s 1086 http/modules/ngx_http_log_module.c data = &value[s].data[i]; s 1088 http/modules/ngx_http_log_module.c if (value[s].data[i] == '$') { s 1090 http/modules/ngx_http_log_module.c if (++i == value[s].len) { s 1094 http/modules/ngx_http_log_module.c if (value[s].data[i] == '{') { s 1097 http/modules/ngx_http_log_module.c if (++i == value[s].len) { s 1101 http/modules/ngx_http_log_module.c var.data = &value[s].data[i]; s 1105 http/modules/ngx_http_log_module.c var.data = &value[s].data[i]; s 1108 http/modules/ngx_http_log_module.c for (var.len = 0; i < value[s].len; i++, var.len++) { s 1109 http/modules/ngx_http_log_module.c ch = value[s].data[i]; s 1180 http/modules/ngx_http_log_module.c while (i < value[s].len && value[s].data[i] != '$') { s 1184 http/modules/ngx_http_log_module.c len = &value[s].data[i] - data; s 1231 http/modules/ngx_http_log_module.c ngx_str_t *value, s; s 1260 http/modules/ngx_http_log_module.c s.len = value[i].len - 9; s 1261 http/modules/ngx_http_log_module.c s.data = value[i].data + 9; s 1263 http/modules/ngx_http_log_module.c inactive = ngx_parse_time(&s, 1); s 1283 http/modules/ngx_http_log_module.c s.len = value[i].len - 6; s 1284 http/modules/ngx_http_log_module.c s.data = value[i].data + 6; s 1286 http/modules/ngx_http_log_module.c valid = ngx_parse_time(&s, 1); s 1722 http/modules/ngx_http_proxy_module.c ngx_keyval_t *s; s 2076 http/modules/ngx_http_proxy_module.c s = ngx_array_push(conf->headers_source); s 2077 http/modules/ngx_http_proxy_module.c if (s == NULL) { s 2081 http/modules/ngx_http_proxy_module.c ngx_str_set(&s->key, "Content-Length"); s 2082 http/modules/ngx_http_proxy_module.c ngx_str_set(&s->value, "$proxy_internal_body_length"); s 2102 http/modules/ngx_http_proxy_module.c ngx_keyval_t *src, *s, *h; s 2171 http/modules/ngx_http_proxy_module.c s = ngx_array_push(conf->headers_source); s 2172 http/modules/ngx_http_proxy_module.c if (s == NULL) { s 2176 http/modules/ngx_http_proxy_module.c *s = *h; s 1345 http/modules/ngx_http_scgi_module.c ngx_keyval_t *h, *s; s 1355 http/modules/ngx_http_scgi_module.c s = ngx_array_push(conf->params_source); s 1356 http/modules/ngx_http_scgi_module.c if (s == NULL) { s 1360 http/modules/ngx_http_scgi_module.c *s = *h; s 13 http/modules/ngx_http_ssl_module.c ngx_pool_t *pool, ngx_str_t *s); s 223 http/modules/ngx_http_ssl_module.c ngx_str_t s; s 227 http/modules/ngx_http_ssl_module.c (void) handler(r->connection, NULL, &s); s 229 http/modules/ngx_http_ssl_module.c v->data = s.data; s 253 http/modules/ngx_http_ssl_module.c ngx_str_t s; s 257 http/modules/ngx_http_ssl_module.c if (handler(r->connection, r->pool, &s) != NGX_OK) { s 261 http/modules/ngx_http_ssl_module.c v->len = s.len; s 262 http/modules/ngx_http_ssl_module.c v->data = s.data; s 1403 http/modules/ngx_http_uwsgi_module.c ngx_keyval_t *h, *s; s 1413 http/modules/ngx_http_uwsgi_module.c s = ngx_array_push(conf->params_source); s 1414 http/modules/ngx_http_uwsgi_module.c if (s == NULL) { s 1418 http/modules/ngx_http_uwsgi_module.c *s = *h; s 79 http/modules/ngx_http_xslt_filter_module.c static u_char *ngx_http_xslt_content_type(xsltStylesheetPtr s); s 80 http/modules/ngx_http_xslt_filter_module.c static u_char *ngx_http_xslt_encoding(xsltStylesheetPtr s); s 569 http/modules/ngx_http_xslt_filter_module.c u_char *p, *last, *value, *dst, *src, **s; s 603 http/modules/ngx_http_xslt_filter_module.c s = ngx_array_push(&ctx->params); s 604 http/modules/ngx_http_xslt_filter_module.c if (s == NULL) { s 608 http/modules/ngx_http_xslt_filter_module.c *s = value; s 634 http/modules/ngx_http_xslt_filter_module.c s = ngx_array_push(&ctx->params); s 635 http/modules/ngx_http_xslt_filter_module.c if (s == NULL) { s 639 http/modules/ngx_http_xslt_filter_module.c *s = value; s 643 http/modules/ngx_http_xslt_filter_module.c s = ngx_array_push(&ctx->params); s 644 http/modules/ngx_http_xslt_filter_module.c if (s == NULL) { s 648 http/modules/ngx_http_xslt_filter_module.c *s = NULL; s 655 http/modules/ngx_http_xslt_filter_module.c ngx_http_xslt_content_type(xsltStylesheetPtr s) s 659 http/modules/ngx_http_xslt_filter_module.c if (s->mediaType) { s 660 http/modules/ngx_http_xslt_filter_module.c return s->mediaType; s 663 http/modules/ngx_http_xslt_filter_module.c for (s = s->imports; s; s = s->next) { s 665 http/modules/ngx_http_xslt_filter_module.c type = ngx_http_xslt_content_type(s); s 677 http/modules/ngx_http_xslt_filter_module.c ngx_http_xslt_encoding(xsltStylesheetPtr s) s 681 http/modules/ngx_http_xslt_filter_module.c if (s->encoding) { s 682 http/modules/ngx_http_xslt_filter_module.c return s->encoding; s 685 http/modules/ngx_http_xslt_filter_module.c for (s = s->imports; s; s = s->next) { s 687 http/modules/ngx_http_xslt_filter_module.c encoding = ngx_http_xslt_encoding(s); s 121 http/ngx_http.c ngx_uint_t mi, m, s; s 278 http/ngx_http.c for (s = 0; s < cmcf->servers.nelts; s++) { s 280 http/ngx_http.c clcf = cscfp[s]->ctx->loc_conf[ngx_http_core_module.ctx_index]; s 282 http/ngx_http.c if (ngx_http_init_locations(cf, cscfp[s], clcf) != NGX_OK) { s 566 http/ngx_http.c ngx_uint_t s; s 576 http/ngx_http.c for (s = 0; s < cmcf->servers.nelts; s++) { s 580 http/ngx_http.c ctx->srv_conf = cscfp[s]->ctx->srv_conf; s 584 http/ngx_http.c cscfp[s]->ctx->srv_conf[ctx_index]); s 594 http/ngx_http.c ctx->loc_conf = cscfp[s]->ctx->loc_conf; s 597 http/ngx_http.c cscfp[s]->ctx->loc_conf[ctx_index]); s 604 http/ngx_http.c clcf = cscfp[s]->ctx->loc_conf[ngx_http_core_module.ctx_index]; s 607 http/ngx_http.c cscfp[s]->ctx->loc_conf, s 1451 http/ngx_http.c ngx_uint_t n, s; s 1477 http/ngx_http.c for (s = 0; s < addr->servers.nelts; s++) { s 1479 http/ngx_http.c name = cscfp[s]->server_names.elts; s 1481 http/ngx_http.c for (n = 0; n < cscfp[s]->server_names.nelts; n++) { s 1579 http/ngx_http.c for (s = 0; s < addr->servers.nelts; s++) { s 1581 http/ngx_http.c name = cscfp[s]->server_names.elts; s 1583 http/ngx_http.c for (n = 0; n < cscfp[s]->server_names.nelts; n++) { s 4204 http/ngx_http_core_module.c ngx_str_t *value, s; s 4231 http/ngx_http_core_module.c s.len = value[i].len - 9; s 4232 http/ngx_http_core_module.c s.data = value[i].data + 9; s 4234 http/ngx_http_core_module.c inactive = ngx_parse_time(&s, 1); s 1516 http/ngx_http_file_cache.c ngx_str_t s, name, *value; s 1600 http/ngx_http_file_cache.c s.len = value[i].data + value[i].len - p; s 1601 http/ngx_http_file_cache.c s.data = p; s 1603 http/ngx_http_file_cache.c size = ngx_parse_size(&s); s 1616 http/ngx_http_file_cache.c s.len = value[i].len - 9; s 1617 http/ngx_http_file_cache.c s.data = value[i].data + 9; s 1619 http/ngx_http_file_cache.c inactive = ngx_parse_time(&s, 1); s 1631 http/ngx_http_file_cache.c s.len = value[i].len - 9; s 1632 http/ngx_http_file_cache.c s.data = value[i].data + 9; s 1634 http/ngx_http_file_cache.c max_size = ngx_parse_offset(&s); s 4057 http/ngx_http_upstream.c ngx_str_t *value, s; s 4136 http/ngx_http_upstream.c s.len = value[i].len - 13; s 4137 http/ngx_http_upstream.c s.data = &value[i].data[13]; s 4139 http/ngx_http_upstream.c fail_timeout = ngx_parse_time(&s, 1); s 536 http/ngx_http_variables.c ngx_str_t *s; s 538 http/ngx_http_variables.c s = (ngx_str_t *) ((char *) r + data); s 540 http/ngx_http_variables.c if (s->data) { s 541 http/ngx_http_variables.c v->len = s->len; s 545 http/ngx_http_variables.c v->data = s->data; s 559 http/ngx_http_variables.c ngx_str_t *s; s 561 http/ngx_http_variables.c s = (ngx_str_t *) ((char *) r + data); s 563 http/ngx_http_variables.c s->len = v->len; s 564 http/ngx_http_variables.c s->data = v->data; s 594 http/ngx_http_variables.c ssize_t s, *sp; s 600 http/ngx_http_variables.c s = ngx_parse_size(&val); s 602 http/ngx_http_variables.c if (s == NGX_ERROR) { s 610 http/ngx_http_variables.c *sp = s; s 777 http/ngx_http_variables.c u_char *p, *s; s 779 http/ngx_http_variables.c s = r->request_line.data; s 781 http/ngx_http_variables.c if (s == NULL) { s 782 http/ngx_http_variables.c s = r->request_start; s 784 http/ngx_http_variables.c if (s == NULL) { s 789 http/ngx_http_variables.c for (p = s; p < r->header_in->last; p++) { s 795 http/ngx_http_variables.c r->request_line.len = p - s; s 796 http/ngx_http_variables.c r->request_line.data = s; s 803 http/ngx_http_variables.c v->data = s; s 815 http/ngx_http_variables.c ngx_str_t cookie, s; s 817 http/ngx_http_variables.c s.len = name->len - (sizeof("cookie_") - 1); s 818 http/ngx_http_variables.c s.data = name->data + sizeof("cookie_") - 1; s 820 http/ngx_http_variables.c if (ngx_http_parse_multi_header_lines(&r->headers_in.cookies, &s, &cookie) s 991 http/ngx_http_variables.c ngx_str_t s; s 994 http/ngx_http_variables.c s.len = NGX_SOCKADDR_STRLEN; s 995 http/ngx_http_variables.c s.data = addr; s 997 http/ngx_http_variables.c if (ngx_connection_local_sockaddr(r->connection, &s, 0) != NGX_OK) { s 1001 http/ngx_http_variables.c s.data = ngx_pnalloc(r->pool, s.len); s 1002 http/ngx_http_variables.c if (s.data == NULL) { s 1006 http/ngx_http_variables.c ngx_memcpy(s.data, addr, s.len); s 1008 http/ngx_http_variables.c v->len = s.len; s 1012 http/ngx_http_variables.c v->data = s.data; s 1792 http/ngx_http_variables.c ngx_http_regex_exec(ngx_http_request_t *r, ngx_http_regex_t *re, ngx_str_t *s) s 1815 http/ngx_http_variables.c rc = ngx_regex_exec(re->regex, s, r->captures, len); s 1824 http/ngx_http_variables.c rc, s, &re->name); s 1838 http/ngx_http_variables.c vv->data = &s->data[r->captures[n]]; s 1854 http/ngx_http_variables.c r->captures_data = s->data; s 88 http/ngx_http_variables.h ngx_str_t *s); s 76 mail/ngx_mail.c ngx_uint_t i, m, mi, s; s 201 mail/ngx_mail.c for (s = 0; s < cmcf->servers.nelts; s++) { s 205 mail/ngx_mail.c cf->ctx = cscfp[s]->ctx; s 210 mail/ngx_mail.c cscfp[s]->ctx->srv_conf[mi]); s 306 mail/ngx_mail.h typedef void (*ngx_mail_init_session_pt)(ngx_mail_session_t *s, s 310 mail/ngx_mail.h typedef ngx_int_t (*ngx_mail_parse_command_pt)(ngx_mail_session_t *s); s 349 mail/ngx_mail.h #define ngx_mail_get_module_ctx(s, module) (s)->ctx[module.ctx_index] s 350 mail/ngx_mail.h #define ngx_mail_set_ctx(s, c, module) s->ctx[module.ctx_index] = c; s 351 mail/ngx_mail.h #define ngx_mail_delete_ctx(s, module) s->ctx[module.ctx_index] = NULL; s 354 mail/ngx_mail.h #define ngx_mail_get_module_main_conf(s, module) \ s 355 mail/ngx_mail.h (s)->main_conf[module.ctx_index] s 356 mail/ngx_mail.h #define ngx_mail_get_module_srv_conf(s, module) (s)->srv_conf[module.ctx_index] s 366 mail/ngx_mail.h ngx_int_t ngx_mail_starttls_only(ngx_mail_session_t *s, ngx_connection_t *c); s 372 mail/ngx_mail.h ngx_int_t ngx_mail_salt(ngx_mail_session_t *s, ngx_connection_t *c, s 374 mail/ngx_mail.h ngx_int_t ngx_mail_auth_plain(ngx_mail_session_t *s, ngx_connection_t *c, s 376 mail/ngx_mail.h ngx_int_t ngx_mail_auth_login_username(ngx_mail_session_t *s, s 378 mail/ngx_mail.h ngx_int_t ngx_mail_auth_login_password(ngx_mail_session_t *s, s 380 mail/ngx_mail.h ngx_int_t ngx_mail_auth_cram_md5_salt(ngx_mail_session_t *s, s 382 mail/ngx_mail.h ngx_int_t ngx_mail_auth_cram_md5(ngx_mail_session_t *s, ngx_connection_t *c); s 383 mail/ngx_mail.h ngx_int_t ngx_mail_auth_parse(ngx_mail_session_t *s, ngx_connection_t *c); s 386 mail/ngx_mail.h ngx_int_t ngx_mail_read_command(ngx_mail_session_t *s, ngx_connection_t *c); s 387 mail/ngx_mail.h void ngx_mail_auth(ngx_mail_session_t *s, ngx_connection_t *c); s 389 mail/ngx_mail.h void ngx_mail_session_internal_server_error(ngx_mail_session_t *s); s 397 mail/ngx_mail.h void ngx_mail_proxy_init(ngx_mail_session_t *s, ngx_addr_t *peer); s 398 mail/ngx_mail.h void ngx_mail_auth_http_init(ngx_mail_session_t *s); s 32 mail/ngx_mail_auth_http_module.c typedef void (*ngx_mail_auth_http_handler_pt)(ngx_mail_session_t *s, s 63 mail/ngx_mail_auth_http_module.c static void ngx_mail_auth_http_ignore_status_line(ngx_mail_session_t *s, s 65 mail/ngx_mail_auth_http_module.c static void ngx_mail_auth_http_process_headers(ngx_mail_session_t *s, s 68 mail/ngx_mail_auth_http_module.c static ngx_int_t ngx_mail_auth_http_parse_header_line(ngx_mail_session_t *s, s 72 mail/ngx_mail_auth_http_module.c static ngx_buf_t *ngx_mail_auth_http_create_request(ngx_mail_session_t *s, s 152 mail/ngx_mail_auth_http_module.c ngx_mail_auth_http_init(ngx_mail_session_t *s) s 159 mail/ngx_mail_auth_http_module.c s->connection->log->action = "in http auth state"; s 161 mail/ngx_mail_auth_http_module.c pool = ngx_create_pool(2048, s->connection->log); s 163 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 170 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 176 mail/ngx_mail_auth_http_module.c ahcf = ngx_mail_get_module_srv_conf(s, ngx_mail_auth_http_module); s 178 mail/ngx_mail_auth_http_module.c ctx->request = ngx_mail_auth_http_create_request(s, pool, ahcf); s 181 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 185 mail/ngx_mail_auth_http_module.c ngx_mail_set_ctx(s, ctx, ngx_mail_auth_http_module); s 191 mail/ngx_mail_auth_http_module.c ctx->peer.log = s->connection->log; s 202 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 206 mail/ngx_mail_auth_http_module.c ctx->peer.connection->data = s; s 207 mail/ngx_mail_auth_http_module.c ctx->peer.connection->pool = s->connection->pool; s 209 mail/ngx_mail_auth_http_module.c s->connection->read->handler = ngx_mail_auth_http_block_read; s 230 mail/ngx_mail_auth_http_module.c ngx_mail_session_t *s; s 235 mail/ngx_mail_auth_http_module.c s = c->data; s 237 mail/ngx_mail_auth_http_module.c ctx = ngx_mail_get_module_ctx(s, ngx_mail_auth_http_module); s 247 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 258 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 275 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 283 mail/ngx_mail_auth_http_module.c ahcf = ngx_mail_get_module_srv_conf(s, ngx_mail_auth_http_module); s 294 mail/ngx_mail_auth_http_module.c ngx_mail_session_t *s; s 298 mail/ngx_mail_auth_http_module.c s = c->data; s 303 mail/ngx_mail_auth_http_module.c ctx = ngx_mail_get_module_ctx(s, ngx_mail_auth_http_module); s 310 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 319 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 331 mail/ngx_mail_auth_http_module.c ctx->handler(s, ctx); s 341 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 346 mail/ngx_mail_auth_http_module.c ngx_mail_auth_http_ignore_status_line(ngx_mail_session_t *s, s 360 mail/ngx_mail_auth_http_module.c ngx_log_debug0(NGX_LOG_DEBUG_MAIL, s->connection->log, 0, s 424 mail/ngx_mail_auth_http_module.c ngx_log_error(NGX_LOG_ERR, s->connection->log, 0, s 429 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 448 mail/ngx_mail_auth_http_module.c ctx->handler(s, ctx); s 453 mail/ngx_mail_auth_http_module.c ngx_mail_auth_http_process_headers(ngx_mail_session_t *s, s 463 mail/ngx_mail_auth_http_module.c ngx_log_debug0(NGX_LOG_DEBUG_MAIL, s->connection->log, 0, s 467 mail/ngx_mail_auth_http_module.c rc = ngx_mail_auth_http_parse_header_line(s, ctx); s 480 mail/ngx_mail_auth_http_module.c ngx_log_debug2(NGX_LOG_DEBUG_MAIL, s->connection->log, 0, s 509 mail/ngx_mail_auth_http_module.c s->auth_wait = 1; s 516 mail/ngx_mail_auth_http_module.c switch (s->protocol) { s 523 mail/ngx_mail_auth_http_module.c size = s->tag.len + sizeof("NO ") - 1 + len s 532 mail/ngx_mail_auth_http_module.c p = ngx_pnalloc(s->connection->pool, size); s 536 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 542 mail/ngx_mail_auth_http_module.c switch (s->protocol) { s 549 mail/ngx_mail_auth_http_module.c p = ngx_cpymem(p, s->tag.data, s->tag.len); s 595 mail/ngx_mail_auth_http_module.c s->login.len = ctx->header_end - ctx->header_start; s 597 mail/ngx_mail_auth_http_module.c s->login.data = ngx_pnalloc(s->connection->pool, s->login.len); s 598 mail/ngx_mail_auth_http_module.c if (s->login.data == NULL) { s 601 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 605 mail/ngx_mail_auth_http_module.c ngx_memcpy(s->login.data, ctx->header_start, s->login.len); s 616 mail/ngx_mail_auth_http_module.c s->passwd.len = ctx->header_end - ctx->header_start; s 618 mail/ngx_mail_auth_http_module.c s->passwd.data = ngx_pnalloc(s->connection->pool, s 619 mail/ngx_mail_auth_http_module.c s->passwd.len); s 620 mail/ngx_mail_auth_http_module.c if (s->passwd.data == NULL) { s 623 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 627 mail/ngx_mail_auth_http_module.c ngx_memcpy(s->passwd.data, ctx->header_start, s->passwd.len); s 656 mail/ngx_mail_auth_http_module.c ctx->errcode.data = ngx_pnalloc(s->connection->pool, s 661 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 677 mail/ngx_mail_auth_http_module.c ngx_log_debug0(NGX_LOG_DEBUG_MAIL, s->connection->log, 0, s 684 mail/ngx_mail_auth_http_module.c ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, s 687 mail/ngx_mail_auth_http_module.c if (s->protocol == NGX_MAIL_SMTP_PROTOCOL) { s 696 mail/ngx_mail_auth_http_module.c p = ngx_pnalloc(s->connection->pool, ctx->err.len); s 700 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 712 mail/ngx_mail_auth_http_module.c s->out = ctx->err; s 718 mail/ngx_mail_auth_http_module.c s->quit = 1; s 719 mail/ngx_mail_auth_http_module.c ngx_mail_send(s->connection->write); s 723 mail/ngx_mail_auth_http_module.c ngx_add_timer(s->connection->read, (ngx_msec_t) (timer * 1000)); s 725 mail/ngx_mail_auth_http_module.c s->connection->read->handler = ngx_mail_auth_sleep_handler; s 730 mail/ngx_mail_auth_http_module.c if (s->auth_wait) { s 736 mail/ngx_mail_auth_http_module.c ngx_mail_auth_http_init(s); s 740 mail/ngx_mail_auth_http_module.c ngx_add_timer(s->connection->read, (ngx_msec_t) (timer * 1000)); s 742 mail/ngx_mail_auth_http_module.c s->connection->read->handler = ngx_mail_auth_sleep_handler; s 748 mail/ngx_mail_auth_http_module.c ngx_log_error(NGX_LOG_ERR, s->connection->log, 0, s 752 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 756 mail/ngx_mail_auth_http_module.c if (s->passwd.data == NULL s 757 mail/ngx_mail_auth_http_module.c && s->protocol != NGX_MAIL_SMTP_PROTOCOL) s 759 mail/ngx_mail_auth_http_module.c ngx_log_error(NGX_LOG_ERR, s->connection->log, 0, s 763 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 767 mail/ngx_mail_auth_http_module.c peer = ngx_pcalloc(s->connection->pool, sizeof(ngx_addr_t)); s 770 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 776 mail/ngx_mail_auth_http_module.c sin = ngx_pcalloc(s->connection->pool, sizeof(struct sockaddr_in)); s 779 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 787 mail/ngx_mail_auth_http_module.c ngx_log_error(NGX_LOG_ERR, s->connection->log, 0, s 792 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 800 mail/ngx_mail_auth_http_module.c ngx_log_error(NGX_LOG_ERR, s->connection->log, 0, s 805 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 816 mail/ngx_mail_auth_http_module.c peer->name.data = ngx_pnalloc(s->connection->pool, len); s 819 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 832 mail/ngx_mail_auth_http_module.c ngx_mail_proxy_init(s, peer); s 843 mail/ngx_mail_auth_http_module.c ngx_log_error(NGX_LOG_ERR, s->connection->log, 0, s 848 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 859 mail/ngx_mail_auth_http_module.c ngx_mail_session_t *s; s 865 mail/ngx_mail_auth_http_module.c s = c->data; s 871 mail/ngx_mail_auth_http_module.c if (s->auth_wait) { s 872 mail/ngx_mail_auth_http_module.c s->auth_wait = 0; s 873 mail/ngx_mail_auth_http_module.c ngx_mail_auth_http_init(s); s 877 mail/ngx_mail_auth_http_module.c cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); s 881 mail/ngx_mail_auth_http_module.c s->mail_state = 0; s 882 mail/ngx_mail_auth_http_module.c s->auth_method = NGX_MAIL_AUTH_PLAIN; s 915 mail/ngx_mail_auth_http_module.c ngx_mail_auth_http_parse_header_line(ngx_mail_session_t *s, s 1101 mail/ngx_mail_auth_http_module.c ngx_mail_session_t *s; s 1109 mail/ngx_mail_auth_http_module.c s = c->data; s 1111 mail/ngx_mail_auth_http_module.c ctx = ngx_mail_get_module_ctx(s, ngx_mail_auth_http_module); s 1115 mail/ngx_mail_auth_http_module.c ngx_mail_session_internal_server_error(s); s 1129 mail/ngx_mail_auth_http_module.c ngx_mail_auth_http_create_request(ngx_mail_session_t *s, ngx_pool_t *pool, s 1137 mail/ngx_mail_auth_http_module.c if (ngx_mail_auth_http_escape(pool, &s->login, &login) != NGX_OK) { s 1141 mail/ngx_mail_auth_http_module.c if (ngx_mail_auth_http_escape(pool, &s->passwd, &passwd) != NGX_OK) { s 1145 mail/ngx_mail_auth_http_module.c cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); s 1150 mail/ngx_mail_auth_http_module.c + ngx_mail_auth_http_method[s->auth_method].len s 1154 mail/ngx_mail_auth_http_module.c + sizeof("Auth-Salt: ") - 1 + s->salt.len s 1159 mail/ngx_mail_auth_http_module.c + sizeof("Client-IP: ") - 1 + s->connection->addr_text.len s 1161 mail/ngx_mail_auth_http_module.c + sizeof("Client-Host: ") - 1 + s->host.len + sizeof(CRLF) - 1 s 1162 mail/ngx_mail_auth_http_module.c + sizeof("Auth-SMTP-Helo: ") - 1 + s->smtp_helo.len s 1163 mail/ngx_mail_auth_http_module.c + sizeof("Auth-SMTP-From: ") - 1 + s->smtp_from.len s 1164 mail/ngx_mail_auth_http_module.c + sizeof("Auth-SMTP-To: ") - 1 + s->smtp_to.len s 1186 mail/ngx_mail_auth_http_module.c ngx_mail_auth_http_method[s->auth_method].data, s 1187 mail/ngx_mail_auth_http_module.c ngx_mail_auth_http_method[s->auth_method].len); s 1198 mail/ngx_mail_auth_http_module.c if (s->auth_method != NGX_MAIL_AUTH_PLAIN && s->salt.len) { s 1200 mail/ngx_mail_auth_http_module.c b->last = ngx_copy(b->last, s->salt.data, s->salt.len); s 1202 mail/ngx_mail_auth_http_module.c s->passwd.data = NULL; s 1212 mail/ngx_mail_auth_http_module.c s->login_attempt); s 1215 mail/ngx_mail_auth_http_module.c b->last = ngx_copy(b->last, s->connection->addr_text.data, s 1216 mail/ngx_mail_auth_http_module.c s->connection->addr_text.len); s 1219 mail/ngx_mail_auth_http_module.c if (s->host.len) { s 1222 mail/ngx_mail_auth_http_module.c b->last = ngx_copy(b->last, s->host.data, s->host.len); s 1226 mail/ngx_mail_auth_http_module.c if (s->auth_method == NGX_MAIL_AUTH_NONE) { s 1232 mail/ngx_mail_auth_http_module.c b->last = ngx_copy(b->last, s->smtp_helo.data, s->smtp_helo.len); s 1237 mail/ngx_mail_auth_http_module.c b->last = ngx_copy(b->last, s->smtp_from.data, s->smtp_from.len); s 1242 mail/ngx_mail_auth_http_module.c b->last = ngx_copy(b->last, s->smtp_to.data, s->smtp_to.len); s 1260 mail/ngx_mail_auth_http_module.c ngx_log_debug1(NGX_LOG_DEBUG_MAIL, s->connection->log, 0, s 30 mail/ngx_mail_handler.c ngx_mail_session_t *s; s 117 mail/ngx_mail_handler.c s = ngx_pcalloc(c->pool, sizeof(ngx_mail_session_t)); s 118 mail/ngx_mail_handler.c if (s == NULL) { s 123 mail/ngx_mail_handler.c s->main_conf = addr_conf->ctx->main_conf; s 124 mail/ngx_mail_handler.c s->srv_conf = addr_conf->ctx->srv_conf; s 126 mail/ngx_mail_handler.c s->addr_text = &addr_conf->addr_text; s 128 mail/ngx_mail_handler.c c->data = s; s 129 mail/ngx_mail_handler.c s->connection = c; s 132 mail/ngx_mail_handler.c c->number, &c->addr_text, s->addr_text); s 141 mail/ngx_mail_handler.c ctx->session = s; s 154 mail/ngx_mail_handler.c sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module); s 192 mail/ngx_mail_handler.c ngx_mail_session_t *s; s 196 mail/ngx_mail_handler.c s = c->data; s 197 mail/ngx_mail_handler.c s->starttls = 1; s 201 mail/ngx_mail_handler.c sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module); s 210 mail/ngx_mail_handler.c ngx_mail_session_t *s; s 220 mail/ngx_mail_handler.c s = c->data; s 222 mail/ngx_mail_handler.c cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); s 238 mail/ngx_mail_handler.c ngx_mail_session_t *s; s 243 mail/ngx_mail_handler.c s = c->data; s 245 mail/ngx_mail_handler.c if (s->starttls) { s 246 mail/ngx_mail_handler.c cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); s 271 mail/ngx_mail_handler.c ngx_mail_session_t *s; s 274 mail/ngx_mail_handler.c s = c->data; s 276 mail/ngx_mail_handler.c cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); s 278 mail/ngx_mail_handler.c s->protocol = cscf->protocol->type; s 280 mail/ngx_mail_handler.c s->ctx = ngx_pcalloc(c->pool, sizeof(void *) * ngx_mail_max_module); s 281 mail/ngx_mail_handler.c if (s->ctx == NULL) { s 282 mail/ngx_mail_handler.c ngx_mail_session_internal_server_error(s); s 288 mail/ngx_mail_handler.c cscf->protocol->init_session(s, c); s 293 mail/ngx_mail_handler.c ngx_mail_salt(ngx_mail_session_t *s, ngx_connection_t *c, s 296 mail/ngx_mail_handler.c s->salt.data = ngx_pnalloc(c->pool, s 300 mail/ngx_mail_handler.c if (s->salt.data == NULL) { s 304 mail/ngx_mail_handler.c s->salt.len = ngx_sprintf(s->salt.data, "<%ul.%T@%V>" CRLF, s 306 mail/ngx_mail_handler.c - s->salt.data; s 315 mail/ngx_mail_handler.c ngx_mail_starttls_only(ngx_mail_session_t *s, ngx_connection_t *c) s 323 mail/ngx_mail_handler.c sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module); s 336 mail/ngx_mail_handler.c ngx_mail_auth_plain(ngx_mail_session_t *s, ngx_connection_t *c, ngx_uint_t n) s 341 mail/ngx_mail_handler.c arg = s->args.elts; s 370 mail/ngx_mail_handler.c s->login.data = p; s 380 mail/ngx_mail_handler.c s->login.len = p++ - s->login.data; s 382 mail/ngx_mail_handler.c s->passwd.len = last - p; s 383 mail/ngx_mail_handler.c s->passwd.data = p; s 387 mail/ngx_mail_handler.c "mail auth plain: \"%V\" \"%V\"", &s->login, &s->passwd); s 395 mail/ngx_mail_handler.c ngx_mail_auth_login_username(ngx_mail_session_t *s, ngx_connection_t *c, s 400 mail/ngx_mail_handler.c arg = s->args.elts; s 405 mail/ngx_mail_handler.c s->login.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[n].len)); s 406 mail/ngx_mail_handler.c if (s->login.data == NULL) { s 410 mail/ngx_mail_handler.c if (ngx_decode_base64(&s->login, &arg[n]) != NGX_OK) { s 417 mail/ngx_mail_handler.c "mail auth login username: \"%V\"", &s->login); s 424 mail/ngx_mail_handler.c ngx_mail_auth_login_password(ngx_mail_session_t *s, ngx_connection_t *c) s 428 mail/ngx_mail_handler.c arg = s->args.elts; s 435 mail/ngx_mail_handler.c s->passwd.data = ngx_pnalloc(c->pool, s 437 mail/ngx_mail_handler.c if (s->passwd.data == NULL) { s 441 mail/ngx_mail_handler.c if (ngx_decode_base64(&s->passwd, &arg[0]) != NGX_OK) { s 449 mail/ngx_mail_handler.c "mail auth login password: \"%V\"", &s->passwd); s 457 mail/ngx_mail_handler.c ngx_mail_auth_cram_md5_salt(ngx_mail_session_t *s, ngx_connection_t *c, s 464 mail/ngx_mail_handler.c p = ngx_pnalloc(c->pool, len + ngx_base64_encoded_length(s->salt.len) + 2); s 470 mail/ngx_mail_handler.c s->salt.len -= 2; s 472 mail/ngx_mail_handler.c ngx_encode_base64(&salt, &s->salt); s 474 mail/ngx_mail_handler.c s->salt.len += 2; s 478 mail/ngx_mail_handler.c s->out.len = n; s 479 mail/ngx_mail_handler.c s->out.data = p; s 486 mail/ngx_mail_handler.c ngx_mail_auth_cram_md5(ngx_mail_session_t *s, ngx_connection_t *c) s 491 mail/ngx_mail_handler.c arg = s->args.elts; s 496 mail/ngx_mail_handler.c s->login.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[0].len)); s 497 mail/ngx_mail_handler.c if (s->login.data == NULL) { s 501 mail/ngx_mail_handler.c if (ngx_decode_base64(&s->login, &arg[0]) != NGX_OK) { s 507 mail/ngx_mail_handler.c p = s->login.data; s 508 mail/ngx_mail_handler.c last = p + s->login.len; s 512 mail/ngx_mail_handler.c s->login.len = p - s->login.data - 1; s 513 mail/ngx_mail_handler.c s->passwd.len = last - p; s 514 mail/ngx_mail_handler.c s->passwd.data = p; s 519 mail/ngx_mail_handler.c if (s->passwd.len != 32) { s 526 mail/ngx_mail_handler.c "mail auth cram-md5: \"%V\" \"%V\"", &s->login, &s->passwd); s 528 mail/ngx_mail_handler.c s->auth_method = NGX_MAIL_AUTH_CRAM_MD5; s 539 mail/ngx_mail_handler.c ngx_mail_session_t *s; s 543 mail/ngx_mail_handler.c s = c->data; s 552 mail/ngx_mail_handler.c if (s->out.len == 0) { s 560 mail/ngx_mail_handler.c n = c->send(c, s->out.data, s->out.len); s 563 mail/ngx_mail_handler.c s->out.len -= n; s 569 mail/ngx_mail_handler.c if (s->quit) { s 574 mail/ngx_mail_handler.c if (s->blocked) { s 588 mail/ngx_mail_handler.c cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); s 600 mail/ngx_mail_handler.c ngx_mail_read_command(ngx_mail_session_t *s, ngx_connection_t *c) s 607 mail/ngx_mail_handler.c n = c->recv(c, s->buffer->last, s->buffer->end - s->buffer->last); s 615 mail/ngx_mail_handler.c s->buffer->last += n; s 620 mail/ngx_mail_handler.c ngx_mail_session_internal_server_error(s); s 627 mail/ngx_mail_handler.c cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); s 629 mail/ngx_mail_handler.c rc = cscf->protocol->parse_command(s); s 633 mail/ngx_mail_handler.c if (s->buffer->last < s->buffer->end) { s 637 mail/ngx_mail_handler.c l.len = s->buffer->last - s->buffer->start; s 638 mail/ngx_mail_handler.c l.data = s->buffer->start; s 643 mail/ngx_mail_handler.c s->quit = 1; s 662 mail/ngx_mail_handler.c ngx_mail_auth(ngx_mail_session_t *s, ngx_connection_t *c) s 664 mail/ngx_mail_handler.c s->args.nelts = 0; s 665 mail/ngx_mail_handler.c s->buffer->pos = s->buffer->start; s 666 mail/ngx_mail_handler.c s->buffer->last = s->buffer->start; s 667 mail/ngx_mail_handler.c s->state = 0; s 673 mail/ngx_mail_handler.c s->login_attempt++; s 675 mail/ngx_mail_handler.c ngx_mail_auth_http_init(s); s 680 mail/ngx_mail_handler.c ngx_mail_session_internal_server_error(ngx_mail_session_t *s) s 684 mail/ngx_mail_handler.c cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); s 686 mail/ngx_mail_handler.c s->out = cscf->protocol->internal_server_error; s 687 mail/ngx_mail_handler.c s->quit = 1; s 689 mail/ngx_mail_handler.c ngx_mail_send(s->connection->write); s 730 mail/ngx_mail_handler.c ngx_mail_session_t *s; s 745 mail/ngx_mail_handler.c s = ctx->session; s 747 mail/ngx_mail_handler.c if (s == NULL) { s 752 mail/ngx_mail_handler.c s->starttls ? " using starttls" : "", s 753 mail/ngx_mail_handler.c s->addr_text); s 757 mail/ngx_mail_handler.c if (s->login.len == 0) { s 761 mail/ngx_mail_handler.c p = ngx_snprintf(buf, len, ", login: \"%V\"", &s->login); s 765 mail/ngx_mail_handler.c if (s->proxy == NULL) { s 769 mail/ngx_mail_handler.c p = ngx_snprintf(buf, len, ", upstream: %V", s->proxy->upstream.name); s 14 mail/ngx_mail_imap_handler.c static ngx_int_t ngx_mail_imap_login(ngx_mail_session_t *s, s 16 mail/ngx_mail_imap_handler.c static ngx_int_t ngx_mail_imap_authenticate(ngx_mail_session_t *s, s 18 mail/ngx_mail_imap_handler.c static ngx_int_t ngx_mail_imap_capability(ngx_mail_session_t *s, s 20 mail/ngx_mail_imap_handler.c static ngx_int_t ngx_mail_imap_starttls(ngx_mail_session_t *s, s 36 mail/ngx_mail_imap_handler.c ngx_mail_imap_init_session(ngx_mail_session_t *s, ngx_connection_t *c) s 40 mail/ngx_mail_imap_handler.c cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); s 42 mail/ngx_mail_imap_handler.c ngx_str_set(&s->out, imap_greeting); s 60 mail/ngx_mail_imap_handler.c ngx_mail_session_t *s; s 74 mail/ngx_mail_imap_handler.c s = c->data; s 76 mail/ngx_mail_imap_handler.c if (s->buffer == NULL) { s 77 mail/ngx_mail_imap_handler.c if (ngx_array_init(&s->args, c->pool, 2, sizeof(ngx_str_t)) s 80 mail/ngx_mail_imap_handler.c ngx_mail_session_internal_server_error(s); s 84 mail/ngx_mail_imap_handler.c iscf = ngx_mail_get_module_srv_conf(s, ngx_mail_imap_module); s 86 mail/ngx_mail_imap_handler.c s->buffer = ngx_create_temp_buf(c->pool, iscf->client_buffer_size); s 87 mail/ngx_mail_imap_handler.c if (s->buffer == NULL) { s 88 mail/ngx_mail_imap_handler.c ngx_mail_session_internal_server_error(s); s 93 mail/ngx_mail_imap_handler.c s->mail_state = ngx_imap_start; s 108 mail/ngx_mail_imap_handler.c ngx_mail_session_t *s; s 111 mail/ngx_mail_imap_handler.c s = c->data; s 122 mail/ngx_mail_imap_handler.c if (s->out.len) { s 124 mail/ngx_mail_imap_handler.c s->blocked = 1; s 128 mail/ngx_mail_imap_handler.c s->blocked = 0; s 130 mail/ngx_mail_imap_handler.c rc = ngx_mail_read_command(s, c); s 137 mail/ngx_mail_imap_handler.c s->text.len = 0; s 138 mail/ngx_mail_imap_handler.c ngx_str_set(&s->out, imap_ok); s 143 mail/ngx_mail_imap_handler.c s->command); s 145 mail/ngx_mail_imap_handler.c if (s->backslash) { s 147 mail/ngx_mail_imap_handler.c arg = s->args.elts; s 149 mail/ngx_mail_imap_handler.c for (i = 0; i < s->args.nelts; i++) { s 163 mail/ngx_mail_imap_handler.c s->backslash = 0; s 166 mail/ngx_mail_imap_handler.c switch (s->mail_state) { s 170 mail/ngx_mail_imap_handler.c switch (s->command) { s 173 mail/ngx_mail_imap_handler.c rc = ngx_mail_imap_login(s, c); s 177 mail/ngx_mail_imap_handler.c rc = ngx_mail_imap_authenticate(s, c); s 182 mail/ngx_mail_imap_handler.c rc = ngx_mail_imap_capability(s, c); s 186 mail/ngx_mail_imap_handler.c s->quit = 1; s 187 mail/ngx_mail_imap_handler.c ngx_str_set(&s->text, imap_bye); s 194 mail/ngx_mail_imap_handler.c rc = ngx_mail_imap_starttls(s, c); s 205 mail/ngx_mail_imap_handler.c rc = ngx_mail_auth_login_username(s, c, 0); s 208 mail/ngx_mail_imap_handler.c ngx_str_set(&s->out, imap_password); s 209 mail/ngx_mail_imap_handler.c s->mail_state = ngx_imap_auth_login_password; s 214 mail/ngx_mail_imap_handler.c rc = ngx_mail_auth_login_password(s, c); s 218 mail/ngx_mail_imap_handler.c rc = ngx_mail_auth_plain(s, c, 0); s 222 mail/ngx_mail_imap_handler.c rc = ngx_mail_auth_cram_md5(s, c); s 228 mail/ngx_mail_imap_handler.c ngx_str_set(&s->out, imap_next); s 234 mail/ngx_mail_imap_handler.c ngx_mail_auth(s, c); s 238 mail/ngx_mail_imap_handler.c ngx_mail_session_internal_server_error(s); s 242 mail/ngx_mail_imap_handler.c s->state = 0; s 243 mail/ngx_mail_imap_handler.c ngx_str_set(&s->out, imap_invalid_command); s 244 mail/ngx_mail_imap_handler.c s->mail_state = ngx_imap_start; s 249 mail/ngx_mail_imap_handler.c if (s->tag.len == 0) { s 250 mail/ngx_mail_imap_handler.c ngx_str_set(&s->tag, imap_star); s 253 mail/ngx_mail_imap_handler.c if (s->tagged_line.len < s->tag.len + s->text.len + s->out.len) { s 254 mail/ngx_mail_imap_handler.c s->tagged_line.len = s->tag.len + s->text.len + s->out.len; s 255 mail/ngx_mail_imap_handler.c s->tagged_line.data = ngx_pnalloc(c->pool, s->tagged_line.len); s 256 mail/ngx_mail_imap_handler.c if (s->tagged_line.data == NULL) { s 262 mail/ngx_mail_imap_handler.c p = s->tagged_line.data; s 264 mail/ngx_mail_imap_handler.c if (s->text.len) { s 265 mail/ngx_mail_imap_handler.c p = ngx_cpymem(p, s->text.data, s->text.len); s 268 mail/ngx_mail_imap_handler.c p = ngx_cpymem(p, s->tag.data, s->tag.len); s 269 mail/ngx_mail_imap_handler.c ngx_memcpy(p, s->out.data, s->out.len); s 271 mail/ngx_mail_imap_handler.c s->out.len = s->text.len + s->tag.len + s->out.len; s 272 mail/ngx_mail_imap_handler.c s->out.data = s->tagged_line.data; s 276 mail/ngx_mail_imap_handler.c s->args.nelts = 0; s 278 mail/ngx_mail_imap_handler.c if (s->state) { s 280 mail/ngx_mail_imap_handler.c s->arg_start = s->buffer->start + s->tag.len; s 281 mail/ngx_mail_imap_handler.c s->buffer->pos = s->arg_start; s 282 mail/ngx_mail_imap_handler.c s->buffer->last = s->arg_start; s 285 mail/ngx_mail_imap_handler.c s->buffer->pos = s->buffer->start; s 286 mail/ngx_mail_imap_handler.c s->buffer->last = s->buffer->start; s 287 mail/ngx_mail_imap_handler.c s->tag.len = 0; s 296 mail/ngx_mail_imap_handler.c ngx_mail_imap_login(ngx_mail_session_t *s, ngx_connection_t *c) s 301 mail/ngx_mail_imap_handler.c if (ngx_mail_starttls_only(s, c)) { s 306 mail/ngx_mail_imap_handler.c arg = s->args.elts; s 308 mail/ngx_mail_imap_handler.c if (s->args.nelts != 2 || arg[0].len == 0) { s 312 mail/ngx_mail_imap_handler.c s->login.len = arg[0].len; s 313 mail/ngx_mail_imap_handler.c s->login.data = ngx_pnalloc(c->pool, s->login.len); s 314 mail/ngx_mail_imap_handler.c if (s->login.data == NULL) { s 318 mail/ngx_mail_imap_handler.c ngx_memcpy(s->login.data, arg[0].data, s->login.len); s 320 mail/ngx_mail_imap_handler.c s->passwd.len = arg[1].len; s 321 mail/ngx_mail_imap_handler.c s->passwd.data = ngx_pnalloc(c->pool, s->passwd.len); s 322 mail/ngx_mail_imap_handler.c if (s->passwd.data == NULL) { s 326 mail/ngx_mail_imap_handler.c ngx_memcpy(s->passwd.data, arg[1].data, s->passwd.len); s 331 mail/ngx_mail_imap_handler.c &s->login, &s->passwd); s 334 mail/ngx_mail_imap_handler.c "imap login:\"%V\"", &s->login); s 342 mail/ngx_mail_imap_handler.c ngx_mail_imap_authenticate(ngx_mail_session_t *s, ngx_connection_t *c) s 349 mail/ngx_mail_imap_handler.c if (ngx_mail_starttls_only(s, c)) { s 354 mail/ngx_mail_imap_handler.c rc = ngx_mail_auth_parse(s, c); s 360 mail/ngx_mail_imap_handler.c ngx_str_set(&s->out, imap_username); s 361 mail/ngx_mail_imap_handler.c s->mail_state = ngx_imap_auth_login_username; s 367 mail/ngx_mail_imap_handler.c ngx_str_set(&s->out, imap_password); s 368 mail/ngx_mail_imap_handler.c s->mail_state = ngx_imap_auth_login_password; s 370 mail/ngx_mail_imap_handler.c return ngx_mail_auth_login_username(s, c, 1); s 374 mail/ngx_mail_imap_handler.c ngx_str_set(&s->out, imap_plain_next); s 375 mail/ngx_mail_imap_handler.c s->mail_state = ngx_imap_auth_plain; s 381 mail/ngx_mail_imap_handler.c iscf = ngx_mail_get_module_srv_conf(s, ngx_mail_imap_module); s 387 mail/ngx_mail_imap_handler.c if (s->salt.data == NULL) { s 388 mail/ngx_mail_imap_handler.c cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); s 390 mail/ngx_mail_imap_handler.c if (ngx_mail_salt(s, c, cscf) != NGX_OK) { s 395 mail/ngx_mail_imap_handler.c if (ngx_mail_auth_cram_md5_salt(s, c, "+ ", 2) == NGX_OK) { s 396 mail/ngx_mail_imap_handler.c s->mail_state = ngx_imap_auth_cram_md5; s 408 mail/ngx_mail_imap_handler.c ngx_mail_imap_capability(ngx_mail_session_t *s, ngx_connection_t *c) s 412 mail/ngx_mail_imap_handler.c iscf = ngx_mail_get_module_srv_conf(s, ngx_mail_imap_module); s 419 mail/ngx_mail_imap_handler.c sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module); s 422 mail/ngx_mail_imap_handler.c s->text = iscf->starttls_capability; s 427 mail/ngx_mail_imap_handler.c s->text = iscf->starttls_only_capability; s 433 mail/ngx_mail_imap_handler.c s->text = iscf->capability; s 440 mail/ngx_mail_imap_handler.c ngx_mail_imap_starttls(ngx_mail_session_t *s, ngx_connection_t *c) s 446 mail/ngx_mail_imap_handler.c sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module); s 29 mail/ngx_mail_imap_module.h void ngx_mail_imap_init_session(ngx_mail_session_t *s, ngx_connection_t *c); s 32 mail/ngx_mail_imap_module.h ngx_int_t ngx_mail_imap_parse_command(ngx_mail_session_t *s); s 14 mail/ngx_mail_parse.c ngx_mail_pop3_parse_command(ngx_mail_session_t *s) s 25 mail/ngx_mail_parse.c state = s->state; s 27 mail/ngx_mail_parse.c for (p = s->buffer->pos; p < s->buffer->last; p++) { s 35 mail/ngx_mail_parse.c c = s->buffer->start; s 46 mail/ngx_mail_parse.c s->command = NGX_POP3_USER; s 50 mail/ngx_mail_parse.c s->command = NGX_POP3_PASS; s 54 mail/ngx_mail_parse.c s->command = NGX_POP3_APOP; s 58 mail/ngx_mail_parse.c s->command = NGX_POP3_QUIT; s 62 mail/ngx_mail_parse.c s->command = NGX_POP3_CAPA; s 66 mail/ngx_mail_parse.c s->command = NGX_POP3_AUTH; s 70 mail/ngx_mail_parse.c s->command = NGX_POP3_NOOP; s 74 mail/ngx_mail_parse.c s->command = NGX_POP3_STLS; s 109 mail/ngx_mail_parse.c s->arg_end = p; s 112 mail/ngx_mail_parse.c s->arg_end = p; s 115 mail/ngx_mail_parse.c if (s->args.nelts <= 2) { s 117 mail/ngx_mail_parse.c s->arg_start = p; s 134 mail/ngx_mail_parse.c if (s->command == NGX_POP3_USER s 135 mail/ngx_mail_parse.c || s->command == NGX_POP3_PASS) s 144 mail/ngx_mail_parse.c arg = ngx_array_push(&s->args); s 148 mail/ngx_mail_parse.c arg->len = p - s->arg_start; s 149 mail/ngx_mail_parse.c arg->data = s->arg_start; s 150 mail/ngx_mail_parse.c s->arg_start = NULL; s 179 mail/ngx_mail_parse.c s->buffer->pos = p; s 180 mail/ngx_mail_parse.c s->state = state; s 186 mail/ngx_mail_parse.c s->buffer->pos = p + 1; s 188 mail/ngx_mail_parse.c if (s->arg_start) { s 189 mail/ngx_mail_parse.c arg = ngx_array_push(&s->args); s 193 mail/ngx_mail_parse.c arg->len = s->arg_end - s->arg_start; s 194 mail/ngx_mail_parse.c arg->data = s->arg_start; s 195 mail/ngx_mail_parse.c s->arg_start = NULL; s 198 mail/ngx_mail_parse.c s->state = (s->command != NGX_POP3_AUTH) ? sw_start : sw_argument; s 204 mail/ngx_mail_parse.c s->state = sw_start; s 205 mail/ngx_mail_parse.c s->arg_start = NULL; s 212 mail/ngx_mail_parse.c ngx_mail_imap_parse_command(ngx_mail_session_t *s) s 231 mail/ngx_mail_parse.c state = s->state; s 233 mail/ngx_mail_parse.c for (p = s->buffer->pos; p < s->buffer->last; p++) { s 242 mail/ngx_mail_parse.c s->tag.len = p - s->buffer->start + 1; s 243 mail/ngx_mail_parse.c s->tag.data = s->buffer->start; s 247 mail/ngx_mail_parse.c s->state = sw_start; s 250 mail/ngx_mail_parse.c s->state = sw_start; s 260 mail/ngx_mail_parse.c s->state = sw_start; s 263 mail/ngx_mail_parse.c s->state = sw_start; s 266 mail/ngx_mail_parse.c s->cmd_start = p; s 275 mail/ngx_mail_parse.c c = s->cmd_start; s 285 mail/ngx_mail_parse.c s->command = NGX_IMAP_NOOP; s 299 mail/ngx_mail_parse.c s->command = NGX_IMAP_LOGIN; s 314 mail/ngx_mail_parse.c s->command = NGX_IMAP_LOGOUT; s 332 mail/ngx_mail_parse.c s->command = NGX_IMAP_STARTTLS; s 352 mail/ngx_mail_parse.c s->command = NGX_IMAP_CAPABILITY; s 373 mail/ngx_mail_parse.c s->command = NGX_IMAP_AUTHENTICATE; s 409 mail/ngx_mail_parse.c s->arg_end = p; s 412 mail/ngx_mail_parse.c s->arg_end = p; s 415 mail/ngx_mail_parse.c if (s->args.nelts <= 2) { s 416 mail/ngx_mail_parse.c s->quoted = 1; s 417 mail/ngx_mail_parse.c s->arg_start = p + 1; s 423 mail/ngx_mail_parse.c if (s->args.nelts <= 2) { s 429 mail/ngx_mail_parse.c if (s->args.nelts <= 2) { s 430 mail/ngx_mail_parse.c s->arg_start = p; s 439 mail/ngx_mail_parse.c if (ch == ' ' && s->quoted) { s 445 mail/ngx_mail_parse.c if (!s->quoted) { s 448 mail/ngx_mail_parse.c s->quoted = 0; s 453 mail/ngx_mail_parse.c arg = ngx_array_push(&s->args); s 457 mail/ngx_mail_parse.c arg->len = p - s->arg_start; s 458 mail/ngx_mail_parse.c arg->data = s->arg_start; s 459 mail/ngx_mail_parse.c s->arg_start = NULL; s 474 mail/ngx_mail_parse.c if (s->quoted) { s 475 mail/ngx_mail_parse.c s->backslash = 1; s 494 mail/ngx_mail_parse.c s->literal_len = s->literal_len * 10 + (ch - '0'); s 509 mail/ngx_mail_parse.c s->no_sync_literal = 1; s 520 mail/ngx_mail_parse.c s->buffer->pos = p + 1; s 521 mail/ngx_mail_parse.c s->arg_start = p + 1; s 522 mail/ngx_mail_parse.c if (s->no_sync_literal == 0) { s 523 mail/ngx_mail_parse.c s->state = sw_literal_argument; s 527 mail/ngx_mail_parse.c s->no_sync_literal = 0; s 535 mail/ngx_mail_parse.c if (s->literal_len && --s->literal_len) { s 539 mail/ngx_mail_parse.c arg = ngx_array_push(&s->args); s 543 mail/ngx_mail_parse.c arg->len = p + 1 - s->arg_start; s 544 mail/ngx_mail_parse.c arg->data = s->arg_start; s 545 mail/ngx_mail_parse.c s->arg_start = NULL; s 553 mail/ngx_mail_parse.c if (s->args.nelts <= 2) { s 579 mail/ngx_mail_parse.c s->buffer->pos = p; s 580 mail/ngx_mail_parse.c s->state = state; s 586 mail/ngx_mail_parse.c s->buffer->pos = p + 1; s 588 mail/ngx_mail_parse.c if (s->arg_start) { s 589 mail/ngx_mail_parse.c arg = ngx_array_push(&s->args); s 593 mail/ngx_mail_parse.c arg->len = s->arg_end - s->arg_start; s 594 mail/ngx_mail_parse.c arg->data = s->arg_start; s 596 mail/ngx_mail_parse.c s->arg_start = NULL; s 597 mail/ngx_mail_parse.c s->cmd_start = NULL; s 598 mail/ngx_mail_parse.c s->quoted = 0; s 599 mail/ngx_mail_parse.c s->no_sync_literal = 0; s 600 mail/ngx_mail_parse.c s->literal_len = 0; s 603 mail/ngx_mail_parse.c s->state = (s->command != NGX_IMAP_AUTHENTICATE) ? sw_start : sw_argument; s 609 mail/ngx_mail_parse.c s->state = sw_start; s 610 mail/ngx_mail_parse.c s->quoted = 0; s 611 mail/ngx_mail_parse.c s->no_sync_literal = 0; s 612 mail/ngx_mail_parse.c s->literal_len = 0; s 619 mail/ngx_mail_parse.c ngx_mail_smtp_parse_command(ngx_mail_session_t *s) s 630 mail/ngx_mail_parse.c state = s->state; s 632 mail/ngx_mail_parse.c for (p = s->buffer->pos; p < s->buffer->last; p++) { s 640 mail/ngx_mail_parse.c c = s->buffer->start; s 651 mail/ngx_mail_parse.c s->command = NGX_SMTP_HELO; s 655 mail/ngx_mail_parse.c s->command = NGX_SMTP_EHLO; s 659 mail/ngx_mail_parse.c s->command = NGX_SMTP_QUIT; s 663 mail/ngx_mail_parse.c s->command = NGX_SMTP_AUTH; s 667 mail/ngx_mail_parse.c s->command = NGX_SMTP_NOOP; s 671 mail/ngx_mail_parse.c s->command = NGX_SMTP_MAIL; s 675 mail/ngx_mail_parse.c s->command = NGX_SMTP_RSET; s 679 mail/ngx_mail_parse.c s->command = NGX_SMTP_RCPT; s 683 mail/ngx_mail_parse.c s->command = NGX_SMTP_VRFY; s 687 mail/ngx_mail_parse.c s->command = NGX_SMTP_EXPN; s 691 mail/ngx_mail_parse.c s->command = NGX_SMTP_HELP; s 708 mail/ngx_mail_parse.c s->command = NGX_SMTP_STARTTLS; s 743 mail/ngx_mail_parse.c s->arg_end = p; s 746 mail/ngx_mail_parse.c s->arg_end = p; s 749 mail/ngx_mail_parse.c if (s->args.nelts <= 10) { s 751 mail/ngx_mail_parse.c s->arg_start = p; s 763 mail/ngx_mail_parse.c arg = ngx_array_push(&s->args); s 767 mail/ngx_mail_parse.c arg->len = p - s->arg_start; s 768 mail/ngx_mail_parse.c arg->data = s->arg_start; s 769 mail/ngx_mail_parse.c s->arg_start = NULL; s 798 mail/ngx_mail_parse.c s->buffer->pos = p; s 799 mail/ngx_mail_parse.c s->state = state; s 805 mail/ngx_mail_parse.c s->buffer->pos = p + 1; s 807 mail/ngx_mail_parse.c if (s->arg_start) { s 808 mail/ngx_mail_parse.c arg = ngx_array_push(&s->args); s 812 mail/ngx_mail_parse.c arg->len = s->arg_end - s->arg_start; s 813 mail/ngx_mail_parse.c arg->data = s->arg_start; s 814 mail/ngx_mail_parse.c s->arg_start = NULL; s 817 mail/ngx_mail_parse.c s->state = (s->command != NGX_SMTP_AUTH) ? sw_start : sw_argument; s 823 mail/ngx_mail_parse.c s->state = sw_start; s 824 mail/ngx_mail_parse.c s->arg_start = NULL; s 831 mail/ngx_mail_parse.c ngx_mail_auth_parse(ngx_mail_session_t *s, ngx_connection_t *c) s 836 mail/ngx_mail_parse.c if (ngx_mail_starttls_only(s, c)) { s 841 mail/ngx_mail_parse.c arg = s->args.elts; s 847 mail/ngx_mail_parse.c if (s->args.nelts == 1) { s 851 mail/ngx_mail_parse.c if (s->args.nelts == 2) { s 860 mail/ngx_mail_parse.c if (s->args.nelts == 1) { s 864 mail/ngx_mail_parse.c if (s->args.nelts == 2) { s 865 mail/ngx_mail_parse.c return ngx_mail_auth_plain(s, c, 1); s 874 mail/ngx_mail_parse.c if (s->args.nelts != 1) { s 14 mail/ngx_mail_pop3_handler.c static ngx_int_t ngx_mail_pop3_user(ngx_mail_session_t *s, ngx_connection_t *c); s 15 mail/ngx_mail_pop3_handler.c static ngx_int_t ngx_mail_pop3_pass(ngx_mail_session_t *s, ngx_connection_t *c); s 16 mail/ngx_mail_pop3_handler.c static ngx_int_t ngx_mail_pop3_capa(ngx_mail_session_t *s, ngx_connection_t *c, s 18 mail/ngx_mail_pop3_handler.c static ngx_int_t ngx_mail_pop3_stls(ngx_mail_session_t *s, ngx_connection_t *c); s 19 mail/ngx_mail_pop3_handler.c static ngx_int_t ngx_mail_pop3_apop(ngx_mail_session_t *s, ngx_connection_t *c); s 20 mail/ngx_mail_pop3_handler.c static ngx_int_t ngx_mail_pop3_auth(ngx_mail_session_t *s, ngx_connection_t *c); s 32 mail/ngx_mail_pop3_handler.c ngx_mail_pop3_init_session(ngx_mail_session_t *s, ngx_connection_t *c) s 38 mail/ngx_mail_pop3_handler.c pscf = ngx_mail_get_module_srv_conf(s, ngx_mail_pop3_module); s 39 mail/ngx_mail_pop3_handler.c cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); s 44 mail/ngx_mail_pop3_handler.c if (ngx_mail_salt(s, c, cscf) != NGX_OK) { s 45 mail/ngx_mail_pop3_handler.c ngx_mail_session_internal_server_error(s); s 49 mail/ngx_mail_pop3_handler.c s->out.data = ngx_pnalloc(c->pool, sizeof(pop3_greeting) + s->salt.len); s 50 mail/ngx_mail_pop3_handler.c if (s->out.data == NULL) { s 51 mail/ngx_mail_pop3_handler.c ngx_mail_session_internal_server_error(s); s 55 mail/ngx_mail_pop3_handler.c p = ngx_cpymem(s->out.data, pop3_greeting, sizeof(pop3_greeting) - 3); s 57 mail/ngx_mail_pop3_handler.c p = ngx_cpymem(p, s->salt.data, s->salt.len); s 59 mail/ngx_mail_pop3_handler.c s->out.len = p - s->out.data; s 62 mail/ngx_mail_pop3_handler.c ngx_str_set(&s->out, pop3_greeting); s 81 mail/ngx_mail_pop3_handler.c ngx_mail_session_t *s; s 94 mail/ngx_mail_pop3_handler.c s = c->data; s 96 mail/ngx_mail_pop3_handler.c if (s->buffer == NULL) { s 97 mail/ngx_mail_pop3_handler.c if (ngx_array_init(&s->args, c->pool, 2, sizeof(ngx_str_t)) s 100 mail/ngx_mail_pop3_handler.c ngx_mail_session_internal_server_error(s); s 104 mail/ngx_mail_pop3_handler.c s->buffer = ngx_create_temp_buf(c->pool, 128); s 105 mail/ngx_mail_pop3_handler.c if (s->buffer == NULL) { s 106 mail/ngx_mail_pop3_handler.c ngx_mail_session_internal_server_error(s); s 111 mail/ngx_mail_pop3_handler.c s->mail_state = ngx_pop3_start; s 123 mail/ngx_mail_pop3_handler.c ngx_mail_session_t *s; s 126 mail/ngx_mail_pop3_handler.c s = c->data; s 137 mail/ngx_mail_pop3_handler.c if (s->out.len) { s 139 mail/ngx_mail_pop3_handler.c s->blocked = 1; s 143 mail/ngx_mail_pop3_handler.c s->blocked = 0; s 145 mail/ngx_mail_pop3_handler.c rc = ngx_mail_read_command(s, c); s 151 mail/ngx_mail_pop3_handler.c ngx_str_set(&s->out, pop3_ok); s 154 mail/ngx_mail_pop3_handler.c switch (s->mail_state) { s 158 mail/ngx_mail_pop3_handler.c switch (s->command) { s 161 mail/ngx_mail_pop3_handler.c rc = ngx_mail_pop3_user(s, c); s 165 mail/ngx_mail_pop3_handler.c rc = ngx_mail_pop3_capa(s, c, 1); s 169 mail/ngx_mail_pop3_handler.c rc = ngx_mail_pop3_apop(s, c); s 173 mail/ngx_mail_pop3_handler.c rc = ngx_mail_pop3_auth(s, c); s 177 mail/ngx_mail_pop3_handler.c s->quit = 1; s 184 mail/ngx_mail_pop3_handler.c rc = ngx_mail_pop3_stls(s, c); s 196 mail/ngx_mail_pop3_handler.c switch (s->command) { s 199 mail/ngx_mail_pop3_handler.c rc = ngx_mail_pop3_pass(s, c); s 203 mail/ngx_mail_pop3_handler.c rc = ngx_mail_pop3_capa(s, c, 0); s 207 mail/ngx_mail_pop3_handler.c s->quit = 1; s 225 mail/ngx_mail_pop3_handler.c rc = ngx_mail_auth_login_username(s, c, 0); s 227 mail/ngx_mail_pop3_handler.c ngx_str_set(&s->out, pop3_password); s 228 mail/ngx_mail_pop3_handler.c s->mail_state = ngx_pop3_auth_login_password; s 232 mail/ngx_mail_pop3_handler.c rc = ngx_mail_auth_login_password(s, c); s 236 mail/ngx_mail_pop3_handler.c rc = ngx_mail_auth_plain(s, c, 0); s 240 mail/ngx_mail_pop3_handler.c rc = ngx_mail_auth_cram_md5(s, c); s 248 mail/ngx_mail_pop3_handler.c ngx_mail_auth(s, c); s 252 mail/ngx_mail_pop3_handler.c ngx_mail_session_internal_server_error(s); s 256 mail/ngx_mail_pop3_handler.c s->mail_state = ngx_pop3_start; s 257 mail/ngx_mail_pop3_handler.c s->state = 0; s 259 mail/ngx_mail_pop3_handler.c ngx_str_set(&s->out, pop3_invalid_command); s 265 mail/ngx_mail_pop3_handler.c s->args.nelts = 0; s 266 mail/ngx_mail_pop3_handler.c s->buffer->pos = s->buffer->start; s 267 mail/ngx_mail_pop3_handler.c s->buffer->last = s->buffer->start; s 269 mail/ngx_mail_pop3_handler.c if (s->state) { s 270 mail/ngx_mail_pop3_handler.c s->arg_start = s->buffer->start; s 278 mail/ngx_mail_pop3_handler.c ngx_mail_pop3_user(ngx_mail_session_t *s, ngx_connection_t *c) s 283 mail/ngx_mail_pop3_handler.c if (ngx_mail_starttls_only(s, c)) { s 288 mail/ngx_mail_pop3_handler.c if (s->args.nelts != 1) { s 292 mail/ngx_mail_pop3_handler.c arg = s->args.elts; s 293 mail/ngx_mail_pop3_handler.c s->login.len = arg[0].len; s 294 mail/ngx_mail_pop3_handler.c s->login.data = ngx_pnalloc(c->pool, s->login.len); s 295 mail/ngx_mail_pop3_handler.c if (s->login.data == NULL) { s 299 mail/ngx_mail_pop3_handler.c ngx_memcpy(s->login.data, arg[0].data, s->login.len); s 302 mail/ngx_mail_pop3_handler.c "pop3 login: \"%V\"", &s->login); s 304 mail/ngx_mail_pop3_handler.c s->mail_state = ngx_pop3_user; s 311 mail/ngx_mail_pop3_handler.c ngx_mail_pop3_pass(ngx_mail_session_t *s, ngx_connection_t *c) s 315 mail/ngx_mail_pop3_handler.c if (s->args.nelts != 1) { s 319 mail/ngx_mail_pop3_handler.c arg = s->args.elts; s 320 mail/ngx_mail_pop3_handler.c s->passwd.len = arg[0].len; s 321 mail/ngx_mail_pop3_handler.c s->passwd.data = ngx_pnalloc(c->pool, s->passwd.len); s 322 mail/ngx_mail_pop3_handler.c if (s->passwd.data == NULL) { s 326 mail/ngx_mail_pop3_handler.c ngx_memcpy(s->passwd.data, arg[0].data, s->passwd.len); s 330 mail/ngx_mail_pop3_handler.c "pop3 passwd: \"%V\"", &s->passwd); s 338 mail/ngx_mail_pop3_handler.c ngx_mail_pop3_capa(ngx_mail_session_t *s, ngx_connection_t *c, ngx_int_t stls) s 342 mail/ngx_mail_pop3_handler.c pscf = ngx_mail_get_module_srv_conf(s, ngx_mail_pop3_module); s 349 mail/ngx_mail_pop3_handler.c sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module); s 352 mail/ngx_mail_pop3_handler.c s->out = pscf->starttls_capability; s 357 mail/ngx_mail_pop3_handler.c s->out = pscf->starttls_only_capability; s 364 mail/ngx_mail_pop3_handler.c s->out = pscf->capability; s 370 mail/ngx_mail_pop3_handler.c ngx_mail_pop3_stls(ngx_mail_session_t *s, ngx_connection_t *c) s 376 mail/ngx_mail_pop3_handler.c sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module); s 390 mail/ngx_mail_pop3_handler.c ngx_mail_pop3_apop(ngx_mail_session_t *s, ngx_connection_t *c) s 396 mail/ngx_mail_pop3_handler.c if (ngx_mail_starttls_only(s, c)) { s 401 mail/ngx_mail_pop3_handler.c if (s->args.nelts != 2) { s 405 mail/ngx_mail_pop3_handler.c pscf = ngx_mail_get_module_srv_conf(s, ngx_mail_pop3_module); s 411 mail/ngx_mail_pop3_handler.c arg = s->args.elts; s 413 mail/ngx_mail_pop3_handler.c s->login.len = arg[0].len; s 414 mail/ngx_mail_pop3_handler.c s->login.data = ngx_pnalloc(c->pool, s->login.len); s 415 mail/ngx_mail_pop3_handler.c if (s->login.data == NULL) { s 419 mail/ngx_mail_pop3_handler.c ngx_memcpy(s->login.data, arg[0].data, s->login.len); s 421 mail/ngx_mail_pop3_handler.c s->passwd.len = arg[1].len; s 422 mail/ngx_mail_pop3_handler.c s->passwd.data = ngx_pnalloc(c->pool, s->passwd.len); s 423 mail/ngx_mail_pop3_handler.c if (s->passwd.data == NULL) { s 427 mail/ngx_mail_pop3_handler.c ngx_memcpy(s->passwd.data, arg[1].data, s->passwd.len); s 430 mail/ngx_mail_pop3_handler.c "pop3 apop: \"%V\" \"%V\"", &s->login, &s->passwd); s 432 mail/ngx_mail_pop3_handler.c s->auth_method = NGX_MAIL_AUTH_APOP; s 439 mail/ngx_mail_pop3_handler.c ngx_mail_pop3_auth(ngx_mail_session_t *s, ngx_connection_t *c) s 445 mail/ngx_mail_pop3_handler.c if (ngx_mail_starttls_only(s, c)) { s 450 mail/ngx_mail_pop3_handler.c pscf = ngx_mail_get_module_srv_conf(s, ngx_mail_pop3_module); s 452 mail/ngx_mail_pop3_handler.c if (s->args.nelts == 0) { s 453 mail/ngx_mail_pop3_handler.c s->out = pscf->auth_capability; s 454 mail/ngx_mail_pop3_handler.c s->state = 0; s 459 mail/ngx_mail_pop3_handler.c rc = ngx_mail_auth_parse(s, c); s 465 mail/ngx_mail_pop3_handler.c ngx_str_set(&s->out, pop3_username); s 466 mail/ngx_mail_pop3_handler.c s->mail_state = ngx_pop3_auth_login_username; s 472 mail/ngx_mail_pop3_handler.c ngx_str_set(&s->out, pop3_password); s 473 mail/ngx_mail_pop3_handler.c s->mail_state = ngx_pop3_auth_login_password; s 475 mail/ngx_mail_pop3_handler.c return ngx_mail_auth_login_username(s, c, 1); s 479 mail/ngx_mail_pop3_handler.c ngx_str_set(&s->out, pop3_next); s 480 mail/ngx_mail_pop3_handler.c s->mail_state = ngx_pop3_auth_plain; s 490 mail/ngx_mail_pop3_handler.c if (ngx_mail_auth_cram_md5_salt(s, c, "+ ", 2) == NGX_OK) { s 491 mail/ngx_mail_pop3_handler.c s->mail_state = ngx_pop3_auth_cram_md5; s 28 mail/ngx_mail_pop3_module.h void ngx_mail_pop3_init_session(ngx_mail_session_t *s, ngx_connection_t *c); s 31 mail/ngx_mail_pop3_module.h ngx_int_t ngx_mail_pop3_parse_command(ngx_mail_session_t *s); s 28 mail/ngx_mail_proxy_module.c static ngx_int_t ngx_mail_proxy_read_response(ngx_mail_session_t *s, s 31 mail/ngx_mail_proxy_module.c static void ngx_mail_proxy_upstream_error(ngx_mail_session_t *s); s 32 mail/ngx_mail_proxy_module.c static void ngx_mail_proxy_internal_server_error(ngx_mail_session_t *s); s 33 mail/ngx_mail_proxy_module.c static void ngx_mail_proxy_close_session(ngx_mail_session_t *s); s 111 mail/ngx_mail_proxy_module.c ngx_mail_proxy_init(ngx_mail_session_t *s, ngx_addr_t *peer) s 119 mail/ngx_mail_proxy_module.c s->connection->log->action = "connecting to upstream"; s 121 mail/ngx_mail_proxy_module.c cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); s 126 mail/ngx_mail_proxy_module.c if (setsockopt(s->connection->fd, SOL_SOCKET, SO_KEEPALIVE, s 130 mail/ngx_mail_proxy_module.c ngx_log_error(NGX_LOG_ALERT, s->connection->log, ngx_socket_errno, s 135 mail/ngx_mail_proxy_module.c p = ngx_pcalloc(s->connection->pool, sizeof(ngx_mail_proxy_ctx_t)); s 137 mail/ngx_mail_proxy_module.c ngx_mail_session_internal_server_error(s); s 141 mail/ngx_mail_proxy_module.c s->proxy = p; s 147 mail/ngx_mail_proxy_module.c p->upstream.log = s->connection->log; s 153 mail/ngx_mail_proxy_module.c ngx_mail_proxy_internal_server_error(s); s 159 mail/ngx_mail_proxy_module.c p->upstream.connection->data = s; s 160 mail/ngx_mail_proxy_module.c p->upstream.connection->pool = s->connection->pool; s 162 mail/ngx_mail_proxy_module.c s->connection->read->handler = ngx_mail_proxy_block_read; s 165 mail/ngx_mail_proxy_module.c pcf = ngx_mail_get_module_srv_conf(s, ngx_mail_proxy_module); s 167 mail/ngx_mail_proxy_module.c s->proxy->buffer = ngx_create_temp_buf(s->connection->pool, s 169 mail/ngx_mail_proxy_module.c if (s->proxy->buffer == NULL) { s 170 mail/ngx_mail_proxy_module.c ngx_mail_proxy_internal_server_error(s); s 174 mail/ngx_mail_proxy_module.c s->out.len = 0; s 176 mail/ngx_mail_proxy_module.c switch (s->protocol) { s 180 mail/ngx_mail_proxy_module.c s->mail_state = ngx_pop3_start; s 185 mail/ngx_mail_proxy_module.c s->mail_state = ngx_imap_start; s 190 mail/ngx_mail_proxy_module.c s->mail_state = ngx_smtp_start; s 200 mail/ngx_mail_proxy_module.c ngx_mail_session_t *s; s 206 mail/ngx_mail_proxy_module.c s = c->data; s 208 mail/ngx_mail_proxy_module.c ngx_mail_proxy_close_session(s); s 220 mail/ngx_mail_proxy_module.c ngx_mail_session_t *s; s 227 mail/ngx_mail_proxy_module.c s = c->data; s 233 mail/ngx_mail_proxy_module.c ngx_mail_proxy_internal_server_error(s); s 237 mail/ngx_mail_proxy_module.c rc = ngx_mail_proxy_read_response(s, 0); s 244 mail/ngx_mail_proxy_module.c ngx_mail_proxy_upstream_error(s); s 248 mail/ngx_mail_proxy_module.c switch (s->mail_state) { s 253 mail/ngx_mail_proxy_module.c s->connection->log->action = "sending user name to upstream"; s 255 mail/ngx_mail_proxy_module.c line.len = sizeof("USER ") - 1 + s->login.len + 2; s 258 mail/ngx_mail_proxy_module.c ngx_mail_proxy_internal_server_error(s); s 263 mail/ngx_mail_proxy_module.c p = ngx_cpymem(p, s->login.data, s->login.len); s 266 mail/ngx_mail_proxy_module.c s->mail_state = ngx_pop3_user; s 272 mail/ngx_mail_proxy_module.c s->connection->log->action = "sending password to upstream"; s 274 mail/ngx_mail_proxy_module.c line.len = sizeof("PASS ") - 1 + s->passwd.len + 2; s 277 mail/ngx_mail_proxy_module.c ngx_mail_proxy_internal_server_error(s); s 282 mail/ngx_mail_proxy_module.c p = ngx_cpymem(p, s->passwd.data, s->passwd.len); s 285 mail/ngx_mail_proxy_module.c s->mail_state = ngx_pop3_passwd; s 289 mail/ngx_mail_proxy_module.c s->connection->read->handler = ngx_mail_proxy_handler; s 290 mail/ngx_mail_proxy_module.c s->connection->write->handler = ngx_mail_proxy_handler; s 294 mail/ngx_mail_proxy_module.c pcf = ngx_mail_get_module_srv_conf(s, ngx_mail_proxy_module); s 295 mail/ngx_mail_proxy_module.c ngx_add_timer(s->connection->read, pcf->timeout); s 301 mail/ngx_mail_proxy_module.c ngx_mail_proxy_handler(s->connection->write); s 317 mail/ngx_mail_proxy_module.c ngx_mail_proxy_internal_server_error(s); s 321 mail/ngx_mail_proxy_module.c s->proxy->buffer->pos = s->proxy->buffer->start; s 322 mail/ngx_mail_proxy_module.c s->proxy->buffer->last = s->proxy->buffer->start; s 333 mail/ngx_mail_proxy_module.c ngx_mail_session_t *s; s 340 mail/ngx_mail_proxy_module.c s = c->data; s 346 mail/ngx_mail_proxy_module.c ngx_mail_proxy_internal_server_error(s); s 350 mail/ngx_mail_proxy_module.c rc = ngx_mail_proxy_read_response(s, s->mail_state); s 357 mail/ngx_mail_proxy_module.c ngx_mail_proxy_upstream_error(s); s 361 mail/ngx_mail_proxy_module.c switch (s->mail_state) { s 367 mail/ngx_mail_proxy_module.c s->connection->log->action = "sending LOGIN command to upstream"; s 369 mail/ngx_mail_proxy_module.c line.len = s->tag.len + sizeof("LOGIN ") - 1 s 373 mail/ngx_mail_proxy_module.c ngx_mail_proxy_internal_server_error(s); s 378 mail/ngx_mail_proxy_module.c &s->tag, s->login.len) s 381 mail/ngx_mail_proxy_module.c s->mail_state = ngx_imap_login; s 387 mail/ngx_mail_proxy_module.c s->connection->log->action = "sending user name to upstream"; s 389 mail/ngx_mail_proxy_module.c line.len = s->login.len + 1 + 1 + NGX_SIZE_T_LEN + 1 + 2; s 392 mail/ngx_mail_proxy_module.c ngx_mail_proxy_internal_server_error(s); s 397 mail/ngx_mail_proxy_module.c &s->login, s->passwd.len) s 400 mail/ngx_mail_proxy_module.c s->mail_state = ngx_imap_user; s 407 mail/ngx_mail_proxy_module.c s->connection->log->action = "sending password to upstream"; s 409 mail/ngx_mail_proxy_module.c line.len = s->passwd.len + 2; s 412 mail/ngx_mail_proxy_module.c ngx_mail_proxy_internal_server_error(s); s 416 mail/ngx_mail_proxy_module.c p = ngx_cpymem(line.data, s->passwd.data, s->passwd.len); s 419 mail/ngx_mail_proxy_module.c s->mail_state = ngx_imap_passwd; s 423 mail/ngx_mail_proxy_module.c s->connection->read->handler = ngx_mail_proxy_handler; s 424 mail/ngx_mail_proxy_module.c s->connection->write->handler = ngx_mail_proxy_handler; s 428 mail/ngx_mail_proxy_module.c pcf = ngx_mail_get_module_srv_conf(s, ngx_mail_proxy_module); s 429 mail/ngx_mail_proxy_module.c ngx_add_timer(s->connection->read, pcf->timeout); s 435 mail/ngx_mail_proxy_module.c ngx_mail_proxy_handler(s->connection->write); s 451 mail/ngx_mail_proxy_module.c ngx_mail_proxy_internal_server_error(s); s 455 mail/ngx_mail_proxy_module.c s->proxy->buffer->pos = s->proxy->buffer->start; s 456 mail/ngx_mail_proxy_module.c s->proxy->buffer->last = s->proxy->buffer->start; s 468 mail/ngx_mail_proxy_module.c ngx_mail_session_t *s; s 476 mail/ngx_mail_proxy_module.c s = c->data; s 482 mail/ngx_mail_proxy_module.c ngx_mail_proxy_internal_server_error(s); s 486 mail/ngx_mail_proxy_module.c rc = ngx_mail_proxy_read_response(s, s->mail_state); s 493 mail/ngx_mail_proxy_module.c ngx_mail_proxy_upstream_error(s); s 497 mail/ngx_mail_proxy_module.c switch (s->mail_state) { s 502 mail/ngx_mail_proxy_module.c s->connection->log->action = "sending HELO/EHLO to upstream"; s 504 mail/ngx_mail_proxy_module.c cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); s 509 mail/ngx_mail_proxy_module.c ngx_mail_proxy_internal_server_error(s); s 513 mail/ngx_mail_proxy_module.c pcf = ngx_mail_get_module_srv_conf(s, ngx_mail_proxy_module); s 516 mail/ngx_mail_proxy_module.c ((s->esmtp || pcf->xclient) ? "EHLO " : "HELO "), s 523 mail/ngx_mail_proxy_module.c s->mail_state = ngx_smtp_helo_xclient; s 525 mail/ngx_mail_proxy_module.c } else if (s->auth_method == NGX_MAIL_AUTH_NONE) { s 526 mail/ngx_mail_proxy_module.c s->mail_state = ngx_smtp_helo_from; s 529 mail/ngx_mail_proxy_module.c s->mail_state = ngx_smtp_helo; s 538 mail/ngx_mail_proxy_module.c s->connection->log->action = "sending XCLIENT to upstream"; s 542 mail/ngx_mail_proxy_module.c + s->connection->addr_text.len + s->login.len + s->host.len; s 546 mail/ngx_mail_proxy_module.c ngx_mail_proxy_internal_server_error(s); s 552 mail/ngx_mail_proxy_module.c &s->connection->addr_text, s 553 mail/ngx_mail_proxy_module.c (s->login.len ? " LOGIN=" : ""), &s->login, &s->host) s 556 mail/ngx_mail_proxy_module.c if (s->smtp_helo.len) { s 557 mail/ngx_mail_proxy_module.c s->mail_state = ngx_smtp_xclient_helo; s 559 mail/ngx_mail_proxy_module.c } else if (s->auth_method == NGX_MAIL_AUTH_NONE) { s 560 mail/ngx_mail_proxy_module.c s->mail_state = ngx_smtp_xclient_from; s 563 mail/ngx_mail_proxy_module.c s->mail_state = ngx_smtp_xclient; s 572 mail/ngx_mail_proxy_module.c s->connection->log->action = "sending client HELO/EHLO to upstream"; s 574 mail/ngx_mail_proxy_module.c line.len = sizeof("HELO " CRLF) - 1 + s->smtp_helo.len; s 578 mail/ngx_mail_proxy_module.c ngx_mail_proxy_internal_server_error(s); s 583 mail/ngx_mail_proxy_module.c ((s->esmtp) ? "EHLO %V" CRLF : "HELO %V" CRLF), s 584 mail/ngx_mail_proxy_module.c &s->smtp_helo) s 587 mail/ngx_mail_proxy_module.c s->mail_state = (s->auth_method == NGX_MAIL_AUTH_NONE) ? s 597 mail/ngx_mail_proxy_module.c s->connection->log->action = "sending MAIL FROM to upstream"; s 599 mail/ngx_mail_proxy_module.c line.len = s->smtp_from.len + sizeof(CRLF) - 1; s 602 mail/ngx_mail_proxy_module.c ngx_mail_proxy_internal_server_error(s); s 606 mail/ngx_mail_proxy_module.c p = ngx_cpymem(line.data, s->smtp_from.data, s->smtp_from.len); s 609 mail/ngx_mail_proxy_module.c s->mail_state = ngx_smtp_from; s 617 mail/ngx_mail_proxy_module.c s->connection->log->action = "sending RCPT TO to upstream"; s 619 mail/ngx_mail_proxy_module.c line.len = s->smtp_to.len + sizeof(CRLF) - 1; s 622 mail/ngx_mail_proxy_module.c ngx_mail_proxy_internal_server_error(s); s 626 mail/ngx_mail_proxy_module.c p = ngx_cpymem(line.data, s->smtp_to.data, s->smtp_to.len); s 629 mail/ngx_mail_proxy_module.c s->mail_state = ngx_smtp_to; s 637 mail/ngx_mail_proxy_module.c b = s->proxy->buffer; s 639 mail/ngx_mail_proxy_module.c if (s->auth_method == NGX_MAIL_AUTH_NONE) { s 647 mail/ngx_mail_proxy_module.c s->connection->read->handler = ngx_mail_proxy_handler; s 648 mail/ngx_mail_proxy_module.c s->connection->write->handler = ngx_mail_proxy_handler; s 652 mail/ngx_mail_proxy_module.c pcf = ngx_mail_get_module_srv_conf(s, ngx_mail_proxy_module); s 653 mail/ngx_mail_proxy_module.c ngx_add_timer(s->connection->read, pcf->timeout); s 659 mail/ngx_mail_proxy_module.c ngx_mail_proxy_handler(s->connection->write); s 675 mail/ngx_mail_proxy_module.c ngx_mail_proxy_internal_server_error(s); s 679 mail/ngx_mail_proxy_module.c s->proxy->buffer->pos = s->proxy->buffer->start; s 680 mail/ngx_mail_proxy_module.c s->proxy->buffer->last = s->proxy->buffer->start; s 688 mail/ngx_mail_proxy_module.c ngx_mail_session_t *s; s 694 mail/ngx_mail_proxy_module.c s = c->data; s 696 mail/ngx_mail_proxy_module.c ngx_mail_proxy_close_session(s); s 702 mail/ngx_mail_proxy_module.c ngx_mail_proxy_read_response(ngx_mail_session_t *s, ngx_uint_t state) s 709 mail/ngx_mail_proxy_module.c s->connection->log->action = "reading response from upstream"; s 711 mail/ngx_mail_proxy_module.c b = s->proxy->buffer; s 713 mail/ngx_mail_proxy_module.c n = s->proxy->upstream.connection->recv(s->proxy->upstream.connection, s 733 mail/ngx_mail_proxy_module.c ngx_log_error(NGX_LOG_ERR, s->connection->log, 0, s 744 mail/ngx_mail_proxy_module.c switch (s->protocol) { s 769 mail/ngx_mail_proxy_module.c if (ngx_strncmp(p, s->tag.data, s->tag.len) == 0) { s 770 mail/ngx_mail_proxy_module.c p += s->tag.len; s 813 mail/ngx_mail_proxy_module.c pcf = ngx_mail_get_module_srv_conf(s, ngx_mail_proxy_module); s 817 mail/ngx_mail_proxy_module.c ngx_log_error(NGX_LOG_ERR, s->connection->log, 0, s 822 mail/ngx_mail_proxy_module.c s->out.len = b->last - p - 2; s 823 mail/ngx_mail_proxy_module.c s->out.data = p; s 825 mail/ngx_mail_proxy_module.c ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, s 826 mail/ngx_mail_proxy_module.c "upstream sent invalid response: \"%V\"", &s->out); s 828 mail/ngx_mail_proxy_module.c s->out.len = b->last - b->pos; s 829 mail/ngx_mail_proxy_module.c s->out.data = b->pos; s 844 mail/ngx_mail_proxy_module.c ngx_mail_session_t *s; s 848 mail/ngx_mail_proxy_module.c s = c->data; s 853 mail/ngx_mail_proxy_module.c if (c == s->connection) { s 863 mail/ngx_mail_proxy_module.c ngx_mail_proxy_close_session(s); s 867 mail/ngx_mail_proxy_module.c if (c == s->connection) { s 871 mail/ngx_mail_proxy_module.c src = s->proxy->upstream.connection; s 873 mail/ngx_mail_proxy_module.c b = s->proxy->buffer; s 879 mail/ngx_mail_proxy_module.c dst = s->proxy->upstream.connection; s 880 mail/ngx_mail_proxy_module.c b = s->buffer; s 887 mail/ngx_mail_proxy_module.c src = s->connection; s 889 mail/ngx_mail_proxy_module.c b = s->buffer; s 895 mail/ngx_mail_proxy_module.c dst = s->connection; s 896 mail/ngx_mail_proxy_module.c b = s->proxy->buffer; s 918 mail/ngx_mail_proxy_module.c ngx_mail_proxy_close_session(s); s 961 mail/ngx_mail_proxy_module.c if ((s->connection->read->eof && s->buffer->pos == s->buffer->last) s 962 mail/ngx_mail_proxy_module.c || (s->proxy->upstream.connection->read->eof s 963 mail/ngx_mail_proxy_module.c && s->proxy->buffer->pos == s->proxy->buffer->last) s 964 mail/ngx_mail_proxy_module.c || (s->connection->read->eof s 965 mail/ngx_mail_proxy_module.c && s->proxy->upstream.connection->read->eof)) s 972 mail/ngx_mail_proxy_module.c ngx_mail_proxy_close_session(s); s 977 mail/ngx_mail_proxy_module.c ngx_mail_proxy_close_session(s); s 982 mail/ngx_mail_proxy_module.c ngx_mail_proxy_close_session(s); s 987 mail/ngx_mail_proxy_module.c ngx_mail_proxy_close_session(s); s 992 mail/ngx_mail_proxy_module.c ngx_mail_proxy_close_session(s); s 996 mail/ngx_mail_proxy_module.c if (c == s->connection) { s 997 mail/ngx_mail_proxy_module.c pcf = ngx_mail_get_module_srv_conf(s, ngx_mail_proxy_module); s 1004 mail/ngx_mail_proxy_module.c ngx_mail_proxy_upstream_error(ngx_mail_session_t *s) s 1006 mail/ngx_mail_proxy_module.c if (s->proxy->upstream.connection) { s 1007 mail/ngx_mail_proxy_module.c ngx_log_debug1(NGX_LOG_DEBUG_MAIL, s->connection->log, 0, s 1009 mail/ngx_mail_proxy_module.c s->proxy->upstream.connection->fd); s 1011 mail/ngx_mail_proxy_module.c ngx_close_connection(s->proxy->upstream.connection); s 1014 mail/ngx_mail_proxy_module.c if (s->out.len == 0) { s 1015 mail/ngx_mail_proxy_module.c ngx_mail_session_internal_server_error(s); s 1019 mail/ngx_mail_proxy_module.c s->quit = 1; s 1020 mail/ngx_mail_proxy_module.c ngx_mail_send(s->connection->write); s 1025 mail/ngx_mail_proxy_module.c ngx_mail_proxy_internal_server_error(ngx_mail_session_t *s) s 1027 mail/ngx_mail_proxy_module.c if (s->proxy->upstream.connection) { s 1028 mail/ngx_mail_proxy_module.c ngx_log_debug1(NGX_LOG_DEBUG_MAIL, s->connection->log, 0, s 1030 mail/ngx_mail_proxy_module.c s->proxy->upstream.connection->fd); s 1032 mail/ngx_mail_proxy_module.c ngx_close_connection(s->proxy->upstream.connection); s 1035 mail/ngx_mail_proxy_module.c ngx_mail_session_internal_server_error(s); s 1040 mail/ngx_mail_proxy_module.c ngx_mail_proxy_close_session(ngx_mail_session_t *s) s 1042 mail/ngx_mail_proxy_module.c if (s->proxy->upstream.connection) { s 1043 mail/ngx_mail_proxy_module.c ngx_log_debug1(NGX_LOG_DEBUG_MAIL, s->connection->log, 0, s 1045 mail/ngx_mail_proxy_module.c s->proxy->upstream.connection->fd); s 1047 mail/ngx_mail_proxy_module.c ngx_close_connection(s->proxy->upstream.connection); s 1050 mail/ngx_mail_proxy_module.c ngx_mail_close_connection(s->connection); s 17 mail/ngx_mail_smtp_handler.c static void ngx_mail_smtp_greeting(ngx_mail_session_t *s, ngx_connection_t *c); s 19 mail/ngx_mail_smtp_handler.c static ngx_int_t ngx_mail_smtp_create_buffer(ngx_mail_session_t *s, s 22 mail/ngx_mail_smtp_handler.c static ngx_int_t ngx_mail_smtp_helo(ngx_mail_session_t *s, ngx_connection_t *c); s 23 mail/ngx_mail_smtp_handler.c static ngx_int_t ngx_mail_smtp_auth(ngx_mail_session_t *s, ngx_connection_t *c); s 24 mail/ngx_mail_smtp_handler.c static ngx_int_t ngx_mail_smtp_mail(ngx_mail_session_t *s, ngx_connection_t *c); s 25 mail/ngx_mail_smtp_handler.c static ngx_int_t ngx_mail_smtp_starttls(ngx_mail_session_t *s, s 27 mail/ngx_mail_smtp_handler.c static ngx_int_t ngx_mail_smtp_rset(ngx_mail_session_t *s, ngx_connection_t *c); s 28 mail/ngx_mail_smtp_handler.c static ngx_int_t ngx_mail_smtp_rcpt(ngx_mail_session_t *s, ngx_connection_t *c); s 30 mail/ngx_mail_smtp_handler.c static ngx_int_t ngx_mail_smtp_discard_command(ngx_mail_session_t *s, s 32 mail/ngx_mail_smtp_handler.c static void ngx_mail_smtp_log_rejected_command(ngx_mail_session_t *s, s 55 mail/ngx_mail_smtp_handler.c ngx_mail_smtp_init_session(ngx_mail_session_t *s, ngx_connection_t *c) s 61 mail/ngx_mail_smtp_handler.c cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); s 64 mail/ngx_mail_smtp_handler.c s->host = smtp_unavailable; s 65 mail/ngx_mail_smtp_handler.c ngx_mail_smtp_greeting(s, c); s 70 mail/ngx_mail_smtp_handler.c s->host = smtp_tempunavail; s 71 mail/ngx_mail_smtp_handler.c ngx_mail_smtp_greeting(s, c); s 89 mail/ngx_mail_smtp_handler.c ctx->data = s; s 102 mail/ngx_mail_smtp_handler.c ngx_mail_session_t *s; s 104 mail/ngx_mail_smtp_handler.c s = ctx->data; s 105 mail/ngx_mail_smtp_handler.c c = s->connection; s 114 mail/ngx_mail_smtp_handler.c s->host = smtp_unavailable; s 117 mail/ngx_mail_smtp_handler.c s->host = smtp_tempunavail; s 122 mail/ngx_mail_smtp_handler.c ngx_mail_smtp_greeting(s, s->connection); s 129 mail/ngx_mail_smtp_handler.c s->host.data = ngx_pstrdup(c->pool, &ctx->name); s 130 mail/ngx_mail_smtp_handler.c if (s->host.data == NULL) { s 136 mail/ngx_mail_smtp_handler.c s->host.len = ctx->name.len; s 141 mail/ngx_mail_smtp_handler.c "address resolved: %V", &s->host); s 153 mail/ngx_mail_smtp_handler.c ngx_mail_session_t *s; s 158 mail/ngx_mail_smtp_handler.c s = c->data; s 160 mail/ngx_mail_smtp_handler.c cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); s 168 mail/ngx_mail_smtp_handler.c ctx->name = s->host; s 171 mail/ngx_mail_smtp_handler.c ctx->data = s; s 187 mail/ngx_mail_smtp_handler.c ngx_mail_session_t *s; s 189 mail/ngx_mail_smtp_handler.c s = ctx->data; s 190 mail/ngx_mail_smtp_handler.c c = s->connection; s 199 mail/ngx_mail_smtp_handler.c s->host = smtp_unavailable; s 202 mail/ngx_mail_smtp_handler.c s->host = smtp_tempunavail; s 227 mail/ngx_mail_smtp_handler.c s->host = smtp_unavailable; s 234 mail/ngx_mail_smtp_handler.c ngx_mail_smtp_greeting(s, c); s 239 mail/ngx_mail_smtp_handler.c ngx_mail_smtp_greeting(ngx_mail_session_t *s, ngx_connection_t *c) s 246 mail/ngx_mail_smtp_handler.c "smtp greeting for \"%V\"", &s->host); s 248 mail/ngx_mail_smtp_handler.c cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); s 249 mail/ngx_mail_smtp_handler.c sscf = ngx_mail_get_module_srv_conf(s, ngx_mail_smtp_module); s 265 mail/ngx_mail_smtp_handler.c s->out = sscf->greeting; s 275 mail/ngx_mail_smtp_handler.c ngx_mail_session_t *s; s 280 mail/ngx_mail_smtp_handler.c s = c->data; s 290 mail/ngx_mail_smtp_handler.c cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); s 301 mail/ngx_mail_smtp_handler.c sscf = ngx_mail_get_module_srv_conf(s, ngx_mail_smtp_module); s 303 mail/ngx_mail_smtp_handler.c s->out = sscf->greeting; s 309 mail/ngx_mail_smtp_handler.c if (s->buffer == NULL) { s 310 mail/ngx_mail_smtp_handler.c if (ngx_mail_smtp_create_buffer(s, c) != NGX_OK) { s 315 mail/ngx_mail_smtp_handler.c if (ngx_mail_smtp_discard_command(s, c, s 322 mail/ngx_mail_smtp_handler.c ngx_str_set(&s->out, smtp_invalid_pipelining); s 333 mail/ngx_mail_smtp_handler.c ngx_mail_session_t *s; s 346 mail/ngx_mail_smtp_handler.c s = c->data; s 348 mail/ngx_mail_smtp_handler.c if (s->buffer == NULL) { s 349 mail/ngx_mail_smtp_handler.c if (ngx_mail_smtp_create_buffer(s, c) != NGX_OK) { s 354 mail/ngx_mail_smtp_handler.c s->mail_state = ngx_smtp_start; s 362 mail/ngx_mail_smtp_handler.c ngx_mail_smtp_create_buffer(ngx_mail_session_t *s, ngx_connection_t *c) s 366 mail/ngx_mail_smtp_handler.c if (ngx_array_init(&s->args, c->pool, 2, sizeof(ngx_str_t)) == NGX_ERROR) { s 367 mail/ngx_mail_smtp_handler.c ngx_mail_session_internal_server_error(s); s 371 mail/ngx_mail_smtp_handler.c sscf = ngx_mail_get_module_srv_conf(s, ngx_mail_smtp_module); s 373 mail/ngx_mail_smtp_handler.c s->buffer = ngx_create_temp_buf(c->pool, sscf->client_buffer_size); s 374 mail/ngx_mail_smtp_handler.c if (s->buffer == NULL) { s 375 mail/ngx_mail_smtp_handler.c ngx_mail_session_internal_server_error(s); s 388 mail/ngx_mail_smtp_handler.c ngx_mail_session_t *s; s 391 mail/ngx_mail_smtp_handler.c s = c->data; s 402 mail/ngx_mail_smtp_handler.c if (s->out.len) { s 404 mail/ngx_mail_smtp_handler.c s->blocked = 1; s 408 mail/ngx_mail_smtp_handler.c s->blocked = 0; s 410 mail/ngx_mail_smtp_handler.c rc = ngx_mail_read_command(s, c); s 416 mail/ngx_mail_smtp_handler.c ngx_str_set(&s->out, smtp_ok); s 419 mail/ngx_mail_smtp_handler.c switch (s->mail_state) { s 423 mail/ngx_mail_smtp_handler.c switch (s->command) { s 427 mail/ngx_mail_smtp_handler.c rc = ngx_mail_smtp_helo(s, c); s 431 mail/ngx_mail_smtp_handler.c rc = ngx_mail_smtp_auth(s, c); s 435 mail/ngx_mail_smtp_handler.c s->quit = 1; s 436 mail/ngx_mail_smtp_handler.c ngx_str_set(&s->out, smtp_bye); s 440 mail/ngx_mail_smtp_handler.c rc = ngx_mail_smtp_mail(s, c); s 444 mail/ngx_mail_smtp_handler.c rc = ngx_mail_smtp_rcpt(s, c); s 448 mail/ngx_mail_smtp_handler.c rc = ngx_mail_smtp_rset(s, c); s 455 mail/ngx_mail_smtp_handler.c rc = ngx_mail_smtp_starttls(s, c); s 456 mail/ngx_mail_smtp_handler.c ngx_str_set(&s->out, smtp_starttls); s 467 mail/ngx_mail_smtp_handler.c rc = ngx_mail_auth_login_username(s, c, 0); s 469 mail/ngx_mail_smtp_handler.c ngx_str_set(&s->out, smtp_password); s 470 mail/ngx_mail_smtp_handler.c s->mail_state = ngx_smtp_auth_login_password; s 474 mail/ngx_mail_smtp_handler.c rc = ngx_mail_auth_login_password(s, c); s 478 mail/ngx_mail_smtp_handler.c rc = ngx_mail_auth_plain(s, c, 0); s 482 mail/ngx_mail_smtp_handler.c rc = ngx_mail_auth_cram_md5(s, c); s 490 mail/ngx_mail_smtp_handler.c ngx_mail_auth(s, c); s 494 mail/ngx_mail_smtp_handler.c ngx_mail_session_internal_server_error(s); s 498 mail/ngx_mail_smtp_handler.c s->mail_state = ngx_smtp_start; s 499 mail/ngx_mail_smtp_handler.c s->state = 0; s 500 mail/ngx_mail_smtp_handler.c ngx_str_set(&s->out, smtp_invalid_command); s 505 mail/ngx_mail_smtp_handler.c s->args.nelts = 0; s 506 mail/ngx_mail_smtp_handler.c s->buffer->pos = s->buffer->start; s 507 mail/ngx_mail_smtp_handler.c s->buffer->last = s->buffer->start; s 509 mail/ngx_mail_smtp_handler.c if (s->state) { s 510 mail/ngx_mail_smtp_handler.c s->arg_start = s->buffer->start; s 519 mail/ngx_mail_smtp_handler.c ngx_mail_smtp_helo(ngx_mail_session_t *s, ngx_connection_t *c) s 524 mail/ngx_mail_smtp_handler.c if (s->args.nelts != 1) { s 525 mail/ngx_mail_smtp_handler.c ngx_str_set(&s->out, smtp_invalid_argument); s 526 mail/ngx_mail_smtp_handler.c s->state = 0; s 530 mail/ngx_mail_smtp_handler.c arg = s->args.elts; s 532 mail/ngx_mail_smtp_handler.c s->smtp_helo.len = arg[0].len; s 534 mail/ngx_mail_smtp_handler.c s->smtp_helo.data = ngx_pnalloc(c->pool, arg[0].len); s 535 mail/ngx_mail_smtp_handler.c if (s->smtp_helo.data == NULL) { s 539 mail/ngx_mail_smtp_handler.c ngx_memcpy(s->smtp_helo.data, arg[0].data, arg[0].len); s 541 mail/ngx_mail_smtp_handler.c ngx_str_null(&s->smtp_from); s 542 mail/ngx_mail_smtp_handler.c ngx_str_null(&s->smtp_to); s 544 mail/ngx_mail_smtp_handler.c sscf = ngx_mail_get_module_srv_conf(s, ngx_mail_smtp_module); s 546 mail/ngx_mail_smtp_handler.c if (s->command == NGX_SMTP_HELO) { s 547 mail/ngx_mail_smtp_handler.c s->out = sscf->server_name; s 550 mail/ngx_mail_smtp_handler.c s->esmtp = 1; s 557 mail/ngx_mail_smtp_handler.c sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module); s 560 mail/ngx_mail_smtp_handler.c s->out = sscf->starttls_capability; s 565 mail/ngx_mail_smtp_handler.c s->out = sscf->starttls_only_capability; s 571 mail/ngx_mail_smtp_handler.c s->out = sscf->capability; s 579 mail/ngx_mail_smtp_handler.c ngx_mail_smtp_auth(ngx_mail_session_t *s, ngx_connection_t *c) s 586 mail/ngx_mail_smtp_handler.c if (ngx_mail_starttls_only(s, c)) { s 591 mail/ngx_mail_smtp_handler.c if (s->args.nelts == 0) { s 592 mail/ngx_mail_smtp_handler.c ngx_str_set(&s->out, smtp_invalid_argument); s 593 mail/ngx_mail_smtp_handler.c s->state = 0; s 597 mail/ngx_mail_smtp_handler.c rc = ngx_mail_auth_parse(s, c); s 603 mail/ngx_mail_smtp_handler.c ngx_str_set(&s->out, smtp_username); s 604 mail/ngx_mail_smtp_handler.c s->mail_state = ngx_smtp_auth_login_username; s 610 mail/ngx_mail_smtp_handler.c ngx_str_set(&s->out, smtp_password); s 611 mail/ngx_mail_smtp_handler.c s->mail_state = ngx_smtp_auth_login_password; s 613 mail/ngx_mail_smtp_handler.c return ngx_mail_auth_login_username(s, c, 1); s 617 mail/ngx_mail_smtp_handler.c ngx_str_set(&s->out, smtp_next); s 618 mail/ngx_mail_smtp_handler.c s->mail_state = ngx_smtp_auth_plain; s 624 mail/ngx_mail_smtp_handler.c sscf = ngx_mail_get_module_srv_conf(s, ngx_mail_smtp_module); s 630 mail/ngx_mail_smtp_handler.c if (s->salt.data == NULL) { s 631 mail/ngx_mail_smtp_handler.c cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); s 633 mail/ngx_mail_smtp_handler.c if (ngx_mail_salt(s, c, cscf) != NGX_OK) { s 638 mail/ngx_mail_smtp_handler.c if (ngx_mail_auth_cram_md5_salt(s, c, "334 ", 4) == NGX_OK) { s 639 mail/ngx_mail_smtp_handler.c s->mail_state = ngx_smtp_auth_cram_md5; s 651 mail/ngx_mail_smtp_handler.c ngx_mail_smtp_mail(ngx_mail_session_t *s, ngx_connection_t *c) s 658 mail/ngx_mail_smtp_handler.c sscf = ngx_mail_get_module_srv_conf(s, ngx_mail_smtp_module); s 661 mail/ngx_mail_smtp_handler.c ngx_mail_smtp_log_rejected_command(s, c, "client was rejected: \"%V\""); s 662 mail/ngx_mail_smtp_handler.c ngx_str_set(&s->out, smtp_auth_required); s 668 mail/ngx_mail_smtp_handler.c if (s->smtp_from.len) { s 669 mail/ngx_mail_smtp_handler.c ngx_str_set(&s->out, smtp_bad_sequence); s 673 mail/ngx_mail_smtp_handler.c l.len = s->buffer->last - s->buffer->start; s 674 mail/ngx_mail_smtp_handler.c l.data = s->buffer->start; s 696 mail/ngx_mail_smtp_handler.c s->smtp_from.len = l.len; s 698 mail/ngx_mail_smtp_handler.c s->smtp_from.data = ngx_pnalloc(c->pool, l.len); s 699 mail/ngx_mail_smtp_handler.c if (s->smtp_from.data == NULL) { s 703 mail/ngx_mail_smtp_handler.c ngx_memcpy(s->smtp_from.data, l.data, l.len); s 706 mail/ngx_mail_smtp_handler.c "smtp mail from:\"%V\"", &s->smtp_from); s 708 mail/ngx_mail_smtp_handler.c ngx_str_set(&s->out, smtp_ok); s 715 mail/ngx_mail_smtp_handler.c ngx_mail_smtp_rcpt(ngx_mail_session_t *s, ngx_connection_t *c) s 721 mail/ngx_mail_smtp_handler.c if (s->smtp_from.len == 0) { s 722 mail/ngx_mail_smtp_handler.c ngx_str_set(&s->out, smtp_bad_sequence); s 726 mail/ngx_mail_smtp_handler.c l.len = s->buffer->last - s->buffer->start; s 727 mail/ngx_mail_smtp_handler.c l.data = s->buffer->start; s 749 mail/ngx_mail_smtp_handler.c s->smtp_to.len = l.len; s 751 mail/ngx_mail_smtp_handler.c s->smtp_to.data = ngx_pnalloc(c->pool, l.len); s 752 mail/ngx_mail_smtp_handler.c if (s->smtp_to.data == NULL) { s 756 mail/ngx_mail_smtp_handler.c ngx_memcpy(s->smtp_to.data, l.data, l.len); s 759 mail/ngx_mail_smtp_handler.c "smtp rcpt to:\"%V\"", &s->smtp_to); s 761 mail/ngx_mail_smtp_handler.c s->auth_method = NGX_MAIL_AUTH_NONE; s 768 mail/ngx_mail_smtp_handler.c ngx_mail_smtp_rset(ngx_mail_session_t *s, ngx_connection_t *c) s 770 mail/ngx_mail_smtp_handler.c ngx_str_null(&s->smtp_from); s 771 mail/ngx_mail_smtp_handler.c ngx_str_null(&s->smtp_to); s 772 mail/ngx_mail_smtp_handler.c ngx_str_set(&s->out, smtp_ok); s 779 mail/ngx_mail_smtp_handler.c ngx_mail_smtp_starttls(ngx_mail_session_t *s, ngx_connection_t *c) s 785 mail/ngx_mail_smtp_handler.c sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module); s 793 mail/ngx_mail_smtp_handler.c ngx_str_null(&s->smtp_helo); s 794 mail/ngx_mail_smtp_handler.c ngx_str_null(&s->smtp_from); s 795 mail/ngx_mail_smtp_handler.c ngx_str_null(&s->smtp_to); s 809 mail/ngx_mail_smtp_handler.c ngx_mail_smtp_discard_command(ngx_mail_session_t *s, ngx_connection_t *c, s 814 mail/ngx_mail_smtp_handler.c n = c->recv(c, s->buffer->last, s->buffer->end - s->buffer->last); s 822 mail/ngx_mail_smtp_handler.c s->buffer->last += n; s 827 mail/ngx_mail_smtp_handler.c ngx_mail_session_internal_server_error(s); s 834 mail/ngx_mail_smtp_handler.c ngx_mail_smtp_log_rejected_command(s, c, err); s 836 mail/ngx_mail_smtp_handler.c s->buffer->pos = s->buffer->start; s 837 mail/ngx_mail_smtp_handler.c s->buffer->last = s->buffer->start; s 844 mail/ngx_mail_smtp_handler.c ngx_mail_smtp_log_rejected_command(ngx_mail_session_t *s, ngx_connection_t *c, s 855 mail/ngx_mail_smtp_handler.c cmd.len = s->buffer->last - s->buffer->start; s 856 mail/ngx_mail_smtp_handler.c cmd.data = s->buffer->start; s 35 mail/ngx_mail_smtp_module.h void ngx_mail_smtp_init_session(ngx_mail_session_t *s, ngx_connection_t *c); s 38 mail/ngx_mail_smtp_module.h ngx_int_t ngx_mail_smtp_parse_command(ngx_mail_session_t *s); s 13 os/unix/ngx_channel.c ngx_write_channel(ngx_socket_t s, ngx_channel_t *ch, size_t size, s 76 os/unix/ngx_channel.c n = sendmsg(s, &msg, 0); s 93 os/unix/ngx_channel.c ngx_read_channel(ngx_socket_t s, ngx_channel_t *ch, size_t size, ngx_log_t *log) s 125 os/unix/ngx_channel.c n = recvmsg(s, &msg, 0); s 24 os/unix/ngx_channel.h ngx_int_t ngx_write_channel(ngx_socket_t s, ngx_channel_t *ch, size_t size, s 26 os/unix/ngx_channel.h ngx_int_t ngx_read_channel(ngx_socket_t s, ngx_channel_t *ch, size_t size, s 244 os/unix/ngx_files.c ngx_set_file_time(u_char *name, ngx_fd_t fd, time_t s) s 250 os/unix/ngx_files.c tv[1].tv_sec = s; s 141 os/unix/ngx_files.h ngx_int_t ngx_set_file_time(u_char *name, ngx_fd_t fd, time_t s); s 69 os/unix/ngx_linux_config.h extern ssize_t sendfile(int s, int fd, int32_t *offset, size_t size); s 90 os/unix/ngx_process.c ngx_int_t s; s 93 os/unix/ngx_process.c s = respawn; s 96 os/unix/ngx_process.c for (s = 0; s < ngx_last_process; s++) { s 97 os/unix/ngx_process.c if (ngx_processes[s].pid == -1) { s 102 os/unix/ngx_process.c if (s == NGX_MAX_PROCESSES) { s 115 os/unix/ngx_process.c if (socketpair(AF_UNIX, SOCK_STREAM, 0, ngx_processes[s].channel) == -1) s 124 os/unix/ngx_process.c ngx_processes[s].channel[0], s 125 os/unix/ngx_process.c ngx_processes[s].channel[1]); s 127 os/unix/ngx_process.c if (ngx_nonblocking(ngx_processes[s].channel[0]) == -1) { s 131 os/unix/ngx_process.c ngx_close_channel(ngx_processes[s].channel, cycle->log); s 135 os/unix/ngx_process.c if (ngx_nonblocking(ngx_processes[s].channel[1]) == -1) { s 139 os/unix/ngx_process.c ngx_close_channel(ngx_processes[s].channel, cycle->log); s 144 os/unix/ngx_process.c if (ioctl(ngx_processes[s].channel[0], FIOASYNC, &on) == -1) { s 147 os/unix/ngx_process.c ngx_close_channel(ngx_processes[s].channel, cycle->log); s 151 os/unix/ngx_process.c if (fcntl(ngx_processes[s].channel[0], F_SETOWN, ngx_pid) == -1) { s 154 os/unix/ngx_process.c ngx_close_channel(ngx_processes[s].channel, cycle->log); s 158 os/unix/ngx_process.c if (fcntl(ngx_processes[s].channel[0], F_SETFD, FD_CLOEXEC) == -1) { s 162 os/unix/ngx_process.c ngx_close_channel(ngx_processes[s].channel, cycle->log); s 166 os/unix/ngx_process.c if (fcntl(ngx_processes[s].channel[1], F_SETFD, FD_CLOEXEC) == -1) { s 170 os/unix/ngx_process.c ngx_close_channel(ngx_processes[s].channel, cycle->log); s 174 os/unix/ngx_process.c ngx_channel = ngx_processes[s].channel[1]; s 177 os/unix/ngx_process.c ngx_processes[s].channel[0] = -1; s 178 os/unix/ngx_process.c ngx_processes[s].channel[1] = -1; s 181 os/unix/ngx_process.c ngx_process_slot = s; s 191 os/unix/ngx_process.c ngx_close_channel(ngx_processes[s].channel, cycle->log); s 205 os/unix/ngx_process.c ngx_processes[s].pid = pid; s 206 os/unix/ngx_process.c ngx_processes[s].exited = 0; s 212 os/unix/ngx_process.c ngx_processes[s].proc = proc; s 213 os/unix/ngx_process.c ngx_processes[s].data = data; s 214 os/unix/ngx_process.c ngx_processes[s].name = name; s 215 os/unix/ngx_process.c ngx_processes[s].exiting = 0; s 220 os/unix/ngx_process.c ngx_processes[s].respawn = 0; s 221 os/unix/ngx_process.c ngx_processes[s].just_spawn = 0; s 222 os/unix/ngx_process.c ngx_processes[s].detached = 0; s 226 os/unix/ngx_process.c ngx_processes[s].respawn = 0; s 227 os/unix/ngx_process.c ngx_processes[s].just_spawn = 1; s 228 os/unix/ngx_process.c ngx_processes[s].detached = 0; s 232 os/unix/ngx_process.c ngx_processes[s].respawn = 1; s 233 os/unix/ngx_process.c ngx_processes[s].just_spawn = 0; s 234 os/unix/ngx_process.c ngx_processes[s].detached = 0; s 238 os/unix/ngx_process.c ngx_processes[s].respawn = 1; s 239 os/unix/ngx_process.c ngx_processes[s].just_spawn = 1; s 240 os/unix/ngx_process.c ngx_processes[s].detached = 0; s 244 os/unix/ngx_process.c ngx_processes[s].respawn = 0; s 245 os/unix/ngx_process.c ngx_processes[s].just_spawn = 0; s 246 os/unix/ngx_process.c ngx_processes[s].detached = 1; s 250 os/unix/ngx_process.c if (s == ngx_last_process) { s 26 os/unix/ngx_socket.c ngx_nonblocking(ngx_socket_t s) s 32 os/unix/ngx_socket.c return ioctl(s, FIONBIO, &nb); s 37 os/unix/ngx_socket.c ngx_blocking(ngx_socket_t s) s 43 os/unix/ngx_socket.c return ioctl(s, FIONBIO, &nb); s 52 os/unix/ngx_socket.c ngx_tcp_nopush(ngx_socket_t s) s 58 os/unix/ngx_socket.c return setsockopt(s, IPPROTO_TCP, TCP_NOPUSH, s 64 os/unix/ngx_socket.c ngx_tcp_push(ngx_socket_t s) s 70 os/unix/ngx_socket.c return setsockopt(s, IPPROTO_TCP, TCP_NOPUSH, s 78 os/unix/ngx_socket.c ngx_tcp_nopush(ngx_socket_t s) s 84 os/unix/ngx_socket.c return setsockopt(s, IPPROTO_TCP, TCP_CORK, s 90 os/unix/ngx_socket.c ngx_tcp_push(ngx_socket_t s) s 96 os/unix/ngx_socket.c return setsockopt(s, IPPROTO_TCP, TCP_CORK, s 103 os/unix/ngx_socket.c ngx_tcp_nopush(ngx_socket_t s) s 110 os/unix/ngx_socket.c ngx_tcp_push(ngx_socket_t s) s 24 os/unix/ngx_socket.h int ngx_nonblocking(ngx_socket_t s); s 25 os/unix/ngx_socket.h int ngx_blocking(ngx_socket_t s); s 32 os/unix/ngx_socket.h #define ngx_nonblocking(s) fcntl(s, F_SETFL, fcntl(s, F_GETFL) | O_NONBLOCK) s 35 os/unix/ngx_socket.h #define ngx_blocking(s) fcntl(s, F_SETFL, fcntl(s, F_GETFL) & ~O_NONBLOCK) s 40 os/unix/ngx_socket.h int ngx_tcp_nopush(ngx_socket_t s); s 41 os/unix/ngx_socket.h int ngx_tcp_push(ngx_socket_t s); s 41 os/unix/ngx_time.c time_t s; s 45 os/unix/ngx_time.c s = time(0); s 47 os/unix/ngx_time.c t = localtime(&s); s 56 os/unix/ngx_time.c ngx_localtime(time_t s, ngx_tm_t *tm) s 59 os/unix/ngx_time.c (void) localtime_r(&s, tm); s 64 os/unix/ngx_time.c t = localtime(&s); s 75 os/unix/ngx_time.c ngx_libc_localtime(time_t s, struct tm *tm) s 78 os/unix/ngx_time.c (void) localtime_r(&s, tm); s 83 os/unix/ngx_time.c t = localtime(&s); s 91 os/unix/ngx_time.c ngx_libc_gmtime(time_t s, struct tm *tm) s 94 os/unix/ngx_time.c (void) gmtime_r(&s, tm); s 99 os/unix/ngx_time.c t = gmtime(&s); s 56 os/unix/ngx_time.h void ngx_localtime(time_t s, ngx_tm_t *tm); s 57 os/unix/ngx_time.h void ngx_libc_localtime(time_t s, struct tm *tm); s 58 os/unix/ngx_time.h void ngx_libc_gmtime(time_t s, struct tm *tm); s 62 os/unix/ngx_time.h #define ngx_sleep(s) (void) sleep(s)