Handle an indexed header representation @param index The index @throws HpackException If an error occurs processing the given index
(int index)
| 273 | * @throws HpackException If an error occurs processing the given index |
| 274 | */ |
| 275 | private void handleIndex(int index) throws HpackException { |
| 276 | if (index <= Hpack.STATIC_TABLE_LENGTH) { |
| 277 | addStaticTableEntry(index); |
| 278 | } else { |
| 279 | // index is 1 based |
| 280 | int adjustedIndex = getRealIndex(index); |
| 281 | if (log.isTraceEnabled()) { |
| 282 | log.trace(sm.getString("hpackdecoder.useDynamic", Integer.valueOf(adjustedIndex))); |
| 283 | } |
| 284 | Hpack.HeaderField headerField = headerTable[adjustedIndex]; |
| 285 | if (headerField == null) { |
| 286 | throw new HpackException(sm.getString("hpackdecoder.nullHeader", Integer.valueOf(index))); |
| 287 | } |
| 288 | emitHeader(headerField.name, headerField.value); |
| 289 | } |
| 290 | } |
| 291 | |
| 292 | /** |
| 293 | * because we use a ring buffer type construct, and don't actually shuffle items in the array, we need to figure out |
no test coverage detected