Changeset - b38cc30c440c
[Not reviewed]
Merge
0 12 1
Jan Kaluza - 10 years ago 2016-01-21 18:39:08
jkaluza@redhat.com
Merge branch 'master' of github.com:hanzz/libtransport
12 files changed with 32 insertions and 11 deletions:
0 comments (0 inline, 0 general)
CMakeLists.txt
Show inline comments
 
@@ -271,27 +271,26 @@ else (SPECTRUM_VERSION)
 
endif (SPECTRUM_VERSION)
 

	
 
message("Version           : " ${SPECTRUM_VERSION})
 

	
 
if (SQLITE3_FOUND)
 
	ADD_DEFINITIONS(-DWITH_SQLITE)
 
	include_directories(${SQLITE3_INCLUDE_DIR})
 
	message("SQLite3           : yes")
 
else (SQLITE3_FOUND)
 
if (WIN32)
 
		ADD_DEFINITIONS(-DWITH_SQLITE)
 
	include_directories("${CMAKE_SOURCE_DIR}/msvc-deps/sqlite3")
 
	message("SQLite3           : bundled")
 
	else()
 
else (WIN32)
 
	include_directories(${SQLITE3_INCLUDE_DIR})
 
	message("SQLite3           : yes")
 
endif (WIN32)
 
else (SQLITE3_FOUND)
 
	set(SQLITE3_LIBRARIES "")
 
	if(ENABLE_SQLITE3)
 
		message("SQLite3           : no (install sqlite3)")
 
	else(ENABLE_SQLITE3)
 
		message("SQLite3           : no (user disabled)")
 
	endif()
 
	endif()
 
endif (SQLITE3_FOUND)
 

	
 
if (MYSQL_FOUND)
 
	ADD_DEFINITIONS(-DWITH_MYSQL)
 
	include_directories(${MYSQL_INCLUDE_DIR})
 
	message("MySQL             : yes")
backends/twitter/libtwitcurl/twitcurl.h
Show inline comments
 
@@ -2,12 +2,13 @@
 
#define _TWITCURL_H_
 

	
 
#include <string>
 
#include <sstream>
 
#include <cstring>
 
#include <vector>
 
#include <algorithm>
 
#include "oauthlib.h"
 
#include "curl/curl.h"
 

	
 
/* Few common types used by twitCurl */
 
namespace twitCurlTypes
 
{
include/transport/Logging.h
Show inline comments
 
@@ -53,12 +53,13 @@ namespace Transport {
 
class Config;
 

	
 
namespace Logging {
 

	
 
void initBackendLogging(Config *config);
 
void initMainLogging(Config *config);
 
void initManagerLogging(Config *config);
 
void shutdownLogging();
 
void redirect_stderr();
 

	
 
}
 

	
 
}
libtransport/CMakeLists.txt
Show inline comments
 
@@ -12,13 +12,12 @@ else()
 
	string(REGEX REPLACE "[^;]+;?/SecureTransport/[^;]+;?" "" SWIFTEN_SRC "${SWIFTEN_SRC}") 
 
endif()
 
else()
 
	string(REGEX REPLACE "[^;]+;?/OpenSSL/[^;]+;?" "" SWIFTEN_SRC "${SWIFTEN_SRC}") 
 
