go-astits icon indicating copy to clipboard operation
go-astits copied to clipboard

PSI: parse multiple sections correctly

Open tmm1 opened this issue 4 years ago • 3 comments
trafficstars

cc #25

tmm1 avatar Apr 07 '21 01:04 tmm1

Coverage Status

Coverage decreased (-76.6%) to 0.0% when pulling d1f8a96c02d311684fb93ed419f54b624476c2f6 on tmm1:psi-parse-multiple into 077af8e17e39a8c822c46bd662cbf8ad6ea90a44 on asticode:master.

coveralls avatar Apr 07 '21 01:04 coveralls

To be honest I don't quite get why removing || tableID.isUnknown() would fix your issue here 🤔 Can you explain it a little bit?

The issue was that when an unknown table was seen previously, parsing stopped altogether. This means that a known table later in the same packet (such as the program_map) was ignored altogether.

tmm1 avatar Apr 10 '21 16:04 tmm1

OK, got it. In that case, I feel like doing the following would better fix the problem and clean everything behind:

  1. Remove the shouldStopPSIParsing function
  2. Make sure the parsePSISectionHeader function returns stop and upon calling it, add an else if stop { return } (and hence remove the if shouldStopPSIParsing(s.Header.TableID) below)
  3. Replace this if with if tableID == PSITableIDNull directly
  4. Remove this function

What do you think?

asticode avatar Apr 11 '21 15:04 asticode