/** * Handle an indexed header representation * * @param index The index * @throws HpackException */ private void handleIndex(int index) throws HpackException { if (index <= Hpack.STATIC_TABLE_LENGTH) { addStaticTableEntry(index); } else { int adjustedIndex = getRealIndex(index - Hpack.STATIC_TABLE_LENGTH); HeaderField headerField = headerTable[adjustedIndex]; headerEmitter.emitHeader(headerField.name, headerField.value, false); } }
decoder.setHeaderEmitter(this); int oldLimit = -1; if(currentPadding > 0) { decoder.decode(resource, moreDataThisFrame || continuationFramesComing); } catch (HpackException e) { throw new ConnectionErrorException(e.getCloseCode(), e);
private HttpString readHeaderName(ByteBuffer buffer, int prefixLength) throws HpackException { buffer.position(buffer.position() - 1); //unget the byte int index = Hpack.decodeInteger(buffer, prefixLength); if (index == -1) { return null; } else if (index != 0) { return handleIndexedHeaderName(index); } else { String string = readHpackString(buffer); if (string == null) { return null; } return new HttpString(string); } }
private HttpString handleIndexedHeaderName(int index) throws HpackException { if (index <= Hpack.STATIC_TABLE_LENGTH) { return Hpack.STATIC_TABLE[index].name; } else { if (index >= Hpack.STATIC_TABLE_LENGTH + filledTableSlots) { throw new HpackException(); } int adjustedIndex = getRealIndex(index - Hpack.STATIC_TABLE_LENGTH); HeaderField res = headerTable[adjustedIndex]; if (res == null) { throw new HpackException(); } return res.name; } }
return; resizeIfRequired(); int newTableSlots = filledTableSlots + 1; int tableLength = headerTable.length;
this.decoder = new HpackDecoder(encoderHeaderTableSize); this.encoder = new HpackEncoder(encoderHeaderTableSize); if(!prefaceRequired) {
private HttpString handleIndexedHeaderName(int index) throws HpackException { if (index <= Hpack.STATIC_TABLE_LENGTH) { return Hpack.STATIC_TABLE[index].name; } else { if (index >= Hpack.STATIC_TABLE_LENGTH + filledTableSlots) { throw new HpackException(); } int adjustedIndex = getRealIndex(index - Hpack.STATIC_TABLE_LENGTH); HeaderField res = headerTable[adjustedIndex]; if (res == null) { throw new HpackException(); } return res.name; } }
return; resizeIfRequired(); int newTableSlots = filledTableSlots + 1; int tableLength = headerTable.length;
this.decoder = new HpackDecoder(encoderHeaderTableSize); this.encoder = new HpackEncoder(encoderHeaderTableSize); if(!prefaceRequired) {
/** * Handle an indexed header representation * * @param index The index * @throws HpackException */ private void handleIndex(int index) throws HpackException { if (index <= Hpack.STATIC_TABLE_LENGTH) { addStaticTableEntry(index); } else { int adjustedIndex = getRealIndex(index - Hpack.STATIC_TABLE_LENGTH); HeaderField headerField = headerTable[adjustedIndex]; headerEmitter.emitHeader(headerField.name, headerField.value, false); } }
private HttpString readHeaderName(ByteBuffer buffer, int prefixLength) throws HpackException { buffer.position(buffer.position() - 1); //unget the byte int index = Hpack.decodeInteger(buffer, prefixLength); if (index == -1) { return null; } else if (index != 0) { return handleIndexedHeaderName(index); } else { String string = readHpackString(buffer); if (string == null) { return null; } return new HttpString(string); } }
decoder.setHeaderEmitter(this); int oldLimit = -1; if(currentPadding > 0) { decoder.decode(resource, moreDataThisFrame || continuationFramesComing); } catch (HpackException e) { throw new ConnectionErrorException(e.getCloseCode(), e);
private HttpString handleIndexedHeaderName(int index) throws HpackException { if (index <= Hpack.STATIC_TABLE_LENGTH) { return Hpack.STATIC_TABLE[index].name; } else { if (index >= Hpack.STATIC_TABLE_LENGTH + filledTableSlots) { throw new HpackException(); } int adjustedIndex = getRealIndex(index - Hpack.STATIC_TABLE_LENGTH); HeaderField res = headerTable[adjustedIndex]; if (res == null) { throw new HpackException(); } return res.name; } }
return; resizeIfRequired(); int newTableSlots = filledTableSlots + 1; int tableLength = headerTable.length;
this.decoder = new HpackDecoder(encoderHeaderTableSize); this.encoder = new HpackEncoder(encoderHeaderTableSize); if(!prefaceRequired) {
/** * Handle an indexed header representation * * @param index The index * @throws HpackException */ private void handleIndex(int index) throws HpackException { if (index <= Hpack.STATIC_TABLE_LENGTH) { addStaticTableEntry(index); } else { int adjustedIndex = getRealIndex(index - Hpack.STATIC_TABLE_LENGTH); HeaderField headerField = headerTable[adjustedIndex]; headerEmitter.emitHeader(headerField.name, headerField.value, false); } }
private HttpString readHeaderName(ByteBuffer buffer, int prefixLength) throws HpackException { buffer.position(buffer.position() - 1); //unget the byte int index = Hpack.decodeInteger(buffer, prefixLength); if (index == -1) { return null; } else if (index != 0) { return handleIndexedHeaderName(index); } else { String string = readHpackString(buffer); if (string == null) { return null; } return new HttpString(string); } }
decoder.setHeaderEmitter(this); int oldLimit = -1; if(currentPadding > 0) { decoder.decode(resource, moreDataThisFrame || continuationFramesComing); } catch (HpackException e) { throw new ConnectionErrorException(e.getCloseCode(), e);