Ethereal-dev: Re: [ethereal-dev] Possible crash problem in file.c

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: Mon, 26 Jun 2000 22:01:52 -0700
On Sun, Jun 25, 2000 at 10:32:06PM +0100, Ben Fowler wrote:
> Unless there is an obvious way to get that routine to bail out, it
> might be a good idea to have file_quit_cmd_cb() stuff a suitable
> USER_CANCELLED_READ value in the capture_file structure,
> and have the read routine check this whenever it receives
> control back from the event loop.

Unfortunately, that means the only way to abort the reading of a capture
file is to quit Ethereal; one might want to abort it but still have
Ethereal running, so that one could, say, open another file instead.

Currently, you can't do "File/Close" until a file has finished being
read, so there's no way to do that.

An alternative might be to have Ethereal pop up a window when reading a
file; the window could have a progress bar and a "Cancel" button, with
the progress bar being used instead of the progress bar in the main
window, and with the "Cancel" button aborting the read without exiting
Ethereal.

Were that dialog box to be modal (as the capture dialog box is when not
doing an "update screen as packets arrive" capture), that would limit
the number of actions the user could take while the file was being read
in.  That has the advantage that it limits the number of operations you
have to ensure can be performed while a file is being read, and the
disadvantage that it limits the number of things a user can do while
reading a capture - for example, it would only let you abort the read,
not let you exit Ethereal, unless a "Quit" or "Exit" button were added. 
It also wouldn't let you turn resolution of names to addresses on or
off...

...but that currently doesn't work right now anyway, due to a bug; it
turns out that "OK" in the "Display Options" dialog box always causes
the time format to be changed in the display, *even if the format is the
same as it was* (which is a bug, as changing the format can be
time-consuming if the capture is large; I will fix that bug), and that
happens to crash Ethereal (and it might be tricky to make it work).

It's also probably more convenient to hit a button in the dialog box
than to select a menu item, which might be another argument for a
progress dialog box with a "Cancel" button to abort the read - and
perhaps a button to control name resolution, although that button
currently wouldn't work immediately if Ethereal is stalled waiting for a
DNS resolution to complete (an asynchronous DNS resolution scheme might
help here, if implementable).

I also wonder whether the progress bar, for possibly-long-running
operations, would be more obvious in a pop-up dialog box than in the
main window.