summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-01-17 07:54:39 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-01-17 20:30:57 (GMT)
commit093d499945d779cfed92b45e413644834004b0d9 (patch)
tree537347674b8285295be9f38b1b27f9fe62a40895 /Swiften/Network/BOSHConnection.h
parente3e6e344dbb7df85e5f13eef944285ea2262e980 (diff)
downloadswift-contrib-093d499945d779cfed92b45e413644834004b0d9.zip
swift-contrib-093d499945d779cfed92b45e413644834004b0d9.tar.bz2
Allow specifying BOSH and BOSH proxy URLs with names (rather than IPs)
Diffstat (limited to 'Swiften/Network/BOSHConnection.h')
-rw-r--r--Swiften/Network/BOSHConnection.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/Swiften/Network/BOSHConnection.h b/Swiften/Network/BOSHConnection.h
index 4d53253..d9fa016 100644
--- a/Swiften/Network/BOSHConnection.h
+++ b/Swiften/Network/BOSHConnection.h
@@ -16,6 +16,7 @@
#include <boost/enable_shared_from_this.hpp>
#include <Swiften/Network/Connection.h>
+#include <Swiften/Network/Connector.h>
#include <Swiften/Network/HostAddressPort.h>
#include <Swiften/Base/String.h>
#include <Swiften/Base/URL.h>
@@ -32,7 +33,6 @@ namespace boost {
class BOSHConnectionTest;
namespace Swift {
- class ConnectionFactory;
class XMLParserFactory;
class TLSContextFactory;
@@ -54,8 +54,8 @@ namespace Swift {
class BOSHConnection : public boost::enable_shared_from_this<BOSHConnection> {
public:
typedef boost::shared_ptr<BOSHConnection> ref;
- static ref create(const URL& boshURL, ConnectionFactory* connectionFactory, XMLParserFactory* parserFactory, TLSContextFactory* tlsFactory) {
- return ref(new BOSHConnection(boshURL, connectionFactory, parserFactory, tlsFactory));
+ static ref create(const URL& boshURL, Connector::ref connector, XMLParserFactory* parserFactory) {
+ return ref(new BOSHConnection(boshURL, connector, parserFactory));
}
virtual ~BOSHConnection();
virtual void connect();
@@ -65,7 +65,7 @@ namespace Swift {
const std::string& getSID();
void setRID(unsigned long long rid);
void setSID(const std::string& sid);
- void startStream(const std::string& to, unsigned long rid);
+ void startStream(const std::string& to, unsigned long long rid);
void terminateStream();
bool isReadyToSend();
void restartStream();
@@ -83,17 +83,18 @@ namespace Swift {
private:
friend class ::BOSHConnectionTest;
- BOSHConnection(const URL& boshURL, ConnectionFactory* connectionFactory, XMLParserFactory* parserFactory, TLSContextFactory* tlsFactory);
+ BOSHConnection(const URL& boshURL, Connector::ref connector, XMLParserFactory* parserFactory);
- static std::pair<SafeByteArray, size_t> createHTTPRequest(const SafeByteArray& data, bool streamRestart, bool terminate, long rid, const std::string& sid, const URL& boshURL);
- void handleConnectionConnectFinished(bool error);
+ static std::pair<SafeByteArray, size_t> createHTTPRequest(const SafeByteArray& data, bool streamRestart, bool terminate, unsigned long long rid, const std::string& sid, const URL& boshURL);
+ void handleConnectFinished(Connection::ref);
void handleDataRead(boost::shared_ptr<SafeByteArray> data);
void handleDisconnected(const boost::optional<Connection::Error>& error);
void write(const SafeByteArray& data, bool streamRestart, bool terminate); /* FIXME: refactor */
BOSHError::Type parseTerminationCondition(const std::string& text);
+ void cancelConnector();
URL boshURL_;
- ConnectionFactory* connectionFactory_;
+ Connector::ref connector_;
XMLParserFactory* parserFactory_;
boost::shared_ptr<Connection> connection_;
std::string sid_;
@@ -101,7 +102,6 @@ namespace Swift {
unsigned long long rid_;
SafeByteArray buffer_;
bool pending_;
- TLSContextFactory* tlsFactory_;
bool connectionReady_;
};
}