Changeset - ee06ad97fd21
[Not reviewed]
0 1 0
Jan Kaluza - 13 years ago 2012-03-29 09:21:33
hanzz.k@gmail.com
More logging
1 file changed with 13 insertions and 5 deletions:
0 comments (0 inline, 0 general)
backends/skype/main.cpp
Show inline comments
 
@@ -366,7 +366,7 @@ bool Skype::createDBusProxy() {
 
			LOG4CXX_INFO(logger,  m_username << ":" << error->message);
 

	
 
			if (m_counter == 15) {
 
				LOG4CXX_ERROR(logger, "Logging out, proxy couldn't be created");
 
				LOG4CXX_ERROR(logger, "Logging out, proxy couldn't be created: " << error->message);
 
				np->handleDisconnected(m_user, pbnetwork::CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE, error->message);
 
				logout();
 
				g_error_free(error);
 
@@ -444,7 +444,8 @@ void Skype::login() {
 
	gchar* argv[6] = {"skype", "--disable-cleanlooks", "--pipelogin", "--dbpath", db, 0};
 

	
 
	int fd;
 
	g_spawn_async_with_pipes(NULL,
 
	GError *error = NULL;
 
	bool spawned = g_spawn_async_with_pipes(NULL,
 
		argv,
 
		NULL /*envp*/,
 
		G_SPAWN_SEARCH_PATH,
 
@@ -454,7 +455,14 @@ void Skype::login() {
 
		&fd,
 
		NULL,
 
		&fd_output,
 
		NULL /*error*/);
 
		&error);
 

	
 
	if (!spawned) {
 
		LOG4CXX_ERROR(logger, "Error spawning the Skype instance: " << error->message)
 
		np->handleDisconnected(m_user, pbnetwork::CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE, "Error spawning the Skype instance.");
 
		return;
 
	}
 

	
 
	std::string login_data = std::string(m_username + " " + m_password + "\n");
 
	LOG4CXX_INFO(logger,  m_username << ": Login data=" << m_username);
 
	write(fd, login_data.c_str(), login_data.size());
 
@@ -469,12 +477,12 @@ void Skype::login() {
 

	
 
	if (m_connection == NULL)
 
	{
 
		LOG4CXX_INFO(logger, "Creating DBus connection.");
 
		LOG4CXX_INFO(logger, "Creating DBUS connection.");
 
		GError *error = NULL;
 
		m_connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
 
		if (m_connection == NULL && error != NULL)
 
		{
 
			LOG4CXX_INFO(logger,  m_username << ": DBUS Error: " << error->message);
 
			LOG4CXX_INFO(logger,  m_username << ": Creating DBUS Connection rrror: " << error->message);
 
			g_error_free(error);
 
			return;
 
		}
0 comments (0 inline, 0 general)