From e69d2b3954ffe711a193f0c2716b043a71c8cabe Mon Sep 17 00:00:00 2001 From: Thulinma Date: Tue, 21 Aug 2012 15:23:47 +0200 Subject: [PATCH] Fixed buffer not moving users from curr to log, fixed controller randomly crashing ^_^ --- src/buffer_user.cpp | 1 + src/controller.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/buffer_user.cpp b/src/buffer_user.cpp index f67422f7..f1c9a68f 100644 --- a/src/buffer_user.cpp +++ b/src/buffer_user.cpp @@ -27,6 +27,7 @@ Buffer::user::user(Socket::Connection fd){ /// Drops held DTSC::Ring class, if one is held. Buffer::user::~user(){ Stream::get()->dropRing(myRing); + Disconnect("User disconnected"); }//destructor /// Disconnects the current user. Doesn't do anything if already disconnected. diff --git a/src/controller.cpp b/src/controller.cpp index 8604937e..a6440b00 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -396,9 +396,9 @@ int main(int argc, char ** argv){ } } - Incoming = API_Socket.accept(); + Incoming = API_Socket.accept(true); if (Incoming.connected()){users.push_back(Incoming);} - Incoming = Stats_Socket.accept(); + Incoming = Stats_Socket.accept(true); if (Incoming.connected()){buffers.push_back(Incoming);} if (buffers.size() > 0){ for( std::vector< Socket::Connection >::iterator it = buffers.begin(); it != buffers.end(); it++) {