]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix bug #291 - fix rehashing bind tags not changing them between servers/clients...
authorAdam <Adam@anope.org>
Wed, 12 Sep 2012 20:56:47 +0000 (16:56 -0400)
committerAdam <Adam@anope.org>
Wed, 12 Sep 2012 20:56:47 +0000 (16:56 -0400)
include/base.h
include/socket.h
src/socket.cpp

index 45c60802c7454f85c46d5af7aeead636710cac2d..230ed1db4f81f02a35816c849aa07ac19015bd3d 100644 (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; }
index 16809c3f81988bd75da2dcae0819348d5fc56f4a..e868af93e7ee14f2a23804eab1fdd3224c6a7f14 100644 (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 */
index 98ff3e00cccf80146eec50d8e3f39336f0978bf2..8c7ec97d85d5c4d5c1b02ae50553b34d95708e6e 100644 (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;