Mercurial > hg > nginx-mail
diff src/mail/ngx_mail_handler.c @ 410:cd9cb7a3ff9e
Merge with nginx 0.7.8.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 11 Aug 2008 22:07:06 +0400 |
parents | 52b28d322d76 984bb0b1399b |
children | 03a69004d77d |
line wrap: on
line diff
--- a/src/mail/ngx_mail_handler.c +++ b/src/mail/ngx_mail_handler.c @@ -29,10 +29,6 @@ ngx_mail_init_connection(ngx_connection_ ngx_mail_in_port_t *imip; ngx_mail_in_addr_t *imia; ngx_mail_session_t *s; -#if (NGX_MAIL_SSL) - ngx_mail_ssl_conf_t *sslcf; -#endif - /* find the server configuration for the address:port */ @@ -116,6 +112,8 @@ ngx_mail_init_connection(ngx_connection_ c->log_error = NGX_ERROR_INFO; #if (NGX_MAIL_SSL) + { + ngx_mail_ssl_conf_t *sslcf; sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module); @@ -123,7 +121,7 @@ ngx_mail_init_connection(ngx_connection_ ngx_mail_ssl_init_connection(&sslcf->ssl, c); return; } - + } #endif ngx_mail_init_session(c); @@ -238,10 +236,10 @@ ngx_int_t ngx_mail_salt(ngx_mail_session_t *s, ngx_connection_t *c, ngx_mail_core_srv_conf_t *cscf) { - s->salt.data = ngx_palloc(c->pool, - sizeof(" <18446744073709551616.@>" CRLF) - 1 - + NGX_TIME_T_LEN - + cscf->server_name.len); + s->salt.data = ngx_pnalloc(c->pool, + sizeof(" <18446744073709551616.@>" CRLF) - 1 + + NGX_TIME_T_LEN + + cscf->server_name.len); if (s->salt.data == NULL) { return NGX_ERROR; } @@ -290,7 +288,7 @@ ngx_mail_auth_plain(ngx_mail_session_t * "mail auth plain: \"%V\"", &arg[n]); #endif - plain.data = ngx_palloc(c->pool, ngx_base64_decoded_length(arg[n].len)); + plain.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[n].len)); if (plain.data == NULL){ return NGX_ERROR; } @@ -346,7 +344,7 @@ ngx_mail_auth_login_username(ngx_mail_se ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0, "mail auth login username: \"%V\"", &arg[0]); - s->login.data = ngx_palloc(c->pool, ngx_base64_decoded_length(arg[0].len)); + s->login.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[0].len)); if (s->login.data == NULL){ return NGX_ERROR; } @@ -376,7 +374,8 @@ ngx_mail_auth_login_password(ngx_mail_se "mail auth login password: \"%V\"", &arg[0]); #endif - s->passwd.data = ngx_palloc(c->pool, ngx_base64_decoded_length(arg[0].len)); + s->passwd.data = ngx_pnalloc(c->pool, + ngx_base64_decoded_length(arg[0].len)); if (s->passwd.data == NULL){ return NGX_ERROR; } @@ -404,7 +403,7 @@ ngx_mail_auth_cram_md5_salt(ngx_mail_ses ngx_str_t salt; ngx_uint_t n; - p = ngx_palloc(c->pool, len + ngx_base64_encoded_length(s->salt.len) + 2); + p = ngx_pnalloc(c->pool, len + ngx_base64_encoded_length(s->salt.len) + 2); if (p == NULL) { return NGX_ERROR; } @@ -436,7 +435,7 @@ ngx_mail_auth_cram_md5(ngx_mail_session_ ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0, "mail auth cram-md5: \"%V\"", &arg[0]); - s->login.data = ngx_palloc(c->pool, ngx_base64_decoded_length(arg[0].len)); + s->login.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[0].len)); if (s->login.data == NULL){ return NGX_ERROR; }