Commit 4cad48da authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Reset cycle to 0 if stream has only 1 direct descendant

parent e6566a1e
......@@ -201,17 +201,22 @@ void nghttp2_stream_reschedule(nghttp2_stream *stream) {
dep_stream = stream->dep_prev;
for (; dep_stream; stream = dep_stream, dep_stream = dep_stream->dep_prev) {
if (nghttp2_pq_size(&dep_stream->obq) == 1) {
dep_stream->descendant_last_cycle = 0;
stream->cycle = 0;
} else {
dep_stream->descendant_last_cycle =
nghttp2_max(dep_stream->descendant_last_cycle, stream->cycle);
stream->cycle =
stream_next_cycle(stream, dep_stream->descendant_last_cycle);
DEBUGF(fprintf(stderr, "stream: stream=%d obq resched cycle=%ld\n",
stream->stream_id, stream->cycle));
nghttp2_pq_remove(&dep_stream->obq, &stream->pq_entry);
nghttp2_pq_push(&dep_stream->obq, &stream->pq_entry);
}
DEBUGF(fprintf(stderr, "stream: stream=%d obq resched cycle=%ld\n",
stream->stream_id, stream->cycle));
dep_stream->last_writelen = stream->last_writelen;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment