summaryrefslogtreecommitdiff
path: root/regress/sys/kern/sosplice/Relay.pm
diff options
context:
space:
mode:
Diffstat (limited to 'regress/sys/kern/sosplice/Relay.pm')
-rw-r--r--regress/sys/kern/sosplice/Relay.pm14
1 files changed, 12 insertions, 2 deletions
diff --git a/regress/sys/kern/sosplice/Relay.pm b/regress/sys/kern/sosplice/Relay.pm
index a4f79733c7c..41c8575ed45 100644
--- a/regress/sys/kern/sosplice/Relay.pm
+++ b/regress/sys/kern/sosplice/Relay.pm
@@ -1,6 +1,6 @@
-# $OpenBSD: Relay.pm,v 1.1 2013/01/03 17:36:37 bluhm Exp $
+# $OpenBSD: Relay.pm,v 1.2 2017/11/07 22:06:17 bluhm Exp $
-# Copyright (c) 2010 Alexander Bluhm <bluhm@openbsd.org>
+# Copyright (c) 2010-2017 Alexander Bluhm <bluhm@openbsd.org>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
@@ -96,6 +96,16 @@ sub child {
or die ref($self), " dup STDIN failed: $!";
print STDERR "Accepted\n";
+ if ($self->{clientreadable}) {
+ my $idle = 15; # timeout
+ my $rin = '';
+ vec($rin, fileno($as), 1) = 1;
+ defined(my $n = select($rin, undef, undef, $idle))
+ or die ref($self), " select failed: $!";
+ $idle && $n == 0
+ and die ref($self), " select timeout";
+ }
+
my $cs = IO::Socket::INET6->new(
Proto => $self->{protocol},
Domain => $self->{connectdomain},