aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2015-10-20 21:26:38 +0300
committerRuslan Ermilov <ru@nginx.com>2015-10-20 21:26:38 +0300
commitc830cf28ae6216d3bd7e7e27dd9b281aa3d75c2c (patch)
tree862c65c9368c79a3e7b60305a946db039d2bec93 /src
parentfaed7212fe78508f7b9675f93946820e9efe3e8f (diff)
downloadnginx-c830cf28ae6216d3bd7e7e27dd9b281aa3d75c2c.tar.gz
nginx-c830cf28ae6216d3bd7e7e27dd9b281aa3d75c2c.zip
HTTP/2: improved HPACK integer parsing code readability.
No functional changes.
Diffstat (limited to 'src')
-rw-r--r--src/http/v2/ngx_http_v2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c
index 54458daeb..5852c9943 100644
--- a/src/http/v2/ngx_http_v2.c
+++ b/src/http/v2/ngx_http_v2.c
@@ -2396,8 +2396,8 @@ ngx_http_v2_parse_int(ngx_http_v2_connection_t *h2c, u_char **pos, u_char *end,
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 @@ ngx_http_v2_parse_int(ngx_http_v2_connection_t *h2c, u_char **pos, u_char *end,
}
}
- if ((size_t) (end - start) >= NGX_HTTP_V2_INT_OCTETS) {
+ if (end == start + NGX_HTTP_V2_INT_OCTETS) {
return NGX_DECLINED;
}