1# test persistent https connection over http relay invoking the callback
2# The client writes a bad header line in the second request.
3# Check that the relay handles the input after the error correctly.
4
5use strict;
6use warnings;
7
8my @lengths = (4, 3);
9our %args = (
10    client => {
11	func => sub {
12	    my $self = shift;
13	    print <<'EOF';
14PUT /4 HTTP/1.1
15Host: foo.bar
16Content-Length: 4
17
18123
19PUT /3 HTTP/1.1
20XXX
21Host: foo.bar
22Content-Length: 3
23
2412
25EOF
26	    print STDERR "LEN: 4\n";
27	    print STDERR "LEN: 3\n";
28	    # relayd does not forward the first request if the second one
29	    # is invalid.  So do not expect any response.
30	    #http_response($self, "without len");
31	},
32	ssl => 1,
33	http_vers => ["1.1"],
34	lengths => \@lengths,
35	method => "PUT",
36    },
37    relayd => {
38	protocol => [ "http",
39	    "match request header log foo",
40	    "match response header log bar",
41	],
42	forwardssl => 1,
43	listenssl => 1,
44	loggrep => {
45	    qr/, malformed, PUT/ => 1,
46	},
47    },
48    server => {
49	func => \&http_server,
50	ssl => 1,
51	# The server does not get any connection.
52	noserver => 1,
53	nocheck => 1,
54    },
55    lengths => \@lengths,
56);
57
581;
59