mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-13 09:34:53 +02:00
* Style fixes for Servent.
This commit is contained in:
committed by
Michael Zanetti
parent
b3b47398bc
commit
81a406d1b5
@@ -252,6 +252,7 @@ Servent::createConnectionKey( const QString& name, const QString &nodeid, const
|
|||||||
return _key;
|
return _key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Servent::isValidExternalIP( const QHostAddress& addr )
|
Servent::isValidExternalIP( const QHostAddress& addr )
|
||||||
{
|
{
|
||||||
@@ -309,12 +310,14 @@ Servent::isValidExternalIP( const QHostAddress& addr )
|
|||||||
return !addr.isNull();
|
return !addr.isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Servent::registerOffer( const QString& key, Connection* conn )
|
Servent::registerOffer( const QString& key, Connection* conn )
|
||||||
{
|
{
|
||||||
d_func()->offers[key] = QPointer<Connection>(conn);
|
d_func()->offers[key] = QPointer<Connection>(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Servent::registerLazyOffer(const QString &key, const peerinfo_ptr &peerInfo, const QString &nodeid, const int timeout )
|
Servent::registerLazyOffer(const QString &key, const peerinfo_ptr &peerInfo, const QString &nodeid, const int timeout )
|
||||||
{
|
{
|
||||||
@@ -326,6 +329,7 @@ Servent::registerLazyOffer(const QString &key, const peerinfo_ptr &peerInfo, con
|
|||||||
timer->start();
|
timer->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Servent::deleteLazyOffer( const QString& key )
|
Servent::deleteLazyOffer( const QString& key )
|
||||||
{
|
{
|
||||||
@@ -373,6 +377,7 @@ Servent::lookupControlConnection( const SipInfo& sipInfo )
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ControlConnection*
|
ControlConnection*
|
||||||
Servent::lookupControlConnection( const QString& nodeid )
|
Servent::lookupControlConnection( const QString& nodeid )
|
||||||
{
|
{
|
||||||
@@ -423,6 +428,7 @@ Servent::getLocalSipInfos( const QString& nodeid, const QString& key )
|
|||||||
return sipInfos;
|
return sipInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Servent::queueForAclResult( const QString& username, const QSet<peerinfo_ptr>& peerInfos )
|
Servent::queueForAclResult( const QString& username, const QSet<peerinfo_ptr>& peerInfos )
|
||||||
{
|
{
|
||||||
@@ -439,6 +445,7 @@ Servent::queueForAclResult( const QString& username, const QSet<peerinfo_ptr>& p
|
|||||||
d_func()->queuedForACLResult[username][ (*peerInfos.begin())->nodeId() ] = QSet<Tomahawk::peerinfo_ptr>( peerInfos );
|
d_func()->queuedForACLResult[username][ (*peerInfos.begin())->nodeId() ] = QSet<Tomahawk::peerinfo_ptr>( peerInfos );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SipInfo
|
SipInfo
|
||||||
Servent::getSipInfoForOldVersions( const QList<SipInfo>& sipInfos )
|
Servent::getSipInfoForOldVersions( const QList<SipInfo>& sipInfos )
|
||||||
{
|
{
|
||||||
@@ -457,6 +464,7 @@ Servent::getSipInfoForOldVersions( const QList<SipInfo>& sipInfos )
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Servent::registerPeer( const Tomahawk::peerinfo_ptr& peerInfo )
|
Servent::registerPeer( const Tomahawk::peerinfo_ptr& peerInfo )
|
||||||
{
|
{
|
||||||
@@ -534,7 +542,8 @@ Servent::onSipInfoChanged()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Servent::handleSipInfo( const Tomahawk::peerinfo_ptr& peerInfo )
|
void
|
||||||
|
Servent::handleSipInfo( const Tomahawk::peerinfo_ptr& peerInfo )
|
||||||
{
|
{
|
||||||
// We do not have received the initial SipInfo for this client yet, so wait for it.
|
// We do not have received the initial SipInfo for this client yet, so wait for it.
|
||||||
// Each client will have at least one non-visible SipInfo
|
// Each client will have at least one non-visible SipInfo
|
||||||
@@ -544,6 +553,7 @@ void Servent::handleSipInfo( const Tomahawk::peerinfo_ptr& peerInfo )
|
|||||||
ConnectionManager::getManagerForNodeId( peerInfo->nodeId() )->handleSipInfo( peerInfo );
|
ConnectionManager::getManagerForNodeId( peerInfo->nodeId() )->handleSipInfo( peerInfo );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Servent::incomingConnection( int sd )
|
Servent::incomingConnection( int sd )
|
||||||
{
|
{
|
||||||
@@ -784,6 +794,7 @@ Servent::socketConnected()
|
|||||||
handoverSocket( conn, sock );
|
handoverSocket( conn, sock );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// transfers ownership of socket to the connection and inits the connection
|
// transfers ownership of socket to the connection and inits the connection
|
||||||
void
|
void
|
||||||
Servent::handoverSocket( Connection* conn, QTcpSocketExtra* sock )
|
Servent::handoverSocket( Connection* conn, QTcpSocketExtra* sock )
|
||||||
@@ -804,6 +815,7 @@ Servent::handoverSocket( Connection* conn, QTcpSocketExtra* sock )
|
|||||||
conn->start( sock );
|
conn->start( sock );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Servent::cleanupSocket( QTcpSocketExtra *sock )
|
Servent::cleanupSocket( QTcpSocketExtra *sock )
|
||||||
{
|
{
|
||||||
@@ -820,6 +832,7 @@ Servent::cleanupSocket( QTcpSocketExtra *sock )
|
|||||||
sock->deleteLater();
|
sock->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Servent::initiateConnection( const SipInfo& sipInfo, Connection* conn )
|
Servent::initiateConnection( const SipInfo& sipInfo, Connection* conn )
|
||||||
{
|
{
|
||||||
@@ -868,6 +881,7 @@ Servent::initiateConnection( const SipInfo& sipInfo, Connection* conn )
|
|||||||
sock->moveToThread( thread() );
|
sock->moveToThread( thread() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Servent::socketError( QAbstractSocket::SocketError e )
|
Servent::socketError( QAbstractSocket::SocketError e )
|
||||||
{
|
{
|
||||||
@@ -898,6 +912,7 @@ Servent::socketError( QAbstractSocket::SocketError e )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Servent::checkACLResult( const QString& nodeid, const QString& username, ACLRegistry::ACL peerStatus )
|
Servent::checkACLResult( const QString& nodeid, const QString& username, ACLRegistry::ACL peerStatus )
|
||||||
{
|
{
|
||||||
@@ -925,6 +940,7 @@ Servent::checkACLResult( const QString& nodeid, const QString& username, ACLRegi
|
|||||||
d_func()->queuedForACLResult[username].remove( nodeid );
|
d_func()->queuedForACLResult[username].remove( nodeid );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Servent::reverseOfferRequest( ControlConnection* orig_conn, const QString& theirdbid, const QString& key, const QString& theirkey )
|
Servent::reverseOfferRequest( ControlConnection* orig_conn, const QString& theirdbid, const QString& key, const QString& theirkey )
|
||||||
{
|
{
|
||||||
@@ -947,12 +963,14 @@ Servent::reverseOfferRequest( ControlConnection* orig_conn, const QString& their
|
|||||||
createParallelConnection( orig_conn, new_conn, theirkey );
|
createParallelConnection( orig_conn, new_conn, theirkey );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Servent::visibleExternally() const
|
Servent::visibleExternally() const
|
||||||
{
|
{
|
||||||
return (!d_func()->externalHostname.isNull()) || (d_func()->externalAddresses.length() > 0);
|
return (!d_func()->externalHostname.isNull()) || (d_func()->externalAddresses.length() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Servent::ipv6ConnectivityLikely() const
|
Servent::ipv6ConnectivityLikely() const
|
||||||
{
|
{
|
||||||
@@ -967,30 +985,35 @@ Servent::ipv6ConnectivityLikely() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Servent::port() const
|
Servent::port() const
|
||||||
{
|
{
|
||||||
return d_func()->port;
|
return d_func()->port;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QList<QHostAddress>
|
QList<QHostAddress>
|
||||||
Servent::addresses() const
|
Servent::addresses() const
|
||||||
{
|
{
|
||||||
return d_func()->externalAddresses;
|
return d_func()->externalAddresses;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString
|
QString
|
||||||
Servent::additionalAddress() const
|
Servent::additionalAddress() const
|
||||||
{
|
{
|
||||||
return d_func()->externalHostname;
|
return d_func()->externalHostname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Servent::additionalPort() const
|
Servent::additionalPort() const
|
||||||
{
|
{
|
||||||
return d_func()->externalPort;
|
return d_func()->externalPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// return the appropriate connection for a given offer key, or NULL if invalid
|
// return the appropriate connection for a given offer key, or NULL if invalid
|
||||||
Connection*
|
Connection*
|
||||||
Servent::claimOffer( ControlConnection* cc, const QString &nodeid, const QString &key, const QHostAddress peer )
|
Servent::claimOffer( ControlConnection* cc, const QString &nodeid, const QString &key, const QHostAddress peer )
|
||||||
@@ -1219,12 +1242,14 @@ Servent::connectedToSession( const QString& session )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned int
|
unsigned int
|
||||||
Servent::numConnectedPeers() const
|
Servent::numConnectedPeers() const
|
||||||
{
|
{
|
||||||
return d_func()->controlconnections.length();
|
return d_func()->controlconnections.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QList<StreamConnection *>
|
QList<StreamConnection *>
|
||||||
Servent::streams() const
|
Servent::streams() const
|
||||||
{
|
{
|
||||||
@@ -1310,6 +1335,7 @@ Servent::httpIODeviceFactory( const Tomahawk::result_ptr& result,
|
|||||||
callback( sp );
|
callback( sp );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Servent::isReady() const
|
Servent::isReady() const
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user