summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/LinkLocal')
-rw-r--r--Swiften/LinkLocal/OutgoingLinkLocalSession.cpp15
-rw-r--r--Swiften/LinkLocal/OutgoingLinkLocalSession.h2
2 files changed, 11 insertions, 6 deletions
diff --git a/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp b/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp
index f32bcdd..f97520a 100644
--- a/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp
+++ b/Swiften/LinkLocal/OutgoingLinkLocalSession.cpp
@@ -55,7 +55,7 @@ void OutgoingLinkLocalSession::handleHostnameResolved(const String& hostname, co
boost::shared_ptr<Connection> connection = connectionFactory_->createConnection();
setConnection(connection);
initializeStreamStack();
- connection->onConnected.connect(boost::bind(&OutgoingLinkLocalSession::handleConnected, boost::dynamic_pointer_cast<OutgoingLinkLocalSession>(shared_from_this())));
+ connection->onConnectFinished.connect(boost::bind(&OutgoingLinkLocalSession::handleConnected, boost::dynamic_pointer_cast<OutgoingLinkLocalSession>(shared_from_this()), _1));
connection->connect(HostAddressPort(*address, port_));
}
else {
@@ -65,10 +65,15 @@ void OutgoingLinkLocalSession::handleHostnameResolved(const String& hostname, co
}
}
-void OutgoingLinkLocalSession::handleConnected() {
- ProtocolHeader header;
- header.setFrom(getLocalJID());
- getXMPPLayer()->writeHeader(header);
+void OutgoingLinkLocalSession::handleConnected(bool error) {
+ if (!error) {
+ ProtocolHeader header;
+ header.setFrom(getLocalJID());
+ getXMPPLayer()->writeHeader(header);
+ }
+ else {
+ // TODO: Error
+ }
}
void OutgoingLinkLocalSession::handleStreamStart(const ProtocolHeader&) {
diff --git a/Swiften/LinkLocal/OutgoingLinkLocalSession.h b/Swiften/LinkLocal/OutgoingLinkLocalSession.h
index abbec80..76ab803 100644
--- a/Swiften/LinkLocal/OutgoingLinkLocalSession.h
+++ b/Swiften/LinkLocal/OutgoingLinkLocalSession.h
@@ -41,7 +41,7 @@ namespace Swift {
void handleElement(boost::shared_ptr<Element>);
void handleStreamStart(const ProtocolHeader&);
void handleHostnameResolved(const String& hostname, const boost::optional<HostAddress>& address);
- void handleConnected();
+ void handleConnected(bool error);
private:
bool resolving_;