comparison h2_request_body_preread.t @ 1986:11463d379570

Tests: reworked HTTP/2 tests to use "http2 on".
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 04 Jun 2024 05:08:02 +0300
parents 236d038dc04a
children
comparison
equal deleted inserted replaced
1985:b5e2609d34a3 1986:11463d379570
38 %%TEST_GLOBALS_HTTP%% 38 %%TEST_GLOBALS_HTTP%%
39 39
40 limit_req_zone $binary_remote_addr zone=req:1m rate=20r/m; 40 limit_req_zone $binary_remote_addr zone=req:1m rate=20r/m;
41 41
42 server { 42 server {
43 listen 127.0.0.1:8080 http2; 43 listen 127.0.0.1:8080;
44 listen 127.0.0.1:8081; 44 listen 127.0.0.1:8081;
45 server_name localhost; 45 server_name localhost;
46 46
47 http2 on;
47 http2_body_preread_size 10; 48 http2_body_preread_size 10;
48 49
49 location /t { } 50 location /t { }
50 location / { 51 location / {
51 add_header X-Body $request_body; 52 add_header X-Body $request_body;
57 } 58 }
58 } 59 }
59 } 60 }
60 61
61 server { 62 server {
62 listen 127.0.0.1:8082 http2; 63 listen 127.0.0.1:8082;
63 server_name localhost; 64 server_name localhost;
64 65
66 http2 on;
65 http2_body_preread_size 0; 67 http2_body_preread_size 0;
66 68
67 location / { 69 location / {
68 add_header X-Body $request_body; 70 add_header X-Body $request_body;
69 proxy_pass http://127.0.0.1:8081/t; 71 proxy_pass http://127.0.0.1:8081/t;
74 } 76 }
75 } 77 }
76 } 78 }
77 79
78 server { 80 server {
79 listen 127.0.0.1:8083 http2; 81 listen 127.0.0.1:8083;
80 server_name localhost; 82 server_name localhost;
83
84 http2 on;
81 85
82 location / { 86 location / {
83 add_header X-Body $request_body; 87 add_header X-Body $request_body;
84 proxy_pass http://127.0.0.1:8081/t; 88 proxy_pass http://127.0.0.1:8081/t;
85 } 89 }
87 } 91 }
88 92
89 EOF 93 EOF
90 94
91 $t->write_file('t', ''); 95 $t->write_file('t', '');
92
93 # suppress deprecation warning
94
95 open OLDERR, ">&", \*STDERR; close STDERR;
96 $t->run(); 96 $t->run();
97 open STDERR, ">&", \*OLDERR;
98 97
99 ############################################################################### 98 ###############################################################################
100 99
101 # request body within preread size (that is, stream window) 100 # request body within preread size (that is, stream window)
102 101