Klaus Demo nginx / 7808ac0
Mail: output client port number on client connects (ticket #531). Ruslan Ermilov 8 years ago
1 changed file(s) with 6 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
2121 void
2222 ngx_mail_init_connection(ngx_connection_t *c)
2323 {
24 size_t len;
2425 ngx_uint_t i;
2526 ngx_mail_port_t *port;
2627 struct sockaddr *sa;
2930 ngx_mail_in_addr_t *addr;
3031 ngx_mail_session_t *s;
3132 ngx_mail_addr_conf_t *addr_conf;
33 u_char text[NGX_SOCKADDR_STRLEN];
3234 #if (NGX_HAVE_INET6)
3335 struct sockaddr_in6 *sin6;
3436 ngx_mail_in6_addr_t *addr6;
126128 c->data = s;
127129 s->connection = c;
128130
129 ngx_log_error(NGX_LOG_INFO, c->log, 0, "*%uA client %V connected to %V",
130 c->number, &c->addr_text, s->addr_text);
131 len = ngx_sock_ntop(c->sockaddr, c->socklen, text, NGX_SOCKADDR_STRLEN, 1);
132
133 ngx_log_error(NGX_LOG_INFO, c->log, 0, "*%uA client %*s connected to %V",
134 c->number, len, text, s->addr_text);
131135
132136 ctx = ngx_palloc(c->pool, sizeof(ngx_mail_log_ctx_t));
133137 if (ctx == NULL) {