namespace
{
- std::set<FlashPDSocket*> sockets;
+ insp::intrusive_list<FlashPDSocket> sockets;
std::string policy_reply;
const std::string expected_request("<policy-file-request/>\0", 23);
}
-class FlashPDSocket : public BufferedSocket, public Timer
+class FlashPDSocket : public BufferedSocket, public Timer, public insp::intrusive_list_node<FlashPDSocket>
{
/** True if this object is in the cull list
*/
if (policy_reply.empty())
return MOD_RES_DENY;
- sockets.insert(new FlashPDSocket(nfd, timeout));
+ sockets.push_front(new FlashPDSocket(nfd, timeout));
return MOD_RES_ALLOW;
}
void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
{
ConfigTag* tag = ServerInstance->Config->ConfValue("flashpolicyd");
- timeout = tag->getInt("timeout", 5, 1);
+ timeout = tag->getDuration("timeout", 5, 1);
std::string file = tag->getString("file");
if (!file.empty())
if (ls->bind_tag->getString("type", "clients") != "clients" || ls->bind_tag->getString("ssl", "plaintext") != "plaintext")
continue;
- to_ports.append(ConvToStr(ls->bind_port)).push_back(',');
+ to_ports.append(ConvToStr(ls->bind_sa.port())).push_back(',');
}
if (to_ports.empty())
</cross-domain-policy>";
}
- CullResult cull()
+ CullResult cull() CXX11_OVERRIDE
{
- for (std::set<FlashPDSocket*>::const_iterator i = sockets.begin(); i != sockets.end(); ++i)
+ for (insp::intrusive_list<FlashPDSocket>::const_iterator i = sockets.begin(); i != sockets.end(); ++i)
{
FlashPDSocket* sock = *i;
sock->AddToCull();