summaryrefslogtreecommitdiffhomepage
path: root/test/perl/input_read_parts/psgi.pl
diff options
context:
space:
mode:
authorAndrey Zelenkov <zelenkov@nginx.com>2018-02-26 19:53:40 +0300
committerAndrey Zelenkov <zelenkov@nginx.com>2018-02-26 19:53:40 +0300
commita89747e97c2a00503260d72082949be4ba97983f (patch)
tree424fea2951f83cde3f73365a0869cff92fad2a39 /test/perl/input_read_parts/psgi.pl
parent6d79c559b5cebeb2ad7c5dbdb779e3bec26fc08a (diff)
downloadunit-a89747e97c2a00503260d72082949be4ba97983f.tar.gz
unit-a89747e97c2a00503260d72082949be4ba97983f.tar.bz2
Tests: more perl tests.
Diffstat (limited to 'test/perl/input_read_parts/psgi.pl')
-rw-r--r--test/perl/input_read_parts/psgi.pl10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/perl/input_read_parts/psgi.pl b/test/perl/input_read_parts/psgi.pl
new file mode 100644
index 00000000..f68ac49c
--- /dev/null
+++ b/test/perl/input_read_parts/psgi.pl
@@ -0,0 +1,10 @@
+my $app = sub {
+ my ($environ) = @_;
+
+ $len_1 = $environ->{'psgi.input'}->read(my $body_1, 4);
+ $len_2 = $environ->{'psgi.input'}->read(my $body_2, 4);
+ $len_3 = $environ->{'psgi.input'}->read(my $body_3, 2);
+
+ return ['200', ['Content-Length' => $len_1 + $len_2 + $len_3],
+ [$body_1 . $body_2 . $body_3]];
+};