diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ssh/libssh/streams/LibSshChannelInputErrStream.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ssh/libssh/streams/LibSshChannelInputErrStream.kt index 5af0146..4faaed4 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ssh/libssh/streams/LibSshChannelInputErrStream.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ssh/libssh/streams/LibSshChannelInputErrStream.kt @@ -1,18 +1,14 @@ package com.jetpackduba.gitnuro.ssh.libssh.streams -import com.jetpackduba.gitnuro.logging.printLog import com.jetpackduba.gitnuro.ssh.libssh.SSHLibrary import com.jetpackduba.gitnuro.ssh.libssh.ssh_channel import java.io.InputStream -private const val TAG = "LibSshChannelInputErrSt" - class LibSshChannelInputErrStream(private val sshChannel: ssh_channel) : InputStream() { private var cancelled = false private val sshLib = SSHLibrary.INSTANCE override fun read(): Int { - printLog(TAG, "Read error") val buffer = ByteArray(1) return if (sshLib.ssh_channel_poll(sshChannel, 1) > 0) { @@ -20,15 +16,12 @@ class LibSshChannelInputErrStream(private val sshChannel: ssh_channel) : InputSt val first = buffer.first() - printLog(TAG, "Read error finished ${first.toInt()} - ${String(buffer)}") - first.toInt() } else -1 } override fun close() { - println("Closing error") cancelled = true } } \ No newline at end of file diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ssh/libssh/streams/LibSshChannelInputStream.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ssh/libssh/streams/LibSshChannelInputStream.kt index 4edce84..34389ad 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ssh/libssh/streams/LibSshChannelInputStream.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ssh/libssh/streams/LibSshChannelInputStream.kt @@ -4,7 +4,6 @@ import com.jetpackduba.gitnuro.ssh.libssh.SSHLibrary import com.jetpackduba.gitnuro.ssh.libssh.ssh_channel import java.io.InputStream - class LibSshChannelInputStream(private val sshChannel: ssh_channel) : InputStream() { private val sshLib = SSHLibrary.INSTANCE @@ -25,8 +24,6 @@ class LibSshChannelInputStream(private val sshChannel: ssh_channel) : InputStrea val first = buffer.first() - print(String(buffer)) - return first.toInt() } diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ssh/libssh/streams/LibSshChannelOutputStream.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ssh/libssh/streams/LibSshChannelOutputStream.kt index ba160a5..abde2d1 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ssh/libssh/streams/LibSshChannelOutputStream.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ssh/libssh/streams/LibSshChannelOutputStream.kt @@ -1,33 +1,22 @@ package com.jetpackduba.gitnuro.ssh.libssh.streams -import com.jetpackduba.gitnuro.logging.printDebug -import com.jetpackduba.gitnuro.logging.printLog import com.jetpackduba.gitnuro.ssh.libssh.SSHLibrary import com.jetpackduba.gitnuro.ssh.libssh.ssh_channel import java.io.OutputStream -private const val TAG = "LibSshChannelOutputStre" - class LibSshChannelOutputStream(private val sshChannel: ssh_channel) : OutputStream() { private val sshLib = SSHLibrary.INSTANCE override fun write(b: Int) { - printDebug(TAG, "Write int") - val byteArrayData = byteArrayOf(b.toByte()) write(byteArrayData) - - printDebug(TAG, "Write int") } override fun write(b: ByteArray) { - printDebug(TAG, "Write byte") sshLib.ssh_channel_write(sshChannel, b, b.size) - printDebug(TAG, "Write byte finished") } override fun close() { - printDebug(TAG, "Closing output") } }