aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp-vala/src')
-rw-r--r--xmpp-vala/src/core/xmpp_log.vala4
-rw-r--r--xmpp-vala/src/core/xmpp_stream.vala5
-rw-r--r--xmpp-vala/src/module/xep/0368_srv_records_tls.vala1
3 files changed, 7 insertions, 3 deletions
diff --git a/xmpp-vala/src/core/xmpp_log.vala b/xmpp-vala/src/core/xmpp_log.vala
index b42cd30a..921899c4 100644
--- a/xmpp-vala/src/core/xmpp_log.vala
+++ b/xmpp-vala/src/core/xmpp_log.vala
@@ -110,13 +110,13 @@ public class XmppLog {
public void node(string what, StanzaNode node) {
if (should_log_node(node)) {
- stderr.printf("%sXMPP %s [%s]%s\n%s\n", ANSI_COLOR_WHITE, what, ident, ANSI_COLOR_END, use_ansi ? node.to_ansi_string(hide_ns) : node.to_string());
+ stderr.printf("%sXMPP %s [%s]%s\n%s\n", use_ansi ? ANSI_COLOR_WHITE : "", what, ident, use_ansi ? ANSI_COLOR_END : "", use_ansi ? node.to_ansi_string(hide_ns) : node.to_string());
}
}
public void str(string what, string str) {
if (should_log_str(str)) {
- stderr.printf("%sXMPP %s [%s]%s\n%s\n", ANSI_COLOR_WHITE, what, ident, ANSI_COLOR_END, str);
+ stderr.printf("%sXMPP %s [%s]%s\n%s\n", use_ansi ? ANSI_COLOR_WHITE : "", what, ident, use_ansi ? ANSI_COLOR_END : "", str);
}
}
diff --git a/xmpp-vala/src/core/xmpp_stream.vala b/xmpp-vala/src/core/xmpp_stream.vala
index aff0b216..4bf6e0db 100644
--- a/xmpp-vala/src/core/xmpp_stream.vala
+++ b/xmpp-vala/src/core/xmpp_stream.vala
@@ -60,6 +60,7 @@ public class XmppStream {
stream = yield best_provider.connect(this);
}
if (stream == null) {
+ debug("Connecting to %s, xmpp-client, tcp (fallback)", this.remote_name.to_string());
stream = yield (new SocketClient()).connect_async(new NetworkService("xmpp-client", "tcp", this.remote_name.to_string()));
}
if (stream == null) {
@@ -67,9 +68,10 @@ public class XmppStream {
}
reset_stream((!)stream);
} catch (Error e) {
- debug("[%p] Could not connect to server", this);
+ debug("[%p] Could not connect to server: %s", this, e.message);
throw new IOStreamError.CONNECT(e.message);
}
+ debug("Connected to %s", remote_name);
yield loop();
}
@@ -379,6 +381,7 @@ public class StartTlsConnectionProvider : ConnectionProvider {
public async override IOStream? connect(XmppStream stream) {
try {
SocketClient client = new SocketClient();
+ debug("Connecting to %s %i (starttls)", srv_target.get_hostname(), srv_target.get_port());
return yield client.connect_to_host_async(srv_target.get_hostname(), srv_target.get_port());
} catch (Error e) {
return null;
diff --git a/xmpp-vala/src/module/xep/0368_srv_records_tls.vala b/xmpp-vala/src/module/xep/0368_srv_records_tls.vala
index a40d0bb5..3d0708fb 100644
--- a/xmpp-vala/src/module/xep/0368_srv_records_tls.vala
+++ b/xmpp-vala/src/module/xep/0368_srv_records_tls.vala
@@ -36,6 +36,7 @@ public class TlsConnectionProvider : ConnectionProvider {
public async override IOStream? connect(XmppStream stream) {
SocketClient client = new SocketClient();
try {
+ debug("Connecting to %s %i (tls)", srv_target.get_hostname(), srv_target.get_port());
IOStream? io_stream = yield client.connect_to_host_async(srv_target.get_hostname(), srv_target.get_port());
TlsConnection tls_connection = TlsClientConnection.new(io_stream, new NetworkAddress(stream.remote_name.to_string(), srv_target.get_port()));
tls_connection.accept_certificate.connect(stream.get_module(Tls.Module.IDENTITY).on_invalid_certificate);