summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlli Salli <ollisal@gmail.com>2011-09-16 21:21:04 +0300
committerOlli Salli <ollisal@gmail.com>2011-10-10 19:17:42 +0300
commit7b9190cf987cba11012b0c7511598f24e9672886 (patch)
treeec61eaacc3c511f5b41ee6211dd56c2d3b9d3269
parent95ec0179c45f4d6b53a265e34dc24afc00d8fdaa (diff)
Admit that STC::TcpSrcAddrGens need to modify their state for generating
-rw-r--r--TelepathyQt4/stream-tube-client.cpp6
-rw-r--r--TelepathyQt4/stream-tube-client.h6
-rw-r--r--tests/dbus/stream-tube-handlers.cpp6
3 files changed, 9 insertions, 9 deletions
diff --git a/TelepathyQt4/stream-tube-client.cpp b/TelepathyQt4/stream-tube-client.cpp
index 3fe9d9b4..2e9d0290 100644
--- a/TelepathyQt4/stream-tube-client.cpp
+++ b/TelepathyQt4/stream-tube-client.cpp
@@ -88,7 +88,7 @@ struct TELEPATHY_QT4_NO_EXPORT StreamTubeClient::Private
bool isRegistered;
bool acceptsAsTcp, acceptsAsUnix;
- const TcpSourceAddressGenerator *tcpGenerator;
+ TcpSourceAddressGenerator *tcpGenerator;
bool requireCredentials;
QHash<StreamTubeChannelPtr, TubeWrapper *> tubes;
@@ -313,7 +313,7 @@ bool StreamTubeClient::acceptsAsTcp() const
return mPriv->acceptsAsTcp;
}
-const StreamTubeClient::TcpSourceAddressGenerator *StreamTubeClient::tcpGenerator() const
+StreamTubeClient::TcpSourceAddressGenerator *StreamTubeClient::tcpGenerator() const
{
if (!acceptsAsTcp()) {
warning() << "StreamTubeClient::tcpGenerator() used, but not accepting as TCP, returning 0";
@@ -328,7 +328,7 @@ bool StreamTubeClient::acceptsAsUnix() const
return mPriv->acceptsAsUnix;
}
-void StreamTubeClient::setToAcceptAsTcp(const TcpSourceAddressGenerator *generator)
+void StreamTubeClient::setToAcceptAsTcp(TcpSourceAddressGenerator *generator)
{
mPriv->tcpGenerator = generator;
mPriv->acceptsAsTcp = true;
diff --git a/TelepathyQt4/stream-tube-client.h b/TelepathyQt4/stream-tube-client.h
index 9dad8e04..c5f557e6 100644
--- a/TelepathyQt4/stream-tube-client.h
+++ b/TelepathyQt4/stream-tube-client.h
@@ -58,7 +58,7 @@ public:
// The tube param can be used to extract the service, initiator contact and other useful
// information for making the decision
virtual QPair<QHostAddress /* source interface address */, quint16 /* source port */>
- nextSourceAddress(const AccountPtr &account, const IncomingStreamTubeChannelPtr &tube) const = 0;
+ nextSourceAddress(const AccountPtr &account, const IncomingStreamTubeChannelPtr &tube) = 0;
protected:
virtual ~TcpSourceAddressGenerator() {}
@@ -120,10 +120,10 @@ public:
bool monitorsConnections() const;
bool acceptsAsTcp() const; // if setToAcceptAsTCP has been used last
- const TcpSourceAddressGenerator *tcpGenerator() const; // warn and return NULL if !acceptsAsTCP
+ TcpSourceAddressGenerator *tcpGenerator() const; // warn and return NULL if !acceptsAsTCP
bool acceptsAsUnix() const; // if setToAcceptAsUnix has been used last
- void setToAcceptAsTcp(const TcpSourceAddressGenerator *generator = 0); // 0 -> Localhost AC used
+ void setToAcceptAsTcp(TcpSourceAddressGenerator *generator = 0); // 0 -> Localhost AC used
void setToAcceptAsUnix(bool requireCredentials = false); // whether CM should req SCM_CREDENTIALS
// This will always be populated
diff --git a/tests/dbus/stream-tube-handlers.cpp b/tests/dbus/stream-tube-handlers.cpp
index 34762d62..95fd4117 100644
--- a/tests/dbus/stream-tube-handlers.cpp
+++ b/tests/dbus/stream-tube-handlers.cpp
@@ -1297,11 +1297,11 @@ void TestStreamTubeHandlers::testClientBasicTcp()
FakeGenerator() : port(0) {}
QPair<QHostAddress, quint16> nextSourceAddress(const AccountPtr &account,
- const IncomingStreamTubeChannelPtr &tube) const {
+ const IncomingStreamTubeChannelPtr &tube) {
return qMakePair(QHostAddress(QHostAddress::LocalHost), ++port);
}
- mutable quint16 port;
+ quint16 port;
} gen;
client->setToAcceptAsTcp(&gen);
@@ -1391,7 +1391,7 @@ void TestStreamTubeHandlers::testClientTcpGeneratorIgnore()
{
public:
QPair<QHostAddress, quint16> nextSourceAddress(const AccountPtr &account,
- const IncomingStreamTubeChannelPtr &tube) const {
+ const IncomingStreamTubeChannelPtr &tube) {
return qMakePair(QHostAddress(QHostAddress::LocalHost), quint16(1111));
}
} gen;