mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-11-09 10:00:57 +03:00
Store tokens in new token frames as IoBuf and hexlify when including in qlogger
Summary: As title. This changes the NewTokenFrame (for writing) to hold the toke as an IOBuf instead of a string. This makes it consistent with the read side. In the same change, the qlogger now hexlifies this buffer when writing the token to the qlog. Reviewed By: hanidamlaj, mjoras Differential Revision: D46955172 fbshipit-source-id: 8f5f575ad2f0a4ec3b4c01cb67defa1f4425cd74
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e40013d568
commit
c3ea605df1
@@ -747,7 +747,7 @@ size_t writeSimpleFrame(
|
||||
QuicInteger intFrameType(static_cast<uint8_t>(FrameType::NEW_TOKEN));
|
||||
|
||||
auto& token = newTokenFrame->token;
|
||||
QuicInteger tokenLength(token.size());
|
||||
QuicInteger tokenLength(token->computeChainDataLength());
|
||||
auto newTokenFrameLength = intFrameType.getSize() +
|
||||
/*encoding token length*/ tokenLength.getSize() +
|
||||
tokenLength.getValue();
|
||||
@@ -755,7 +755,7 @@ size_t writeSimpleFrame(
|
||||
if (packetSpaceCheck(spaceLeft, newTokenFrameLength)) {
|
||||
builder.write(intFrameType);
|
||||
builder.write(tokenLength);
|
||||
builder.push((uint8_t*)token.data(), tokenLength.getValue());
|
||||
builder.insert(token->clone());
|
||||
builder.appendFrame(QuicSimpleFrame(*newTokenFrame));
|
||||
return newTokenFrameLength;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user