summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-03-31 14:57:35 (GMT)
committerTobias Markmann <tm@ayena.de>2016-03-31 14:57:35 (GMT)
commitcfbdb43d2cadd40aa87338d41548e4bf89e146e6 (patch)
tree18d94153a302445196fc0c18586abf44a1ce4a38 /Swiften/Network/BOSHConnection.h
parent1d545a4a7fb877f021508094b88c1f17b30d8b4e (diff)
downloadswift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.zip
swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.tar.bz2
Convert tabs to 4 spaces for all source files
Removed trailing spaces and whitespace on empty lines in the process. Changed CheckTabs.py tool to disallow hard tabs in source files. Test-Information: Manually checked 30 random files that the conversion worked as expected. Change-Id: I874f99d617bd3d2bb55f02d58f22f58f9b094480
Diffstat (limited to 'Swiften/Network/BOSHConnection.h')
-rw-r--r--Swiften/Network/BOSHConnection.h184
1 files changed, 92 insertions, 92 deletions
diff --git a/Swiften/Network/BOSHConnection.h b/Swiften/Network/BOSHConnection.h
index da43e71..dc0f3a5 100644
--- a/Swiften/Network/BOSHConnection.h
+++ b/Swiften/Network/BOSHConnection.h
@@ -26,101 +26,101 @@
#include <Swiften/TLS/TLSError.h>
namespace boost {
- class thread;
- namespace system {
- class error_code;
- }
+ class thread;
+ namespace system {
+ class error_code;
+ }
}
class BOSHConnectionTest;
namespace Swift {
- class XMLParserFactory;
- class TLSContextFactory;
- class TLSLayer;
- struct TLSOptions;
- class HighLayer;
-
- class SWIFTEN_API BOSHError : public SessionStream::SessionStreamError {
- public:
- enum Type {
- BadRequest, HostGone, HostUnknown, ImproperAddressing,
- InternalServerError, ItemNotFound, OtherRequest, PolicyViolation,
- RemoteConnectionFailed, RemoteStreamError, SeeOtherURI, SystemShutdown, UndefinedCondition,
- NoError};
-
- BOSHError(Type type) : SessionStream::SessionStreamError(SessionStream::SessionStreamError::ConnectionReadError), type(type) {}
- Type getType() {return type;}
- typedef boost::shared_ptr<BOSHError> ref;
-
- private:
- Type type;
- };
-
- class SWIFTEN_API BOSHConnection : public boost::enable_shared_from_this<BOSHConnection> {
- public:
- typedef boost::shared_ptr<BOSHConnection> ref;
- static ref create(const URL& boshURL, Connector::ref connector, XMLParserFactory* parserFactory, TLSContextFactory* tlsContextFactory, const TLSOptions& tlsOptions) {
- return ref(new BOSHConnection(boshURL, connector, parserFactory, tlsContextFactory, tlsOptions));
- }
- virtual ~BOSHConnection();
- virtual void connect();
- virtual void disconnect();
- virtual void write(const SafeByteArray& data);
-
- const std::string& getSID();
- void setRID(unsigned long long rid);
- void setSID(const std::string& sid);
- void startStream(const std::string& to, unsigned long long rid);
- void terminateStream();
- bool isReadyToSend();
- void restartStream();
-
- bool setClientCertificate(CertificateWithKey::ref cert);
- Certificate::ref getPeerCertificate() const;
- std::vector<Certificate::ref> getPeerCertificateChain() const;
- CertificateVerificationError::ref getPeerCertificateVerificationError() const;
-
- boost::signal<void (bool /* error */)> onConnectFinished;
- boost::signal<void (bool /* error */)> onDisconnected;
- boost::signal<void (BOSHError::ref)> onSessionTerminated;
- boost::signal<void (const std::string& /*sid*/, size_t /*requests*/)> onSessionStarted;
- boost::signal<void (const SafeByteArray&)> onXMPPDataRead;
- boost::signal<void (const SafeByteArray&)> onBOSHDataRead;
- boost::signal<void (const SafeByteArray&)> onBOSHDataWritten;
- boost::signal<void (const std::string&)> onHTTPError;
-
- private:
- friend class ::BOSHConnectionTest;
-
- BOSHConnection(const URL& boshURL, Connector::ref connector, XMLParserFactory* parserFactory, TLSContextFactory* tlsContextFactory, const TLSOptions& tlsOptions);
-
- 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();
-
- void handleTLSConnected();
- void handleTLSApplicationDataRead(const SafeByteArray& data);
- void handleTLSNetowrkDataWriteRequest(const SafeByteArray& data);
- void handleRawDataRead(boost::shared_ptr<SafeByteArray> data);
- void handleTLSError(boost::shared_ptr<TLSError> error);
- void writeData(const SafeByteArray& data);
-
- URL boshURL_;
- Connector::ref connector_;
- XMLParserFactory* parserFactory_;
- boost::shared_ptr<Connection> connection_;
- boost::shared_ptr<HighLayer> dummyLayer_;
- boost::shared_ptr<TLSLayer> tlsLayer_;
- std::string sid_;
- bool waitingForStartResponse_;
- unsigned long long rid_;
- SafeByteArray buffer_;
- bool pending_;
- bool connectionReady_;
- };
+ class XMLParserFactory;
+ class TLSContextFactory;
+ class TLSLayer;
+ struct TLSOptions;
+ class HighLayer;
+
+ class SWIFTEN_API BOSHError : public SessionStream::SessionStreamError {
+ public:
+ enum Type {
+ BadRequest, HostGone, HostUnknown, ImproperAddressing,
+ InternalServerError, ItemNotFound, OtherRequest, PolicyViolation,
+ RemoteConnectionFailed, RemoteStreamError, SeeOtherURI, SystemShutdown, UndefinedCondition,
+ NoError};
+
+ BOSHError(Type type) : SessionStream::SessionStreamError(SessionStream::SessionStreamError::ConnectionReadError), type(type) {}
+ Type getType() {return type;}
+ typedef boost::shared_ptr<BOSHError> ref;
+
+ private:
+ Type type;
+ };
+
+ class SWIFTEN_API BOSHConnection : public boost::enable_shared_from_this<BOSHConnection> {
+ public:
+ typedef boost::shared_ptr<BOSHConnection> ref;
+ static ref create(const URL& boshURL, Connector::ref connector, XMLParserFactory* parserFactory, TLSContextFactory* tlsContextFactory, const TLSOptions& tlsOptions) {
+ return ref(new BOSHConnection(boshURL, connector, parserFactory, tlsContextFactory, tlsOptions));
+ }
+ virtual ~BOSHConnection();
+ virtual void connect();
+ virtual void disconnect();
+ virtual void write(const SafeByteArray& data);
+
+ const std::string& getSID();
+ void setRID(unsigned long long rid);
+ void setSID(const std::string& sid);
+ void startStream(const std::string& to, unsigned long long rid);
+ void terminateStream();
+ bool isReadyToSend();
+ void restartStream();
+
+ bool setClientCertificate(CertificateWithKey::ref cert);
+ Certificate::ref getPeerCertificate() const;
+ std::vector<Certificate::ref> getPeerCertificateChain() const;
+ CertificateVerificationError::ref getPeerCertificateVerificationError() const;
+
+ boost::signal<void (bool /* error */)> onConnectFinished;
+ boost::signal<void (bool /* error */)> onDisconnected;
+ boost::signal<void (BOSHError::ref)> onSessionTerminated;
+ boost::signal<void (const std::string& /*sid*/, size_t /*requests*/)> onSessionStarted;
+ boost::signal<void (const SafeByteArray&)> onXMPPDataRead;
+ boost::signal<void (const SafeByteArray&)> onBOSHDataRead;
+ boost::signal<void (const SafeByteArray&)> onBOSHDataWritten;
+ boost::signal<void (const std::string&)> onHTTPError;
+
+ private:
+ friend class ::BOSHConnectionTest;
+
+ BOSHConnection(const URL& boshURL, Connector::ref connector, XMLParserFactory* parserFactory, TLSContextFactory* tlsContextFactory, const TLSOptions& tlsOptions);
+
+ 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();
+
+ void handleTLSConnected();
+ void handleTLSApplicationDataRead(const SafeByteArray& data);
+ void handleTLSNetowrkDataWriteRequest(const SafeByteArray& data);
+ void handleRawDataRead(boost::shared_ptr<SafeByteArray> data);
+ void handleTLSError(boost::shared_ptr<TLSError> error);
+ void writeData(const SafeByteArray& data);
+
+ URL boshURL_;
+ Connector::ref connector_;
+ XMLParserFactory* parserFactory_;
+ boost::shared_ptr<Connection> connection_;
+ boost::shared_ptr<HighLayer> dummyLayer_;
+ boost::shared_ptr<TLSLayer> tlsLayer_;
+ std::string sid_;
+ bool waitingForStartResponse_;
+ unsigned long long rid_;
+ SafeByteArray buffer_;
+ bool pending_;
+ bool connectionReady_;
+ };
}