IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 18, 2009, 10:29:11 AM (17 years ago)
Author:
eugene
Message:

updated pcontrol to restart pclients that have been connected for too long

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pcontrol/StartHost.c

    r12840 r25872  
    2121    if (VerboseMode()) gprint (GP_ERR, "failure to start %s\n", host[0].hostname);
    2222    gettimeofday (&now, (void *) NULL);
    23     if (ZTIME(host[0].nexttry) || ZTIME(host[0].lasttry)) {
     23    if (ZTIME(host[0].next_start_try) || ZTIME(host[0].last_start_try)) {
    2424      /* reset retry period if either is zero */
    2525      delta = RETRY_BASE;
    2626    } else {
    27       delta = 2*DTIME (host[0].nexttry, host[0].lasttry);
     27      delta = MAX(1.0, 2*DTIME (host[0].next_start_try, host[0].last_start_try));
    2828    }
    29     host[0].nexttry.tv_sec  = now.tv_sec  + delta;
    30     host[0].nexttry.tv_usec = now.tv_usec;
    31     host[0].lasttry.tv_sec  = now.tv_sec;
    32     host[0].lasttry.tv_usec = now.tv_usec;
     29    host[0].next_start_try.tv_sec  = now.tv_sec  + delta;
     30    host[0].next_start_try.tv_usec = now.tv_usec;
     31    host[0].last_start_try.tv_sec  = now.tv_sec;
     32    host[0].last_start_try.tv_usec = now.tv_usec;
    3333    PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM);
    3434    return (FALSE);
    3535  }
    36   host[0].nexttry.tv_sec  = 0;
    37   host[0].nexttry.tv_usec = 0;
    38   host[0].lasttry.tv_sec  = 0;
    39   host[0].lasttry.tv_usec = 0;
     36  host[0].next_start_try.tv_sec  = 0;
     37  host[0].next_start_try.tv_usec = 0;
     38  host[0].last_start_try.tv_sec  = 0;
     39  host[0].last_start_try.tv_usec = 0;
     40
     41  // set the connection time
     42  gettimeofday (&host[0].connect_time, (void *) NULL);
    4043
    4144  host[0].stdin_fd  = stdio[0];
Note: See TracChangeset for help on using the changeset viewer.