From f41f3b120cdf8ee07a6f10b17c38cbb6cb2692eb Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Sun, 16 Nov 2014 12:00:53 +0100 Subject: [PATCH 1/3] better error checking in ssl switch over Conflicts: src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java --- .../siacs/conversations/xmpp/XmppConnection.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 2b9d6632d..d59a302dc 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -18,6 +18,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.math.BigInteger; +import java.net.IDN; +import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Socket; import java.net.UnknownHostException; @@ -553,12 +555,15 @@ public class XmppConnection implements Runnable { HostnameVerifier verifier = this.mXmppConnectionService.getMemorizingTrustManager().wrapHostnameVerifier(new StrictHostnameVerifier()); - if (socket == null) { - throw new IOException("socket was null"); + if (socket == null || socket.isClosed()) { + throw new IOException("socket null or closed"); } - SSLSocket sslSocket = (SSLSocket) factory.createSocket(socket, - socket.getInetAddress().getHostAddress(), socket.getPort(), - true); + final InetAddress address = socket.getInetAddress(); + if (address == null) { + throw new IOException("socket address was null"); + } + + final SSLSocket sslSocket = (SSLSocket) factory.createSocket(socket,address.getHostAddress(), socket.getPort(),true); // Support all protocols except legacy SSL. // The min SDK version prevents us having to worry about SSLv2. In From ccc3c100668b693a7ccde1075661a71ab654f51d Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Sun, 16 Nov 2014 12:11:14 +0100 Subject: [PATCH 2/3] show full time stamp in connection established field --- .../java/eu/siacs/conversations/ui/EditAccountActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java index c1da35f51..29a6395d6 100644 --- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java @@ -415,7 +415,7 @@ public class EditAccountActivity extends XmppActivity { if (this.mAccount.getStatus() == Account.STATUS_ONLINE && !this.mFetchingAvatar) { this.mStats.setVisibility(View.VISIBLE); - this.mSessionEst.setText(UIHelper.readableTimeDifference( + this.mSessionEst.setText(UIHelper.readableTimeDifferenceFull( getApplicationContext(), this.mAccount.getXmppConnection() .getLastSessionEstablished())); Features features = this.mAccount.getXmppConnection().getFeatures(); From 279534ddb485007721d43751408fae42cd98b955 Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Sun, 16 Nov 2014 12:25:08 +0100 Subject: [PATCH 3/3] version bump to 0.8.4 --- CHANGELOG.md | 3 +++ build.gradle | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 990545334..db4f687bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ###Changelog +####Version 0.8.4 +* bug fixes + ####Version 0.8.3 * increased UI performance * fixed rotation bugs diff --git a/build.gradle b/build.gradle index 0e6396da5..6def8bb2e 100644 --- a/build.gradle +++ b/build.gradle @@ -45,8 +45,8 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion 19 - versionCode 35 - versionName "0.8.3" + versionCode 36 + versionName "0.8.4" } compileOptions {