[kdeconnect-android/ssl] /: Using custom built Netty 4.0.25, with fix for high memory usage.

Albert Vaca albertvaka at gmail.com
Fri Aug 21 17:01:31 UTC 2015


Hi Vineet,

So with this version of Netty, we don't need the fix for Android 5?

Regardless of that, I think the problem of infinite reverse connections is
still a bug that can happen in other cases and we should keep the timer
approach to fix it. Can you put it back but this time generic (not only for
Android 5)?

Albert

On Thu, Aug 20, 2015 at 11:25 AM, Vineet Garg <grgvineet at gmail.com> wrote:

> Git commit 8cd59e701af9259509c6214d9ddbff09c97e154c by Vineet Garg.
> Committed on 20/08/2015 at 18:18.
> Pushed by vineetgarg into branch 'ssl'.
>
> Using custom built Netty 4.0.25, with fix for high memory usage.
> This version does not have any error, as of now and working fine
>
> Remove timer based blacklist for reverse connection since it is not needed
> now
>
> M  +-    --    libs/netty-handler.jar
> M  +1    -28
>  src/org/kde/kdeconnect/Backends/LanBackend/LanLinkProvider.java
>
>
> http://commits.kde.org/kdeconnect-android/8cd59e701af9259509c6214d9ddbff09c97e154c
>
> diff --git a/libs/netty-handler.jar b/libs/netty-handler.jar
> index b49a5e0..7e283cf 100644
> Binary files a/libs/netty-handler.jar and b/libs/netty-handler.jar differ
> diff --git
> a/src/org/kde/kdeconnect/Backends/LanBackend/LanLinkProvider.java
> b/src/org/kde/kdeconnect/Backends/LanBackend/LanLinkProvider.java
> index 2d573da..37c350b 100644
> --- a/src/org/kde/kdeconnect/Backends/LanBackend/LanLinkProvider.java
> +++ b/src/org/kde/kdeconnect/Backends/LanBackend/LanLinkProvider.java
> @@ -21,8 +21,6 @@
>  package org.kde.kdeconnect.Backends.LanBackend;
>
>  import android.content.Context;
> -import android.net.wifi.WifiManager;
> -import android.os.Build;
>  import android.preference.PreferenceManager;
>  import android.support.v4.util.LongSparseArray;
>  import android.util.Base64;
> @@ -41,10 +39,8 @@ import java.net.InetSocketAddress;
>  import java.security.cert.Certificate;
>  import java.util.ArrayList;
>  import java.util.HashMap;
> -import java.util.Set;
>  import java.util.Timer;
>  import java.util.TimerTask;
> -import java.util.concurrent.TimeUnit;
>
>  import javax.net.ssl.SSLEngine;
>  import javax.net.ssl.SSLHandshakeException;
> @@ -92,9 +88,6 @@ public class LanLinkProvider extends BaseLinkProvider {
>      private TcpHandler tcpHandler = new TcpHandler();
>      private UdpHandler udpHandler = new UdpHandler();
>
> -    private ArrayList<String> reverseConnectionBlacklist = new
> ArrayList<>();
> -    private Timer reverseConnectionTimer;
> -
>      @ChannelHandler.Sharable
>      private class TcpHandler extends SimpleChannelInboundHandler<String>{
>          @Override
> @@ -264,22 +257,7 @@ public class LanLinkProvider extends BaseLinkProvider
> {
>                              if (!future.isSuccess()) {
>                                  Log.e("KDE/LanLinkProvider", "Cannot
> connect to " + identityPackage.getString("deviceId"));
>                                  // Try reverse connection
> -
> -                                if
> (!reverseConnectionBlacklist.contains(identityPackage.getString("deviceId")))
> {
> -                                    // We are waiting for 3 seconds after
> trying reverse connection, to avoid any further emmission
> -                                    // Without this, infinite loop is
> created between two devices with Android 5.0, because server will not work
> on it
> -                                    // and it will cause trouble for
> ohter devices too
> -                                    reverseConnectionTimer = new Timer();
> -                                    reverseConnectionTimer.schedule(new
> TimerTask() {
> -                                        @Override
> -                                        public void run() {
> -
> reverseConnectionBlacklist.remove(identityPackage.getString("deviceId"));
> -                                        }
> -                                    }, 3*1000);
> -
> reverseConnectionBlacklist.add(identityPackage.getString("deviceId"));
> -                                    onNetworkChange();
> -                                }
> -
> +                                onNetworkChange();
>                                  return;
>                              }
>
> @@ -430,11 +408,6 @@ public class LanLinkProvider extends BaseLinkProvider
> {
>
>          clientGroup = new NioEventLoopGroup();
>
> -        if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
> -            // Server not working in Android Lollipop due to ssl bug
> -            return ;
> -        }
> -
>          bossGroup = new NioEventLoopGroup(1);
>          workerGroup = new NioEventLoopGroup();
>          try{
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdeconnect/attachments/20150821/a31fd9f6/attachment-0001.html>


More information about the KDEConnect mailing list