Remove libssh stream logs

This commit is contained in:
Abdelilah El Aissaoui 2023-05-03 21:25:25 +02:00
parent 0a1c812bf9
commit 33c7db5863
No known key found for this signature in database
GPG Key ID: 7587FC860F594869
3 changed files with 0 additions and 21 deletions

View File

@ -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
}
}

View File

@ -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()
}

View File

@ -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")
}
}