TRANSUM: File loading slow with transum enabled

This change improves performance through better handling of SYN -
SYN/ACK pairs.

Bug: 14094
Change-Id: Ie479f1b69fa48f85a2ed9f8f173533db25582bbd
Reviewed-on: https://code.wireshark.org/review/24090
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Paul Offord 2017-10-26 23:08:43 +01:00 committed by Michael Mann
parent 4e4f1debb7
commit 1ceab868cd
2 changed files with 19 additions and 10 deletions

View File

@ -22,7 +22,7 @@
include(WiresharkPlugin)
# Plugin name and version info (major minor micro extra)
set_module_info(transum 2 0 3 0)
set_module_info(transum 2 0 4 0)
set(DISSECTOR_SRC
packet-transum.c

View File

@ -269,6 +269,10 @@ static RRPD *find_latest_rrpd(RRPD *in_rrpd, int state)
RRPD *rrpd_index = NULL, *rrpd;
wmem_list_frame_t* i;
/* If this is a SYN from C2S there is no point searching the list */
if (in_rrpd->c2s && in_rrpd->calculation == RTE_CALC_SYN)
return NULL;
for (i = wmem_list_tail(rrpd_list); i != NULL; i = wmem_list_frame_prev(i))
{
rrpd = (RRPD*)wmem_list_frame_data(i);
@ -495,18 +499,23 @@ static void update_rrpd_list_entry_req(RRPD *in_rrpd)
{
while (TRUE)
{
match = find_latest_rrpd(in_rrpd, RRPD_STATE_1);
if (match != NULL) /* Check to cover TCP Reassembly enabled */
if (preferences.reassembly)
{
update_rrpd_list_entry(match, in_rrpd);
break;
match = find_latest_rrpd(in_rrpd, RRPD_STATE_1);
if (match != NULL) /* Check to cover TCP Reassembly enabled */
{
update_rrpd_list_entry(match, in_rrpd);
break;
}
}
match = find_latest_rrpd(in_rrpd, RRPD_STATE_4);
if (match != NULL)
else
{
update_rrpd_list_entry(match, in_rrpd);
break;
match = find_latest_rrpd(in_rrpd, RRPD_STATE_4);
if (match != NULL)
{
update_rrpd_list_entry(match, in_rrpd);
break;
}
}
/* No entries and so add one */