From 077398fdef39b5d2f4901b87417f0a80ef19da6c Mon Sep 17 00:00:00 2001 From: Frank Schmirler Date: Mon, 24 Oct 2011 08:44:31 +0200 Subject: Revert "dropped cServerConnection::m_Pending" Required by VTP This reverts commit bdaea38b863ef7649d7a2253ac937130b6e11d8d. --- server/connection.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'server/connection.c') diff --git a/server/connection.c b/server/connection.c index 64b912c..a73470b 100644 --- a/server/connection.c +++ b/server/connection.c @@ -66,6 +66,7 @@ cServerConnection::cServerConnection(const char *Protocol, int Type): cTBSocket(Type), m_Protocol(Protocol), m_DeferClose(false), + m_Pending(false), m_ReadBytes(0), m_WriteBytes(0), m_WriteIndex(0) @@ -195,6 +196,8 @@ bool cServerConnection::Write(void) if (m_WriteIndex == m_WriteBytes) { m_WriteIndex = 0; m_WriteBytes = 0; + if (m_Pending) + Command(NULL); if (m_DeferClose) return false; Flushed(); @@ -202,12 +205,12 @@ bool cServerConnection::Write(void) return true; } -bool cServerConnection::Respond(const char *Message, ...) +bool cServerConnection::Respond(const char *Message, bool Last, ...) { char *buffer; int length; va_list ap; - va_start(ap, Message); + va_start(ap, Last); length = vasprintf(&buffer, Message, ap); va_end(ap); @@ -230,6 +233,7 @@ bool cServerConnection::Respond(const char *Message, ...) m_WriteBytes += length; m_WriteBuffer[m_WriteBytes++] = '\015'; m_WriteBuffer[m_WriteBytes++] = '\012'; + m_Pending = !Last; return true; } -- cgit v1.2.3