From jmmikkel@mit.edu (Bug 2895):
We might receive new packets while redissecting and don't want to dissect those before the packet-list is fully rebuilt. svn path=/trunk/; revision=26309
This commit is contained in:
parent
aa30dcd129
commit
2ce22e6bca
1
cfile.c
1
cfile.c
|
@ -55,4 +55,5 @@ init_cap_file(capture_file *cf)
|
||||||
cf->snap = WTAP_MAX_PACKET_SIZE;
|
cf->snap = WTAP_MAX_PACKET_SIZE;
|
||||||
cf->count = 0;
|
cf->count = 0;
|
||||||
cf->pstats = NULL;
|
cf->pstats = NULL;
|
||||||
|
cf->redissecting = FALSE;
|
||||||
}
|
}
|
||||||
|
|
1
cfile.h
1
cfile.h
|
@ -61,6 +61,7 @@ typedef struct _capture_file {
|
||||||
wtap *wth; /* Wiretap session */
|
wtap *wth; /* Wiretap session */
|
||||||
dfilter_t *rfcode; /* Compiled read (display) filter program */
|
dfilter_t *rfcode; /* Compiled read (display) filter program */
|
||||||
gchar *dfilter; /* Display filter string */
|
gchar *dfilter; /* Display filter string */
|
||||||
|
gboolean redissecting; /* TRUE if currently redissecting (cf_redissect_packets) */
|
||||||
/* search */
|
/* search */
|
||||||
gchar *sfilter; /* Search filter string */
|
gchar *sfilter; /* Search filter string */
|
||||||
gboolean sbackward; /* TRUE if search is backward, FALSE if forward */
|
gboolean sbackward; /* TRUE if search is backward, FALSE if forward */
|
||||||
|
|
11
file.c
11
file.c
|
@ -1122,7 +1122,9 @@ read_packet(capture_file *cf, dfilter_t *dfcode, gint64 offset)
|
||||||
cf->count++;
|
cf->count++;
|
||||||
cf->f_datalen = offset + phdr->caplen;
|
cf->f_datalen = offset + phdr->caplen;
|
||||||
fdata->num = cf->count;
|
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 {
|
} else {
|
||||||
/* XXX - if we didn't have read filters, or if we could avoid
|
/* XXX - if we didn't have read filters, or if we could avoid
|
||||||
allocating the "frame_data" structure until we knew whether
|
allocating the "frame_data" structure until we knew whether
|
||||||
|
@ -1515,6 +1517,10 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item,
|
||||||
which might cause the state information to be constructed differently
|
which might cause the state information to be constructed differently
|
||||||
by that dissector. */
|
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. */
|
/* Initialize all data structures used for dissection. */
|
||||||
init_dissection();
|
init_dissection();
|
||||||
}
|
}
|
||||||
|
@ -1661,6 +1667,9 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item,
|
||||||
prev_frame = fdata;
|
prev_frame = fdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* We are done redissecting the packet list. */
|
||||||
|
cf->redissecting = FALSE;
|
||||||
|
|
||||||
/* Re-sort the list using the previously selected order */
|
/* Re-sort the list using the previously selected order */
|
||||||
packet_list_set_sort_column();
|
packet_list_set_sort_column();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue