Loading src/DBManager.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -56,11 +56,10 @@ void DBManager::connect() throw(soci::soci_error) for(unsigned int i=0; i<connectionNumber; ++i) { m_connectionPool_sp->at(i).open(connection.str()); m_connectionPool_sp->at(i).open(soci::mysql, connection.str()); #ifdef VERBOSE_DEBUG INFO_STREAM << "CONNECTION: " << connection.str() << " -> OPEN" << endl; INFO_STREAM << "-------------------------------------------------" << endl; #endif } } Loading @@ -86,7 +85,6 @@ void DBManager::disconnect() #ifdef VERBOSE_DEBUG INFO_STREAM << "CONNECTION: " << connection.str() << " -> CLOSE" << endl; INFO_STREAM << "-------------------------------------------------" << endl; #endif } } Loading src/MetadataExporter.cpp +25 −26 Original line number Diff line number Diff line Loading @@ -586,6 +586,8 @@ void MetadataExporter::importExportedTables(std::vector<std::string>& exportedTa std::multimap<const std::string, const std::string>& exportedTablesMap) throw(std::invalid_argument) { DEBUG_STREAM << "MetadataExporter::importExportedTables() - " << device_name << endl; for(unsigned int i=0; i<exportedTables.size(); ++i) { std::size_t found; Loading @@ -601,10 +603,7 @@ void MetadataExporter::importExportedTables(std::vector<std::string>& exportedTa std::string schema = exportedTables.at(i).substr(0, found); std::string table = exportedTables.at(i).substr(found+1, std::string::npos); #ifdef VERBOSE_DEBUG INFO_STREAM << "SCHEMA: " << schema << " TABLE: " << table << endl; INFO_STREAM << "-------------------------------------------------" << endl; #endif exportedTablesMap.insert(std::pair<const std::string, const std::string> (schema, table)); } Loading @@ -617,6 +616,8 @@ void MetadataExporter::importAuthorisedUsers(std::vector<std::string>& authorise std::map<const std::string, const std::string>& authorisedUsersMap) throw(std::invalid_argument) { DEBUG_STREAM << "MetadataExporter::importAuthorisedUsers() - " << device_name << endl; for(unsigned int i=0; i<authorisedUsers.size(); ++i) { std::size_t found; Loading @@ -634,7 +635,6 @@ void MetadataExporter::importAuthorisedUsers(std::vector<std::string>& authorise #ifdef VERBOSE_DEBUG INFO_STREAM << "USER: " << user << " PASSWORD: " << password << endl; INFO_STREAM << "-------------------------------------------------" << endl; #endif authorisedUsersMap.insert(std::pair<const std::string, const std::string>(user, password)); Loading @@ -647,6 +647,8 @@ void MetadataExporter::importAuthorisedUsers(std::vector<std::string>& authorise void MetadataExporter::checkIfFileExists(std::string fileName) throw(std::invalid_argument) { DEBUG_STREAM << "MetadataExporter::checkIfFileExists() - " << device_name << endl; boost::filesystem::path path(fileName); if(!boost::filesystem::exists(path)) Loading @@ -657,10 +659,7 @@ void MetadataExporter::checkIfFileExists(std::string fileName) throw std::invalid_argument(errorStream.str()); } #ifdef VERBOSE_DEBUG INFO_STREAM << "FILE: " << fileName << " -> OK" << endl; INFO_STREAM << "-------------------------------------------------" << endl; #endif DEBUG_STREAM << "FILE: " << fileName << " -> OK" << endl; } /*----- PROTECTED REGION END -----*/ // MetadataExporter::namespace_ending Loading src/PlainSession.cpp +8 −3 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ PlainSession::~PlainSession() { DEBUG_STREAM << "PlainSession::~PlainSession()" << endl; INFO_STREAM << m_plainSocket.remote_endpoint() << " CONNECTED" << endl; boost::system::error_code errorCode; m_plainSocket.shutdown(boost::asio::ip::tcp::socket::shutdown_both, errorCode); Loading Loading @@ -63,8 +65,7 @@ void PlainSession::start() { DEBUG_STREAM << "PlainSession::start()" << endl; INFO_STREAM << "PlainSession::start() connection from " << m_plainSocket.remote_endpoint() << endl; INFO_STREAM << m_plainSocket.remote_endpoint() << " DISCONNECTED" << endl; startReadRequestHeader(); } Loading Loading @@ -92,6 +93,9 @@ void PlainSession::startReadRequestBody(boost::uint32_t bodySize) { DEBUG_STREAM << "PlainSession::startReadRequestBody()" << endl; INFO_STREAM << m_plainSocket.remote_endpoint() << " >>>> " << bodySize << " BYTE" << endl; m_readBuff.resize(HEADER_SIZE + bodySize); boost::asio::mutable_buffers_1 mutableBuffer = Loading Loading @@ -119,7 +123,8 @@ void PlainSession::startWriteResponse() boost::uint32_t bodySize = response_sp->ByteSize(); DEBUG_STREAM << "PlainSession::startWriteResponse() SIZE: " << bodySize << endl; INFO_STREAM << m_plainSocket.remote_endpoint() << " <<<< " << bodySize << " BYTE" << endl; std::vector<boost::uint8_t> writeBuff; writeBuff.resize(HEADER_SIZE + bodySize); Loading src/SSLServer.cpp +4 −8 Original line number Diff line number Diff line Loading @@ -29,15 +29,11 @@ SSLServer::SSLServer(Tango::DeviceImpl* deviceImpl_p, std::string privateKey = m_configuration_sp->getPrivateKeyFile(); std::string dHTempFile = m_configuration_sp->getDHTempFile(); #ifdef VERBOSE_DEBUG INFO_STREAM << "CERTIFICATE FILE: " << certificateFile << endl; INFO_STREAM << "-------------------------------------------------" << endl; INFO_STREAM << "PRIVATE KEY FILE: " << privateKey << endl; INFO_STREAM << "-------------------------------------------------" << endl; INFO_STREAM << "DH TEMPORARY FILE: " << dHTempFile << endl; INFO_STREAM << "-------------------------------------------------" << endl; #endif //@todo: check error_code use in load file methods m_context_sp->use_certificate_chain_file(certificateFile); m_context_sp->use_private_key_file(privateKey, boost::asio::ssl::context::pem); m_context_sp->use_tmp_dh_file(dHTempFile); Loading src/SSLSession.cpp +19 −3 Original line number Diff line number Diff line Loading @@ -23,6 +23,18 @@ SSLSession::SSLSession(Tango::DeviceImpl* deviceImpl_p, SSLSession::~SSLSession() { DEBUG_STREAM << "SSLSession::~SSLSession()" << endl; INFO_STREAM << m_sslSocket.lowest_layer().remote_endpoint() << " DISCONNECTED" << endl; boost::system::error_code errorCode; m_sslSocket.shutdown(errorCode); m_sslSocket.lowest_layer().shutdown( boost::asio::ip::tcp::socket::shutdown_both, errorCode); m_sslSocket.lowest_layer().close(errorCode); } //============================================================================== Loading Loading @@ -56,8 +68,8 @@ void SSLSession::start() { DEBUG_STREAM << "SSLSession::start()" << endl; INFO_STREAM << "SSLSession::start() connection from " << m_sslSocket.lowest_layer().remote_endpoint() << endl; INFO_STREAM << m_sslSocket.lowest_layer().remote_endpoint() << " CONNECTED" << endl; startHandShake(); } Loading Loading @@ -116,6 +128,9 @@ void SSLSession::startReadRequestBody(boost::uint32_t bodySize) { DEBUG_STREAM << "SSLSession::startReadRequestBody()" << endl; INFO_STREAM << m_sslSocket.lowest_layer().remote_endpoint() << " >>>> " << bodySize << " BYTE" << endl; m_readBuff.resize(HEADER_SIZE + bodySize); boost::asio::mutable_buffers_1 mutableBuffer = Loading Loading @@ -143,7 +158,8 @@ void SSLSession::startWriteResponse() boost::uint32_t bodySize = response_sp->ByteSize(); DEBUG_STREAM << "SSLSession::startWriteResponse() SIZE: " << bodySize << endl; INFO_STREAM << m_sslSocket.lowest_layer().remote_endpoint() << " <<<< " << bodySize << " BYTE" << endl; std::vector<boost::uint8_t> writeBuff; writeBuff.resize(HEADER_SIZE + bodySize); Loading Loading
src/DBManager.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -56,11 +56,10 @@ void DBManager::connect() throw(soci::soci_error) for(unsigned int i=0; i<connectionNumber; ++i) { m_connectionPool_sp->at(i).open(connection.str()); m_connectionPool_sp->at(i).open(soci::mysql, connection.str()); #ifdef VERBOSE_DEBUG INFO_STREAM << "CONNECTION: " << connection.str() << " -> OPEN" << endl; INFO_STREAM << "-------------------------------------------------" << endl; #endif } } Loading @@ -86,7 +85,6 @@ void DBManager::disconnect() #ifdef VERBOSE_DEBUG INFO_STREAM << "CONNECTION: " << connection.str() << " -> CLOSE" << endl; INFO_STREAM << "-------------------------------------------------" << endl; #endif } } Loading
src/MetadataExporter.cpp +25 −26 Original line number Diff line number Diff line Loading @@ -586,6 +586,8 @@ void MetadataExporter::importExportedTables(std::vector<std::string>& exportedTa std::multimap<const std::string, const std::string>& exportedTablesMap) throw(std::invalid_argument) { DEBUG_STREAM << "MetadataExporter::importExportedTables() - " << device_name << endl; for(unsigned int i=0; i<exportedTables.size(); ++i) { std::size_t found; Loading @@ -601,10 +603,7 @@ void MetadataExporter::importExportedTables(std::vector<std::string>& exportedTa std::string schema = exportedTables.at(i).substr(0, found); std::string table = exportedTables.at(i).substr(found+1, std::string::npos); #ifdef VERBOSE_DEBUG INFO_STREAM << "SCHEMA: " << schema << " TABLE: " << table << endl; INFO_STREAM << "-------------------------------------------------" << endl; #endif exportedTablesMap.insert(std::pair<const std::string, const std::string> (schema, table)); } Loading @@ -617,6 +616,8 @@ void MetadataExporter::importAuthorisedUsers(std::vector<std::string>& authorise std::map<const std::string, const std::string>& authorisedUsersMap) throw(std::invalid_argument) { DEBUG_STREAM << "MetadataExporter::importAuthorisedUsers() - " << device_name << endl; for(unsigned int i=0; i<authorisedUsers.size(); ++i) { std::size_t found; Loading @@ -634,7 +635,6 @@ void MetadataExporter::importAuthorisedUsers(std::vector<std::string>& authorise #ifdef VERBOSE_DEBUG INFO_STREAM << "USER: " << user << " PASSWORD: " << password << endl; INFO_STREAM << "-------------------------------------------------" << endl; #endif authorisedUsersMap.insert(std::pair<const std::string, const std::string>(user, password)); Loading @@ -647,6 +647,8 @@ void MetadataExporter::importAuthorisedUsers(std::vector<std::string>& authorise void MetadataExporter::checkIfFileExists(std::string fileName) throw(std::invalid_argument) { DEBUG_STREAM << "MetadataExporter::checkIfFileExists() - " << device_name << endl; boost::filesystem::path path(fileName); if(!boost::filesystem::exists(path)) Loading @@ -657,10 +659,7 @@ void MetadataExporter::checkIfFileExists(std::string fileName) throw std::invalid_argument(errorStream.str()); } #ifdef VERBOSE_DEBUG INFO_STREAM << "FILE: " << fileName << " -> OK" << endl; INFO_STREAM << "-------------------------------------------------" << endl; #endif DEBUG_STREAM << "FILE: " << fileName << " -> OK" << endl; } /*----- PROTECTED REGION END -----*/ // MetadataExporter::namespace_ending Loading
src/PlainSession.cpp +8 −3 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ PlainSession::~PlainSession() { DEBUG_STREAM << "PlainSession::~PlainSession()" << endl; INFO_STREAM << m_plainSocket.remote_endpoint() << " CONNECTED" << endl; boost::system::error_code errorCode; m_plainSocket.shutdown(boost::asio::ip::tcp::socket::shutdown_both, errorCode); Loading Loading @@ -63,8 +65,7 @@ void PlainSession::start() { DEBUG_STREAM << "PlainSession::start()" << endl; INFO_STREAM << "PlainSession::start() connection from " << m_plainSocket.remote_endpoint() << endl; INFO_STREAM << m_plainSocket.remote_endpoint() << " DISCONNECTED" << endl; startReadRequestHeader(); } Loading Loading @@ -92,6 +93,9 @@ void PlainSession::startReadRequestBody(boost::uint32_t bodySize) { DEBUG_STREAM << "PlainSession::startReadRequestBody()" << endl; INFO_STREAM << m_plainSocket.remote_endpoint() << " >>>> " << bodySize << " BYTE" << endl; m_readBuff.resize(HEADER_SIZE + bodySize); boost::asio::mutable_buffers_1 mutableBuffer = Loading Loading @@ -119,7 +123,8 @@ void PlainSession::startWriteResponse() boost::uint32_t bodySize = response_sp->ByteSize(); DEBUG_STREAM << "PlainSession::startWriteResponse() SIZE: " << bodySize << endl; INFO_STREAM << m_plainSocket.remote_endpoint() << " <<<< " << bodySize << " BYTE" << endl; std::vector<boost::uint8_t> writeBuff; writeBuff.resize(HEADER_SIZE + bodySize); Loading
src/SSLServer.cpp +4 −8 Original line number Diff line number Diff line Loading @@ -29,15 +29,11 @@ SSLServer::SSLServer(Tango::DeviceImpl* deviceImpl_p, std::string privateKey = m_configuration_sp->getPrivateKeyFile(); std::string dHTempFile = m_configuration_sp->getDHTempFile(); #ifdef VERBOSE_DEBUG INFO_STREAM << "CERTIFICATE FILE: " << certificateFile << endl; INFO_STREAM << "-------------------------------------------------" << endl; INFO_STREAM << "PRIVATE KEY FILE: " << privateKey << endl; INFO_STREAM << "-------------------------------------------------" << endl; INFO_STREAM << "DH TEMPORARY FILE: " << dHTempFile << endl; INFO_STREAM << "-------------------------------------------------" << endl; #endif //@todo: check error_code use in load file methods m_context_sp->use_certificate_chain_file(certificateFile); m_context_sp->use_private_key_file(privateKey, boost::asio::ssl::context::pem); m_context_sp->use_tmp_dh_file(dHTempFile); Loading
src/SSLSession.cpp +19 −3 Original line number Diff line number Diff line Loading @@ -23,6 +23,18 @@ SSLSession::SSLSession(Tango::DeviceImpl* deviceImpl_p, SSLSession::~SSLSession() { DEBUG_STREAM << "SSLSession::~SSLSession()" << endl; INFO_STREAM << m_sslSocket.lowest_layer().remote_endpoint() << " DISCONNECTED" << endl; boost::system::error_code errorCode; m_sslSocket.shutdown(errorCode); m_sslSocket.lowest_layer().shutdown( boost::asio::ip::tcp::socket::shutdown_both, errorCode); m_sslSocket.lowest_layer().close(errorCode); } //============================================================================== Loading Loading @@ -56,8 +68,8 @@ void SSLSession::start() { DEBUG_STREAM << "SSLSession::start()" << endl; INFO_STREAM << "SSLSession::start() connection from " << m_sslSocket.lowest_layer().remote_endpoint() << endl; INFO_STREAM << m_sslSocket.lowest_layer().remote_endpoint() << " CONNECTED" << endl; startHandShake(); } Loading Loading @@ -116,6 +128,9 @@ void SSLSession::startReadRequestBody(boost::uint32_t bodySize) { DEBUG_STREAM << "SSLSession::startReadRequestBody()" << endl; INFO_STREAM << m_sslSocket.lowest_layer().remote_endpoint() << " >>>> " << bodySize << " BYTE" << endl; m_readBuff.resize(HEADER_SIZE + bodySize); boost::asio::mutable_buffers_1 mutableBuffer = Loading Loading @@ -143,7 +158,8 @@ void SSLSession::startWriteResponse() boost::uint32_t bodySize = response_sp->ByteSize(); DEBUG_STREAM << "SSLSession::startWriteResponse() SIZE: " << bodySize << endl; INFO_STREAM << m_sslSocket.lowest_layer().remote_endpoint() << " <<<< " << bodySize << " BYTE" << endl; std::vector<boost::uint8_t> writeBuff; writeBuff.resize(HEADER_SIZE + bodySize); Loading