From b406af451bbdaeb6b06b834461bb34cf7e82db92 Mon Sep 17 00:00:00 2001 From: Anoop Saldanha Date: Sun, 16 Oct 2011 00:15:11 +0530 Subject: [PATCH] updates to http tx id vars. FFR now flags the app layer session for EOF when creating a pseudo packet for a flow --- src/app-layer-htp.c | 4 +++- src/app-layer-parser.c | 2 +- src/app-layer-parser.h | 1 + src/flow-timeout.c | 6 ++++++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/app-layer-htp.c b/src/app-layer-htp.c index c4a5607caf..91e37a34f7 100644 --- a/src/app-layer-htp.c +++ b/src/app-layer-htp.c @@ -787,7 +787,6 @@ static int HTPCallbackRequest(htp_connp_t *connp) { SCReturnInt(HOOK_ERROR); } - hstate->transaction_cnt++; SCLogDebug("transaction_cnt %"PRIu16", list_size %"PRIuMAX, hstate->transaction_cnt, (uintmax_t)list_size(hstate->connp->conn->transactions)); @@ -811,6 +810,9 @@ static int HTPCallbackResponse(htp_connp_t *connp) { SCReturnInt(HOOK_ERROR); } + /* we have one whole transaction now */ + hstate->transaction_cnt++; + /* Unset the body inspection (if any) */ hstate->flags &=~ HTP_FLAG_NEW_BODY_SET; diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index 249fa42301..cad5560b23 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -56,7 +56,7 @@ #include "util-debug.h" -static uint16_t app_layer_sid = 0; +uint16_t app_layer_sid = 0; static AppLayerProto al_proto_table[ALPROTO_MAX]; /**< Application layer protocol table mapped to their corresponding parsers */ diff --git a/src/app-layer-parser.h b/src/app-layer-parser.h index 5ec859ea84..b5fb252f1d 100644 --- a/src/app-layer-parser.h +++ b/src/app-layer-parser.h @@ -211,6 +211,7 @@ AppLayerProbingParserInfo *AppLayerGetProbingParserInfo(AppLayerProbingParserInf return NULL; } +extern uint16_t app_layer_sid; struct AlpProtoDetectCtx_; diff --git a/src/flow-timeout.c b/src/flow-timeout.c index 6caabce4c5..9a0ca9a93a 100644 --- a/src/flow-timeout.c +++ b/src/flow-timeout.c @@ -214,6 +214,12 @@ 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; + } + return p; }