From 106adcffb820aadec74bc9a289decfaa2604f7aa Mon Sep 17 00:00:00 2001 From: Thulinma Date: Sun, 15 Apr 2012 01:54:39 +0200 Subject: [PATCH] RTMP Connector upgrade to DTSC - push mode doesn't convert to DTSC yet (it will tomorrow) and it is still untested - but should work. --- util/socket.cpp | 5 +++-- util/socket.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/util/socket.cpp b/util/socket.cpp index ed669e75..e751b097 100644 --- a/util/socket.cpp +++ b/util/socket.cpp @@ -222,9 +222,10 @@ std::string Socket::Connection::getStats(std::string C){ } /// Updates the downbuffer and upbuffer internal variables. -void Socket::Connection::spool(){ - iread(downbuffer); +/// Returns true if new data was received, false otherwise. +bool Socket::Connection::spool(){ iwrite(upbuffer); + return iread(downbuffer); } /// Returns a reference to the download buffer. diff --git a/util/socket.h b/util/socket.h index 988b96c2..3a538286 100644 --- a/util/socket.h +++ b/util/socket.h @@ -48,7 +48,7 @@ namespace Socket{ bool swrite(std::string & buffer); ///< Write call that is compatible with std::string. bool iread(std::string & buffer); ///< Incremental write call that is compatible with std::string. bool iwrite(std::string & buffer); ///< Write call that is compatible with std::string. - void spool(); ///< Updates the downbuffer and upbuffer internal variables. + bool spool(); ///< Updates the downbuffer and upbuffer internal variables. std::string & Received(); ///< Returns a reference to the download buffer. void Send(std::string data); ///< Appends data to the upbuffer. void close(); ///< Close connection.