Mercurial > hg > nginx
comparison src/mail/ngx_mail_proxy_module.c @ 6141:bf1655ae9a1c
Removed the deprecated "so_keepalive" directive.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Wed, 29 Apr 2015 13:53:08 +0300 |
parents | bb3dc21c89ef |
children | f01ab2dbcfdc |
comparison
equal
deleted
inserted
replaced
6140:2911b7e5491b | 6141:bf1655ae9a1c |
---|---|
109 | 109 |
110 | 110 |
111 void | 111 void |
112 ngx_mail_proxy_init(ngx_mail_session_t *s, ngx_addr_t *peer) | 112 ngx_mail_proxy_init(ngx_mail_session_t *s, ngx_addr_t *peer) |
113 { | 113 { |
114 int keepalive; | |
115 ngx_int_t rc; | 114 ngx_int_t rc; |
116 ngx_mail_proxy_ctx_t *p; | 115 ngx_mail_proxy_ctx_t *p; |
117 ngx_mail_proxy_conf_t *pcf; | 116 ngx_mail_proxy_conf_t *pcf; |
118 ngx_mail_core_srv_conf_t *cscf; | 117 ngx_mail_core_srv_conf_t *cscf; |
119 | 118 |
120 s->connection->log->action = "connecting to upstream"; | 119 s->connection->log->action = "connecting to upstream"; |
121 | 120 |
122 cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); | 121 cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); |
123 | |
124 if (cscf->so_keepalive) { | |
125 keepalive = 1; | |
126 | |
127 if (setsockopt(s->connection->fd, SOL_SOCKET, SO_KEEPALIVE, | |
128 (const void *) &keepalive, sizeof(int)) | |
129 == -1) | |
130 { | |
131 ngx_log_error(NGX_LOG_ALERT, s->connection->log, ngx_socket_errno, | |
132 "setsockopt(SO_KEEPALIVE) failed"); | |
133 } | |
134 } | |
135 | 122 |
136 p = ngx_pcalloc(s->connection->pool, sizeof(ngx_mail_proxy_ctx_t)); | 123 p = ngx_pcalloc(s->connection->pool, sizeof(ngx_mail_proxy_ctx_t)); |
137 if (p == NULL) { | 124 if (p == NULL) { |
138 ngx_mail_session_internal_server_error(s); | 125 ngx_mail_session_internal_server_error(s); |
139 return; | 126 return; |