HttpParser { public void atEOF() { if (DEBUG) LOG.debug("atEOF {}", this); eof = true; } HttpParser(RequestHandler handler);  HttpParser(ResponseHandler handler);  HttpParser(RequestHandler handler, int maxHeaderBytes);  HttpParser(ResponseHandler handler, int maxHeaderBytes); @Deprecated  HttpParser(RequestHandler handler, int maxHeaderBytes, boolean strict); @Deprecated  HttpParser(ResponseHandler handler, int maxHeaderBytes, boolean strict);  HttpParser(RequestHandler handler, HttpCompliance compliance);  HttpParser(RequestHandler handler, int maxHeaderBytes, HttpCompliance compliance);  HttpParser(ResponseHandler handler, int maxHeaderBytes, HttpCompliance compliance); private  HttpParser(RequestHandler requestHandler, ResponseHandler responseHandler, int maxHeaderBytes, HttpCompliance compliance); HttpHandler getHandler(); long getContentLength(); long getContentRead(); void setHeadResponse(boolean head); State getState(); boolean inContentState(); boolean inHeaderState(); boolean isChunking(); boolean isStart(); boolean isClose(); boolean isClosed(); boolean isIdle(); boolean isComplete(); boolean isState(State state); boolean parseNext(ByteBuffer buffer); boolean isAtEOF(); void atEOF(); void close(); void reset(); Trie<HttpField> getFieldCache(); @Override String toString(); static final LazyLogger LOG; @Deprecated
    final static String STRICT; final static int INITIAL_URI_LENGTH; final static Trie<HttpField> CACHE; }
@Test void testEarlyEOF() { ByteBuffer buffer = BufferUtils.toBuffer( "GET /uri HTTP/1.0\r\n" + "Content-Length: 20\r\n" + "\r\n" + "0123456789"); HttpParser.RequestHandler handler = new Handler(); HttpParser parser = new HttpParser(handler); parser.atEOF(); parseAll(parser, buffer); assertEquals("GET", methodOrVersion); assertEquals("/uri", uriOrStatus); assertEquals("HTTP/1.0", versionOrReason); assertEquals("0123456789", content); assertTrue(early); }
@Test void testChunkEarlyEOF() { ByteBuffer buffer = BufferUtils.toBuffer( "GET /chunk HTTP/1.0\r\n" + "Header1: value1\r\n" + "Transfer-Encoding: chunked\r\n" + "\r\n" + "a;\r\n" + "0123456789\r\n"); HttpParser.RequestHandler handler = new Handler(); HttpParser parser = new HttpParser(handler); parser.atEOF(); parseAll(parser, buffer); assertEquals("GET", methodOrVersion); assertEquals("/chunk", uriOrStatus); assertEquals("HTTP/1.0", versionOrReason); assertEquals(1, headers); assertEquals("Header1", hdr[0]); assertEquals("value1", val[0]); assertEquals("0123456789", content); assertTrue(early); }