diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index 46829138..8273dc98 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -1398,11 +1398,15 @@ nghttp2_outbound_item* nghttp2_session_pop_next_ob_item */ static void adjust_pri(nghttp2_outbound_item *item) { - if(item->pri >= (int32_t)(NGHTTP2_PRI_LOWEST - (item->pri_decay - 1))) { + if(item->pri == NGHTTP2_PRI_LOWEST) { item->pri = item->inipri; item->pri_decay = 1; return; } + if(item->pri > (int32_t)(NGHTTP2_PRI_LOWEST - (item->pri_decay - 1))) { + item->pri = NGHTTP2_PRI_LOWEST; + return; + } item->pri += (int32_t)(item->pri_decay - 1); item->pri_decay <<= 1; }