From be0f2b85761c40cbdc7339bbe722fad2d5e1eca4 Mon Sep 17 00:00:00 2001 From: g8bpq Date: Wed, 23 Nov 2022 10:56:20 +0000 Subject: 6.0.23.29 --- ChatUtils.c | 76 ------------------------------------------------------------- 1 file changed, 76 deletions(-) (limited to 'ChatUtils.c') diff --git a/ChatUtils.c b/ChatUtils.c index bb5f502..651ac6c 100644 --- a/ChatUtils.c +++ b/ChatUtils.c @@ -484,82 +484,6 @@ void TrytoSend() } } - -void ChatFlush(ChatCIRCUIT * conn) -{ - int tosend, len, sent; - - // Try to send data to user. May be stopped by user paging or node flow control - - // UCHAR * OutputQueue; // Messages to user - // int OutputQueueLength; // Total Malloc'ed size. Also Put Pointer for next Message - // int OutputGetPointer; // Next byte to send. When Getpointer = Quele Length all is sent - free the buffer and start again. - - // BOOL Paging; // Set if user wants paging - // int LinesSent; // Count when paging - // int PageLen; // Lines per page - - - if (conn->OutputQueue == NULL) - { - // Nothing to send. If Close after Flush is set, disconnect - - if (conn->CloseAfterFlush) - { - conn->CloseAfterFlush--; - - if (conn->CloseAfterFlush) - return; - - Disconnect(conn->BPQStream); - } - - return; // Nothing to send - } - tosend = conn->OutputQueueLength - conn->OutputGetPointer; - - sent=0; - - while (tosend > 0) - { - if (TXCount(conn->BPQStream) > 4) - return; // Busy - - if (tosend <= conn->paclen) - len=tosend; - else - len=conn->paclen; - - GetSemaphore(&OutputSEM, 0); - - SendUnbuffered(conn->BPQStream, &conn->OutputQueue[conn->OutputGetPointer], len); - - conn->OutputGetPointer+=len; - - FreeSemaphore(&OutputSEM); - - tosend-=len; - sent++; - - if (sent > 4) - return; - } - - // All Sent. Free buffers and reset pointers - - ChatClearQueue(conn); -} - -VOID ChatClearQueue(ChatCIRCUIT * conn) -{ - GetSemaphore(&OutputSEM, 0); - - conn->OutputGetPointer=0; - conn->OutputQueueLength=0; - - FreeSemaphore(&OutputSEM); -} - /* char * FormatDateAndTime(time_t Datim, BOOL DateOnly) { -- cgit v1.2.3