Setting TCP keepalive for Cyrus daemons

Bron Gondwana brong at fastmail.fm
Thu Jun 30 16:39:29 EDT 2011


On Sat, Feb 13, 2010 at 09:09:05PM +1100, Bron Gondwana wrote:
> +                if (config_getint(IMAPOPT_TCP_KEEPALIVE_CNT)) {
> +                    r = setsockopt(be->sock, SOL_TCP, TCP_KEEPCNT, &optval, optlen);
> +                    if (r < 0) {
> +                        syslog(LOG_ERR, "unable to setsocketopt(TCP_KEEPCNT): %m");
> +                    }
> +                }
> +                if (config_getint(IMAPOPT_TCP_KEEPALIVE_IDLE)) {
> +                    r = setsockopt(be->sock, SOL_TCP, TCP_KEEPIDLE, &optval, optlen);
> +                    if (r < 0) {
> +                        syslog(LOG_ERR, "unable to setsocketopt(TCP_KEEPIDLE): %m");
> +                    }
> +                }
> +                if (config_getint(IMAPOPT_TCP_KEEPALIVE_INTVL)) {
> +                    r = setsockopt(be->sock, SOL_TCP, TCP_KEEPINTVL, &optval, optlen);
> +                    if (r < 0) {
> +                        syslog(LOG_ERR, "unable to setsocketopt(TCP_KEEPINTVL): %m");
> +                    }
> +                }

Why didn't one of you scumbags code review me and tell me
how bogus this is??

Now I have to fix it.

"keepalive interval 1 indeed"

Bron.


More information about the Info-cyrus mailing list