Index: ncat/ncat_connect.c =================================================================== --- ncat/ncat_connect.c (revision 12996) +++ ncat/ncat_connect.c (working copy) @@ -250,11 +250,9 @@ } /* end switch */ } else if (status == NSE_STATUS_EOF) { - /* Close up, got EOF from network side */ - if (nsi == cs->sock_nsi) { - nsi_delete(cs->stdin_nsi, NSOCK_PENDING_NOTIFY); - nsi_delete(cs->sock_nsi, NSOCK_PENDING_NOTIFY); - } + /* Close up, got EOF either on network side or on standard input. */ + nsi_delete(cs->stdin_nsi, NSOCK_PENDING_NOTIFY); + nsi_delete(cs->sock_nsi, NSOCK_PENDING_NOTIFY); } else if (status == NSE_STATUS_ERROR) { if (socket_errno() == EINPROGRESS) /* XXX: this is weird. errno always seems to be incorrect on ret from nsock. */