From 384b18ba9233054d4139b6830dc3d74105169958 Mon Sep 17 00:00:00 2001 From: Constantin Kaplinsky Date: Tue, 13 Sep 2005 18:34:13 +0000 Subject: [PATCH] Removed the FdOutStream::writeBytes() implementation as the same method of the parent class seems to do the work better. The function can flush buffered data even if there were only a few bytes in the buffer. That results in sending packets with just 1 byte of data, while encoding data with 32-bit Hextile. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@318 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- rdr/FdOutStream.cxx | 22 +--------------------- rdr/FdOutStream.h | 1 - 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/rdr/FdOutStream.cxx b/rdr/FdOutStream.cxx index 6795fc89..a9075cc9 100644 --- a/rdr/FdOutStream.cxx +++ b/rdr/FdOutStream.cxx @@ -39,8 +39,7 @@ using namespace rdr; -enum { DEFAULT_BUF_SIZE = 16384, - MIN_BULK_SIZE = 1024 }; +enum { DEFAULT_BUF_SIZE = 16384 }; FdOutStream::FdOutStream(int fd_, int timeoutms_, int bufSize_) : fd(fd_), timeoutms(timeoutms_), @@ -63,25 +62,6 @@ void FdOutStream::setTimeout(int timeoutms_) { timeoutms = timeoutms_; } -void FdOutStream::writeBytes(const void* data, int length) -{ - if (length < MIN_BULK_SIZE) { - OutStream::writeBytes(data, length); - return; - } - - const U8* dataPtr = (const U8*)data; - - flush(); - - while (length > 0) { - int n = writeWithTimeout(dataPtr, length); - length -= n; - dataPtr += n; - offset += n; - } -} - int FdOutStream::length() { return offset + ptr - start; diff --git a/rdr/FdOutStream.h b/rdr/FdOutStream.h index 9c46db94..5294b704 100644 --- a/rdr/FdOutStream.h +++ b/rdr/FdOutStream.h @@ -39,7 +39,6 @@ namespace rdr { void flush(); int length(); - void writeBytes(const void* data, int length); private: int overrun(int itemSize, int nItems); -- 2.39.5