summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-10-06 00:55:21 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-10-06 00:55:21 +0000
commitbb5e5d6ce10fe015e1c7aabcca8c51d097b5c789 (patch)
tree433f89941372c48953ab394a1dda36da8b645606 /file.c
parent70d49795575878ccb1f4a48536243866ba6a61ef (diff)
downloadwireshark-bb5e5d6ce10fe015e1c7aabcca8c51d097b5c789.tar.gz
fix a packet_list_freeze / thaw pair, if a return comes in it's way
add a g_warning() call if an error occured while reading from capture file (while doing a live update), usually shouldn't happen but is difficult to debug *if* it happens add a new log domain LOG_DOMAIN_MAIN and the standard log handler for it add some (partly commented out) g_log() calls, useful for GUI sequence debugging svn path=/trunk/; revision=16136
Diffstat (limited to 'file.c')
-rw-r--r--file.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/file.c b/file.c
index cdab76a8e8..a555092ec1 100644
--- a/file.c
+++ b/file.c
@@ -554,6 +554,8 @@ cf_continue_tail(capture_file *cf, int to_read, int *err)
packet_list_freeze();
+ /*g_log(NULL, G_LOG_LEVEL_MESSAGE, "cf_continue_tail: %u new: %u", cf->count, to_read);*/
+
while (to_read != 0 && (wtap_read(cf->wth, err, &err_info, &data_offset))) {
if (cf->state == FILE_READ_ABORTED) {
/* Well, the user decided to exit Ethereal. Break out of the
@@ -565,6 +567,9 @@ cf_continue_tail(capture_file *cf, int to_read, int *err)
to_read--;
}
+ /*g_log(NULL, G_LOG_LEVEL_MESSAGE, "cf_continue_tail: count %u state: %u err: %u",
+ cf->count, cf->state, *err);*/
+
/* XXX - this cheats and looks inside the packet list to find the final
row number. */
if (auto_scroll_live && cf->plist_end != NULL)
@@ -581,7 +586,10 @@ cf_continue_tail(capture_file *cf, int to_read, int *err)
return CF_READ_ABORTED;
} else if (*err != 0) {
/* We got an error reading the capture file.
- XXX - pop up a dialog box? */
+ XXX - pop up a dialog box instead? */
+ g_warning("Error \"%s\" while reading: \"%s\"\n",
+ wtap_strerror(*err), cf->filename);
+
return CF_READ_ERROR;
} else
return CF_READ_OK;
@@ -610,6 +618,8 @@ cf_finish_tail(capture_file *cf, int *err)
read_packet(cf, data_offset);
}
+ packet_list_thaw();
+
if (cf->state == FILE_READ_ABORTED) {
/* Well, the user decided to abort the read. We're only called
when the child capture process closes the pipe to us (meaning
@@ -620,7 +630,6 @@ cf_finish_tail(capture_file *cf, int *err)
return CF_READ_ABORTED;
}
- packet_list_thaw();
if (auto_scroll_live && cf->plist_end != NULL)
/* XXX - this cheats and looks inside the packet list to find the final
row number. */