id:1258808
pattern:\x06\x62\x68\x69\x66\x72\x69\x03\x63\x6F\x6D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
flag :0
for (size_t i = 0; i < packets.size(); ++i) {
const std::string pkt = packets[i];
err = hs_scan(database, pkt.c_str(), pkt.length(), 0,
scratch, onMatch, &matchCount);
if (err != HS_SUCCESS) {
cerr << "ERROR: Unable to scan packet. Exiting." << endl;
exit(-1);
}
}
I am wondering where is my problem, and how to short the run time?
I figured out the problem, the cause of the slow is because I mixed too many different patterns of flags in my database. So I split the pattern by different flags, and it works amazingly. Thank u guys.