comparison src/http/v3/ngx_http_v3_filter_module.c @ 8612:355461f0cc3b quic

HTTP/3: Huffman encoding for the Last-Modified response field.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 13 Sep 2021 16:25:31 +0300
parents 2cb697e7d77f
children 051968b73c59
comparison
equal deleted inserted replaced
8611:2cb697e7d77f 8612:355461f0cc3b
409 } 409 }
410 410
411 if (r->headers_out.last_modified == NULL 411 if (r->headers_out.last_modified == NULL
412 && r->headers_out.last_modified_time != -1) 412 && r->headers_out.last_modified_time != -1)
413 { 413 {
414 n = sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1;
415
416 p = ngx_pnalloc(r->pool, n);
417 if (p == NULL) {
418 return NGX_ERROR;
419 }
420
421 ngx_http_time(p, r->headers_out.last_modified_time);
422
414 b->last = (u_char *) ngx_http_v3_encode_field_lri(b->last, 0, 423 b->last = (u_char *) ngx_http_v3_encode_field_lri(b->last, 0,
415 NGX_HTTP_V3_HEADER_LAST_MODIFIED, NULL, 424 NGX_HTTP_V3_HEADER_LAST_MODIFIED,
416 sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1); 425 p, n);
417
418 b->last = ngx_http_time(b->last, r->headers_out.last_modified_time);
419 } 426 }
420 427
421 if (host.data) { 428 if (host.data) {
422 n = sizeof("https://") - 1 + host.len 429 n = sizeof("https://") - 1 + host.len
423 + r->headers_out.location->value.len; 430 + r->headers_out.location->value.len;