@Override public void onStreamRemoved(final Http2Stream stream) { stream.removeProperty(this.responseHeadersPropertyKey); stream.removeProperty(this.responsePromisePropertyKey); }
/** * The stream is out of scope for the HTTP message flow and will no longer be tracked * @param stream The stream to remove associated state with * @param release {@code true} to call release on the value if it is present. {@code false} to not call release. */ protected final void removeMessage(Http2Stream stream, boolean release) { FullHttpMessage msg = stream.removeProperty(messageKey); if (release && msg != null) { msg.release(); } }
/** * Release remaining content from {@link EmbeddedChannel} and remove the compressor from the {@link Http2Stream}. * * @param stream The stream for which {@code compressor} is the compressor for * @param compressor The compressor for {@code stream} */ void cleanup(Http2Stream stream, EmbeddedChannel compressor) { if (compressor.finish()) { for (;;) { final ByteBuf buf = compressor.readOutbound(); if (buf == null) { break; } buf.release(); } } stream.removeProperty(propertyKey); }
void retryPushNotificationFromStream(final ChannelHandlerContext context, final int streamId) { final Http2Stream stream = this.connection().stream(streamId); final PushNotificationPromise responsePromise = stream.removeProperty(this.responsePromisePropertyKey); final ChannelPromise writePromise = context.channel().newPromise(); this.writePushNotification(context, responsePromise, writePromise); }
@Override public void onStreamRemoved(final Http2Stream stream) { stream.removeProperty(this.responseHeadersPropertyKey); stream.removeProperty(this.responsePromisePropertyKey); }
/** * The stream is out of scope for the HTTP message flow and will no longer be tracked * @param stream The stream to remove associated state with * @param release {@code true} to call release on the value if it is present. {@code false} to not call release. */ protected final void removeMessage(Http2Stream stream, boolean release) { FullHttpMessage msg = stream.removeProperty(messageKey); if (release && msg != null) { msg.release(); } }
/** * The stream is out of scope for the HTTP message flow and will no longer be tracked * @param stream The stream to remove associated state with * @param release {@code true} to call release on the value if it is present. {@code false} to not call release. */ protected final void removeMessage(Http2Stream stream, boolean release) { FullHttpMessage msg = stream.removeProperty(messageKey); if (release && msg != null) { msg.release(); } }
/** * Release remaining content from {@link EmbeddedChannel} and remove the compressor from the {@link Http2Stream}. * * @param stream The stream for which {@code compressor} is the compressor for * @param compressor The compressor for {@code stream} */ void cleanup(Http2Stream stream, EmbeddedChannel compressor) { if (compressor.finish()) { for (;;) { final ByteBuf buf = compressor.readOutbound(); if (buf == null) { break; } buf.release(); } } stream.removeProperty(propertyKey); }
/** * Release remaining content from {@link EmbeddedChannel} and remove the compressor from the {@link Http2Stream}. * * @param stream The stream for which {@code compressor} is the compressor for * @param compressor The compressor for {@code stream} */ void cleanup(Http2Stream stream, EmbeddedChannel compressor) { if (compressor.finish()) { for (;;) { final ByteBuf buf = compressor.readOutbound(); if (buf == null) { break; } buf.release(); } } stream.removeProperty(propertyKey); }
@Override public int onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream) throws Http2Exception { LOG.debug("Received HTTP/2 DATA frame, stream={}, end={}, data={}bytes, padding={}bytes", new Object[]{streamId, endOfStream, data.readableBytes(), padding}); // Ignores response for the upgrade request if (streamId == Http2CodecUtil.HTTP_UPGRADE_STREAM_ID) { return data.readableBytes() + padding; } final TimeoutBufferedWriter writer = _connection.stream(streamId).getProperty(_writerKey); if (writer == null) { throw new IllegalStateException("No writer is associated with current stream ID " + streamId); } writer.onDataRead(data, endOfStream); if (endOfStream) { _connection.stream(streamId).removeProperty(_writerKey); } return padding; }
void retryPushNotificationFromStream(final ChannelHandlerContext context, final int streamId) { final Http2Stream stream = this.connection().stream(streamId); final PushNotificationPromise responsePromise = stream.removeProperty(this.responsePromisePropertyKey); final ChannelPromise writePromise = context.channel().newPromise(); this.writePushNotification(context, responsePromise, writePromise); writePromise.addListener(new GenericFutureListener<Future<Void>>() { @Override public void operationComplete(final Future<Void> writeFuture) { if (!writeFuture.isSuccess()) { responsePromise.tryFailure(writeFuture.cause()); } } }); }