#include <wsutil/file_util.h>
#include <epan/column-utils.h>
#include <epan/strutil.h>
-#include <epan/emem.h>
#ifdef HAVE_LIBPCAP
gboolean auto_scroll_live;
/* No frame selected, no field in that frame selected. */
cf->current_frame = NULL;
+ cf->current_row = 0;
cf->finfo_selected = NULL;
/* Clear the packet list. */
const gchar *name_ptr;
const char *errmsg;
char errmsg_errno[1024+1];
- gchar err_str[2048+1];
gint64 data_offset;
progdlg_t *volatile progbar = NULL;
gboolean stop_flag;
cf->lnk_t = wtap_file_encap(cf->wth);
cf->current_frame = cf->first_displayed;
+ cf->current_row = 0;
+
packet_list_thaw();
cf_callback_invoke(cf_cb_file_read_finished, cf);
errmsg = errmsg_errno;
break;
}
- g_snprintf(err_str, sizeof err_str, errmsg);
- simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, err_str);
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", errmsg);
return CF_READ_ERROR;
} else
return CF_READ_OK;
cf->count++;
cf->f_datalen = offset + phdr->caplen;
fdata->num = cf->count;
- row = add_packet_to_packet_list(fdata, cf, dfcode, pseudo_header, buf, TRUE);
+ if (!cf->redissecting) {
+ row = add_packet_to_packet_list(fdata, cf, dfcode, pseudo_header, buf, TRUE);
+ }
} else {
/* XXX - if we didn't have read filters, or if we could avoid
allocating the "frame_data" structure until we knew whether
int err_fileno;
int i;
char errmsg_errno[1024+1];
- gchar err_str[2048+1];
const char *errmsg;
gboolean got_read_error = FALSE, got_write_error = FALSE;
gint64 data_offset;
errmsg = errmsg_errno;
break;
}
- g_snprintf(err_str, sizeof err_str, errmsg, in_files[i].filename);
- simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, err_str);
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, errmsg, in_files[i].filename);
}
}
}
which might cause the state information to be constructed differently
by that dissector. */
+ /* We might receive new packets while redissecting, and we don't
+ want to dissect those before their time. */
+ cf->redissecting = TRUE;
+
/* Initialize all data structures used for dissection. */
init_dissection();
}
prev_frame = fdata;
}
+ /* We are done redissecting the packet list. */
+ cf->redissecting = FALSE;
+
/* Re-sort the list using the previously selected order */
packet_list_set_sort_column();
/* Either the frame that was selected passed the filter, or we've
found the nearest displayed frame to that frame. Select it, make
it the focus row, and make it visible. */
+ if (selected_row == 0) {
+ /* Set to invalid to force update of packet list and packet details */
+ cf->current_row = -1;
+ }
packet_list_set_selected_row(selected_row);
}
/* Record that this frame is the current frame. */
cf->current_frame = fdata;
+ cf->current_row = row;
/* Create the logical protocol tree. */
if (cf->edt != NULL) {
/* No packet is selected. */
cf->current_frame = NULL;
+ cf->current_row = 0;
cf_callback_invoke(cf_cb_packet_unselected, cf);