# HG changeset patch # User Ruslan Ermilov # Date 1445365598 -10800 # Node ID adaac65899c81506089a20646c291408385b58ee # Parent dceb078b1156d305d482ea81ebaa02c3eb1fe531 HTTP/2: improved HPACK integer parsing code readability. No functional changes. diff -r dceb078b1156 -r adaac65899c8 src/http/v2/ngx_http_v2.c --- a/src/http/v2/ngx_http_v2.c Tue Oct 20 18:16:18 2015 +0300 +++ b/src/http/v2/ngx_http_v2.c Tue Oct 20 21:26:38 2015 +0300 @@ -2396,8 +2396,8 @@ return value; } - if (end - p > NGX_HTTP_V2_INT_OCTETS - 1) { - end = p + NGX_HTTP_V2_INT_OCTETS - 1; + if (end - start > NGX_HTTP_V2_INT_OCTETS) { + end = start + NGX_HTTP_V2_INT_OCTETS; } for (shift = 0; p != end; shift += 7) { @@ -2417,7 +2417,7 @@ } } - if ((size_t) (end - start) >= NGX_HTTP_V2_INT_OCTETS) { + if (end == start + NGX_HTTP_V2_INT_OCTETS) { return NGX_DECLINED; }