stream: use reassembly fast path after proto detect

Use the reassembly fast paths only after protocol detection has completed.
In some corner cases the sending of smaller segments lead to protocol
detection failing.
pull/1652/head
Victor Julien 10 years ago
parent 34ed15e182
commit 596465b76d

@ -2620,6 +2620,12 @@ static inline int DoReassemble(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx,
TcpSession *ssn, TcpStream *stream, TcpSegment *seg, ReassembleData *rd,
Packet *p)
{
/* fast paths: send data directly into the app layer, w/o first doing
* a copy step. However, don't use the fast path until protocol detection
* has been completed
* TODO if initial data is big enough for proto detect, we could do the
* fast path anyway. */
if (stream->flags & STREAMTCP_STREAM_FLAG_APPPROTO_DETECTION_COMPLETED) {
/* fast path 1: segment is exactly what we need */
if (likely(rd->data_len == 0 &&
SEQ_EQ(seg->seq, rd->ra_base_seq+1) &&
@ -2666,6 +2672,7 @@ static inline int DoReassemble(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx,
}
return 1;
}
}
#ifdef DEBUG
ra_ctx->sp++;
#endif

Loading…
Cancel
Save