private void registerUpgradeStream(final Http2Stream stream) throws Http2StreamException { synchronized(sessionLock) { if (isClosed()) { throw new Http2StreamException(Http2Stream.UPGRADE_STREAM_ID, ErrorCode.REFUSED_STREAM, "Session is closed"); } registerStream(Http2Stream.UPGRADE_STREAM_ID, stream); if (!isServer()) { lastLocalStreamId = Http2Stream.UPGRADE_STREAM_ID; } } }
private void registerUpgradeStream(final Http2Stream stream) throws Http2StreamException { synchronized(sessionLock) { if (isClosed()) { throw new Http2StreamException(Http2Stream.UPGRADE_STREAM_ID, ErrorCode.REFUSED_STREAM, "Session is closed"); } registerStream(Http2Stream.UPGRADE_STREAM_ID, stream); if (!isServer()) { lastLocalStreamId = Http2Stream.UPGRADE_STREAM_ID; } } }
private void registerUpgradeStream(final Http2Stream stream) throws Http2StreamException { synchronized(sessionLock) { if (isClosed()) { throw new Http2StreamException(Http2Stream.UPGRADE_STREAM_ID, ErrorCode.REFUSED_STREAM, "Session is closed"); } registerStream(Http2Stream.UPGRADE_STREAM_ID, stream); if (!isServer()) { lastLocalStreamId = Http2Stream.UPGRADE_STREAM_ID; } } }
private void registerUpgradeStream(final Http2Stream stream) throws Http2StreamException { synchronized(sessionLock) { if (isClosed()) { throw new Http2StreamException(Http2Stream.UPGRADE_STREAM_ID, ErrorCode.REFUSED_STREAM, "Session is closed"); } registerStream(Http2Stream.UPGRADE_STREAM_ID, stream); if (!isServer()) { lastLocalStreamId = Http2Stream.UPGRADE_STREAM_ID; } } }
private void registerUpgradeStream(final Http2Stream stream) throws Http2StreamException { synchronized(sessionLock) { if (isClosed()) { throw new Http2StreamException(Http2Stream.UPGRADE_STREAM_ID, ErrorCode.REFUSED_STREAM, "Session is closed"); } registerStream(Http2Stream.UPGRADE_STREAM_ID, stream); if (!isServer()) { lastLocalStreamId = Http2Stream.UPGRADE_STREAM_ID; } } }
private void registerUpgradeStream(final Http2Stream stream) throws Http2StreamException { synchronized(sessionLock) { if (isClosed()) { throw new Http2StreamException(Http2Stream.UPGRADE_STREAM_ID, ErrorCode.REFUSED_STREAM, "Session is closed"); } registerStream(Http2Stream.UPGRADE_STREAM_ID, stream); if (!isServer()) { lastLocalStreamId = Http2Stream.UPGRADE_STREAM_ID; } } }
private void registerUpgradeStream(final Http2Stream stream) throws Http2StreamException { synchronized(sessionLock) { if (isClosed()) { throw new Http2StreamException(Http2Stream.UPGRADE_STREAM_ID, ErrorCode.REFUSED_STREAM, "Session is closed"); } registerStream(Http2Stream.UPGRADE_STREAM_ID, stream); if (!isServer()) { lastLocalStreamId = Http2Stream.UPGRADE_STREAM_ID; } } }
private void registerUpgradeStream(final Http2Stream stream) throws Http2StreamException { synchronized(sessionLock) { if (isClosed()) { throw new Http2StreamException(Http2Stream.UPGRADE_STREAM_ID, ErrorCode.REFUSED_STREAM, "Session is closed"); } registerStream(Http2Stream.UPGRADE_STREAM_ID, stream); if (!isServer()) { lastLocalStreamId = Http2Stream.UPGRADE_STREAM_ID; } } }
private void registerUpgradeStream(final Http2Stream stream) throws Http2StreamException { synchronized(sessionLock) { if (isClosed()) { throw new Http2StreamException(Http2Stream.UPGRADE_STREAM_ID, ErrorCode.REFUSED_STREAM, "Session is closed"); } registerStream(Http2Stream.UPGRADE_STREAM_ID, stream); if (!isServer()) { lastLocalStreamId = Http2Stream.UPGRADE_STREAM_ID; } } }
@Override public Buffer read(final int length) throws Http2StreamException { if (isClosed) { throw new Http2StreamException(stream.getId(), ErrorCode.INTERNAL_ERROR, "The source was closed"); } final int remaining = buffer.remaining(); if (length == 0 || remaining == 0) { return Buffers.EMPTY_BUFFER; } final int bytesToSplit = Math.min(remaining, length); final Buffer newBuf = buffer.split(buffer.position() + bytesToSplit); final Buffer bufferToReturn = buffer; buffer = newBuf; return bufferToReturn; }
@Override public Buffer read(final int length) throws Http2StreamException { if (isClosed) { throw new Http2StreamException(stream.getId(), ErrorCode.INTERNAL_ERROR, "The source was closed"); } final int remaining = buffer.remaining(); if (length == 0 || remaining == 0) { return Buffers.EMPTY_BUFFER; } final int bytesToSplit = Math.min(remaining, length); final Buffer newBuf = buffer.split(buffer.position() + bytesToSplit); final Buffer bufferToReturn = buffer; buffer = newBuf; return bufferToReturn; }
IOException assertCanAcceptHeader(final boolean fin) { final Http2Stream.State state = getState(); if (state == State.HALF_CLOSED_REMOTE || getState() == State.CLOSED) { close0(null, CloseType.LOCALLY, new IOException("Received HEADER frame on " + state + " stream."), false); return ((fin) ? new Http2SessionException(ErrorCode.STREAM_CLOSED) : new Http2StreamException(getId(), ErrorCode.STREAM_CLOSED, "Received HEADER frame on " + state + " stream.")); } return null; }
IOException assertCanAcceptHeader(final boolean fin) { final Http2Stream.State state = getState(); if (state == State.HALF_CLOSED_REMOTE || getState() == State.CLOSED) { close0(null, CloseType.LOCALLY, new IOException("Received HEADER frame on " + state + " stream."), false); return ((fin) ? new Http2SessionException(ErrorCode.STREAM_CLOSED) : new Http2StreamException(getId(), ErrorCode.STREAM_CLOSED, "Received HEADER frame on " + state + " stream.")); } return null; }
IOException assertCanAcceptHeader(final boolean fin) { final Http2Stream.State state = getState(); if (state == State.HALF_CLOSED_REMOTE || getState() == State.CLOSED) { close0(null, CloseType.LOCALLY, new IOException("Received HEADER frame on " + state + " stream."), false); return ((fin) ? new Http2SessionException(ErrorCode.STREAM_CLOSED) : new Http2StreamException(getId(), ErrorCode.STREAM_CLOSED, "Received HEADER frame on " + state + " stream.")); } return null; }
IOException assertCanAcceptHeader(final boolean fin) { final Http2Stream.State state = getState(); if (state == State.HALF_CLOSED_REMOTE || getState() == State.CLOSED) { close0(null, CloseType.LOCALLY, new IOException("Received HEADER frame on " + state + " stream."), false); return ((fin) ? new Http2SessionException(ErrorCode.STREAM_CLOSED) : new Http2StreamException(getId(), ErrorCode.STREAM_CLOSED, "Received HEADER frame on " + state + " stream.")); } return null; }
IOException assertCanAcceptHeader(final boolean fin) { final Http2Stream.State state = getState(); if (state == State.HALF_CLOSED_REMOTE || getState() == State.CLOSED) { close0(null, CloseType.LOCALLY, new IOException("Received HEADER frame on " + state + " stream."), false); return ((fin) ? new Http2SessionException(ErrorCode.STREAM_CLOSED) : new Http2StreamException(getId(), ErrorCode.STREAM_CLOSED, "Received HEADER frame on " + state + " stream.")); } return null; }
IOException assertCanAcceptHeader(final boolean fin) { final Http2Stream.State state = getState(); if (state == State.HALF_CLOSED_REMOTE || getState() == State.CLOSED) { close0(null, CloseType.LOCALLY, new IOException("Received HEADER frame on " + state + " stream."), false); return ((fin) ? new Http2SessionException(ErrorCode.STREAM_CLOSED) : new Http2StreamException(getId(), ErrorCode.STREAM_CLOSED, "Received HEADER frame on " + state + " stream.")); } return null; }
IOException assertCanAcceptHeader(final boolean fin) { final Http2Stream.State state = getState(); if (state == State.HALF_CLOSED_REMOTE || getState() == State.CLOSED) { close0(null, CloseType.LOCALLY, new IOException("Received HEADER frame on " + state + " stream."), false); return ((fin) ? new Http2SessionException(ErrorCode.STREAM_CLOSED) : new Http2StreamException(getId(), ErrorCode.STREAM_CLOSED, "Received HEADER frame on " + state + " stream.")); } return null; }
IOException assertCanAcceptHeader(final boolean fin) { final Http2Stream.State state = getState(); if (state == State.HALF_CLOSED_REMOTE || getState() == State.CLOSED) { close0(null, CloseType.LOCALLY, new IOException("Received HEADER frame on " + state + " stream."), false); return ((fin) ? new Http2SessionException(ErrorCode.STREAM_CLOSED) : new Http2StreamException(getId(), ErrorCode.STREAM_CLOSED, "Received HEADER frame on " + state + " stream.")); } return null; }
IOException assertCanAcceptHeader(final boolean fin) { final Http2Stream.State state = getState(); if (state == State.HALF_CLOSED_REMOTE || getState() == State.CLOSED) { close0(null, CloseType.LOCALLY, new IOException("Received HEADER frame on " + state + " stream."), false); return ((fin) ? new Http2SessionException(ErrorCode.STREAM_CLOSED) : new Http2StreamException(getId(), ErrorCode.STREAM_CLOSED, "Received HEADER frame on " + state + " stream.")); } return null; }