"stream.reassembly_depth_reached",
STREAM_REASSEMBLY_DEPTH_REACHED,
},
+ {
+ "stream.reassembly_insert_memcap",
+ STREAM_REASSEMBLY_INSERT_MEMCAP,
+ },
+ {
+ "stream.reassembly_insert_limit",
+ STREAM_REASSEMBLY_INSERT_LIMIT,
+ },
+ {
+ "stream.reassembly_insert_invalid",
+ STREAM_REASSEMBLY_INSERT_INVALID,
+ },
{ NULL, 0 },
};
STREAM_REASSEMBLY_SEQ_GAP,
STREAM_REASSEMBLY_OVERLAP_DIFFERENT_DATA,
STREAM_REASSEMBLY_DEPTH_REACHED,
+ STREAM_REASSEMBLY_INSERT_MEMCAP,
+ STREAM_REASSEMBLY_INSERT_LIMIT,
+ STREAM_REASSEMBLY_INSERT_INVALID,
/* should always be last! */
DECODE_EVENT_MAX,
int ret = StreamingBufferInsertAt(&stream->sb, &stream_config.sbcnf, &seg->sbseg,
data + data_offset, data_len - data_offset, stream_offset);
- if (ret != 0) {
- /* StreamingBufferInsertAt can return -2 only if the offset is wrong, which should be
- * impossible in this path. */
- DEBUG_VALIDATE_BUG_ON(ret != -1);
- SCReturnInt(SC_ENOMEM);
+ if (ret != SC_OK) {
+ SCReturnInt(ret);
}
#ifdef DEBUG
{
if (res != SC_OK) {
if (res == SC_ENOMEM) {
StatsIncr(tv, ra_ctx->counter_tcp_segment_memcap);
+ StreamTcpSetEvent(p, STREAM_REASSEMBLY_INSERT_MEMCAP);
+ } else if (res == SC_ELIMIT) {
+ StreamTcpSetEvent(p, STREAM_REASSEMBLY_INSERT_LIMIT);
+ } else if (res == SC_EINVAL) {
+ StreamTcpSetEvent(p, STREAM_REASSEMBLY_INSERT_INVALID);
+ } else {
+ DEBUG_VALIDATE_BUG_ON(1);
}
return -1;
}