1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# test relay closes stdin after relaying some data
use strict;
use warnings;
our %args = (
client => {
func => sub { errignore(@_); write_stream(@_); },
len => 2**30, # not reached
sndbuf => 2**10, # small buffer triggers error during write
# the error message seems to be timing dependent
down => "Client print failed: (Broken pipe|Connection reset by peer)",
nocheck => 1,
error => 54,
},
relay => {
func => sub { errignore(@_); $SIG{ALRM} = sub { close STDIN };
alarm(3); relay(@_); },
rcvbuf => 2**10,
sndbuf => 2**10,
down => "Bad file descriptor",
nocheck => 1,
errorin => "",
},
server => {
rcvbuf => 2**10,
nocheck => 1,
},
);
|