comparison scgi_body.t @ 952:e9064d691790

Tests: converted tests to run in parallel.
author Andrey Zelenkov <zelenkov@nginx.com>
date Tue, 21 Jun 2016 16:39:13 +0300
parents dc2f8aac0553
children d4a0232425ee
comparison
equal deleted inserted replaced
951:9361c7eddfc1 952:e9064d691790
36 36
37 http { 37 http {
38 %%TEST_GLOBALS_HTTP%% 38 %%TEST_GLOBALS_HTTP%%
39 39
40 server { 40 server {
41 listen 127.0.0.1:8080; 41 listen 127.0.0.1:%%PORT_0%%;
42 server_name localhost; 42 server_name localhost;
43 43
44 location / { 44 location / {
45 scgi_pass 127.0.0.1:8081; 45 scgi_pass 127.0.0.1:%%PORT_1%%;
46 scgi_param SCGI 1; 46 scgi_param SCGI 1;
47 scgi_param REQUEST_URI $request_uri; 47 scgi_param REQUEST_URI $request_uri;
48 } 48 }
49 } 49 }
50 } 50 }
102 ############################################################################### 102 ###############################################################################
103 103
104 sub scgi_daemon { 104 sub scgi_daemon {
105 my $server = IO::Socket::INET->new( 105 my $server = IO::Socket::INET->new(
106 Proto => 'tcp', 106 Proto => 'tcp',
107 LocalHost => '127.0.0.1:8081', 107 LocalHost => '127.0.0.1:' . port(1),
108 Listen => 5, 108 Listen => 5,
109 Reuse => 1 109 Reuse => 1
110 ) 110 )
111 or die "Can't create listening socket: $!\n"; 111 or die "Can't create listening socket: $!\n";
112 112
117 $request->read_env(); 117 $request->read_env();
118 read($request->connection, $body, 118 read($request->connection, $body,
119 $request->env->{CONTENT_LENGTH}); 119 $request->env->{CONTENT_LENGTH});
120 120
121 $request->connection()->print(<<EOF); 121 $request->connection()->print(<<EOF);
122 Location: http://127.0.0.1:8080/redirect 122 Location: http://localhost/redirect
123 Content-Type: text/html 123 Content-Type: text/html
124 X-Body: $body 124 X-Body: $body
125 125
126 SEE-THIS 126 SEE-THIS
127 EOF 127 EOF