// Now, remove the last ')' and anything beyond. We will automatically
// add that part back when printing each rule.
- std::streamoff curr_pos = data_stream.tellg();
+ const std::istringstream::off_type curr_pos = data_stream.tellg();
std::string rule_string = data_stream.str();
std::size_t end_pos = rule_string.rfind(')');
rule_string = rule_string.substr(0, end_pos);
std::string Frag3Engine::choose_table_name(std::istringstream& data_stream)
{
static uint32_t binding_id = 0;
- const std::streamoff pos = data_stream.tellg();
+ const std::istringstream::off_type pos = data_stream.tellg();
std::string keyword;
while (data_stream >> keyword)
{
if (!keyword.compare("bind_to"))
{
- data_stream.seekg(pos);
data_stream.clear();
+ data_stream.seekg(pos);
return "stream_ip_" + std::to_string(binding_id++);
}
}
- data_stream.seekg(pos);
data_stream.clear();
+ data_stream.seekg(pos);
return "stream_ip";
}
else
{
+ data_stream.clear();
data_stream.seekg(pos);
break;
}
if (args.find(":") != std::string::npos)
{
rule_api.add_option("base64_decode");
+ data_stream.clear();
data_stream.seekg(pos);
}
else
}
else
{
+ data_stream.clear();
data_stream.seekg(pos);
rule_api.add_option("base64_decode");
}
// since this option is not an content modifier,
// lets coninue parsing the rest of the rule.
- data_stream.seekg(pos);
data_stream.clear();
+ data_stream.seekg(pos);
return set_next_rule_state(data_stream);
}
// Therefore, if a colon is present, we are in the next rule option.
if (args.find(":") != std::string::npos)
{
+ data_stream.clear();
data_stream.seekg(pos);
}
else
std::istringstream(args) >> tmp;
if (!tmp.compare("mime"))
+ {
rule_api.add_comment("file_data's 'mime' option has been deleted");
+ }
else
+ {
+ data_stream.clear();
data_stream.seekg(pos);
+ }
}
}
return set_next_rule_state(data_stream);
{
std::string args;
std::string tmp;
- std::streamoff pos = data_stream.tellg();
+ std::istringstream::off_type pos = data_stream.tellg();
args = util::get_rule_option_args(data_stream);
// Therefore, if a colon is present, we are in the next rule option.
if (args.find(":") != std::string::npos)
{
+ data_stream.clear();
data_stream.seekg(pos);
}
else
}
else
{
+ data_stream.clear();
data_stream.seekg(pos);
}
}
// save the current position
- const std::streamoff curr_pos = data_stream.tellg();
+ const std::istringstream::off_type curr_pos = data_stream.tellg();
if (curr_pos == -1)
data_stream.clear();
{
// found an option without a colon, so set stream
// to semi-colon
- std::streamoff off = 1 + (std::streamoff)(tmp_pos) +
- (std::streamoff)(semi_colon_pos);
+ std::istringstream::off_type off = 1 +
+ (std::streamoff)(tmp_pos) + (std::streamoff)(semi_colon_pos);
data_stream.seekg(off);
rule_keyword = rule_keyword.substr(0, semi_colon_pos);
}