From 3bfec5be3453433ee1f2ba8cca13416c6eb8a6f4 Mon Sep 17 00:00:00 2001 From: Matthias Einwag Date: Wed, 11 Aug 2021 16:15:42 -0700 Subject: [PATCH] Emit Stream frame length correctly The property `quic.stream.length` that the tool uses doesn't seem to be emitted by wireshark for frames that carry no explicit length information (stream frame is at the end of the packet). In that case the generated qlog will not have a length field. To fix this, we calculate the length based on the data in the frame (which is correctly emitted). Fixes #7 --- src/parsers/ParserPCAP.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parsers/ParserPCAP.ts b/src/parsers/ParserPCAP.ts index 1a18bac..1a84b0f 100644 --- a/src/parsers/ParserPCAP.ts +++ b/src/parsers/ParserPCAP.ts @@ -915,7 +915,7 @@ export class ParserPCAP { stream_id: tsharkStreamFrame["quic.stream.stream_id"], offset: tsharkStreamFrame['quic.frame_type_tree']['quic.stream.off'] === "1" ? tsharkStreamFrame["quic.stream.offset"] : "0", - length: tsharkStreamFrame["quic.stream.length"], + length: ((tsharkStreamFrame["quic.stream_data"].length + 1) / 3).toString(), // Data is hex encoded like 00:00:00:00 fin: tsharkStreamFrame["quic.frame_type_tree"]["quic.stream.fin"] === "1", // raw: logRawPayloads ? tsharkStreamFrame["quic.stream_data"].replace(/:/g, '') : undefined,