/** * @deprecated Use {@link HttpUtil#isTransferEncodingChunked(HttpMessage)} instead. * * Checks to see if the transfer encoding in a specified {@link HttpMessage} is chunked * * @param message The message to check * @return True if transfer encoding is chunked, otherwise false */ @Deprecated public static boolean isTransferEncodingChunked(HttpMessage message) { return HttpUtil.isTransferEncodingChunked(message); }
@Override protected boolean hasBody(HttpRequest request) { // Http requests don't have a body if they define 0 content length, or no content length and no transfer // encoding return HttpUtil.getContentLength(request, 0) != 0 || HttpUtil.isTransferEncodingChunked(request); }
/** * Keep-alive only works if the client can detect when the message has ended without relying on the connection being * closed. * <p> * <ul> * <li>See <a href="https://tools.ietf.org/html/rfc7230#section-6.3"/></li> * <li>See <a href="https://tools.ietf.org/html/rfc7230#section-3.3.2"/></li> * <li>See <a href="https://tools.ietf.org/html/rfc7230#section-3.3.3"/></li> * </ul> * * @param response The HttpResponse to check * * @return true if the response has a self defined message length. */ private static boolean isSelfDefinedMessageLength(HttpResponse response) { return isContentLengthSet(response) || isTransferEncodingChunked(response) || isMultipart(response) || isInformational(response) || response.status().code() == HttpResponseStatus.NO_CONTENT.code(); }
isSuccessResponse = response.status().equals(HttpResponseStatus.OK) && HttpUtil.isTransferEncodingChunked(response);
if (HttpUtil.isTransferEncodingChunked(response)) { ctx.write(new HttpChunkedInput(jerseyChunkedInput)).addListener(FLUSH_FUTURE); } else {
HttpUtil.isTransferEncodingChunked(m) ? ST_CONTENT_CHUNK : ST_CONTENT_NON_CHUNK;
if (HttpUtil.isTransferEncodingChunked(nettyRequest)) { ch.write(new HttpChunkedInput(jerseyChunkedInput)); } else {
|| HttpUtil.isTransferEncodingChunked(response)) {
boolean chunked = HttpUtil.isTransferEncodingChunked(message); if (currentState == State.READ_VARIABLE_LENGTH_CONTENT && !in.isReadable() && !chunked) {
|| HttpUtil.isTransferEncodingChunked(req)) {
@Override protected boolean hasBody(HttpResponse response) { if (response.status().code() >= HttpStatus.CONTINUE.getCode() && response.status().code() < HttpStatus.OK.getCode()) { return false; } if (response.status().equals(HttpResponseStatus.NO_CONTENT) || response.status().equals(HttpResponseStatus.NOT_MODIFIED)) { return false; } if (HttpUtil.isTransferEncodingChunked(response)) { return true; } if (HttpUtil.isContentLengthSet(response)) { return HttpUtil.getContentLength(response) > 0; } return true; }
if (! HttpUtil.isContentLengthSet(nativeResponse) && ! HttpUtil.isTransferEncodingChunked(nativeResponse)) { nativeResponse.headers().add(HttpHeaderNames.TRANSFER_ENCODING, HttpHeaderValues.CHUNKED);
HttpUtil.setTransferEncodingChunked(message, false); nextState = State.SKIP_CONTROL_CHARS; } else if (HttpUtil.isTransferEncodingChunked(message)) { nextState = State.READ_CHUNK_SIZE; } else if (contentLength() >= 0) {
if (!HttpUtil.isContentLengthSet(out.message) && !HttpUtil.isTransferEncodingChunked(out.message) && canHaveBody(out.message)) { HttpUtil.setKeepAlive(out.message, false);
&& !HttpUtil.isTransferEncodingChunked(httpRequest) && !HttpUtil.isTransferEncodingChunked(response)) { future.setReuseChannel(true); requestSender.drainChannelAndExecuteNextRequest(channel, future, nextRequest);
&& !HttpUtil.isTransferEncodingChunked(httpRequest) && !HttpUtil.isTransferEncodingChunked(response)) { future.setConnectAllowed(true); future.setReuseChannel(true);
if (! HttpUtil.isContentLengthSet(nativeResponse) && ! HttpUtil.isTransferEncodingChunked(nativeResponse)) { nativeResponse.headers().add(HttpHeaderNames.TRANSFER_ENCODING, HttpHeaderValues.CHUNKED);
if (contentEmpty && !HttpUtil.isTransferEncodingChunked(nettyReq)) { req.close();
if (future.isKeepAlive() && !HttpUtil.isTransferEncodingChunked(response)) { if (sameBase) { future.setReuseChannel(true);
if (HttpUtil.isTransferEncodingChunked(response)) { if (log.isDebugEnabled()) { log.debug("#HTTP 内容开始{");