InputBuffer for HTTP that provides request header parsing as well as transfer encoding.
| 40 | * InputBuffer for HTTP that provides request header parsing as well as transfer encoding. |
| 41 | */ |
| 42 | public class Http11InputBuffer implements InputBuffer, ApplicationBufferHandler, HeaderDataSource { |
| 43 | |
| 44 | // -------------------------------------------------------------- Constants |
| 45 | |
| 46 | private static final Log log = LogFactory.getLog(Http11InputBuffer.class); |
| 47 | |
| 48 | /** |
| 49 | * The string manager for this package. |
| 50 | */ |
| 51 | private static final StringManager sm = StringManager.getManager(Http11InputBuffer.class); |
| 52 | |
| 53 | |
| 54 | private static final byte[] CLIENT_PREFACE_START = |
| 55 | "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n".getBytes(StandardCharsets.ISO_8859_1); |
| 56 | |
| 57 | /** |
| 58 | * Associated Coyote request. |
| 59 | */ |
| 60 | private final Request request; |
| 61 | |
| 62 | |
| 63 | /** |
| 64 | * State. |
| 65 | */ |
| 66 | private volatile boolean parsingHeader; |
| 67 | |
| 68 | |
| 69 | /** |
| 70 | * Swallow input ? (in the case of an expectation) |
| 71 | */ |
| 72 | private boolean swallowInput; |
| 73 | |
| 74 | |
| 75 | /** |
| 76 | * The read buffer. |
| 77 | */ |
| 78 | private ByteBuffer byteBuffer; |
| 79 | |
| 80 | |
| 81 | /** |
| 82 | * Pos of the end of the header in the buffer, which is also the start of the body. |
| 83 | */ |
| 84 | private int end; |
| 85 | |
| 86 | |
| 87 | /** |
| 88 | * Wrapper that provides access to the underlying socket. |
| 89 | */ |
| 90 | private SocketWrapperBase<?> wrapper; |
| 91 | |
| 92 | |
| 93 | /** |
| 94 | * Underlying input buffer. |
| 95 | */ |
| 96 | private final InputBuffer inputStreamInputBuffer; |
| 97 | |
| 98 | |
| 99 | /** |
nothing calls this directly
no test coverage detected