Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not return from listen_stream if there's more data to read (Fixes:… #1673

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions ncat/ncat_listen.c
Expand Up @@ -420,10 +420,15 @@ static int ncat_listen_stream(int proto)
/* Read from stdin and write to all clients. */
rc = read_stdin();
if (rc == 0) {
if (o.debug) {
logdebug("EOF on stdin\n");
}
if (o.proto != IPPROTO_TCP || (o.proto == IPPROTO_TCP && o.sendonly)) {
/* There will be nothing more to send. If we're not
receiving anything, we can quit here. */
return 0;
/* There will be nothing more to send. Prior to quiting we have to print
* remaining messages but ignore stdin
*/
FD_CLR(STDIN_FILENO, &listen_fds);
continue;
}
if (!o.noshutdown) shutdown_sockets(SHUT_WR);
}
Expand Down