Skip to content
Snippets Groups Projects
Verified Commit 9d535387 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Further debugging improvements for #79

parent c722bb60
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -364,7 +364,7 @@ class QuasselService : DaggerLifecycleService(),
.observe(
this, Observer {
handlerService.backend {
LoggingHandler.log(INFO, "QuasselService", "Autoreconnect: Closed")
LoggingHandler.log(INFO, "QuasselService", "Autoreconnect: State Changed")
sessionManager.autoReconnect()
}
})
......
......@@ -19,6 +19,8 @@
package de.kuschku.quasseldroid.util.backport
import de.kuschku.libquassel.util.compatibility.LoggingHandler.Companion.log
import de.kuschku.libquassel.util.compatibility.LoggingHandler.LogLevel.ERROR
import java.io.InputStream
import java.nio.ByteBuffer
import java.nio.channels.ReadableByteChannel
......@@ -59,6 +61,10 @@ class ReadableWrappedChannel(
end(readData > 0)
}
if (readData <= 0) {
log(ERROR, "ReadableWrappedChannel", "Read: $readData")
}
// read is negative if no data was read, in that case, terminate
if (readData < 0)
break
......
......@@ -86,8 +86,13 @@ class CoreConnection(
}
fun setState(value: ConnectionState) {
val current = state.value
if (current != ConnectionState.CLOSED) {
log(DEBUG, TAG, value.name)
state.onNext(value)
} else if (current != value) {
log(WARN, TAG, "Trying to set state while closed: $value", Throwable())
}
}
private fun sendHandshake() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment