diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2005-11-08 22:24:53 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2005-11-08 22:24:53 +0000 |
commit | a10a0d26364b43107379f9709024c16b07bd5acf (patch) | |
tree | 44b2454bcc56755cecfd813336660b3adc816a7c /file.c | |
parent | 2044d02bcb5c0270c270e217b123a537dfe34f0f (diff) |
from Jaap Keuter:
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.
I've done some extensions:
-Improve the corresponding comment on the implications why this is useful
-added a new simple_dialog text to explain what's really going on (simply using the WTAP truncated packet message was a bit misleading)
svn path=/trunk/; revision=16441
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 26 |
1 files changed, 18 insertions, 8 deletions
@@ -446,14 +446,12 @@ cf_read(capture_file *cf) } if (stop_flag) { - /* 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; + /* Well, the user decided to abort the read. He/She will be warned and + it might be enough for him/her to work with the already loaded packets. + This is especially true for very large capture files, where you don't + want to wait loading the whole file (which may last minutes or even + hours even on fast machines) just to see that it was the wrong file. */ + break; } read_packet(cf, data_offset); } @@ -488,6 +486,18 @@ cf_read(capture_file *cf) if (cf->first_displayed != NULL) packet_list_select_row(0); + if(stop_flag) { + simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, + "%sFile loading was cancelled!%s\n" + "\n" + "The remaining packets in the file were discarded.\n" + "\n" + "As a lot of packets from the original file will be missing,\n" + "remember to be careful when saving the current content to a file.\n", + simple_dialog_primary_start(), simple_dialog_primary_end()); + return CF_READ_ERROR; + } + if (err != 0) { /* Put up a message box noting that the read failed somewhere along the line. Don't throw out the stuff we managed to read, though, |