pull/801/head
gedoor 4 years ago
parent fa88777ea8
commit c3ddd72e06
  1. 3
      app/src/main/java/io/legado/app/web/SourceDebugWebSocket.kt

@ -48,10 +48,8 @@ class SourceDebugWebSocket(handshakeRequest: NanoHTTPD.IHTTPSession) :
val tag = debugBean["tag"]
val key = debugBean["key"]
if (tag.isNullOrBlank() || key.isNullOrBlank()) {
kotlin.runCatching {
send(App.INSTANCE.getString(R.string.cannot_empty))
close(NanoWSD.WebSocketFrame.CloseCode.NormalClosure, "调试结束", false)
}
return
}
App.db.bookSourceDao.getBookSource(tag)?.let {
@ -75,6 +73,7 @@ class SourceDebugWebSocket(handshakeRequest: NanoHTTPD.IHTTPSession) :
send(msg)
if (state == -1 || state == 1000) {
Debug.cancelDebug(true)
close(NanoWSD.WebSocketFrame.CloseCode.NormalClosure, "调试结束", false)
}
}
}

Loading…
Cancel
Save