stream: optimize proto detect segment handling

In case of protocol detection not yet being complete, the segment
list was walked unconditionally to unset the app layer processed
flag. Optimize this to bail on the first segment that doesn't have
the flag set.
pull/1652/head
Victor Julien 10 years ago
parent 84fd28eaed
commit 708e80c900

@ -3035,6 +3035,8 @@ int StreamTcpReassembleAppLayer (ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx,
} else {
TcpSegment *tmp_seg = stream->seg_list;
while (tmp_seg != NULL) {
if (!(tmp_seg->flags & SEGMENTTCP_FLAG_APPLAYER_PROCESSED))
break;
tmp_seg->flags &= ~SEGMENTTCP_FLAG_APPLAYER_PROCESSED;
tmp_seg = tmp_seg->next;
}

Loading…
Cancel
Save