~ubuntu-branches/ubuntu/oneiric/inspircd/oneiric-security

« back to all changes in this revision

Viewing changes to src/modules/m_spanningtree/treesocket1.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2008-11-15 20:39:50 UTC
  • mfrom: (1.1.4 upstream) (3.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20081115203950-uv1pf98x2vkon7se
Tags: 1.1.21+dfsg-1ubuntu1
* Merge from debian unstable, remaining changes: (LP: #298418)
  - debian/patches/04_include-limits-h.dpatch:
    + Explicitly include limits.h for gcc 4.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
225
225
                                Utils->DoFailOver(MyLink);
226
226
                break;
227
227
                case I_ERR_SOCKET:
228
 
                        Utils->Creator->RemoteMessage(NULL,"Connection failed: Could not create socket");
 
228
                        Utils->Creator->RemoteMessage(NULL,"Connection failed: Could not create socket (%s)", strerror(errno));
229
229
                break;
230
230
                case I_ERR_BIND:
231
 
                        Utils->Creator->RemoteMessage(NULL,"Connection failed: Error binding socket to address or port");
 
231
                        Utils->Creator->RemoteMessage(NULL,"Connection failed: Error binding socket to address or port (%s)", strerror(errno));
232
232
                break;
233
233
                case I_ERR_WRITE:
234
 
                        Utils->Creator->RemoteMessage(NULL,"Connection failed: I/O error on connection");
 
234
                        Utils->Creator->RemoteMessage(NULL,"Connection failed: I/O error on connection (%s)", strerror(errno));
235
235
                break;
236
236
                case I_ERR_NOMOREFDS:
237
237
                        Utils->Creator->RemoteMessage(NULL,"Connection failed: Operating system is out of file descriptors!");
728
728
        {
729
729
                if ((ts >= c->topicset) || (!*c->topic))
730
730
                {
731
 
                        std::string oldtopic = c->topic;
732
 
                        strlcpy(c->topic,params[3].c_str(),MAXTOPIC);
733
 
                        strlcpy(c->setby,params[2].c_str(),127);
734
 
                        c->topicset = ts;
735
 
                        /* if the topic text is the same as the current topic,
736
 
                         * dont bother to send the TOPIC command out, just silently
737
 
                         * update the set time and set nick.
738
 
                         */
739
 
                        if (oldtopic != params[3])
 
731
                        userrec* user = this->Instance->FindNick(source);
 
732
 
 
733
                        if (c->topic != params[3])
740
734
                        {
741
 
                                userrec* user = this->Instance->FindNick(source);
 
735
                                // Update topic only when it differs from current topic
 
736
                                strlcpy(c->topic, params[3].c_str(), MAXTOPIC);
 
737
 
742
738
                                if (!user)
743
739
                                {
744
740
                                        c->WriteChannelWithServ(Instance->Config->ServerName, "TOPIC %s :%s", c->name, c->topic);
746
742
                                else
747
743
                                {
748
744
                                        c->WriteChannel(user, "TOPIC %s :%s", c->name, c->topic);
749
 
                                        nsource = user->server;
750
745
                                }
751
746
                        }
752
747
 
 
748
                        // But always update set time and setter
 
749
                        strlcpy(c->setby, params[2].c_str(), 127);
 
750
                        c->topicset = ts;
 
751
 
 
752
                        /*
 
753
                         * Take careful note of what happens here;
 
754
                         * Above, we display the topic change to the server IF the topic incoming is different to the topic already set.
 
755
                         * HERE, we find the server the user that sent this topic is on, so we *do not* send topics back to the link they just
 
756
                         * came from. This *cannot* be easily merged with the above check!
 
757
                         *
 
758
                         * Thanks to Anope and Namegduf for finally helping me isolate this
 
759
                         *                      -- w00t (5th/aug/2008)
 
760
                         */
 
761
                        if (user)
 
762
                        {
 
763
                                nsource = user->server;
 
764
                        }
 
765
 
753
766
                        /* all done, send it on its way */
754
767
                        params[3] = ":" + params[3];
755
768
                        Utils->DoOneToAllButSender(source,"FTOPIC",params,nsource);