Loading src/Client.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -275,7 +275,8 @@ void Client::handleReadResponseBody(const boost::system::error_code& errorCode) { ResponseSP response_sp(new Response); response_sp->ParseFromArray(&m_readBuff[HEADER_SIZE], m_readBuff.size() - HEADER_SIZE); response_sp->ParseFromArray(&m_readBuff[HEADER_SIZE], m_readBuff.size() - HEADER_SIZE); m_protocolManager_sp->processResponse(response_sp); Loading @@ -284,7 +285,8 @@ void Client::handleReadResponseBody(const boost::system::error_code& errorCode) m_requestResponseTimer.expires_from_now( boost::posix_time::seconds(m_configuration_sp->getRefreshTime())); m_requestResponseTimer.async_wait(boost::bind(&Client::startWriteRequest, this)); m_requestResponseTimer.async_wait( boost::bind(&Client::startWriteRequest, this)); } else { Loading src/DBManager.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ void DBManager::connect() throw(soci::soci_error) { DEBUG_STREAM << "DBManager::connect()" << endl; boost::mutex::scoped_lock lock(m_connectionPoolMutex); boost::mutex::scoped_lock lock(m_connectionMutex); std::stringstream connection; connection << " host=" << m_configuration_sp->getDatabaseHost(); Loading @@ -72,7 +72,7 @@ void DBManager::disconnect() { DEBUG_STREAM << "DBManager::disconnect()" << endl; boost::mutex::scoped_lock lock(m_connectionPoolMutex); boost::mutex::scoped_lock lock(m_connectionMutex); m_session_sp->close(); } Loading @@ -85,7 +85,7 @@ DBManager::InformationList DBManager::retrieveInformation(std::string schema, { DEBUG_STREAM << "DBManager::retrieveInformation()" << endl; boost::mutex::scoped_lock lock(m_connectionPoolMutex); boost::mutex::scoped_lock lock(m_connectionMutex); if(m_session_sp->get_backend() == NULL) m_session_sp->reconnect(); Loading Loading @@ -117,7 +117,7 @@ std::tm DBManager::retrieveLastTimestamp(std::string schema, std::string table) { DEBUG_STREAM << "DBManager::retrieveLastTimestamp()" << endl; boost::mutex::scoped_lock lock(m_connectionPoolMutex); boost::mutex::scoped_lock lock(m_connectionMutex); if(m_session_sp->get_backend() == NULL) m_session_sp->reconnect(); Loading @@ -138,7 +138,7 @@ void DBManager::persistMetadata(std::string schema, std::string table, { DEBUG_STREAM << "DBManager::persistMetadata()" << endl; boost::mutex::scoped_lock lock(m_connectionPoolMutex); boost::mutex::scoped_lock lock(m_connectionMutex); if(m_session_sp->get_backend() == NULL) m_session_sp->reconnect(); Loading src/DBManager.h +1 −1 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ protected: Configuration::SP m_configuration_sp; //Connection mutex boost::mutex m_connectionPoolMutex; boost::mutex m_connectionMutex; //Database connection scoped pointer boost::scoped_ptr<soci::session> m_session_sp; Loading src/PlainClient.h +7 −1 Original line number Diff line number Diff line Loading @@ -39,19 +39,25 @@ public: protected: //------------------------------------------------------------------------------ // [Protected] Utilities methods // [Protected] Connection initialization methods //------------------------------------------------------------------------------ virtual void startConnect(boost::asio::ip::tcp::resolver::iterator); virtual void handleConnect(const boost::system::error_code&, boost::asio::ip::tcp::resolver::iterator); //------------------------------------------------------------------------------ // [Protected] Request response methods //------------------------------------------------------------------------------ virtual void startWriteRequest(); virtual void startReadResponseHeader(); virtual void startReadResponseBody(boost::uint32_t); //------------------------------------------------------------------------------ // [Protected] Connection close method //------------------------------------------------------------------------------ virtual void closeConnection(); //------------------------------------------------------------------------------ Loading src/ProtocolManager.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,9 @@ void ProtocolManager::processResponse(ResponseSP response_sp) { DEBUG_STREAM << "ProtocolManager::processResponse()" << endl; if(!response_sp->IsInitialized()) throw std::runtime_error("Not initialized response!"); switch(response_sp->type()) { case Response::AUTHORIZATION: Loading Loading
src/Client.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -275,7 +275,8 @@ void Client::handleReadResponseBody(const boost::system::error_code& errorCode) { ResponseSP response_sp(new Response); response_sp->ParseFromArray(&m_readBuff[HEADER_SIZE], m_readBuff.size() - HEADER_SIZE); response_sp->ParseFromArray(&m_readBuff[HEADER_SIZE], m_readBuff.size() - HEADER_SIZE); m_protocolManager_sp->processResponse(response_sp); Loading @@ -284,7 +285,8 @@ void Client::handleReadResponseBody(const boost::system::error_code& errorCode) m_requestResponseTimer.expires_from_now( boost::posix_time::seconds(m_configuration_sp->getRefreshTime())); m_requestResponseTimer.async_wait(boost::bind(&Client::startWriteRequest, this)); m_requestResponseTimer.async_wait( boost::bind(&Client::startWriteRequest, this)); } else { Loading
src/DBManager.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ void DBManager::connect() throw(soci::soci_error) { DEBUG_STREAM << "DBManager::connect()" << endl; boost::mutex::scoped_lock lock(m_connectionPoolMutex); boost::mutex::scoped_lock lock(m_connectionMutex); std::stringstream connection; connection << " host=" << m_configuration_sp->getDatabaseHost(); Loading @@ -72,7 +72,7 @@ void DBManager::disconnect() { DEBUG_STREAM << "DBManager::disconnect()" << endl; boost::mutex::scoped_lock lock(m_connectionPoolMutex); boost::mutex::scoped_lock lock(m_connectionMutex); m_session_sp->close(); } Loading @@ -85,7 +85,7 @@ DBManager::InformationList DBManager::retrieveInformation(std::string schema, { DEBUG_STREAM << "DBManager::retrieveInformation()" << endl; boost::mutex::scoped_lock lock(m_connectionPoolMutex); boost::mutex::scoped_lock lock(m_connectionMutex); if(m_session_sp->get_backend() == NULL) m_session_sp->reconnect(); Loading Loading @@ -117,7 +117,7 @@ std::tm DBManager::retrieveLastTimestamp(std::string schema, std::string table) { DEBUG_STREAM << "DBManager::retrieveLastTimestamp()" << endl; boost::mutex::scoped_lock lock(m_connectionPoolMutex); boost::mutex::scoped_lock lock(m_connectionMutex); if(m_session_sp->get_backend() == NULL) m_session_sp->reconnect(); Loading @@ -138,7 +138,7 @@ void DBManager::persistMetadata(std::string schema, std::string table, { DEBUG_STREAM << "DBManager::persistMetadata()" << endl; boost::mutex::scoped_lock lock(m_connectionPoolMutex); boost::mutex::scoped_lock lock(m_connectionMutex); if(m_session_sp->get_backend() == NULL) m_session_sp->reconnect(); Loading
src/DBManager.h +1 −1 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ protected: Configuration::SP m_configuration_sp; //Connection mutex boost::mutex m_connectionPoolMutex; boost::mutex m_connectionMutex; //Database connection scoped pointer boost::scoped_ptr<soci::session> m_session_sp; Loading
src/PlainClient.h +7 −1 Original line number Diff line number Diff line Loading @@ -39,19 +39,25 @@ public: protected: //------------------------------------------------------------------------------ // [Protected] Utilities methods // [Protected] Connection initialization methods //------------------------------------------------------------------------------ virtual void startConnect(boost::asio::ip::tcp::resolver::iterator); virtual void handleConnect(const boost::system::error_code&, boost::asio::ip::tcp::resolver::iterator); //------------------------------------------------------------------------------ // [Protected] Request response methods //------------------------------------------------------------------------------ virtual void startWriteRequest(); virtual void startReadResponseHeader(); virtual void startReadResponseBody(boost::uint32_t); //------------------------------------------------------------------------------ // [Protected] Connection close method //------------------------------------------------------------------------------ virtual void closeConnection(); //------------------------------------------------------------------------------ Loading
src/ProtocolManager.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,9 @@ void ProtocolManager::processResponse(ResponseSP response_sp) { DEBUG_STREAM << "ProtocolManager::processResponse()" << endl; if(!response_sp->IsInitialized()) throw std::runtime_error("Not initialized response!"); switch(response_sp->type()) { case Response::AUTHORIZATION: Loading