]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
m_spanningtree Add TreeSocket::WriteLineNoCompat() to send a line without doing any...
authorAttila Molnar <attilamolnar@hush.com>
Sun, 27 Jul 2014 16:37:39 +0000 (18:37 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Sun, 27 Jul 2014 16:37:39 +0000 (18:37 +0200)
src/modules/m_spanningtree/compat.cpp
src/modules/m_spanningtree/treesocket.h

index 9cd081e1e770dbb682ea1abe6f7acb798e84f883..83ad77414371a0d476d059209c8f4f11544a4cd4 100644 (file)
 
 static std::string newline("\n");
 
+void TreeSocket::WriteLineNoCompat(const std::string& line)
+{
+       ServerInstance->Logs->Log(MODNAME, LOG_RAWIO, "S[%d] O %s", this->GetFd(), line.c_str());
+       this->WriteData(line);
+       this->WriteData(newline);
+}
+
 void TreeSocket::WriteLine(const std::string& original_line)
 {
        if (LinkState == CONNECTED)
@@ -275,16 +282,12 @@ void TreeSocket::WriteLine(const std::string& original_line)
                                        line.insert(c, " * 0");
                                }
                        }
-                       ServerInstance->Logs->Log(MODNAME, LOG_RAWIO, "S[%d] O %s", this->GetFd(), line.c_str());
-                       this->WriteData(line);
-                       this->WriteData(newline);
+                       WriteLineNoCompat(line);
                        return;
                }
        }
 
-       ServerInstance->Logs->Log(MODNAME, LOG_RAWIO, "S[%d] O %s", this->GetFd(), original_line.c_str());
-       this->WriteData(original_line);
-       this->WriteData(newline);
+       WriteLineNoCompat(original_line);
 }
 
 namespace
index bee8b30692b09d747e3790479121dff161947058..2a47da39bcdc05d8af6986ca2781fe63af181615 100644 (file)
@@ -148,6 +148,11 @@ class TreeSocket : public BufferedSocket
         */
        Link* AuthRemote(const parameterlist& params);
 
+       /** Write a line on this socket with a new line character appended, skipping all translation for old protocols
+        * @param line Line to write without a new line character at the end
+        */
+       void WriteLineNoCompat(const std::string& line);
+
  public:
        const time_t age;