#endif
bool reverse_flow = false;
+ DEBUG_VALIDATE_BUG_ON(data == NULL && data_len > 0);
PACKET_PROFILING_APP_PD_START(app_tctx);
*alproto = AppLayerProtoDetectGetProto(app_tctx->alpd_tctx,
f, data, data_len,
-/* Copyright (C) 2007-2016 Open Information Security Foundation
+/* Copyright (C) 2007-2021 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
uint32_t mydata_len;
while (1) {
+ const uint8_t flags = StreamGetAppLayerFlags(ssn, *stream, p);
GetAppBuffer(*stream, &mydata, &mydata_len, app_progress);
DEBUG_VALIDATE_BUG_ON(mydata_len > (uint32_t)INT_MAX);
if (mydata == NULL && mydata_len > 0 && CheckGap(ssn, *stream, p)) {
return 0;
continue;
- } else if (mydata == NULL || mydata_len == 0) {
+ } else if (flags & STREAM_DEPTH) {
+ // we're just called once with this flag, so make sure we pass it on
+ if (mydata == NULL && mydata_len > 0) {
+ mydata_len = 0;
+ }
+ } else if (mydata == NULL || (mydata_len == 0)) {
/* Possibly a gap, but no new data. */
if ((p->flags & PKT_PSEUDO_STREAM_END) == 0 || ssn->state < TCP_CLOSED)
SCReturnInt(0);
mydata = NULL;
mydata_len = 0;
}
+ DEBUG_VALIDATE_BUG_ON(mydata == NULL && mydata_len > 0);
+
SCLogDebug("%"PRIu64" got %p/%u", p->pcap_cnt, mydata, mydata_len);
break;
}