diff options
author | Keith Winstein <keithw@mit.edu> | 2012-03-07 03:21:33 -0500 |
---|---|---|
committer | Keith Winstein <keithw@mit.edu> | 2012-03-07 03:21:33 -0500 |
commit | 4e158a22e536d63dc41400c39282297c67d4361d (patch) | |
tree | f6355269d981659a59fca6c8d22bae0f3236d959 /src | |
parent | 4295111fd902a8377476d0b0d0ba2ba28bfbf350 (diff) |
Fix bug affecting clean shutdown on OS X
Diffstat (limited to 'src')
-rw-r--r-- | src/frontend/mosh-server.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/frontend/mosh-server.cc b/src/frontend/mosh-server.cc index 6325803..69647ce 100644 --- a/src/frontend/mosh-server.cc +++ b/src/frontend/mosh-server.cc @@ -349,7 +349,11 @@ void serve( int host_fd, Terminal::Complete &terminal, ServerConnection &network /* fill buffer if possible */ ssize_t bytes_read = read( pollfds[ 1 ].fd, buf, buf_size ); if ( bytes_read == 0 ) { /* EOF */ - return; + if ( !network.has_remote_addr() ) { + return; + } else if ( !network.shutdown_in_progress() ) { + network.start_shutdown(); + } } else if ( bytes_read < 0 ) { perror( "read" ); return; |