streaming: small code cleanup

pull/2737/head
Victor Julien 9 years ago
parent 30a8b2def0
commit 888ed9db0d

@ -151,24 +151,27 @@ static int HttpBodyIterator(Flow *f, int close, void *cbdata, uint8_t iflags)
SCLogDebug("called with %p, %d, %p, %02x", f, close, cbdata, iflags);
HtpState *s = f->alstate;
if (s != NULL && s->conn != NULL) {
int tx_progress_done_value_ts =
if (s == NULL || s->conn == NULL) {
return 0;
}
const int tx_progress_done_value_ts =
AppLayerParserGetStateProgressCompletionStatus(ALPROTO_HTTP,
STREAM_TOSERVER);
int tx_progress_done_value_tc =
const int tx_progress_done_value_tc =
AppLayerParserGetStateProgressCompletionStatus(ALPROTO_HTTP,
STREAM_TOCLIENT);
const uint64_t total_txs = AppLayerParserGetTxCnt(f, f->alstate);
// for each tx
uint64_t tx_id = 0;
const uint64_t total_txs = AppLayerParserGetTxCnt(f, f->alstate);
SCLogDebug("s->conn %p", s->conn);
for (tx_id = 0; tx_id < total_txs; tx_id++) { // TODO optimization store log tx
htp_tx_t *tx = AppLayerParserGetTx(f->proto, f->alproto, f->alstate, tx_id);
if (tx != NULL) {
if (tx == NULL) {
continue;
}
int tx_done = 0;
int tx_logged = 0;
int tx_progress_ts = AppLayerParserGetStateProgress(
IPPROTO_TCP, ALPROTO_HTTP, tx, FlowGetDisruptionFlags(f, STREAM_TOSERVER));
if (tx_progress_ts >= tx_progress_done_value_ts) {
@ -240,10 +243,6 @@ static int HttpBodyIterator(Flow *f, int close, void *cbdata, uint8_t iflags)
}
}
}
}
}
return 0;
}

Loading…
Cancel
Save