Welcome! Log In Create A New Profile

Advanced

Documentation doesn't match code

sridhar basam
March 01, 2010 02:24PM
The documentation for the mail proxy module state the "so_keepalive"
variable can be used to toggle keepalive functionality to the backend
server.

The actual code though uses this configuration variable to drive keepalive
functionality on the client side connection though. Below is a short patch
which changes the keepalive functionality to the backend server.

--- ngx_mail_proxy_module.c.orig 2009-11-02 10:14:17.000000000 -0500
+++ ngx_mail_proxy_module.c 2010-03-01 14:09:20.866649958 -0500
@@ -120,18 +120,6 @@

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);
@@ -154,6 +142,18 @@
return;
}

+ if (cscf->so_keepalive) {
+ keepalive = 1;
+
+ if (setsockopt(s->proxy->upstream.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");
+ }
+ }
+
ngx_add_timer(p->upstream.connection->read, cscf->timeout);

p->upstream.connection->data = s;


--
Sridhar
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Documentation doesn't match code

sridhar basam March 01, 2010 02:24PM

Re: Documentation doesn't match code

Maxim Dounin March 01, 2010 02:48PM

Re: Documentation doesn't match code

sridhar basam March 01, 2010 03:28PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 207
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready