From 71cb5a2f07dc98a1ad232c639bf76d0efd9c43d5 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Wed, 21 May 2025 23:58:35 +0800 Subject: internal(session write): reuse the other write function as function overload --- src/session.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'src') diff --git a/src/session.cpp b/src/session.cpp index e8597e3..6631fae 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -215,18 +215,7 @@ template bool CSession::write(std::format_string fmt, Args &&...args) { if (isDeaf()) return false; - std::string msg = NFormatter::fmt(NONE, fmt, std::forward(args)...); - if (m_isReading) - msg.insert(0, "\n"); - - if (send(m_sockfd.get(), msg.c_str(), msg.size(), MSG_NOSIGNAL) < 0) { - onErrno(WRITE); - return false; - } -#ifdef DEBUG - onSend(msg); -#endif - return true; + return write(NONE, fmt, std::forward(args)...); } template -- cgit v1.2.3