	string(REGEX REPLACE "[^;]+;?/SecureTransport/[^;]+;?" "" SWIFTEN_SRC "${SWIFTEN_SRC}")
 
endif()
 

	
 
FILE(GLOB HEADERS ../include/transport/*.h)
 
include_directories(../spectrum/src/frontends/xmpp/)
 

	
 
if (NOT WIN32)
 
include_directories(${POPT_INCLUDE_DIR})
 
endif()
 
@@ -45,13 +44,13 @@ endif(PROTOBUF_FOUND)
 
# endif()
 

	
 
find_package(CURL)
 

	
 
if (WIN32)
 
	include_directories("${CMAKE_SOURCE_DIR}/msvc-deps/sqlite3")
 
	TARGET_LINK_LIBRARIES(transport transport-plugin sqlite3 ${PQXX_LIBRARY} ${CURL_LIBRARIES ${PQ_LIBRARY} ${MYSQL_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES} ${PROTOBUF_LIBRARY} psapi.lib)
 
	TARGET_LINK_LIBRARIES(transport transport-plugin sqlite3 ${PQXX_LIBRARY} ${CURL_LIBRARIES} ${PQ_LIBRARY} ${MYSQL_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES} ${PROTOBUF_LIBRARY} psapi.lib)
 
else()
 
	TARGET_LINK_LIBRARIES(transport transport-plugin ${PQXX_LIBRARY} ${CURL_LIBRARIES} ${PQ_LIBRARY} ${SQLITE3_LIBRARIES} ${MYSQL_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES} ${POPT_LIBRARY} ${PROTOBUF_LIBRARY})
 
endif()
 

	
 
SET_TARGET_PROPERTIES(transport PROPERTIES
 
      VERSION ${TRANSPORT_VERSION} SOVERSION ${TRANSPORT_VERSION}
libtransport/FileTransferManager.cpp
Show inline comments
 
@@ -80,23 +80,23 @@ FileTransferManager::~FileTransferManager() {
 
// 	delete m_bytestreamProxy;
 
// 	delete m_connectivityManager;
 
// #endif
 
}
 

	
 
FileTransferManager::Transfer FileTransferManager::sendFile(User *user, Buddy *buddy, boost::shared_ptr<Swift::ReadBytestream> byteStream, const Swift::StreamInitiationFileInfo &info) {
 
// 	FileTransferManager::Transfer transfer;
 
 	FileTransferManager::Transfer transfer;
 
// 	transfer.from = buddy->getJID();
 
// 	transfer.to = user->getJID();
 
// 	transfer.readByteStream = byteStream;
 
// 
 
// 	LOG4CXX_INFO(logger, "Starting FT from '" << transfer.from << "' to '" << transfer.to << "'")
 
// 
 
// 	transfer.ft = m_outgoingFTManager->createOutgoingFileTransfer(transfer.from, transfer.to, transfer.readByteStream, info);
 
// // 	if (transfer.ft) {
 
// // 		m_filetransfers.push_back(ft);
 
// // 		ft->onStateChange.connect(boost::bind(&User::handleFTStateChanged, this, _1, Buddy::JIDToLegacyName(from), info.getName(), info.getSize(), id));
 
// // 		transfer.ft->start();
 
// // 	}
 
// 	return transfer;
 
 	return transfer;
 
}
 

	
 
}
libtransport/Logging.cpp
Show inline comments
 
@@ -200,12 +200,15 @@ void initBackendLogging(Config *config) {
 
}
 

	
 
void initMainLogging(Config *config) {
 
	initLogging(config, "logging.config");
 
	initLogging(config, "logging.backend_config", true);
 
}
 
void initManagerLogging(Config *config) {
 
        initLogging(config, "logging.config");
 
}
 

	
 
void redirect_stderr() {
 
	 intercepter_cerr = new intercept_stream(std::cerr, "cerr");
 
	 intercepter_cout = new intercept_stream(std::cout, "cout");
 
}
 

	
spectrum/src/CMakeLists.txt
Show inline comments
 
@@ -46,7 +46,11 @@ INSTALL(FILES
 

	
 
INSTALL(FILES
 
	logging.cfg
 
	DESTINATION /etc/spectrum2
 
	)
 

	
 
INSTALL(FILES
 
	manager-logging.cfg
 
	DESTINATION /etc/spectrum2
 
	)
 

	
spectrum/src/frontends/xmpp/XMPPFrontend.cpp
Show inline comments
 
@@ -344,13 +344,13 @@ void XMPPFrontend::disconnectFromServer() {
 

	
 
void XMPPFrontend::handleConnected() {
 
	m_transport->handleConnected();
 
}
 

	
 
void XMPPFrontend::handleServerStopped(boost::optional<Swift::BoostConnectionServer::Error> e) {
 
	if(e != NULL ) {
 
	if(e) {
 
		if(*e == Swift::BoostConnectionServer::Conflict) {
 
			LOG4CXX_INFO(logger, "Port "<< CONFIG_INT(m_config, "service.port") << " already in use! Stopping server..");
 
			if (CONFIG_INT(m_config, "service.port") == 5347) {
 
				LOG4CXX_INFO(logger, "Port 5347 is usually used for components. You are using server_mode=1. Are you sure you don't want to use server_mode=0 and run spectrum as component?");
 
			}
 
		}
spectrum/src/manager-logging.cfg
Show inline comments
 
new file 100644
 
log4j.rootLogger=debug, R
 

	
 
log4j.appender.R=org.apache.log4j.RollingFileAppender
 
log4j.appender.R.File=/var/log/spectrum2/spectrum_manager.log
 

	
 
log4j.appender.R.MaxFileSize=10000KB
 
# Keep one backup file
 
log4j.appender.R.MaxBackupIndex=1
 

	
 
log4j.appender.R.layout=org.apache.log4j.PatternLayout
 
log4j.appender.R.layout.ConversionPattern=%d %-5p %c: %m%n
spectrum_manager/src/managerconfig.cpp
Show inline comments
 
@@ -41,12 +41,13 @@ bool ManagerConfig::load(const std::string &configfile, boost::program_options::
 
		("database.database", value<std::string>()->default_value("/var/lib/spectrum2/$jid/database.sql"), "Database used to store data")
 
		("database.server", value<std::string>()->default_value("localhost"), "Database server.")
 
		("database.user", value<std::string>()->default_value(""), "Database user.")
 
		("database.password", value<std::string>()->default_value(""), "Database Password.")
 
		("database.port", value<int>()->default_value(0), "Database port.")
 
		("database.prefix", value<std::string>()->default_value(""), "Prefix of tables in database")
 
		("logging.config", value<std::string>()->default_value("/etc/spectrum2/manager_logging.cfg"), "Logging configuration file")
 
	;
 

	
 
	store(parse_config_file(ifs, opts), m_variables);
 
	notify(m_variables);
 

	
 
	m_file = configfile;
spectrum_manager/src/server.cpp
Show inline comments
 
@@ -103,12 +103,13 @@ Server::Server(ManagerConfig *config, const std::string &config_file) {
 
		footer.close();
 
	}
 

	
 
	m_storageCfg = new Config();
 
	m_storageCfg->load(config_file);
 
	
 
	Logging::initManagerLogging(m_storageCfg);
 
	std::string error;
 
	m_storage = StorageBackend::createBackend(m_storageCfg, error);
 
	if (m_storage == NULL) {
 
		std::cerr << "Error creating StorageBackend! " << error << "\n";
 
		std::cerr << "Registering new Spectrum 2 manager users won't work" << "\n";
 
	}
spectrum_manager/src/server.h
Show inline comments
 
@@ -29,12 +29,13 @@
 
#include <boost/signal.hpp>
 

	
 
#include "mongoose.h"
 
#include "managerconfig.h"
 

	
 
#include "transport/Config.h"
 
#include "transport/Logging.h"
 
#include "transport/SQLite3Backend.h"
 
#include "transport/MySQLBackend.h"
 
#include "transport/PQXXBackend.h"
 
#include "transport/StorageBackend.h"
 

	
 
using namespace Transport;
0 comments (0 inline, 0 general)