Commit b9948b71 authored by zhujiashun's avatar zhujiashun

add max_concurrent_streams check in receiver

parent 3bc173cb
......@@ -570,6 +570,11 @@ H2ParseResult H2Context::OnHeaders(
LOG(ERROR) << "Invalid stream_id=" << frame_head.stream_id;
return MakeH2Error(H2_PROTOCOL_ERROR);
}
if (VolatilePendingStreamSize() >= local_settings().max_concurrent_streams) {
LOG(ERROR) << "Reached max concurrent stream="
<< local_settings().max_concurrent_streams;
return MakeH2Error(H2_REFUSED_STREAM);
}
_last_server_stream_id = frame_head.stream_id;
sctx = new H2StreamContext(this, frame_head.stream_id);
const int rc = TryToInsertStream(frame_head.stream_id, sctx);
......
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