diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-12-22 15:46:23 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-12-22 16:53:18 (GMT) |
commit | 732253a9b3e88b99b36dd3298157cf502f743294 (patch) | |
tree | 3471f2d999dfe3cb2ae8f5aec5bdd7b3d1465078 /Swiften/Session/BOSHSessionStream.cpp | |
parent | 6c1e7d8a8339a849896566464bd9f1db33e3b3da (diff) | |
download | swift-contrib-732253a9b3e88b99b36dd3298157cf502f743294.zip swift-contrib-732253a9b3e88b99b36dd3298157cf502f743294.tar.bz2 |
BOSH Refactoring.
Diffstat (limited to 'Swiften/Session/BOSHSessionStream.cpp')
-rw-r--r-- | Swiften/Session/BOSHSessionStream.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Swiften/Session/BOSHSessionStream.cpp b/Swiften/Session/BOSHSessionStream.cpp index 73bbfd6..f53b8e1 100644 --- a/Swiften/Session/BOSHSessionStream.cpp +++ b/Swiften/Session/BOSHSessionStream.cpp @@ -27,9 +27,10 @@ namespace Swift { BOSHSessionStream::BOSHSessionStream( - boost::shared_ptr<BOSHConnectionFactory> connectionFactory, /*FIXME: probably rip out*/ + const URL& boshURL, PayloadParserFactoryCollection* payloadParserFactories, PayloadSerializerCollection* payloadSerializers, + ConnectionFactory* connectionFactory, TLSContextFactory* tlsContextFactory, TimerFactory* timerFactory, XMLParserFactory* xmlParserFactory, @@ -48,12 +49,11 @@ BOSHSessionStream::BOSHSessionStream( firstHeader(true) { boost::mt19937 random; - boost::uniform_int<long> dist(0, LONG_MAX); + boost::uniform_int<long long> dist(0, (1LL<<53) - 1); random.seed(time(NULL)); - boost::variate_generator<boost::mt19937&, boost::uniform_int<long> > randomRID(random, dist); - long initialRID = randomRID(); + long long initialRID = boost::variate_generator<boost::mt19937&, boost::uniform_int<long long> >(random, dist)(); - connectionPool = new BOSHConnectionPool(connectionFactory, to, initialRID, boshHTTPConnectProxyURL, boshHTTPConnectProxyAuthID, boshHTTPConnectProxyAuthPassword); + connectionPool = new BOSHConnectionPool(boshURL, connectionFactory, xmlParserFactory, tlsContextFactory, to, initialRID, boshHTTPConnectProxyURL, boshHTTPConnectProxyAuthID, boshHTTPConnectProxyAuthPassword); connectionPool->onSessionTerminated.connect(boost::bind(&BOSHSessionStream::handlePoolSessionTerminated, this, _1)); connectionPool->onSessionStarted.connect(boost::bind(&BOSHSessionStream::handlePoolSessionStarted, this)); connectionPool->onXMPPDataRead.connect(boost::bind(&BOSHSessionStream::handlePoolXMPPDataRead, this, _1)); |