diff --git a/include/inspsocket.h b/include/inspsocket.h index a1ffd0d39..d5d6d4454 100644 --- a/include/inspsocket.h +++ b/include/inspsocket.h @@ -338,12 +338,6 @@ class CoreExport StreamSocket : public EventHandler /** Send the given data out the socket, either now or when writes unblock */ void WriteData(const std::string& data); - /** Convenience function: read a line from the socket - * @param line The line read - * @param delim The line delimiter - * @return true if a line was read - */ - bool GetNextLine(std::string& line, char delim = '\n'); /** Retrieves the current size of the send queue. */ size_t GetSendQSize() const; diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index 71fdbeb2b..f0f804fff 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -137,16 +137,6 @@ CullResult StreamSocket::cull() return EventHandler::cull(); } -bool StreamSocket::GetNextLine(std::string& line, char delim) -{ - std::string::size_type i = recvq.find(delim); - if (i == std::string::npos) - return false; - line.assign(recvq, 0, i); - recvq.erase(0, i + 1); - return true; -} - int StreamSocket::HookChainRead(IOHook* hook, std::string& rq) { if (!hook) diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h index 7214123e4..d0c497cf9 100644 --- a/src/modules/m_spanningtree/treesocket.h +++ b/src/modules/m_spanningtree/treesocket.h @@ -155,6 +155,13 @@ class TreeSocket : public BufferedSocket */ std::shared_ptr AuthRemote(const CommandBase::Params& params); + /** Convenience function: read a line from the socket + * @param line The line read + * @param delim The line delimiter + * @return true if a line was read + */ + bool GetNextLine(std::string& line, char delim = '\n'); + public: const time_t age; diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 64dd3d2b8..8cc699d09 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -197,6 +197,16 @@ CmdResult CommandSQuit::HandleServer(TreeServer* server, CommandBase::Params& pa return ret; } +bool TreeSocket::GetNextLine(std::string& line, char delim) +{ + std::string::size_type i = recvq.find(delim); + if (i == std::string::npos) + return false; + line.assign(recvq, 0, i); + recvq.erase(0, i + 1); + return true; +} + /** This function is called when we receive data from a remote * server. */