[Date Prev][Date Next] [Chronological] [Thread] [Top]

idletimeout implementation



I can't figure out why global_idletimeout is divided by 4 before it's added
to the last_idle_check value (/SLAPD_IDLE_CHECK_LIMIT) in daemon.c.  Doesn't
this cause the idle timeout to actually be 1/4th the configured value?

openldap-2.0.27/servers/slapd/daemon.c:

   723  #define SLAPD_IDLE_CHECK_LIMIT 4
   ...
   737          if( emfile || ( global_idletimeout > 0 && difftime(
   738
last_idle_check+global_idletimeout/SLAPD_IDLE_CHECK_LIMIT,
   739              now ) < 0 ))
   740          {
   741              connections_timeout_idle(now);
   742          }

openldap-2.1.22/servers/slapd/daemon.c

  1139  #define SLAPD_IDLE_CHECK_LIMIT 4
  1140
  1141      if ( global_idletimeout > 0 ) {
  1142          last_idle_check = slap_get_time();
  1143          /* Set the select timeout.
  1144           * Don't just truncate, preserve the fractions of
  1145           * seconds to prevent sleeping for zero time.
  1146           */
  1147          idle.tv_sec = global_idletimeout/SLAPD_IDLE_CHECK_LIMIT;
  1148          idle.tv_usec = global_idletimeout - idle.tv_sec *
SLAPD_IDLE_CHECK_LIMIT;
  1149          idle.tv_usec *= 1000000 / SLAPD_IDLE_CHECK_LIMIT;
  1150      } else {
  1151          idle.tv_sec = 0;
  1152          idle.tv_usec = 0;
  1153      }


Mark A. Horstman
SBC Services, Inc.
Mark.Horstman@SBC.com