From 1a66c49dca8c3069828c1e70672eae605edb1236 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Fri, 17 May 2024 14:59:14 -0700 Subject: [PATCH] another bug, this time in CodecStream --- reflector/CodecStream.cpp | 2 +- reflector/TCSocket.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reflector/CodecStream.cpp b/reflector/CodecStream.cpp index a84f6aa..ba8457c 100644 --- a/reflector/CodecStream.cpp +++ b/reflector/CodecStream.cpp @@ -127,7 +127,7 @@ void CCodecStream::Task(void) } STCPacket pack; - if (! g_TCServer.Receive(m_CSModule, pack, 8)) + if (g_TCServer.Receive(m_CSModule, pack, 8)) { // update statistics double rt = pack.rt_timer.time(); // the round-trip time diff --git a/reflector/TCSocket.cpp b/reflector/TCSocket.cpp index a950df3..f16cb50 100644 --- a/reflector/TCSocket.cpp +++ b/reflector/TCSocket.cpp @@ -149,7 +149,7 @@ bool CTCSocket::receive(int fd, STCPacket &packet) return false; } -// returns false if there is data to return +// returns true if there is data to return bool CTCServer::Receive(char module, STCPacket &packet, int ms) { bool rv = false; @@ -183,7 +183,7 @@ bool CTCServer::Receive(char module, STCPacket &packet, int ms) rv = ! receive(pfds->fd, packet); } - // I think it's possible that we read the data, but the socket had an error after the read... + // I think it's possible that even if we read the data, the socket can have an error after the read... // So we'll check... if (pfds->revents & POLLERR || pfds->revents & POLLHUP) {