]> git.kaiwu.me - nginx.git/commitdiff
Removed the deprecated "so_keepalive" directive.
authorRuslan Ermilov <ru@nginx.com>
Wed, 29 Apr 2015 10:53:08 +0000 (13:53 +0300)
committerRuslan Ermilov <ru@nginx.com>
Wed, 29 Apr 2015 10:53:08 +0000 (13:53 +0300)
src/mail/ngx_mail.h
src/mail/ngx_mail_core_module.c
src/mail/ngx_mail_proxy_module.c

index e15bc6342a7d5729b58e12f64f504710ed96a8b6..dd8a23abbd870f0fa2b4c108248ad433c7b5d498 100644 (file)
@@ -131,8 +131,6 @@ typedef struct {
     ngx_msec_t              timeout;
     ngx_msec_t              resolver_timeout;
 
-    ngx_flag_t              so_keepalive;
-
     ngx_str_t               server_name;
 
     u_char                 *file_name;
index 9f349fa5e9fc4f01e42fd9edee260aabe4ce0dd6..ab455b8d93bee027c4f0d4b405e4ead1a598c4e5 100644 (file)
@@ -27,12 +27,6 @@ static char *ngx_mail_core_resolver(ngx_conf_t *cf, ngx_command_t *cmd,
     void *conf);
 
 
-static ngx_conf_deprecated_t  ngx_conf_deprecated_so_keepalive = {
-    ngx_conf_deprecated, "so_keepalive",
-    "so_keepalive\" parameter of the \"listen"
-};
-
-
 static ngx_command_t  ngx_mail_core_commands[] = {
 
     { ngx_string("server"),
@@ -56,13 +50,6 @@ static ngx_command_t  ngx_mail_core_commands[] = {
       0,
       NULL },
 
-    { ngx_string("so_keepalive"),
-      NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_FLAG,
-      ngx_conf_set_flag_slot,
-      NGX_MAIL_SRV_CONF_OFFSET,
-      offsetof(ngx_mail_core_srv_conf_t, so_keepalive),
-      &ngx_conf_deprecated_so_keepalive },
-
     { ngx_string("timeout"),
       NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
       ngx_conf_set_msec_slot,
@@ -175,7 +162,6 @@ ngx_mail_core_create_srv_conf(ngx_conf_t *cf)
 
     cscf->timeout = NGX_CONF_UNSET_MSEC;
     cscf->resolver_timeout = NGX_CONF_UNSET_MSEC;
-    cscf->so_keepalive = NGX_CONF_UNSET;
 
     cscf->resolver = NGX_CONF_UNSET_PTR;
 
@@ -196,8 +182,6 @@ ngx_mail_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
     ngx_conf_merge_msec_value(conf->resolver_timeout, prev->resolver_timeout,
                               30000);
 
-    ngx_conf_merge_value(conf->so_keepalive, prev->so_keepalive, 0);
-
 
     ngx_conf_merge_str_value(conf->server_name, prev->server_name, "");
 
index 41cbcf6e312c7b2c6a0766dda2627626c4c8b6b1..3802c3e6751344bf98225feff976dd1821a08a48 100644 (file)
@@ -111,7 +111,6 @@ static u_char  smtp_auth_ok[] = "235 2.0.0 OK" CRLF;
 void
 ngx_mail_proxy_init(ngx_mail_session_t *s, ngx_addr_t *peer)
 {
-    int                        keepalive;
     ngx_int_t                  rc;
     ngx_mail_proxy_ctx_t      *p;
     ngx_mail_proxy_conf_t     *pcf;
@@ -121,18 +120,6 @@ ngx_mail_proxy_init(ngx_mail_session_t *s, ngx_addr_t *peer)
 
     cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
 
-    if (cscf->so_keepalive) {
-        keepalive = 1;
-
-        if (setsockopt(s->connection->fd, SOL_SOCKET, SO_KEEPALIVE,
-                       (const void *) &keepalive, sizeof(int))
-                == -1)
-        {
-            ngx_log_error(NGX_LOG_ALERT, s->connection->log, ngx_socket_errno,
-                          "setsockopt(SO_KEEPALIVE) failed");
-        }
-    }
-
     p = ngx_pcalloc(s->connection->pool, sizeof(ngx_mail_proxy_ctx_t));
     if (p == NULL) {
         ngx_mail_session_internal_server_error(s);