Skip to content

Commit

Permalink
Adjust timeouts so server dies quicker, updates utmp slower
Browse files Browse the repository at this point in the history
  • Loading branch information
keithw committed Nov 26, 2012
1 parent 486325e commit 2f8a67a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/frontend/mosh-server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ void serve( int host_fd, Terminal::Complete &terminal, ServerConnection &network
int timeout = min( network.wait_time(), terminal.wait_time( now ) );
if ( (!network.get_remote_state_num())
|| network.shutdown_in_progress() ) {
timeout = min( timeout, timeout_if_no_client );
timeout = min( timeout, 5000 );
}

/* poll for events */
Expand Down Expand Up @@ -682,9 +682,9 @@ void serve( int host_fd, Terminal::Complete &terminal, ServerConnection &network
}

#ifdef HAVE_UTEMPTER
/* update utmp if has been more than 10 seconds since heard from client */
/* update utmp if has been more than 30 seconds since heard from client */
if ( connected_utmp ) {
if ( time_since_remote_state > 10000 ) {
if ( time_since_remote_state > 30000 ) {
utempter_remove_record( host_fd );

char tmp[ 64 ];
Expand Down

0 comments on commit 2f8a67a

Please sign in to comment.