mirror of
https://github.com/JetpackDuba/Gitnuro.git
synced 2024-09-11 10:25:44 +03:00
Remove libssh stream logs
This commit is contained in:
parent
0a1c812bf9
commit
33c7db5863
@ -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
|
||||
}
|
||||
}
|
@ -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()
|
||||
}
|
||||
|
||||
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user