mirror of
https://github.com/nmap/nmap.git
synced 2026-01-19 12:49:02 +00:00
Ncat server UDP: do not quit after EOF on STDIN. Fixes #2685
This commit is contained in:
@@ -376,13 +376,13 @@ restart_fd_loop:
|
||||
} else {
|
||||
/* Read from stdin and write to all clients. */
|
||||
rc = read_stdin();
|
||||
if (rc == 0) {
|
||||
if (rc == 0 && type == SOCK_STREAM) {
|
||||
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;
|
||||
}
|
||||
if (!o.noshutdown && type == SOCK_STREAM) shutdown_sockets(SHUT_WR);
|
||||
if (!o.noshutdown) shutdown_sockets(SHUT_WR);
|
||||
}
|
||||
if (rc < 0)
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user