updates to ac-gfbs search. Handle cases where we have a single entry for a state goto transition, just like how we handle for no entry for a particular state

remotes/origin/master-1.2.x
Anoop Saldanha 14 years ago committed by Victor Julien
parent 9b75de3339
commit e9eb0e502c

@ -1280,6 +1280,14 @@ uint32_t SCACGfbsSearch(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx,
if (no_of_entries[0] == 0) {
temp_state = SC_AC_GFBS_FAIL;
} else {
if (no_of_entries[0] == 1) {
ascii_codes = no_of_entries + 1;
buf_local = u8_tolower(buf[i]);
if (buf_local == ascii_codes[0])
temp_state = ((SC_AC_GFBS_STATE_TYPE_U32 *)(ascii_codes + no_of_entries[0]))[0];
else
temp_state = SC_AC_GFBS_FAIL;
} else {
ascii_codes = no_of_entries + 1;
buf_local = u8_tolower(buf[i]);
if (state == 0) {
@ -1301,6 +1309,7 @@ uint32_t SCACGfbsSearch(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx,
}
}
}
}
}
while (temp_state == SC_AC_GFBS_FAIL) {
state = failure_table[state];
@ -1310,6 +1319,14 @@ uint32_t SCACGfbsSearch(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx,
if (no_of_entries[0] == 0) {
temp_state = SC_AC_GFBS_FAIL;
} else {
if (no_of_entries[0] == 1) {
ascii_codes = no_of_entries + 1;
buf_local = u8_tolower(buf[i]);
if (buf_local == ascii_codes[0])
temp_state = ((SC_AC_GFBS_STATE_TYPE_U32 *)(ascii_codes + no_of_entries[0]))[0];
else
temp_state = SC_AC_GFBS_FAIL;
} else {
ascii_codes = no_of_entries + 1;
buf_local = u8_tolower(buf[i]);
if (state == 0) {
@ -1331,6 +1348,7 @@ uint32_t SCACGfbsSearch(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx,
}
}
}
}
} /* else - if (no_of_entries[0] == 0) */
} /* while (temp_state == SC_AC_GFBS_FAIL) */
state = temp_state;

Loading…
Cancel
Save