diff options
-rw-r--r-- | src/inspsocket.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_spanningtree/compat.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket1.cpp | 2 |
3 files changed, 11 insertions, 1 deletions
diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index 964582062..1f0aa5629 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -296,6 +296,12 @@ void StreamSocket::DoWrite() void StreamSocket::WriteData(const std::string &data) { + if (fd < 0) + { + ServerInstance->Logs->Log("SOCKET", DEBUG, "Attempt to write data to dead socket: %s", + data.c_str()); + return; + } bool newWrite = sendq.empty() && !data.empty(); /* Append the data to the back of the queue ready for writing */ diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp index 71272edec..94c797bfd 100644 --- a/src/modules/m_spanningtree/compat.cpp +++ b/src/modules/m_spanningtree/compat.cpp @@ -27,6 +27,8 @@ static const char* const forge_common_1201[] = { "m_setident.so", }; +static std::string wide_newline("\r\n"); + void TreeSocket::CompatAddModules(std::vector<std::string>& modlist) { if (proto_version < 1202) @@ -81,8 +83,8 @@ void TreeSocket::WriteLine(std::string line) } ServerInstance->Logs->Log("m_spanningtree",DEBUG, "S[%d] O %s", this->GetFd(), line.c_str()); - line.append("\r\n"); this->WriteData(line); + this->WriteData(wide_newline); } diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 55fbc2c91..729c273ec 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -176,6 +176,8 @@ void TreeSocket::SendError(const std::string &errormessage) */ void TreeSocket::SquitServer(std::string &from, TreeServer* Current) { + ServerInstance->Logs->Log("m_spanningtree",DEBUG,"SquitServer for %s from %s", + Current->GetName().c_str(), from.c_str()); /* recursively squit the servers attached to 'Current'. * We're going backwards so we don't remove users * while we still need them ;) |