Ethereal-cvs: [Ethereal-cvs] cvs commit: ethereal packet-smtp.c

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

From: Guy Harris <guy@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 11 Nov 2000 01:48:31 -0600 (CST)
guy         2000/11/11 01:48:30 CST

  Modified files:
    .                    packet-smtp.c 
  Log:
  Simplify the state machine:
  
  	you're either reading commands, or you're reading message data;
  
  	if you're reading commands, and you see a DATA command, you
  	start reading data;
  
  	if you're reading data, and you see an EOM, you start reading
  	commands.
  
  Also, *always* fill in the per-frame data you allocate for a frame, and
  *always* attach it to the packet.
  
  The old state machine assumed it was done with the SMTP conversation
  once it saw an EOM, and the dissector wouldn't fill in the per-frame
  data it'd allocated and attach it to the packet if it thought it was
  done with the SMTP conversation.  This meant that:
  
  	1) the per-frame data allocated for frames following the EOM
  	   (e.g., a QUIT command) would contain random junk for data
  	   such as the packet type;
  
  	2) that per-frame data would be re-allocated every time the
  	   frame was looked at, as it wouldn't be attached to the frame,
  	   so you might well get *different* random junk each time the
  	   frame was looked at.
  
  This caused Tethereal and Ethereal to sometimes fail to recognize
  commands following the EOM - but it wouldn't *always* fail to do so,
  sometimes it'd work and sometimes it wouldn't.
  
  Fix a comment; conversations are *not* removed during filter operations,
  and the visited flag is *not* cleared during a filter operation - that's
  only true on a *redissection* operation.  In any case, given that frames
  can, after the initial sequential scan through the capture, be visited
  in any order, and visited repeatedly, it's irrelevant whether
  conversations are removed or not - we have to associate with each frame
  information telling us how to process it.
  
  Revision  Changes    Path
  1.8       +63 -42    ethereal/packet-smtp.c