/** * Set <tt>true</tt>, if this {@link HttpPacket} content will be transferred * in chunking mode, or <tt>false</tt> if case of fixed-length message. * * NOTE: If the protocol version of this header is 1.0 or older, chunking * will be disabled regardless of the value passed. * * @param isChunked <tt>true</tt>, if this {@link HttpPacket} content * will be transferred in chunking mode, or <tt>false</tt> if case * of fixed-length message. */ public void setChunked(boolean isChunked) { if (getProtocol().compareTo(Protocol.HTTP_1_1) >= 0) { // HTTP/1.1 and later this.isChunked = isChunked; if (isChunked) { headers.removeHeader(Header.ContentLength); } } else { this.isChunked = false; } }
/** * Set <tt>true</tt>, if this {@link HttpPacket} content will be transferred * in chunking mode, or <tt>false</tt> if case of fixed-length message. * * NOTE: If the protocol version of this header is 1.0 or older, chunking * will be disabled regardless of the value passed. * * @param isChunked <tt>true</tt>, if this {@link HttpPacket} content * will be transferred in chunking mode, or <tt>false</tt> if case * of fixed-length message. */ public void setChunked(boolean isChunked) { if (getProtocol().compareTo(Protocol.HTTP_1_1) >= 0) { // HTTP/1.1 and later this.isChunked = isChunked; if (isChunked) { headers.removeHeader(Header.ContentLength); } } else { this.isChunked = false; } }
/** * Set <tt>true</tt>, if this {@link HttpPacket} content will be transferred * in chunking mode, or <tt>false</tt> if case of fixed-length message. * * NOTE: If the protocol version of this header is 1.0 or older, chunking * will be disabled regardless of the value passed. * * @param isChunked <tt>true</tt>, if this {@link HttpPacket} content * will be transferred in chunking mode, or <tt>false</tt> if case * of fixed-length message. */ public void setChunked(boolean isChunked) { if (getProtocol().compareTo(Protocol.HTTP_1_1) >= 0) { // HTTP/1.1 and later this.isChunked = isChunked; if (isChunked) { headers.removeHeader(Header.ContentLength); } } else { this.isChunked = false; } }
/** * Set <tt>true</tt>, if this {@link HttpPacket} content will be transferred * in chunking mode, or <tt>false</tt> if case of fixed-length message. * * NOTE: If the protocol version of this header is 1.0 or older, chunking * will be disabled regardless of the value passed. * * @param isChunked <tt>true</tt>, if this {@link HttpPacket} content * will be transferred in chunking mode, or <tt>false</tt> if case * of fixed-length message. */ public void setChunked(boolean isChunked) { if (getProtocol().compareTo(Protocol.HTTP_1_1) >= 0) { // HTTP/1.1 and later this.isChunked = isChunked; if (isChunked) { headers.removeHeader(Header.ContentLength); } } else { this.isChunked = false; } }
/** * Set <tt>true</tt>, if this {@link HttpPacket} content will be transferred * in chunking mode, or <tt>false</tt> if case of fixed-length message. * * NOTE: If the protocol version of this header is 1.0 or older, chunking * will be disabled regardless of the value passed. * * @param isChunked <tt>true</tt>, if this {@link HttpPacket} content * will be transferred in chunking mode, or <tt>false</tt> if case * of fixed-length message. */ public void setChunked(boolean isChunked) { if (getProtocol().compareTo(Protocol.HTTP_1_1) >= 0) { // HTTP/1.1 and later this.isChunked = isChunked; if (isChunked) { headers.removeHeader(Header.ContentLength); } } else { this.isChunked = false; } }
/** * Set <tt>true</tt>, if this {@link HttpPacket} content will be transferred * in chunking mode, or <tt>false</tt> if case of fixed-length message. * * NOTE: If the protocol version of this header is 1.0 or older, chunking * will be disabled regardless of the value passed. * * @param isChunked <tt>true</tt>, if this {@link HttpPacket} content * will be transferred in chunking mode, or <tt>false</tt> if case * of fixed-length message. */ public void setChunked(boolean isChunked) { if (getProtocol().compareTo(Protocol.HTTP_1_1) >= 0) { // HTTP/1.1 and later this.isChunked = isChunked; if (isChunked) { headers.removeHeader(Header.ContentLength); } } else { this.isChunked = false; } }
/** * Set <tt>true</tt>, if this {@link HttpPacket} content will be transferred * in chunking mode, or <tt>false</tt> if case of fixed-length message. * * NOTE: If the protocol version of this header is 1.0 or older, chunking * will be disabled regardless of the value passed. * * @param isChunked <tt>true</tt>, if this {@link HttpPacket} content * will be transferred in chunking mode, or <tt>false</tt> if case * of fixed-length message. */ public void setChunked(boolean isChunked) { if (getProtocol().compareTo(Protocol.HTTP_1_1) >= 0) { // HTTP/1.1 and later this.isChunked = isChunked; if (isChunked) { headers.removeHeader(Header.ContentLength); } } else { this.isChunked = false; } }
/** * Set <tt>true</tt>, if this {@link HttpPacket} content will be transferred * in chunking mode, or <tt>false</tt> if case of fixed-length message. * * NOTE: If the protocol version of this header is 1.0 or older, chunking * will be disabled regardless of the value passed. * * @param isChunked <tt>true</tt>, if this {@link HttpPacket} content * will be transferred in chunking mode, or <tt>false</tt> if case * of fixed-length message. */ public void setChunked(boolean isChunked) { if (getProtocol().compareTo(Protocol.HTTP_1_1) >= 0) { // HTTP/1.1 and later this.isChunked = isChunked; if (isChunked) { headers.removeHeader(Header.ContentLength); } } else { this.isChunked = false; } }
/** * Set <tt>true</tt>, if this {@link HttpPacket} content will be transferred * in chunking mode, or <tt>false</tt> if case of fixed-length message. * * NOTE: If the protocol version of this header is 1.0 or older, chunking * will be disabled regardless of the value passed. * * @param isChunked <tt>true</tt>, if this {@link HttpPacket} content * will be transferred in chunking mode, or <tt>false</tt> if case * of fixed-length message. */ public void setChunked(boolean isChunked) { if (getProtocol().compareTo(Protocol.HTTP_1_1) >= 0) { // HTTP/1.1 and later this.isChunked = isChunked; if (isChunked) { headers.removeHeader(Header.ContentLength); } } else { this.isChunked = false; } }
/** * Set <tt>true</tt>, if this {@link HttpPacket} content will be transferred * in chunking mode, or <tt>false</tt> if case of fixed-length message. * * NOTE: If the protocol version of this header is 1.0 or older, chunking * will be disabled regardless of the value passed. * * @param isChunked <tt>true</tt>, if this {@link HttpPacket} content * will be transferred in chunking mode, or <tt>false</tt> if case * of fixed-length message. */ public void setChunked(boolean isChunked) { if (getProtocol().compareTo(Protocol.HTTP_1_1) >= 0) { // HTTP/1.1 and later this.isChunked = isChunked; if (isChunked) { headers.removeHeader(Header.ContentLength); } } else { this.isChunked = false; } }
private void flushBuffer(final Buffer bufferToFlush, final boolean isLast, final MessageCloner<Buffer> messageCloner) throws IOException { final HttpContent content; if (isLast && trailersSupplier != null && (outputHeader.isChunked() || outputHeader.getProtocol().equals(Protocol.HTTP_2_0))) { forceCommitHeaders(false); HttpTrailer.Builder tBuilder = outputHeader.httpTrailerBuilder().content(bufferToFlush).last(true); final Map<String, String> trailers = trailersSupplier.get(); if (trailers != null && !trailers.isEmpty()) { for (Map.Entry<String, String> entry : trailers.entrySet()) { tBuilder.header(entry.getKey(), entry.getValue()); } } content = tBuilder.build(); } else { content = builder.content(bufferToFlush).last(isLast).build(); } ctx.write(null, content, null, messageCloner, IS_BLOCKING); }
private void flushBuffer(final Buffer bufferToFlush, final boolean isLast, final MessageCloner<Buffer> messageCloner) throws IOException { final HttpContent content; if (isLast && trailersSupplier != null && (outputHeader.isChunked() || outputHeader.getProtocol().equals(Protocol.HTTP_2_0))) { forceCommitHeaders(false); HttpTrailer.Builder tBuilder = outputHeader.httpTrailerBuilder().content(bufferToFlush).last(true); final Map<String, String> trailers = trailersSupplier.get(); if (trailers != null && !trailers.isEmpty()) { for (Map.Entry<String, String> entry : trailers.entrySet()) { tBuilder.header(entry.getKey(), entry.getValue()); } } content = tBuilder.build(); } else { content = builder.content(bufferToFlush).last(isLast).build(); } ctx.write(null, content, null, messageCloner, IS_BLOCKING); }
private void flushBuffer(final Buffer bufferToFlush, final boolean isLast, final MessageCloner<Buffer> messageCloner) throws IOException { final HttpContent content; if (isLast && trailersSupplier != null && (outputHeader.isChunked() || outputHeader.getProtocol().equals(Protocol.HTTP_2_0))) { forceCommitHeaders(false); HttpTrailer.Builder tBuilder = outputHeader.httpTrailerBuilder().content(bufferToFlush).last(true); final Map<String, String> trailers = trailersSupplier.get(); if (trailers != null && !trailers.isEmpty()) { for (Map.Entry<String, String> entry : trailers.entrySet()) { tBuilder.header(entry.getKey(), entry.getValue()); } } content = tBuilder.build(); } else { content = builder.content(bufferToFlush).last(isLast).build(); } ctx.write(null, content, null, messageCloner, IS_BLOCKING); }
private void flushBuffer(final Buffer bufferToFlush, final boolean isLast, final MessageCloner<Buffer> messageCloner) throws IOException { final HttpContent content; if (isLast && trailersSupplier != null && (outputHeader.isChunked() || outputHeader.getProtocol().equals(Protocol.HTTP_2_0))) { forceCommitHeaders(false); HttpTrailer.Builder tBuilder = outputHeader.httpTrailerBuilder().content(bufferToFlush).last(true); final Map<String, String> trailers = trailersSupplier.get(); if (trailers != null && !trailers.isEmpty()) { for (Map.Entry<String, String> entry : trailers.entrySet()) { tBuilder.header(entry.getKey(), entry.getValue()); } } content = tBuilder.build(); } else { content = builder.content(bufferToFlush).last(isLast).build(); } ctx.write(null, content, null, messageCloner, IS_BLOCKING); }
private void flushBuffer(final Buffer bufferToFlush, final boolean isLast, final MessageCloner<Buffer> messageCloner) throws IOException { final HttpContent content; if (isLast && trailersSupplier != null && (outputHeader.isChunked() || outputHeader.getProtocol().equals(Protocol.HTTP_2_0))) { forceCommitHeaders(false); HttpTrailer.Builder tBuilder = outputHeader.httpTrailerBuilder().content(bufferToFlush).last(true); final Map<String, String> trailers = trailersSupplier.get(); if (trailers != null && !trailers.isEmpty()) { for (Map.Entry<String, String> entry : trailers.entrySet()) { tBuilder.header(entry.getKey(), entry.getValue()); } } content = tBuilder.build(); } else { content = builder.content(bufferToFlush).last(isLast).build(); } ctx.write(null, content, null, messageCloner, IS_BLOCKING); }
private void flushBuffer(final Buffer bufferToFlush, final boolean isLast, final MessageCloner<Buffer> messageCloner) throws IOException { final HttpContent content; if (isLast && trailersSupplier != null && (outputHeader.isChunked() || outputHeader.getProtocol().equals(Protocol.HTTP_2_0))) { forceCommitHeaders(false); HttpTrailer.Builder tBuilder = outputHeader.httpTrailerBuilder().content(bufferToFlush).last(true); final Map<String, String> trailers = trailersSupplier.get(); if (trailers != null && !trailers.isEmpty()) { for (Map.Entry<String, String> entry : trailers.entrySet()) { tBuilder.header(entry.getKey(), entry.getValue()); } } content = tBuilder.build(); } else { content = builder.content(bufferToFlush).last(isLast).build(); } ctx.write(null, content, null, messageCloner, IS_BLOCKING); }
private void flushBuffer(final Buffer bufferToFlush, final boolean isLast, final MessageCloner<Buffer> messageCloner) throws IOException { final HttpContent content; if (isLast && trailersSupplier != null && (outputHeader.isChunked() || outputHeader.getProtocol().equals(Protocol.HTTP_2_0))) { forceCommitHeaders(false); HttpTrailer.Builder tBuilder = outputHeader.httpTrailerBuilder().content(bufferToFlush).last(true); final Map<String, String> trailers = trailersSupplier.get(); if (trailers != null && !trailers.isEmpty()) { for (Map.Entry<String, String> entry : trailers.entrySet()) { tBuilder.header(entry.getKey(), entry.getValue()); } } content = tBuilder.build(); } else { content = builder.content(bufferToFlush).last(isLast).build(); } ctx.write(null, content, null, messageCloner, IS_BLOCKING); }
private void flushBuffer(final Buffer bufferToFlush, final boolean isLast, final MessageCloner<Buffer> messageCloner) throws IOException { final HttpContent content; if (isLast && trailersSupplier != null && (outputHeader.isChunked() || outputHeader.getProtocol().equals(Protocol.HTTP_2_0))) { forceCommitHeaders(false); HttpTrailer.Builder tBuilder = outputHeader.httpTrailerBuilder().content(bufferToFlush).last(true); final Map<String, String> trailers = trailersSupplier.get(); if (trailers != null && !trailers.isEmpty()) { for (Map.Entry<String, String> entry : trailers.entrySet()) { tBuilder.header(entry.getKey(), entry.getValue()); } } content = tBuilder.build(); } else { content = builder.content(bufferToFlush).last(isLast).build(); } ctx.write(null, content, null, messageCloner, IS_BLOCKING); }
if (!httpHeader.isRequest() // it's a response??? don't know what to do with it || httpHeader.getProtocol() != Protocol.HTTP_1_1 // only HTTP/1.1 is considered for upgrade
if (!httpHeader.isRequest() // it's a response??? don't know what to do with it || httpHeader.getProtocol() != Protocol.HTTP_1_1 // only HTTP/1.1 is considered for upgrade