mirror of
https://github.com/nmap/nmap.git
synced 2026-11-22 23:50:56 +00:00
Merge db84088f4e into 80dd68b8d8
This commit is contained in:
commit
fe5bce057f
2 changed files with 17 additions and 1 deletions
|
|
@ -409,7 +409,9 @@ int ncat_listen()
|
|||
|
||||
init_fdlist(&broadcast_fdlist, o.conn_limit);
|
||||
|
||||
while (!breakloop && (client_fdlist.nfds > 1 || get_conn_count() > 0)) {
|
||||
/* Receive-only mode does not add stdin to the descriptor list. */
|
||||
while (!breakloop && (client_fdlist.nfds > (o.recvonly ? 0 : 1)
|
||||
|| get_conn_count() > 0)) {
|
||||
long usec_wait = -1;
|
||||
tvp = NULL;
|
||||
/* We pass these temporary descriptor sets to fselect, since fselect
|
||||
|
|
|
|||
|
|
@ -1075,6 +1075,20 @@ server_client_test_tcp_sctp_ssl "--recv-only server closes stdout and stops runn
|
|||
["--recv-only"], [], eof_test("Server", 1, "socket");
|
||||
kill_children;
|
||||
|
||||
# Receive-only listeners must work with either address family on its own.
|
||||
for my $binding (["-4", "IPv4"], ["-6", "IPv6"]) {
|
||||
my ($family, $description) = @$binding;
|
||||
|
||||
server_client_test_tcp_ssl "--recv-only server receives data over $description",
|
||||
["--recv-only", $family], [$family, "--send-only"], sub {
|
||||
syswrite($c_in, "abc\n");
|
||||
close($c_in);
|
||||
|
||||
my $resp = timeout_read($s_out) or die "Read timeout";
|
||||
$resp eq "abc\n" or die "Server got " . d($resp);
|
||||
};
|
||||
}
|
||||
|
||||
# Tests to check that server defaults to non-persistent without --keep-open.
|
||||
|
||||
# Server immediately quits after the first connection closed without --keep-open
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue