private StreamSourceConduit createSourceConduit(StreamSourceConduit underlyingConduit, AjpServerResponseConduit responseConduit, final HttpServerExchange exchange) {
ReadDataStreamSourceConduit conduit = new ReadDataStreamSourceConduit(underlyingConduit, (AbstractServerConnection) exchange.getConnection());
final HeaderMap requestHeaders = exchange.getRequestHeaders();
HttpString transferEncoding = Headers.IDENTITY;
Long length;
final String teHeader = requestHeaders.getLast(Headers.TRANSFER_ENCODING);
boolean hasTransferEncoding = teHeader != null;
if (hasTransferEncoding) {
transferEncoding = new HttpString(teHeader);
}
final String requestContentLength = requestHeaders.getFirst(Headers.CONTENT_LENGTH);
if (hasTransferEncoding && !transferEncoding.equals(Headers.IDENTITY)) {
length = null; //unknown length
} else if (requestContentLength != null) {
final long contentLength = Long.parseLong(requestContentLength);
if (contentLength == 0L) {
UndertowLogger.REQUEST_LOGGER.trace("No content, starting next request");