Ethereal-dev: Re: [ethereal-dev] Why are we doing a conversation_init in rescan_packets in fil

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Wed, 23 Aug 2000 23:50:58 -0700
On Tue, Aug 22, 2000 at 08:54:49PM +0900, Richard Sharpe wrote:
> OK, in the SMTP protocol, I only need to hang info off of the frames that
> contain a mail message. I had hoped to stick info in the conversation that
> allowed me to figure out the right things on the first pass and then not
> have to figure this out again.

We now don't do that, in the code in the CVS tree, on subsequent passes
through the packet list...

...*except* for passes triggered by a protocol preference having
changed, as the change to the protocol preference could conceivably
change what sate that protocol's dissector would change when dissecting
that packet.

I'm not sure why having to figure stuff out again on a subsequent pass
through the file is a problem, however, other than a performance
problem, as long as, on the subsequent pass, every single packet gets
fed to the dissectors, in the same order that they got fed to the
dissectors in the previous pass; unless a preference changed, the
dissector should behave the same on subsequent passes (and, as per the
above, if a preference changed, the dissector might not behave the same
on subsequent passes, *and if that means it constructs different state
on the subsequent pass, that's the state that should be kept around, not
the state from the previous pass*).

(I.e., the fact that we reset the information on such a redissect pass
is a feature, not a bug or a misfeature; the dissectors are *supposed*
to be told to figure that stuff out again, although I suppose, as an
*optimization*, we could have an indication for a preference whether
it'll affect state or not - but that seems to easy for somebody to get
wrong, or to forget to update if the dissector changes.)