comparison src/http/v3/ngx_http_v3_filter_module.c @ 8508:0ac25efb2da3 quic

HTTP/3: quic-qpack term updates. Renamed header -> field per quic-qpack naming convention, in particular: - Header Field -> Field Line - Header Block -> (Encoded) Field Section - Without Name Reference -> With Literal Name - Header Acknowledgement -> Section Acknowledgment
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 01 Jul 2021 15:37:53 +0300
parents 1fec68e322d0
children 8e8cdb7bfb17
comparison
equal deleted inserted replaced
8507:f8ad3dd142ad 8508:0ac25efb2da3
157 if (ngx_http_v3_push_resources(r, &ll) != NGX_OK) { 157 if (ngx_http_v3_push_resources(r, &ll) != NGX_OK) {
158 return NGX_ERROR; 158 return NGX_ERROR;
159 } 159 }
160 } 160 }
161 161
162 len = ngx_http_v3_encode_header_block_prefix(NULL, 0, 0, 0); 162 len = ngx_http_v3_encode_field_section_prefix(NULL, 0, 0, 0);
163 163
164 if (r->headers_out.status == NGX_HTTP_OK) { 164 if (r->headers_out.status == NGX_HTTP_OK) {
165 len += ngx_http_v3_encode_header_ri(NULL, 0, 165 len += ngx_http_v3_encode_field_ri(NULL, 0,
166 NGX_HTTP_V3_HEADER_STATUS_200); 166 NGX_HTTP_V3_HEADER_STATUS_200);
167 167
168 } else { 168 } else {
169 len += ngx_http_v3_encode_header_lri(NULL, 0, 169 len += ngx_http_v3_encode_field_lri(NULL, 0,
170 NGX_HTTP_V3_HEADER_STATUS_200, 170 NGX_HTTP_V3_HEADER_STATUS_200,
171 NULL, 3); 171 NULL, 3);
172 } 172 }
173 173
174 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); 174 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
175 175
176 if (r->headers_out.server == NULL) { 176 if (r->headers_out.server == NULL) {
182 182
183 } else { 183 } else {
184 n = sizeof("nginx") - 1; 184 n = sizeof("nginx") - 1;
185 } 185 }
186 186
187 len += ngx_http_v3_encode_header_lri(NULL, 0, 187 len += ngx_http_v3_encode_field_lri(NULL, 0,
188 NGX_HTTP_V3_HEADER_SERVER, 188 NGX_HTTP_V3_HEADER_SERVER,
189 NULL, n); 189 NULL, n);
190 } 190 }
191 191
192 if (r->headers_out.date == NULL) { 192 if (r->headers_out.date == NULL) {
193 len += ngx_http_v3_encode_header_lri(NULL, 0, NGX_HTTP_V3_HEADER_DATE, 193 len += ngx_http_v3_encode_field_lri(NULL, 0, NGX_HTTP_V3_HEADER_DATE,
194 NULL, ngx_cached_http_time.len); 194 NULL, ngx_cached_http_time.len);
195 } 195 }
196 196
197 if (r->headers_out.content_type.len) { 197 if (r->headers_out.content_type.len) {
198 n = r->headers_out.content_type.len; 198 n = r->headers_out.content_type.len;
199 199
201 && r->headers_out.charset.len) 201 && r->headers_out.charset.len)
202 { 202 {
203 n += sizeof("; charset=") - 1 + r->headers_out.charset.len; 203 n += sizeof("; charset=") - 1 + r->headers_out.charset.len;
204 } 204 }
205 205
206 len += ngx_http_v3_encode_header_lri(NULL, 0, 206 len += ngx_http_v3_encode_field_lri(NULL, 0,
207 NGX_HTTP_V3_HEADER_CONTENT_TYPE_TEXT_PLAIN, 207 NGX_HTTP_V3_HEADER_CONTENT_TYPE_TEXT_PLAIN,
208 NULL, n); 208 NULL, n);
209 } 209 }
210 210
211 if (r->headers_out.content_length == NULL) { 211 if (r->headers_out.content_length == NULL) {
212 if (r->headers_out.content_length_n > 0) { 212 if (r->headers_out.content_length_n > 0) {
213 len += ngx_http_v3_encode_header_lri(NULL, 0, 213 len += ngx_http_v3_encode_field_lri(NULL, 0,
214 NGX_HTTP_V3_HEADER_CONTENT_LENGTH_ZERO, 214 NGX_HTTP_V3_HEADER_CONTENT_LENGTH_ZERO,
215 NULL, NGX_OFF_T_LEN); 215 NULL, NGX_OFF_T_LEN);
216 216
217 } else if (r->headers_out.content_length_n == 0) { 217 } else if (r->headers_out.content_length_n == 0) {
218 len += ngx_http_v3_encode_header_ri(NULL, 0, 218 len += ngx_http_v3_encode_field_ri(NULL, 0,
219 NGX_HTTP_V3_HEADER_CONTENT_LENGTH_ZERO); 219 NGX_HTTP_V3_HEADER_CONTENT_LENGTH_ZERO);
220 } 220 }
221 } 221 }
222 222
223 if (r->headers_out.last_modified == NULL 223 if (r->headers_out.last_modified == NULL
224 && r->headers_out.last_modified_time != -1) 224 && r->headers_out.last_modified_time != -1)
225 { 225 {
226 len += ngx_http_v3_encode_header_lri(NULL, 0, 226 len += ngx_http_v3_encode_field_lri(NULL, 0,
227 NGX_HTTP_V3_HEADER_LAST_MODIFIED, NULL, 227 NGX_HTTP_V3_HEADER_LAST_MODIFIED, NULL,
228 sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1); 228 sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1);
229 } 229 }
230 230
231 if (r->headers_out.location 231 if (r->headers_out.location
265 265
266 if (port) { 266 if (port) {
267 n += sizeof(":65535") - 1; 267 n += sizeof(":65535") - 1;
268 } 268 }
269 269
270 len += ngx_http_v3_encode_header_lri(NULL, 0, 270 len += ngx_http_v3_encode_field_lri(NULL, 0,
271 NGX_HTTP_V3_HEADER_LOCATION, NULL, n); 271 NGX_HTTP_V3_HEADER_LOCATION, NULL, n);
272 272
273 } else { 273 } else {
274 ngx_str_null(&host); 274 ngx_str_null(&host);
275 port = 0; 275 port = 0;
276 } 276 }
277 277
278 #if (NGX_HTTP_GZIP) 278 #if (NGX_HTTP_GZIP)
279 if (r->gzip_vary) { 279 if (r->gzip_vary) {
280 if (clcf->gzip_vary) { 280 if (clcf->gzip_vary) {
281 len += ngx_http_v3_encode_header_ri(NULL, 0, 281 len += ngx_http_v3_encode_field_ri(NULL, 0,
282 NGX_HTTP_V3_HEADER_VARY_ACCEPT_ENCODING); 282 NGX_HTTP_V3_HEADER_VARY_ACCEPT_ENCODING);
283 283
284 } else { 284 } else {
285 r->gzip_vary = 0; 285 r->gzip_vary = 0;
286 } 286 }
304 304
305 if (header[i].hash == 0) { 305 if (header[i].hash == 0) {
306 continue; 306 continue;
307 } 307 }
308 308
309 len += ngx_http_v3_encode_header_l(NULL, &header[i].key, 309 len += ngx_http_v3_encode_field_l(NULL, &header[i].key,
310 &header[i].value); 310 &header[i].value);
311 } 311 }
312 312
313 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 header len:%uz", len); 313 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 header len:%uz", len);
314 314
315 b = ngx_create_temp_buf(r->pool, len); 315 b = ngx_create_temp_buf(r->pool, len);
316 if (b == NULL) { 316 if (b == NULL) {
317 return NGX_ERROR; 317 return NGX_ERROR;
318 } 318 }
319 319
320 b->last = (u_char *) ngx_http_v3_encode_header_block_prefix(b->last, 320 b->last = (u_char *) ngx_http_v3_encode_field_section_prefix(b->last,
321 0, 0, 0); 321 0, 0, 0);
322 322
323 if (r->headers_out.status == NGX_HTTP_OK) { 323 if (r->headers_out.status == NGX_HTTP_OK) {
324 b->last = (u_char *) ngx_http_v3_encode_header_ri(b->last, 0, 324 b->last = (u_char *) ngx_http_v3_encode_field_ri(b->last, 0,
325 NGX_HTTP_V3_HEADER_STATUS_200); 325 NGX_HTTP_V3_HEADER_STATUS_200);
326 326
327 } else { 327 } else {
328 b->last = (u_char *) ngx_http_v3_encode_header_lri(b->last, 0, 328 b->last = (u_char *) ngx_http_v3_encode_field_lri(b->last, 0,
329 NGX_HTTP_V3_HEADER_STATUS_200, 329 NGX_HTTP_V3_HEADER_STATUS_200,
330 NULL, 3); 330 NULL, 3);
331 b->last = ngx_sprintf(b->last, "%03ui", r->headers_out.status); 331 b->last = ngx_sprintf(b->last, "%03ui", r->headers_out.status);
332 } 332 }
333 333
343 } else { 343 } else {
344 p = (u_char *) "nginx"; 344 p = (u_char *) "nginx";
345 n = sizeof("nginx") - 1; 345 n = sizeof("nginx") - 1;
346 } 346 }
347 347
348 b->last = (u_char *) ngx_http_v3_encode_header_lri(b->last, 0, 348 b->last = (u_char *) ngx_http_v3_encode_field_lri(b->last, 0,
349 NGX_HTTP_V3_HEADER_SERVER, 349 NGX_HTTP_V3_HEADER_SERVER,
350 p, n); 350 p, n);
351 } 351 }
352 352
353 if (r->headers_out.date == NULL) { 353 if (r->headers_out.date == NULL) {
354 b->last = (u_char *) ngx_http_v3_encode_header_lri(b->last, 0, 354 b->last = (u_char *) ngx_http_v3_encode_field_lri(b->last, 0,
355 NGX_HTTP_V3_HEADER_DATE, 355 NGX_HTTP_V3_HEADER_DATE,
356 ngx_cached_http_time.data, 356 ngx_cached_http_time.data,
357 ngx_cached_http_time.len); 357 ngx_cached_http_time.len);
358 } 358 }
359 359
364 && r->headers_out.charset.len) 364 && r->headers_out.charset.len)
365 { 365 {
366 n += sizeof("; charset=") - 1 + r->headers_out.charset.len; 366 n += sizeof("; charset=") - 1 + r->headers_out.charset.len;
367 } 367 }
368 368
369 b->last = (u_char *) ngx_http_v3_encode_header_lri(b->last, 0, 369 b->last = (u_char *) ngx_http_v3_encode_field_lri(b->last, 0,
370 NGX_HTTP_V3_HEADER_CONTENT_TYPE_TEXT_PLAIN, 370 NGX_HTTP_V3_HEADER_CONTENT_TYPE_TEXT_PLAIN,
371 NULL, n); 371 NULL, n);
372 372
373 p = b->last; 373 p = b->last;
374 b->last = ngx_cpymem(b->last, r->headers_out.content_type.data, 374 b->last = ngx_cpymem(b->last, r->headers_out.content_type.data,
392 if (r->headers_out.content_length == NULL) { 392 if (r->headers_out.content_length == NULL) {
393 if (r->headers_out.content_length_n > 0) { 393 if (r->headers_out.content_length_n > 0) {
394 p = ngx_sprintf(b->last, "%O", r->headers_out.content_length_n); 394 p = ngx_sprintf(b->last, "%O", r->headers_out.content_length_n);
395 n = p - b->last; 395 n = p - b->last;
396 396
397 b->last = (u_char *) ngx_http_v3_encode_header_lri(b->last, 0, 397 b->last = (u_char *) ngx_http_v3_encode_field_lri(b->last, 0,
398 NGX_HTTP_V3_HEADER_CONTENT_LENGTH_ZERO, 398 NGX_HTTP_V3_HEADER_CONTENT_LENGTH_ZERO,
399 NULL, n); 399 NULL, n);
400 400
401 b->last = ngx_sprintf(b->last, "%O", 401 b->last = ngx_sprintf(b->last, "%O",
402 r->headers_out.content_length_n); 402 r->headers_out.content_length_n);
403 403
404 } else if (r->headers_out.content_length_n == 0) { 404 } else if (r->headers_out.content_length_n == 0) {
405 b->last = (u_char *) ngx_http_v3_encode_header_ri(b->last, 0, 405 b->last = (u_char *) ngx_http_v3_encode_field_ri(b->last, 0,
406 NGX_HTTP_V3_HEADER_CONTENT_LENGTH_ZERO); 406 NGX_HTTP_V3_HEADER_CONTENT_LENGTH_ZERO);
407 } 407 }
408 } 408 }
409 409
410 if (r->headers_out.last_modified == NULL 410 if (r->headers_out.last_modified == NULL
411 && r->headers_out.last_modified_time != -1) 411 && r->headers_out.last_modified_time != -1)
412 { 412 {
413 b->last = (u_char *) ngx_http_v3_encode_header_lri(b->last, 0, 413 b->last = (u_char *) ngx_http_v3_encode_field_lri(b->last, 0,
414 NGX_HTTP_V3_HEADER_LAST_MODIFIED, NULL, 414 NGX_HTTP_V3_HEADER_LAST_MODIFIED, NULL,
415 sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1); 415 sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1);
416 416
417 b->last = ngx_http_time(b->last, r->headers_out.last_modified_time); 417 b->last = ngx_http_time(b->last, r->headers_out.last_modified_time);
418 } 418 }
423 423
424 if (port) { 424 if (port) {
425 n += ngx_sprintf(b->last, ":%ui", port) - b->last; 425 n += ngx_sprintf(b->last, ":%ui", port) - b->last;
426 } 426 }
427 427
428 b->last = (u_char *) ngx_http_v3_encode_header_lri(b->last, 0, 428 b->last = (u_char *) ngx_http_v3_encode_field_lri(b->last, 0,
429 NGX_HTTP_V3_HEADER_LOCATION, 429 NGX_HTTP_V3_HEADER_LOCATION,
430 NULL, n); 430 NULL, n);
431 431
432 p = b->last; 432 p = b->last;
433 b->last = ngx_cpymem(b->last, "https://", sizeof("https://") - 1); 433 b->last = ngx_cpymem(b->last, "https://", sizeof("https://") - 1);
447 ngx_str_set(&r->headers_out.location->key, "Location"); 447 ngx_str_set(&r->headers_out.location->key, "Location");
448 } 448 }
449 449
450 #if (NGX_HTTP_GZIP) 450 #if (NGX_HTTP_GZIP)
451 if (r->gzip_vary) { 451 if (r->gzip_vary) {
452 b->last = (u_char *) ngx_http_v3_encode_header_ri(b->last, 0, 452 b->last = (u_char *) ngx_http_v3_encode_field_ri(b->last, 0,
453 NGX_HTTP_V3_HEADER_VARY_ACCEPT_ENCODING); 453 NGX_HTTP_V3_HEADER_VARY_ACCEPT_ENCODING);
454 } 454 }
455 #endif 455 #endif
456 456
457 part = &r->headers_out.headers.part; 457 part = &r->headers_out.headers.part;
471 471
472 if (header[i].hash == 0) { 472 if (header[i].hash == 0) {
473 continue; 473 continue;
474 } 474 }
475 475
476 b->last = (u_char *) ngx_http_v3_encode_header_l(b->last, 476 b->last = (u_char *) ngx_http_v3_encode_field_l(b->last,
477 &header[i].key, 477 &header[i].key,
478 &header[i].value); 478 &header[i].value);
479 } 479 }
480 480
481 if (r->header_only) { 481 if (r->header_only) {
482 b->last_buf = 1; 482 b->last_buf = 1;
483 } 483 }
1063 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 1063 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1064 "http3 create push promise id:%uL", push_id); 1064 "http3 create push promise id:%uL", push_id);
1065 1065
1066 len = ngx_http_v3_encode_varlen_int(NULL, push_id); 1066 len = ngx_http_v3_encode_varlen_int(NULL, push_id);
1067 1067
1068 len += ngx_http_v3_encode_header_block_prefix(NULL, 0, 0, 0); 1068 len += ngx_http_v3_encode_field_section_prefix(NULL, 0, 0, 0);
1069 1069
1070 len += ngx_http_v3_encode_header_ri(NULL, 0, 1070 len += ngx_http_v3_encode_field_ri(NULL, 0,
1071 NGX_HTTP_V3_HEADER_METHOD_GET); 1071 NGX_HTTP_V3_HEADER_METHOD_GET);
1072 1072
1073 len += ngx_http_v3_encode_header_lri(NULL, 0, 1073 len += ngx_http_v3_encode_field_lri(NULL, 0,
1074 NGX_HTTP_V3_HEADER_AUTHORITY, 1074 NGX_HTTP_V3_HEADER_AUTHORITY,
1075 NULL, r->headers_in.server.len); 1075 NULL, r->headers_in.server.len);
1076 1076
1077 if (path->len == 1 && path->data[0] == '/') { 1077 if (path->len == 1 && path->data[0] == '/') {
1078 len += ngx_http_v3_encode_header_ri(NULL, 0, 1078 len += ngx_http_v3_encode_field_ri(NULL, 0,
1079 NGX_HTTP_V3_HEADER_PATH_ROOT); 1079 NGX_HTTP_V3_HEADER_PATH_ROOT);
1080 1080
1081 } else { 1081 } else {
1082 len += ngx_http_v3_encode_header_lri(NULL, 0, 1082 len += ngx_http_v3_encode_field_lri(NULL, 0,
1083 NGX_HTTP_V3_HEADER_PATH_ROOT, 1083 NGX_HTTP_V3_HEADER_PATH_ROOT,
1084 NULL, path->len); 1084 NULL, path->len);
1085 } 1085 }
1086 1086
1087 if (r->schema.len == 5 && ngx_strncmp(r->schema.data, "https", 5) == 0) { 1087 if (r->schema.len == 5 && ngx_strncmp(r->schema.data, "https", 5) == 0) {
1088 len += ngx_http_v3_encode_header_ri(NULL, 0, 1088 len += ngx_http_v3_encode_field_ri(NULL, 0,
1089 NGX_HTTP_V3_HEADER_SCHEME_HTTPS); 1089 NGX_HTTP_V3_HEADER_SCHEME_HTTPS);
1090 1090
1091 } else if (r->schema.len == 4 1091 } else if (r->schema.len == 4
1092 && ngx_strncmp(r->schema.data, "http", 4) == 0) 1092 && ngx_strncmp(r->schema.data, "http", 4) == 0)
1093 { 1093 {
1094 len += ngx_http_v3_encode_header_ri(NULL, 0, 1094 len += ngx_http_v3_encode_field_ri(NULL, 0,
1095 NGX_HTTP_V3_HEADER_SCHEME_HTTP); 1095 NGX_HTTP_V3_HEADER_SCHEME_HTTP);
1096 1096
1097 } else { 1097 } else {
1098 len += ngx_http_v3_encode_header_lri(NULL, 0, 1098 len += ngx_http_v3_encode_field_lri(NULL, 0,
1099 NGX_HTTP_V3_HEADER_SCHEME_HTTP, 1099 NGX_HTTP_V3_HEADER_SCHEME_HTTP,
1100 NULL, r->schema.len); 1100 NULL, r->schema.len);
1101 } 1101 }
1102 1102
1103 if (r->headers_in.accept_encoding) { 1103 if (r->headers_in.accept_encoding) {
1104 len += ngx_http_v3_encode_header_lri(NULL, 0, 1104 len += ngx_http_v3_encode_field_lri(NULL, 0,
1105 NGX_HTTP_V3_HEADER_ACCEPT_ENCODING, NULL, 1105 NGX_HTTP_V3_HEADER_ACCEPT_ENCODING, NULL,
1106 r->headers_in.accept_encoding->value.len); 1106 r->headers_in.accept_encoding->value.len);
1107 } 1107 }
1108 1108
1109 if (r->headers_in.accept_language) { 1109 if (r->headers_in.accept_language) {
1110 len += ngx_http_v3_encode_header_lri(NULL, 0, 1110 len += ngx_http_v3_encode_field_lri(NULL, 0,
1111 NGX_HTTP_V3_HEADER_ACCEPT_LANGUAGE, NULL, 1111 NGX_HTTP_V3_HEADER_ACCEPT_LANGUAGE, NULL,
1112 r->headers_in.accept_language->value.len); 1112 r->headers_in.accept_language->value.len);
1113 } 1113 }
1114 1114
1115 if (r->headers_in.user_agent) { 1115 if (r->headers_in.user_agent) {
1116 len += ngx_http_v3_encode_header_lri(NULL, 0, 1116 len += ngx_http_v3_encode_field_lri(NULL, 0,
1117 NGX_HTTP_V3_HEADER_USER_AGENT, NULL, 1117 NGX_HTTP_V3_HEADER_USER_AGENT, NULL,
1118 r->headers_in.user_agent->value.len); 1118 r->headers_in.user_agent->value.len);
1119 } 1119 }
1120 1120
1121 b = ngx_create_temp_buf(r->pool, len); 1121 b = ngx_create_temp_buf(r->pool, len);
1123 return NULL; 1123 return NULL;
1124 } 1124 }
1125 1125
1126 b->last = (u_char *) ngx_http_v3_encode_varlen_int(b->last, push_id); 1126 b->last = (u_char *) ngx_http_v3_encode_varlen_int(b->last, push_id);
1127 1127
1128 b->last = (u_char *) ngx_http_v3_encode_header_block_prefix(b->last, 1128 b->last = (u_char *) ngx_http_v3_encode_field_section_prefix(b->last,
1129 0, 0, 0); 1129 0, 0, 0);
1130 1130
1131 b->last = (u_char *) ngx_http_v3_encode_header_ri(b->last, 0, 1131 b->last = (u_char *) ngx_http_v3_encode_field_ri(b->last, 0,
1132 NGX_HTTP_V3_HEADER_METHOD_GET); 1132 NGX_HTTP_V3_HEADER_METHOD_GET);
1133 1133
1134 b->last = (u_char *) ngx_http_v3_encode_header_lri(b->last, 0, 1134 b->last = (u_char *) ngx_http_v3_encode_field_lri(b->last, 0,
1135 NGX_HTTP_V3_HEADER_AUTHORITY, 1135 NGX_HTTP_V3_HEADER_AUTHORITY,
1136 r->headers_in.server.data, 1136 r->headers_in.server.data,
1137 r->headers_in.server.len); 1137 r->headers_in.server.len);
1138 1138
1139 if (path->len == 1 && path->data[0] == '/') { 1139 if (path->len == 1 && path->data[0] == '/') {
1140 b->last = (u_char *) ngx_http_v3_encode_header_ri(b->last, 0, 1140 b->last = (u_char *) ngx_http_v3_encode_field_ri(b->last, 0,
1141 NGX_HTTP_V3_HEADER_PATH_ROOT); 1141 NGX_HTTP_V3_HEADER_PATH_ROOT);
1142 1142
1143 } else { 1143 } else {
1144 b->last = (u_char *) ngx_http_v3_encode_header_lri(b->last, 0, 1144 b->last = (u_char *) ngx_http_v3_encode_field_lri(b->last, 0,
1145 NGX_HTTP_V3_HEADER_PATH_ROOT, 1145 NGX_HTTP_V3_HEADER_PATH_ROOT,
1146 path->data, path->len); 1146 path->data, path->len);
1147 } 1147 }
1148 1148
1149 if (r->schema.len == 5 && ngx_strncmp(r->schema.data, "https", 5) == 0) { 1149 if (r->schema.len == 5 && ngx_strncmp(r->schema.data, "https", 5) == 0) {
1150 b->last = (u_char *) ngx_http_v3_encode_header_ri(b->last, 0, 1150 b->last = (u_char *) ngx_http_v3_encode_field_ri(b->last, 0,
1151 NGX_HTTP_V3_HEADER_SCHEME_HTTPS); 1151 NGX_HTTP_V3_HEADER_SCHEME_HTTPS);
1152 1152
1153 } else if (r->schema.len == 4 1153 } else if (r->schema.len == 4
1154 && ngx_strncmp(r->schema.data, "http", 4) == 0) 1154 && ngx_strncmp(r->schema.data, "http", 4) == 0)
1155 { 1155 {
1156 b->last = (u_char *) ngx_http_v3_encode_header_ri(b->last, 0, 1156 b->last = (u_char *) ngx_http_v3_encode_field_ri(b->last, 0,
1157 NGX_HTTP_V3_HEADER_SCHEME_HTTP); 1157 NGX_HTTP_V3_HEADER_SCHEME_HTTP);
1158 1158
1159 } else { 1159 } else {
1160 b->last = (u_char *) ngx_http_v3_encode_header_lri(b->last, 0, 1160 b->last = (u_char *) ngx_http_v3_encode_field_lri(b->last, 0,
1161 NGX_HTTP_V3_HEADER_SCHEME_HTTP, 1161 NGX_HTTP_V3_HEADER_SCHEME_HTTP,
1162 r->schema.data, r->schema.len); 1162 r->schema.data, r->schema.len);
1163 } 1163 }
1164 1164
1165 if (r->headers_in.accept_encoding) { 1165 if (r->headers_in.accept_encoding) {
1166 b->last = (u_char *) ngx_http_v3_encode_header_lri(b->last, 0, 1166 b->last = (u_char *) ngx_http_v3_encode_field_lri(b->last, 0,
1167 NGX_HTTP_V3_HEADER_ACCEPT_ENCODING, 1167 NGX_HTTP_V3_HEADER_ACCEPT_ENCODING,
1168 r->headers_in.accept_encoding->value.data, 1168 r->headers_in.accept_encoding->value.data,
1169 r->headers_in.accept_encoding->value.len); 1169 r->headers_in.accept_encoding->value.len);
1170 } 1170 }
1171 1171
1172 if (r->headers_in.accept_language) { 1172 if (r->headers_in.accept_language) {
1173 b->last = (u_char *) ngx_http_v3_encode_header_lri(b->last, 0, 1173 b->last = (u_char *) ngx_http_v3_encode_field_lri(b->last, 0,
1174 NGX_HTTP_V3_HEADER_ACCEPT_LANGUAGE, 1174 NGX_HTTP_V3_HEADER_ACCEPT_LANGUAGE,
1175 r->headers_in.accept_language->value.data, 1175 r->headers_in.accept_language->value.data,
1176 r->headers_in.accept_language->value.len); 1176 r->headers_in.accept_language->value.len);
1177 } 1177 }
1178 1178
1179 if (r->headers_in.user_agent) { 1179 if (r->headers_in.user_agent) {
1180 b->last = (u_char *) ngx_http_v3_encode_header_lri(b->last, 0, 1180 b->last = (u_char *) ngx_http_v3_encode_field_lri(b->last, 0,
1181 NGX_HTTP_V3_HEADER_USER_AGENT, 1181 NGX_HTTP_V3_HEADER_USER_AGENT,
1182 r->headers_in.user_agent->value.data, 1182 r->headers_in.user_agent->value.data,
1183 r->headers_in.user_agent->value.len); 1183 r->headers_in.user_agent->value.len);
1184 } 1184 }
1185 1185