Ticket #1292: nginx-chunked.cgi

File nginx-chunked.cgi, 530 bytes (added by jmarshall.com@…, 9 years ago)

Demonstrates the bug with FastCGI and chunked encoding

Line 
1#!/usr/bin/perl
2
3use strict ;
4use warnings ;
5
6use FCGI ;
7use FCGI::ProcManager ;
8
9my $pm= FCGI::ProcManager->new() ;
10my $socket= FCGI::OpenSocket(':8003', 10) ;
11my $request= FCGI::Request(\*STDIN, \*STDOUT, \*STDERR, \%ENV, $socket) ;
12
13$pm->pm_manage() ;
14while ($request->Accept>=0) {
15 $pm->pm_pre_dispatch() ;
16 doit() ;
17 $pm->pm_post_dispatch() ;
18}
19FCGI::CloseSocket($socket);
20
21
22sub doit {
23 print <<EOR ;
24Status: 200 OK
25Content-Type: text/plain
26Transfer-Encoding: chunked
27Connection: close
28
295
30hello
316
32 world
330
34
35EOR
36}