summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/compat.cpp15
-rw-r--r--src/modules/m_spanningtree/treesocket.h5
2 files changed, 14 insertions, 6 deletions
diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp
index 9cd081e1e..83ad77414 100644
--- a/src/modules/m_spanningtree/compat.cpp
+++ b/src/modules/m_spanningtree/compat.cpp
@@ -24,6 +24,13 @@
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
diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h
index bee8b3069..2a47da39b 100644
--- a/src/modules/m_spanningtree/treesocket.h
+++ b/src/modules/m_spanningtree/treesocket.h
@@ -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;