<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap:break-word;line-break:after-white-space"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div># HG changeset patch</div><div># User Alex Zhang <<a href="mailto:zchao1995@gmail.com">zchao1995@gmail.com</a>></div><div># Date 1520229178 -28800</div><div># Mon Mar 05 13:52:58 2018 +0800</div><div># Node ID 03ecef37a93d541e55802393636c101a4da14550</div><div># Parent 265c29b0b8b8c54b1c623268481ed85324ce3c79</div><div>HTTP/2: used bitwise operation to replace division and modulo.</div><div><br></div><div>Signed-off-by: Alex Zhang <<a href="mailto:zchao1995@gmail.com">zchao1995@gmail.com</a>></div><div><br></div><div>diff -r 265c29b0b8b8 -r 03ecef37a93d src/http/v2/ngx_http_v2.c</div><div>--- a/src/http/v2/ngx_http_v2.c Thu Mar 01 11:42:55 2018 +0300</div><div>+++ b/src/http/v2/ngx_http_v2.c Mon Mar 05 13:52:58 2018 +0800</div><div>@@ -1094,7 +1094,7 @@</div><div> "depends on %ui excl:%ui weight:%ui",</div><div> h2c->state.sid, depend, excl, weight);</div><div><br></div><div>- if (h2c->state.sid % 2 == 0 || h2c->state.sid <= h2c->last_sid) {</div><div>+ if (h2c->state.sid & 0x1 == 0 || h2c->state.sid <= h2c->last_sid) {</div><div> ngx_log_error(NGX_LOG_INFO, h2c->connection->log, 0,</div><div> "client sent HEADERS frame with incorrect identifier "</div><div> "%ui, the last was %ui", h2c->state.sid, h2c->last_sid);</div><div>diff -r 265c29b0b8b8 -r 03ecef37a93d src/http/v2/ngx_http_v2_filter_module.c</div><div>--- a/src/http/v2/ngx_http_v2_filter_module.c Thu Mar 01 11:42:55 2018 +0300</div><div>+++ b/src/http/v2/ngx_http_v2_filter_module.c Mon Mar 05 13:52:58 2018 +0800</div><div>@@ -1149,8 +1149,8 @@</div><div> value -= prefix;</div><div><br></div><div> while (value >= 128) {</div><div>- *pos++ = value % 128 + 128;</div><div>- value /= 128;</div><div>+ *pos++ = (value & 0x7f) + 128;</div><div>+ value >>= 7;</div><div> }</div><div><br></div><div> *pos++ = (u_char) value;</div><div id="bloop_sign_1520231726042014976" class="bloop_sign"></div></body></html>