Guy Harris wrote:
Hi, I would like to know why in packet-smtp.c there is a local
"GHashTable *smtp_request_hash" that seems to do the same job that the
conversation table can do.
There may not be a good reason. It might be possible to just attach the
"smtp_request_val" structure pointer directly to the conversation, using
"conversation_add_proto_data()", when the data structure is first
allocated, and fetch it with "conversation_get_proto_data()".
Hmmm, I will have to go back and look at the code ... I can't recall that structure, but it was a while ago :-)
I found that I only needed to keep state info for requests, and that I needed to actually keep per-packet state for requests to make sure that when users were clicking around, we could do the right things.
However, I can't think of any good reason to have a separate hash ATM ...
Hmmm, I have looked at the code, and can't see any good reason for the hash, so perhaps I simply copied that from elsewhere.
The only case I think we need to be careful of is a trace that is so
long running that we get re-use of source and destination ports and
source and destination IP addresses ... but the hash simply uses the
conversation ID, so it does not protect against that.
--
Richard Sharpe, rsharpe@xxxxxxxxxx, LPIC-1
www.samba.org, www.ethereal.com, SAMS Teach Yourself Samba
in 24 Hours, Special Edition, Using Samba