This represents an HTTP/2 connection from a client to Tomcat. It is designed on the basis that there will never be more than one thread performing I/O at a time. For reading, this implementation is blocking within frames and non-blocking between frames. Note: You will need to nest
| 70 | * </ul> |
| 71 | */ |
| 72 | class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeHandler, Input, Output { |
| 73 | |
| 74 | /** |
| 75 | * Logger for this class. |
| 76 | */ |
| 77 | protected static final Log log = LogFactory.getLog(Http2UpgradeHandler.class); |
| 78 | |
| 79 | /** |
| 80 | * String manager for error messages. |
| 81 | */ |
| 82 | protected static final StringManager sm = StringManager.getManager(Http2UpgradeHandler.class); |
| 83 | |
| 84 | private static final Integer STREAM_ID_ZERO = Integer.valueOf(0); |
| 85 | |
| 86 | /** |
| 87 | * Flag indicating the end of a stream. |
| 88 | */ |
| 89 | protected static final int FLAG_END_OF_STREAM = 1; |
| 90 | |
| 91 | /** |
| 92 | * Flag indicating the end of headers. |
| 93 | */ |
| 94 | protected static final int FLAG_END_OF_HEADERS = 4; |
| 95 | |
| 96 | /** |
| 97 | * PING frame with zero payload length and zero stream ID. |
| 98 | */ |
| 99 | protected static final byte[] PING = { 0x00, 0x00, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 100 | |
| 101 | /** |
| 102 | * PING ACK frame with zero payload length and zero stream ID. |
| 103 | */ |
| 104 | protected static final byte[] PING_ACK = { 0x00, 0x00, 0x08, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00 }; |
| 105 | |
| 106 | /** |
| 107 | * SETTINGS ACK frame with zero payload length and zero stream ID. |
| 108 | */ |
| 109 | protected static final byte[] SETTINGS_ACK = { 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00 }; |
| 110 | |
| 111 | /** |
| 112 | * GOAWAY frame header with zero stream ID. |
| 113 | */ |
| 114 | protected static final byte[] GOAWAY = { 0x07, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 115 | |
| 116 | private static final String HTTP2_SETTINGS_HEADER = "HTTP2-Settings"; |
| 117 | |
| 118 | /** |
| 119 | * Default header sink for HPACK decoding. |
| 120 | */ |
| 121 | protected static final HeaderSink HEADER_SINK = new HeaderSink(); |
| 122 | |
| 123 | /** |
| 124 | * Helper for user data logging with rate limiting. |
| 125 | */ |
| 126 | protected static final UserDataHelper userDataHelper = new UserDataHelper(log); |
| 127 | |
| 128 | /** |
| 129 | * Unique identifier for this connection. |
nothing calls this directly
no test coverage detected