1# test chunked https connection over http relay invoking the callback
2# The client writes a bad chunk length in the second chunk.
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/3 HTTP/1.1
15Host: foo.bar
16Transfer-Encoding: chunked
17
184
19123
20
21XXX
223
2312
24
250
26
27EOF
28	    print STDERR "LEN: 4\n";
29	    print STDERR "LEN: 3\n";
30	    # relayd does not forward the first chunk if the second one
31	    # is invalid.  So do not expect any response.
32	    #http_response($self, "without len");
33	},
34	ssl => 1,
35	http_vers => ["1.1"],
36	lengths => \@lengths,
37	method => "PUT",
38    },
39    relayd => {
40	protocol => [ "http",
41	    "match request header log foo",
42	    "match response header log bar",
43	],
44	forwardssl => 1,
45	listenssl => 1,
46	loggrep => {
47	    qr/, invalid chunk size, PUT/ => 1,
48	},
49    },
50    server => {
51	func => \&http_server,
52	# relayd only connects but does no ssl handshake
53	#ssl => 1,
54	nocheck => 1,
55    },
56    lengths => \@lengths,
57);
58
591;
60