static Buffer encodeTrailerHeaders(final Http2Session http2Session, final MimeHeaders trailers, final Map<String,String> capture) { assert http2Session.getDeflaterLock().isLocked(); if (trailers == null || trailers.size() == 0) { return Buffers.EMPTY_BUFFER; } final HeadersEncoder encoder = http2Session.getHeadersEncoder(); for (final String name : trailers.names()) { encoder.encodeHeader(name, trailers.getHeader(name), capture); } return encoder.flushHeaders(); }
static Buffer encodeTrailerHeaders(final Http2Session http2Session, final MimeHeaders trailers, final Map<String,String> capture) { assert http2Session.getDeflaterLock().isLocked(); if (trailers == null || trailers.size() == 0) { return Buffers.EMPTY_BUFFER; } final HeadersEncoder encoder = http2Session.getHeadersEncoder(); for (final String name : trailers.names()) { encoder.encodeHeader(name, trailers.getHeader(name), capture); } return encoder.flushHeaders(); }
static Buffer encodeTrailerHeaders(final Http2Session http2Session, final MimeHeaders trailers, final Map<String,String> capture) { assert http2Session.getDeflaterLock().isLocked(); if (trailers == null || trailers.size() == 0) { return Buffers.EMPTY_BUFFER; } final HeadersEncoder encoder = http2Session.getHeadersEncoder(); for (final String name : trailers.names()) { encoder.encodeHeader(name, trailers.getHeader(name), capture); } return encoder.flushHeaders(); }
static Buffer encodeTrailerHeaders(final Http2Session http2Session, final MimeHeaders trailers, final Map<String,String> capture) { assert http2Session.getDeflaterLock().isLocked(); if (trailers == null || trailers.size() == 0) { return Buffers.EMPTY_BUFFER; } final HeadersEncoder encoder = http2Session.getHeadersEncoder(); for (final String name : trailers.names()) { encoder.encodeHeader(name, trailers.getHeader(name), capture); } return encoder.flushHeaders(); }
static Buffer encodeTrailerHeaders(final Http2Session http2Session, final MimeHeaders trailers, final Map<String,String> capture) { assert http2Session.getDeflaterLock().isLocked(); if (trailers == null || trailers.size() == 0) { return Buffers.EMPTY_BUFFER; } final HeadersEncoder encoder = http2Session.getHeadersEncoder(); for (final String name : trailers.names()) { encoder.encodeHeader(name, trailers.getHeader(name), capture); } return encoder.flushHeaders(); }
static Buffer encodeTrailerHeaders(final Http2Session http2Session, final MimeHeaders trailers, final Map<String,String> capture) { assert http2Session.getDeflaterLock().isLocked(); if (trailers == null || trailers.size() == 0) { return Buffers.EMPTY_BUFFER; } final HeadersEncoder encoder = http2Session.getHeadersEncoder(); for (final String name : trailers.names()) { encoder.encodeHeader(name, trailers.getHeader(name), capture); } return encoder.flushHeaders(); }
static Buffer encodeTrailerHeaders(final Http2Session http2Session, final MimeHeaders trailers, final Map<String,String> capture) { assert http2Session.getDeflaterLock().isLocked(); if (trailers == null || trailers.size() == 0) { return Buffers.EMPTY_BUFFER; } final HeadersEncoder encoder = http2Session.getHeadersEncoder(); for (final String name : trailers.names()) { encoder.encodeHeader(name, trailers.getHeader(name), capture); } return encoder.flushHeaders(); }
private void sendTrailers(final CompletionHandler<WriteResult> completionHandler, final MessageCloner<Buffer> messageCloner, final HttpTrailer httpContent) throws IOException { http2Session.getDeflaterLock().lock(); final boolean logging = NetLogger.isActive(); final Map<String,String> capture = ((logging) ? new HashMap<>() : null); List<Http2Frame> trailerFrames = http2Session.encodeTrailersAsHeaderFrames(stream.getId(), new ArrayList<>(4), httpContent.getHeaders(), capture); if (logging) { for (Http2Frame http2Frame : trailerFrames) { if (http2Frame.getType() == PushPromiseFrame.TYPE) { NetLogger.log(NetLogger.Context.TX, http2Session, (HeadersFrame) http2Frame, capture); break; } } } unflushedWritesCounter.incrementAndGet(); flushToConnectionOutputSink(trailerFrames, null, new FlushCompletionHandler(completionHandler), messageCloner, true); }
static Buffer encodeTrailerHeaders(final Http2Session http2Session, final MimeHeaders trailers, final Map<String,String> capture) { assert http2Session.getDeflaterLock().isLocked(); if (trailers == null || trailers.size() == 0) { return Buffers.EMPTY_BUFFER; } final HeadersEncoder encoder = http2Session.getHeadersEncoder(); for (final String name : trailers.names()) { encoder.encodeHeader(name, trailers.getHeader(name), capture); } return encoder.flushHeaders(); }
static Buffer encodeTrailerHeaders(final Http2Session http2Session, final MimeHeaders trailers, final Map<String,String> capture) { assert http2Session.getDeflaterLock().isLocked(); if (trailers == null || trailers.size() == 0) { return Buffers.EMPTY_BUFFER; } final HeadersEncoder encoder = http2Session.getHeadersEncoder(); for (final String name : trailers.names()) { encoder.encodeHeader(name, trailers.getHeader(name), capture); } return encoder.flushHeaders(); }
private void sendTrailers(final CompletionHandler<WriteResult> completionHandler, final MessageCloner<Buffer> messageCloner, final HttpTrailer httpContent) throws IOException { http2Session.getDeflaterLock().lock(); final boolean logging = NetLogger.isActive(); final Map<String,String> capture = ((logging) ? new HashMap<>() : null); List<Http2Frame> trailerFrames = http2Session.encodeTrailersAsHeaderFrames(stream.getId(), new ArrayList<>(4), httpContent.getHeaders(), capture); if (logging) { for (Http2Frame http2Frame : trailerFrames) { if (http2Frame.getType() == PushPromiseFrame.TYPE) { NetLogger.log(NetLogger.Context.TX, http2Session, (HeadersFrame) http2Frame, capture); break; } } } unflushedWritesCounter.incrementAndGet(); flushToConnectionOutputSink(trailerFrames, null, new FlushCompletionHandler(completionHandler), messageCloner, true); }
@SuppressWarnings("unchecked") static Buffer encodeResponseHeaders(final Http2Session http2Session, final HttpResponsePacket response, final Map<String,String> capture) throws IOException { assert http2Session.getDeflaterLock().isLocked(); final MimeHeaders headers = response.getHeaders(); headers.removeHeader(Header.Connection); headers.removeHeader(Header.KeepAlive); headers.removeHeader(Header.ProxyConnection); headers.removeHeader(Header.TransferEncoding); headers.removeHeader(Header.Upgrade); final HeadersEncoder encoder = http2Session.getHeadersEncoder(); // encoder.encodeHeader(Constants.STATUS_HEADER_BYTES, // response.getHttpStatus().getStatusBytes(), false); encoder.encodeHeader(STATUS_HEADER, String.valueOf(response.getHttpStatus().getStatusCode()), capture); encodeUserHeaders(headers, encoder, capture); return encoder.flushHeaders(); }
@SuppressWarnings("unchecked") static Buffer encodeResponseHeaders(final Http2Session http2Session, final HttpResponsePacket response, final Map<String,String> capture) throws IOException { assert http2Session.getDeflaterLock().isLocked(); final MimeHeaders headers = response.getHeaders(); headers.removeHeader(Header.Connection); headers.removeHeader(Header.KeepAlive); headers.removeHeader(Header.ProxyConnection); headers.removeHeader(Header.TransferEncoding); headers.removeHeader(Header.Upgrade); final HeadersEncoder encoder = http2Session.getHeadersEncoder(); // encoder.encodeHeader(Constants.STATUS_HEADER_BYTES, // response.getHttpStatus().getStatusBytes(), false); encoder.encodeHeader(STATUS_HEADER, String.valueOf(response.getHttpStatus().getStatusCode()), capture); encodeUserHeaders(headers, encoder, capture); return encoder.flushHeaders(); }
@SuppressWarnings("unchecked") static Buffer encodeResponseHeaders(final Http2Session http2Session, final HttpResponsePacket response, final Map<String,String> capture) throws IOException { assert http2Session.getDeflaterLock().isLocked(); final MimeHeaders headers = response.getHeaders(); headers.removeHeader(Header.Connection); headers.removeHeader(Header.KeepAlive); headers.removeHeader(Header.ProxyConnection); headers.removeHeader(Header.TransferEncoding); headers.removeHeader(Header.Upgrade); final HeadersEncoder encoder = http2Session.getHeadersEncoder(); // encoder.encodeHeader(Constants.STATUS_HEADER_BYTES, // response.getHttpStatus().getStatusBytes(), false); encoder.encodeHeader(STATUS_HEADER, String.valueOf(response.getHttpStatus().getStatusCode()), capture); encodeUserHeaders(headers, encoder, capture); return encoder.flushHeaders(); }
@SuppressWarnings("unchecked") static Buffer encodeResponseHeaders(final Http2Session http2Session, final HttpResponsePacket response, final Map<String,String> capture) throws IOException { assert http2Session.getDeflaterLock().isLocked(); final MimeHeaders headers = response.getHeaders(); headers.removeHeader(Header.Connection); headers.removeHeader(Header.KeepAlive); headers.removeHeader(Header.ProxyConnection); headers.removeHeader(Header.TransferEncoding); headers.removeHeader(Header.Upgrade); final HeadersEncoder encoder = http2Session.getHeadersEncoder(); // encoder.encodeHeader(Constants.STATUS_HEADER_BYTES, // response.getHttpStatus().getStatusBytes(), false); encoder.encodeHeader(STATUS_HEADER, String.valueOf(response.getHttpStatus().getStatusCode()), capture); encodeUserHeaders(headers, encoder, capture); return encoder.flushHeaders(); }
@SuppressWarnings("unchecked") static Buffer encodeResponseHeaders(final Http2Session http2Session, final HttpResponsePacket response, final Map<String,String> capture) throws IOException { assert http2Session.getDeflaterLock().isLocked(); final MimeHeaders headers = response.getHeaders(); headers.removeHeader(Header.Connection); headers.removeHeader(Header.KeepAlive); headers.removeHeader(Header.ProxyConnection); headers.removeHeader(Header.TransferEncoding); headers.removeHeader(Header.Upgrade); final HeadersEncoder encoder = http2Session.getHeadersEncoder(); // encoder.encodeHeader(Constants.STATUS_HEADER_BYTES, // response.getHttpStatus().getStatusBytes(), false); encoder.encodeHeader(STATUS_HEADER, String.valueOf(response.getHttpStatus().getStatusCode()), capture); encodeUserHeaders(headers, encoder, capture); return encoder.flushHeaders(); }
@SuppressWarnings("unchecked") static Buffer encodeResponseHeaders(final Http2Session http2Session, final HttpResponsePacket response, final Map<String,String> capture) throws IOException { assert http2Session.getDeflaterLock().isLocked(); final MimeHeaders headers = response.getHeaders(); headers.removeHeader(Header.Connection); headers.removeHeader(Header.KeepAlive); headers.removeHeader(Header.ProxyConnection); headers.removeHeader(Header.TransferEncoding); headers.removeHeader(Header.Upgrade); final HeadersEncoder encoder = http2Session.getHeadersEncoder(); // encoder.encodeHeader(Constants.STATUS_HEADER_BYTES, // response.getHttpStatus().getStatusBytes(), false); encoder.encodeHeader(STATUS_HEADER, String.valueOf(response.getHttpStatus().getStatusCode()), capture); encodeUserHeaders(headers, encoder, capture); return encoder.flushHeaders(); }
@SuppressWarnings("unchecked") static Buffer encodeResponseHeaders(final Http2Session http2Session, final HttpResponsePacket response, final Map<String,String> capture) throws IOException { assert http2Session.getDeflaterLock().isLocked(); final MimeHeaders headers = response.getHeaders(); headers.removeHeader(Header.Connection); headers.removeHeader(Header.KeepAlive); headers.removeHeader(Header.ProxyConnection); headers.removeHeader(Header.TransferEncoding); headers.removeHeader(Header.Upgrade); final HeadersEncoder encoder = http2Session.getHeadersEncoder(); // encoder.encodeHeader(Constants.STATUS_HEADER_BYTES, // response.getHttpStatus().getStatusBytes(), false); encoder.encodeHeader(STATUS_HEADER, String.valueOf(response.getHttpStatus().getStatusCode()), capture); encodeUserHeaders(headers, encoder, capture); return encoder.flushHeaders(); }
@SuppressWarnings("unchecked") static Buffer encodeResponseHeaders(final Http2Session http2Session, final HttpResponsePacket response, final Map<String,String> capture) throws IOException { assert http2Session.getDeflaterLock().isLocked(); final MimeHeaders headers = response.getHeaders(); headers.removeHeader(Header.Connection); headers.removeHeader(Header.KeepAlive); headers.removeHeader(Header.ProxyConnection); headers.removeHeader(Header.TransferEncoding); headers.removeHeader(Header.Upgrade); final HeadersEncoder encoder = http2Session.getHeadersEncoder(); // encoder.encodeHeader(Constants.STATUS_HEADER_BYTES, // response.getHttpStatus().getStatusBytes(), false); encoder.encodeHeader(STATUS_HEADER, String.valueOf(response.getHttpStatus().getStatusCode()), capture); encodeUserHeaders(headers, encoder, capture); return encoder.flushHeaders(); }
@SuppressWarnings("unchecked") static Buffer encodeResponseHeaders(final Http2Session http2Session, final HttpResponsePacket response, final Map<String,String> capture) throws IOException { assert http2Session.getDeflaterLock().isLocked(); final MimeHeaders headers = response.getHeaders(); headers.removeHeader(Header.Connection); headers.removeHeader(Header.KeepAlive); headers.removeHeader(Header.ProxyConnection); headers.removeHeader(Header.TransferEncoding); headers.removeHeader(Header.Upgrade); final HeadersEncoder encoder = http2Session.getHeadersEncoder(); // encoder.encodeHeader(Constants.STATUS_HEADER_BYTES, // response.getHttpStatus().getStatusBytes(), false); encoder.encodeHeader(STATUS_HEADER, String.valueOf(response.getHttpStatus().getStatusCode()), capture); encodeUserHeaders(headers, encoder, capture); return encoder.flushHeaders(); }