Mercurial > hg > nginx
comparison src/http/v2/ngx_http_v2.h @ 7201:641306096f5b
HTTP/2: server push.
Resources to be pushed are configured with the "http2_push" directive.
Also, preload links from the Link response headers, as described in
https://www.w3.org/TR/preload/#server-push-http-2, can be pushed, if
enabled with the "http2_push_preload" directive.
Only relative URIs with absolute paths can be pushed.
The number of concurrent pushes is normally limited by a client, but
cannot exceed a hard limit set by the "http2_max_concurrent_pushes"
directive.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Thu, 08 Feb 2018 09:55:03 +0300 |
parents | ca8f8a443c11 |
children | 3d2b0b02bd3d |
comparison
equal
deleted
inserted
replaced
7200:cadb43014c7c | 7201:641306096f5b |
---|---|
21 #define NGX_HTTP_V2_MAX_FRAME_SIZE ((1 << 24) - 1) | 21 #define NGX_HTTP_V2_MAX_FRAME_SIZE ((1 << 24) - 1) |
22 | 22 |
23 #define NGX_HTTP_V2_INT_OCTETS 4 | 23 #define NGX_HTTP_V2_INT_OCTETS 4 |
24 #define NGX_HTTP_V2_MAX_FIELD \ | 24 #define NGX_HTTP_V2_MAX_FIELD \ |
25 (127 + (1 << (NGX_HTTP_V2_INT_OCTETS - 1) * 7) - 1) | 25 (127 + (1 << (NGX_HTTP_V2_INT_OCTETS - 1) * 7) - 1) |
26 | |
27 #define NGX_HTTP_V2_STREAM_ID_SIZE 4 | |
26 | 28 |
27 #define NGX_HTTP_V2_FRAME_HEADER_SIZE 9 | 29 #define NGX_HTTP_V2_FRAME_HEADER_SIZE 9 |
28 | 30 |
29 /* frame types */ | 31 /* frame types */ |
30 #define NGX_HTTP_V2_DATA_FRAME 0x0 | 32 #define NGX_HTTP_V2_DATA_FRAME 0x0 |
116 ngx_connection_t *connection; | 118 ngx_connection_t *connection; |
117 ngx_http_connection_t *http_connection; | 119 ngx_http_connection_t *http_connection; |
118 | 120 |
119 ngx_uint_t processing; | 121 ngx_uint_t processing; |
120 | 122 |
123 ngx_uint_t pushing; | |
124 ngx_uint_t concurrent_pushes; | |
125 | |
121 size_t send_window; | 126 size_t send_window; |
122 size_t recv_window; | 127 size_t recv_window; |
123 size_t init_window; | 128 size_t init_window; |
124 | 129 |
125 size_t frame_size; | 130 size_t frame_size; |
141 | 146 |
142 ngx_queue_t dependencies; | 147 ngx_queue_t dependencies; |
143 ngx_queue_t closed; | 148 ngx_queue_t closed; |
144 | 149 |
145 ngx_uint_t last_sid; | 150 ngx_uint_t last_sid; |
151 ngx_uint_t last_push; | |
146 | 152 |
147 unsigned closed_nodes:8; | 153 unsigned closed_nodes:8; |
148 unsigned settings_ack:1; | 154 unsigned settings_ack:1; |
149 unsigned table_update:1; | 155 unsigned table_update:1; |
150 unsigned blocked:1; | 156 unsigned blocked:1; |
151 unsigned goaway:1; | 157 unsigned goaway:1; |
158 unsigned push_disabled:1; | |
152 }; | 159 }; |
153 | 160 |
154 | 161 |
155 struct ngx_http_v2_node_s { | 162 struct ngx_http_v2_node_s { |
156 ngx_uint_t id; | 163 ngx_uint_t id; |
274 void ngx_http_v2_init(ngx_event_t *rev); | 281 void ngx_http_v2_init(ngx_event_t *rev); |
275 | 282 |
276 ngx_int_t ngx_http_v2_read_request_body(ngx_http_request_t *r); | 283 ngx_int_t ngx_http_v2_read_request_body(ngx_http_request_t *r); |
277 ngx_int_t ngx_http_v2_read_unbuffered_request_body(ngx_http_request_t *r); | 284 ngx_int_t ngx_http_v2_read_unbuffered_request_body(ngx_http_request_t *r); |
278 | 285 |
286 ngx_int_t ngx_http_v2_push_stream(ngx_http_v2_connection_t *h2c, | |
287 ngx_uint_t depend, size_t request_length, ngx_str_t *path, | |
288 ngx_str_t *authority); | |
289 | |
279 void ngx_http_v2_close_stream(ngx_http_v2_stream_t *stream, ngx_int_t rc); | 290 void ngx_http_v2_close_stream(ngx_http_v2_stream_t *stream, ngx_int_t rc); |
280 | 291 |
281 ngx_int_t ngx_http_v2_send_output_queue(ngx_http_v2_connection_t *h2c); | 292 ngx_int_t ngx_http_v2_send_output_queue(ngx_http_v2_connection_t *h2c); |
282 | 293 |
283 | 294 |