Account for seg list not always being empty when stream closes.

remotes/origin/master-1.1.x
Victor Julien 15 years ago
parent ecfa2d0176
commit 8faacb727d

@ -2617,7 +2617,13 @@ static int StreamTcpReassembleAppLayer (TcpReassemblyThreadCtx *ra_ctx,
PrintList(stream->seg_list); PrintList(stream->seg_list);
#endif #endif
if (stream->seg_list == NULL) { /* if no segments are in the list or all are already processed,
* and state is beyond established, we send an empty msg */
TcpSegment *seg_tail = stream->seg_list_tail;
if (seg_tail == NULL ||
(seg_tail->flags & SEGMENTTCP_FLAG_RAW_PROCESSED &&
seg_tail->flags & SEGMENTTCP_FLAG_APPLAYER_PROCESSED))
{
/* send an empty EOF msg if we have no segments but TCP state /* send an empty EOF msg if we have no segments but TCP state
* is beyond ESTABLISHED */ * is beyond ESTABLISHED */
if (ssn->state > TCP_ESTABLISHED) { if (ssn->state > TCP_ESTABLISHED) {
@ -2631,13 +2637,17 @@ static int StreamTcpReassembleAppLayer (TcpReassemblyThreadCtx *ra_ctx,
* release reassembly for both directions. */ * release reassembly for both directions. */
ssn->flags |= STREAMTCP_FLAG_TOSERVER_REASSEMBLY_STARTED; ssn->flags |= STREAMTCP_FLAG_TOSERVER_REASSEMBLY_STARTED;
} else { SCReturnInt(0);
SCLogDebug("no segments in the list to reassemble");
} }
}
/* no segments, nothing to do */
if (stream->seg_list == NULL) {
SCLogDebug("no segments in the list to reassemble");
SCReturnInt(0); SCReturnInt(0);
} }
/* check if reassembling has been paused for the moment or not */ /* check if reassembling has been paused for the moment or not */
if (stream->flags & STREAMTCP_STREAM_FLAG_PAUSE_REASSEMBLY) { if (stream->flags & STREAMTCP_STREAM_FLAG_PAUSE_REASSEMBLY) {
SCLogDebug("reassembling has been paused for this stream, so no" SCLogDebug("reassembling has been paused for this stream, so no"

Loading…
Cancel
Save