From 6f311b7213cd34f12a7714433f86318c938ae3f9 Mon Sep 17 00:00:00 2001 From: vadym Date: Wed, 5 Aug 2020 14:48:57 -0700 Subject: [PATCH] 1. condition fix --- .../io/github/chronosx88/yggdrasil/YggdrasilTunService.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/src/main/java/io/github/chronosx88/yggdrasil/YggdrasilTunService.kt b/app/src/main/java/io/github/chronosx88/yggdrasil/YggdrasilTunService.kt index 78e11fc..8220a45 100644 --- a/app/src/main/java/io/github/chronosx88/yggdrasil/YggdrasilTunService.kt +++ b/app/src/main/java/io/github/chronosx88/yggdrasil/YggdrasilTunService.kt @@ -216,9 +216,7 @@ class YggdrasilTunService : VpnService() { try { // Read the outgoing packet from the input stream. val length = tunInputStream.read(buffer) - if(length>0) { - yggConduitEndpoint.send(buffer.sliceArray(IntRange(0, length - 1))) - } + yggConduitEndpoint.send(buffer.sliceArray(IntRange(0, length - 1))) } catch (e: IOException) { e.printStackTrace() }