diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index cad5560b23..7b2c23aa11 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -56,7 +56,7 @@ #include "util-debug.h" -uint16_t app_layer_sid = 0; +static uint16_t app_layer_sid = 0; static AppLayerProto al_proto_table[ALPROTO_MAX]; /**< Application layer protocol table mapped to their corresponding parsers */ @@ -174,6 +174,17 @@ static int AlpStoreField(AppLayerParserResult *output, uint16_t idx, SCReturnInt(0); } +void AppLayerSetEOF(Flow *f) +{ + AppLayerParserStateStore *parser_state_store = + (AppLayerParserStateStore *)f->aldata[app_layer_sid]; + if (parser_state_store != NULL) { + parser_state_store->id_flags |= APP_LAYER_TRANSACTION_EOF; + parser_state_store->to_client.flags |= APP_LAYER_PARSER_EOF; + parser_state_store->to_server.flags |= APP_LAYER_PARSER_EOF; + } +} + /** \brief Parse a field up to we reach the size limit * * \retval 1 Field found and stored. diff --git a/src/app-layer-parser.h b/src/app-layer-parser.h index b5fb252f1d..2cc24eeadb 100644 --- a/src/app-layer-parser.h +++ b/src/app-layer-parser.h @@ -251,6 +251,7 @@ int AlpParseFieldByDelimiter(AppLayerParserResult *, AppLayerParserState *, uint16_t, const uint8_t *, uint8_t, uint8_t *, uint32_t, uint32_t *); uint16_t AlpGetStateIdx(uint16_t); +void AppLayerSetEOF(Flow *); uint16_t AppLayerGetProtoByName(const char *); diff --git a/src/flow-timeout.c b/src/flow-timeout.c index 9a0ca9a93a..ee12722469 100644 --- a/src/flow-timeout.c +++ b/src/flow-timeout.c @@ -214,11 +214,7 @@ static inline Packet *FlowForceReassemblyPseudoPacketSetup(Packet *p, memset(&p->ts, 0, sizeof(struct timeval)); TimeGet(&p->ts); - AppLayerParserStateStore *parser_state_store = - (AppLayerParserStateStore *)f->aldata[app_layer_sid]; - if (parser_state_store != NULL) { - parser_state_store->id_flags |= APP_LAYER_TRANSACTION_EOF; - } + AppLayerSetEOF(f); return p; }