Mercurial > hg > nginx
comparison src/http/v2/ngx_http_v2_filter_module.c @ 6279:c72eaf694d99
HTTP/2: improved the ngx_http_v2_integer_octets(v) macro.
Previously, it didn't work well for 0, 127, and 128, returning less than needed.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Mon, 26 Oct 2015 17:46:16 +0300 |
parents | b930e598a199 |
children | f72d3129cd35 |
comparison
equal
deleted
inserted
replaced
6278:b78df0822168 | 6279:c72eaf694d99 |
---|---|
10 #include <ngx_http.h> | 10 #include <ngx_http.h> |
11 #include <nginx.h> | 11 #include <nginx.h> |
12 #include <ngx_http_v2_module.h> | 12 #include <ngx_http_v2_module.h> |
13 | 13 |
14 | 14 |
15 #define ngx_http_v2_integer_octets(v) (((v) + 127) / 128) | 15 /* |
16 * This returns precise number of octets for values in range 0..253 | |
17 * and estimate number for the rest, but not smaller than required. | |
18 */ | |
19 | |
20 #define ngx_http_v2_integer_octets(v) (1 + (v) / 127) | |
16 | 21 |
17 #define ngx_http_v2_literal_size(h) \ | 22 #define ngx_http_v2_literal_size(h) \ |
18 (ngx_http_v2_integer_octets(sizeof(h) - 1) + sizeof(h) - 1) | 23 (ngx_http_v2_integer_octets(sizeof(h) - 1) + sizeof(h) - 1) |
19 | 24 |
20 #define ngx_http_v2_indexed(i) (128 + (i)) | 25 #define ngx_http_v2_indexed(i) (128 + (i)) |