lt sync 2781
This commit is contained in:
parent
abfad5f19d
commit
0ae879daf8
@ -13,16 +13,21 @@ namespace
|
|||||||
{
|
{
|
||||||
void add_rule(ip_filter& filter, std::string start, std::string end, int flags)
|
void add_rule(ip_filter& filter, std::string start, std::string end, int flags)
|
||||||
{
|
{
|
||||||
return filter.add_rule(address_v4::from_string(start), address_v4::from_string(end), flags);
|
return filter.add_rule(address::from_string(start), address::from_string(end), flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
int _access(ip_filter& filter, std::string addr)
|
||||||
|
{
|
||||||
|
return filter.access(address::from_string(addr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void bind_ip_filter()
|
void bind_ip_filter()
|
||||||
{
|
{
|
||||||
class_<ip_filter>("ip_filter")
|
class_<ip_filter>("ip_filter")
|
||||||
.def("add_rule", &add_rule)
|
.def("add_rule", add_rule)
|
||||||
.def("access", allow_threads(&ip_filter::access))
|
.def("access", _access)
|
||||||
.def_readonly("export_filter", allow_threads(&ip_filter::export_filter))
|
.def("export_filter", allow_threads(&ip_filter::export_filter))
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -336,7 +336,7 @@ void http_connection::callback(error_code const& e, char const* data, int size)
|
|||||||
if (!m_bottled || !m_called)
|
if (!m_bottled || !m_called)
|
||||||
{
|
{
|
||||||
std::vector<char> buf;
|
std::vector<char> buf;
|
||||||
if (m_bottled && m_parser.finished())
|
if (m_bottled && m_parser.header_finished())
|
||||||
{
|
{
|
||||||
std::string const& encoding = m_parser.header("content-encoding");
|
std::string const& encoding = m_parser.header("content-encoding");
|
||||||
if (encoding == "gzip" || encoding == "x-gzip")
|
if (encoding == "gzip" || encoding == "x-gzip")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user