fix a cleanup-handler related issue in sstream.cpp / sched_remote.cpp
parent
687b56e73d
commit
6777864990
|
@ -73,6 +73,9 @@ RemoteWorker::RemoteWorker(const std::string &name, Stream *stream) : Worker(nam
|
|||
|
||||
RemoteWorker::~RemoteWorker() {
|
||||
Log(EDebug, "Shutting down");
|
||||
if (!m_reader || !m_mutex || !m_memStream)
|
||||
return;
|
||||
|
||||
LockGuard lock(m_mutex);
|
||||
m_reader->shutdown();
|
||||
m_memStream->writeShort(StreamBackend::EQuit);
|
||||
|
|
|
@ -39,6 +39,9 @@
|
|||
|
||||
MTS_NAMESPACE_BEGIN
|
||||
|
||||
static StatsCounter bytesRcvd("Network", "Bytes received");
|
||||
static StatsCounter bytesSent("Network", "Bytes sent");
|
||||
|
||||
namespace
|
||||
{
|
||||
#if defined(WIN32)
|
||||
|
@ -155,7 +158,6 @@ SocketStream::~SocketStream() {
|
|||
}
|
||||
|
||||
void SocketStream::read(void *ptr, size_t size) {
|
||||
static StatsCounter bytesRcvd("Network", "Bytes received");
|
||||
const size_t total = size;
|
||||
char *data = (char *) ptr;
|
||||
while (size > 0) {
|
||||
|
@ -180,7 +182,6 @@ void SocketStream::read(void *ptr, size_t size) {
|
|||
}
|
||||
|
||||
void SocketStream::write(const void *ptr, size_t size) {
|
||||
static StatsCounter bytesSent("Network", "Bytes sent");
|
||||
const size_t total = size;
|
||||
char *data = (char *) ptr;
|
||||
while (size > 0) {
|
||||
|
|
Loading…
Reference in New Issue