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: Tue, 27 Jun 2000 00:16:13 -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.

I've done that (actually, there's now a state variable in there, which
is either:

	no capture file is open;

	the file is open and in the process of being read;

	the file is open, and in the process of being read, but the user
	asked that the read be terminated;

	the file is open and has been completely read).

The changes also allow Ethereal to, if you do File->Quit while a live
"update the screen as packets arrive" capture, kill off the child
process (which the code does with a "kill(<pid>, SIGTERM)" in UNIX; no
code is in there yet to do that on Win32) before exiting, so that it
doesn't leave the child process hanging around.

> Here is a patch which converts the global cf to cfile.

Checked in.