[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdenetwork/kopete/protocols/wlm
From: Roman Jarosz <kedgedev () gmail ! com>
Date: 2009-05-24 14:47:16
Message-ID: 1243176436.897662.13996.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 972308 by rjarosz:
If we get socket error for not main connection just close that connection and not all \
connections.
CCBUG: 180058
CCBUG: 178053
M +14 -6 wlmlibmsn.cpp
M +6 -0 wlmsocket.cpp
--- trunk/KDE/kdenetwork/kopete/protocols/wlm/wlmlibmsn.cpp #972307:972308
@@ -30,7 +30,6 @@
#include "kopetemessage.h"
#include "kopetecontact.h"
#include "kopeteuiglobal.h"
-#include "kopetesockettimeoutwatcher.h"
// include first to not get compile errors on windows
#include <msn/msn.h>
@@ -684,10 +683,6 @@
connect( a, SIGNAL(sslErrors(const QList<QSslError> &)), a, \
SLOT(ignoreSslErrors()) );
connect( a, SIGNAL(error(QAbstractSocket::SocketError)), this, \
SLOT(emitSocketError(QAbstractSocket::SocketError)) );
- Kopete::SocketTimeoutWatcher* timeoutWatcher = \
Kopete::SocketTimeoutWatcher::watch( a );
- if ( timeoutWatcher )
- connect( timeoutWatcher, SIGNAL(error(QAbstractSocket::SocketError)), this, \
SLOT(emitSocketError(QAbstractSocket::SocketError)) );
-
if(!isSSL)
a->connectToHost (hostname.c_str (), port);
else
@@ -898,7 +893,20 @@
void Callbacks::emitSocketError( QAbstractSocket::SocketError error )
{
- emit socketError( error );
+ if ( !mainConnection )
+ return;
+
+ WlmSocket* socket = qobject_cast<WlmSocket*>(sender());
+ Q_ASSERT( socket );
+
+ MSN::Connection *c = mainConnection->connectionWithSocket((void*)socket);
+ if ( !c )
+ return;
+
+ if ( c == mainConnection )
+ emit socketError( error );
+ else
+ c->disconnect();
}
#include "wlmlibmsn.moc"
--- trunk/KDE/kdenetwork/kopete/protocols/wlm/wlmsocket.cpp #972307:972308
@@ -18,6 +18,8 @@
#include <QTimer>
+#include "kopetesockettimeoutwatcher.h"
+
WlmSocket::WlmSocket(MSN::NotificationServerConnection * mainConnection, bool isSSL)
: mMainConnection(mainConnection), mIsSSL(isSSL), mPingTimer(0)
{
@@ -25,6 +27,10 @@
QObject::connect( this, SIGNAL(disconnected()), this, SLOT(connectionFinished()) \
);
QObject::connect( this, SIGNAL(encrypted()), this, \
SLOT(connectionEncryptedReady()) );
QObject::connect( this, SIGNAL(bytesWritten(qint64)), this, SLOT(resetPing()) );
+
+ Kopete::SocketTimeoutWatcher* timeoutWatcher = \
Kopete::SocketTimeoutWatcher::watch( this ); + if ( timeoutWatcher )
+ connect( timeoutWatcher, SIGNAL(error(QAbstractSocket::SocketError)), this, \
SIGNAL(error(QAbstractSocket::SocketError)) ); }
WlmSocket::~WlmSocket()
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic