Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include number of maximum active streams in exception message #11644

Merged
merged 2 commits into from Sep 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -483,8 +483,10 @@ public final <V> V removeProperty(PropertyKey key) {
@Override
public Http2Stream open(boolean halfClosed) throws Http2Exception {
state = activeState(id, state, isLocal(), halfClosed);
if (!createdBy().canOpenStream()) {
throw connectionError(PROTOCOL_ERROR, "Maximum active streams violated for this endpoint.");
final DefaultEndpoint<? extends Http2FlowController> endpoint = createdBy();
if (!endpoint.canOpenStream()) {
throw connectionError(PROTOCOL_ERROR, "Maximum active streams violated for this endpoint: " +
endpoint.maxActiveStreams());
}

activate();
Expand Down Expand Up @@ -897,7 +899,8 @@ private void checkNewStreamAllowed(int streamId, State state) throws Http2Except
}
boolean isReserved = state == RESERVED_LOCAL || state == RESERVED_REMOTE;
if (!isReserved && !canOpenStream() || isReserved && numStreams >= maxStreams) {
throw streamError(streamId, REFUSED_STREAM, "Maximum active streams violated for this endpoint.");
throw streamError(streamId, REFUSED_STREAM, "Maximum active streams violated for this endpoint: " +
(isReserved ? maxStreams : maxActiveStreams));
}
if (isClosed()) {
throw connectionError(INTERNAL_ERROR, "Attempted to create stream id %d after connection was closed",
Expand Down