mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-30 14:44:27 +02:00
Added a try catch to HandlePacket.
This commit is contained in:
parent
73b048d4c5
commit
0e64fa8d4c
@ -121,6 +121,7 @@ class SyncSession : IAuthorizable {
|
||||
}
|
||||
|
||||
fun handlePacket(socketSession: SyncSocketSession, opcode: UByte, subOpcode: UByte, data: ByteBuffer) {
|
||||
try {
|
||||
Logger.i(TAG, "Handle packet (opcode: ${opcode}, subOpcode: ${subOpcode}, data.length: ${data.remaining()})")
|
||||
|
||||
when (opcode) {
|
||||
@ -146,7 +147,6 @@ class SyncSession : IAuthorizable {
|
||||
|
||||
Logger.i(TAG, "Received (opcode = ${opcode}, subOpcode = ${subOpcode}) (${data.remaining()} bytes)")
|
||||
//TODO: Abstract this out
|
||||
try {
|
||||
when (subOpcode) {
|
||||
GJSyncOpcodes.sendToDevices -> {
|
||||
StateApp.instance.scopeOrNull?.launch(Dispatchers.Main) {
|
||||
|
@ -274,7 +274,7 @@ class SyncSocketSession {
|
||||
_sendBuffer.asUByteArray()[4] = opcode
|
||||
_sendBuffer.asUByteArray()[5] = subOpcode
|
||||
|
||||
//Logger.i(TAG, "Encrypting message (size = ${HEADER_SIZE})")
|
||||
//Logger.i(TAG, "Encrypting message (opcode = ${opcode}, subOpcode = ${subOpcode}, size = ${HEADER_SIZE})")
|
||||
|
||||
val len = _cipherStatePair!!.sender.encryptWithAd(null, _sendBuffer, 0, _sendBufferEncrypted, 0, HEADER_SIZE)
|
||||
//Logger.i(TAG, "Sending encrypted message (size = ${len})")
|
||||
|
Loading…
x
Reference in New Issue
Block a user