Ethereal-dev: [Ethereal-dev] Stopping the load of a capture file [PATCH]

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

From: Jaap Keuter <jaap.keuter@xxxxxxxxx>
Date: Tue, 8 Nov 2005 10:22:56 +0100 (CET)
Hi list,

This is the patch that implements this request.

It obsoletes some return value handing code for CF_READ_ABORTED
here and there. This can be worked out later.

Thanx,
Jaap

---------- Forwarded message ----------
Date: Sun, 6 Nov 2005 00:28:15 +0100 (CET)
From: Jaap Keuter <jaap.keuter@xxxxxxxxx>
Reply-To: Ethereal development <ethereal-dev@xxxxxxxxxxxx>
To: Ethereal Developer Mailinglist <ethereal-dev@xxxxxxxxxxxx>
Subject: [Ethereal-dev] Stopping the load of a capture file

Hi list,

Anyone having objections to idea of stopping the load of a capture file
i.s.o. cancelling it? I'm refering to WishList Data I/O item #6.
It seems a very reasonable idea and easy to implement.

Thanx,
Jaap

Index: file.c
===================================================================
--- file.c	(revision 16434)
+++ file.c	(working copy)
@@ -449,11 +449,8 @@
       /* Well, the user decided to abort the read.  Destroy the progress
          bar, close the capture file, and return CF_READ_ABORTED so our caller
 	 can do whatever is appropriate when that happens. */
-      destroy_progress_dlg(progbar);
-      cf->state = FILE_READ_ABORTED;	/* so that we're allowed to close it */
-      packet_list_thaw();		/* undo our freeze */
-      cf_close(cf);
-      return CF_READ_ABORTED;
+      err = WTAP_ERR_SHORT_READ;
+      break;
     }
     read_packet(cf, data_offset);
   }