| 92 | } |
| 93 | |
| 94 | public class HeaderLine implements NioReader.State { |
| 95 | |
| 96 | private final HttpRequest headers; |
| 97 | int eol; |
| 98 | |
| 99 | public HeaderLine(HttpRequest headers) { |
| 100 | this.headers = headers; |
| 101 | } |
| 102 | |
| 103 | @Override |
| 104 | public NioReader.State processBytes(ByteBuffer buffer) { |
| 105 | int stripped = stripEndOfLines(buffer); |
| 106 | eol += stripped; |
| 107 | if (eol == 4) { |
| 108 | if (headers.contentLength == 0) { |
| 109 | return dispatchHttpRequest(headers); |
| 110 | } else { |
| 111 | return new ContentReader(headers); |
| 112 | } |
| 113 | } |
| 114 | if (buffer.hasRemaining() && eol == 2) { |
| 115 | return new ReadHeader(headers); |
| 116 | } |
| 117 | return null; |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | private class ContentReader implements NioReader.State { |
| 122 |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…