# HG changeset patch # User Roman Arutyunyan # Date 1587478309 -10800 # Node ID b13176e717baafef7a3bbaff52a92a450b032f29 # Parent d42b50d239f41bc0923e7052b3231b489ff8e59d HTTP/3: fixed encoding variable-length integers. diff -r d42b50d239f4 -r b13176e717ba src/http/v3/ngx_http_v3.c --- a/src/http/v3/ngx_http_v3.c Mon Apr 20 18:32:46 2020 +0300 +++ b/src/http/v3/ngx_http_v3.c Tue Apr 21 17:11:49 2020 +0300 @@ -34,21 +34,25 @@ if (value <= 1073741823) { if (p == NULL) { - return 3; + return 4; } - *p++ = 0x80 | (value >> 16); + *p++ = 0x80 | (value >> 24); + *p++ = (value >> 16); *p++ = (value >> 8); *p++ = value; return (uintptr_t) p; - } if (p == NULL) { - return 4; + return 8; } - *p++ = 0xc0 | (value >> 24); + *p++ = 0xc0 | (value >> 56); + *p++ = (value >> 48); + *p++ = (value >> 40); + *p++ = (value >> 32); + *p++ = (value >> 24); *p++ = (value >> 16); *p++ = (value >> 8); *p++ = value;