Merge pull request #301 from Adam-/insp20+bindrehash

Fix bug #291 - fix rehashing bind tags not changing them between servers/clients and ssl/nonssl
This commit is contained in:
Attila Molnar 2012-09-13 08:32:18 -07:00
commit 35ce47718b
3 changed files with 17 additions and 1 deletions

View File

@ -142,6 +142,21 @@ class CoreExport reference
if (value && value->refcount_dec())
delete value;
}
inline reference<T>& operator=(T* other)
{
if (value != other)
{
if (value && value->refcount_dec())
delete value;
value = other;
if (value)
value->refcount_inc();
}
return *this;
}
inline operator bool() const { return value; }
inline operator T*() const { return value; }
inline T* operator->() const { return value; }

View File

@ -146,7 +146,7 @@ namespace irc
class CoreExport ListenSocket : public EventHandler
{
public:
const reference<ConfigTag> bind_tag;
reference<ConfigTag> bind_tag;
std::string bind_addr;
int bind_port;
/** Human-readable bind description */

View File

@ -105,6 +105,7 @@ int InspIRCd::BindPorts(FailedPortList &failed_ports)
{
if ((**n).bind_desc == bind_readable)
{
(*n)->bind_tag = tag; // Replace tag, we know addr and port match, but other info (type, ssl) may not
skip = true;
old_ports.erase(n);
break;