mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-09-25 02:39:04 +00:00
Fixed sending packets without data in sync protocol.
This commit is contained in:
parent
5b8905c1d2
commit
07e78e0d12
2 changed files with 2 additions and 4 deletions
|
@ -477,8 +477,6 @@ class StateSync {
|
|||
}
|
||||
}.apply { start() }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun getDeviceName(): String {
|
||||
|
|
|
@ -447,14 +447,14 @@ class SyncSocketSession {
|
|||
ensureNotMainThread()
|
||||
|
||||
synchronized(_sendLockObject) {
|
||||
ByteBuffer.wrap(_sendBuffer, 0, 4).order(ByteOrder.LITTLE_ENDIAN).putInt(2)
|
||||
ByteBuffer.wrap(_sendBuffer, 0, 4).order(ByteOrder.LITTLE_ENDIAN).putInt(HEADER_SIZE - 4)
|
||||
_sendBuffer.asUByteArray()[4] = opcode
|
||||
_sendBuffer.asUByteArray()[5] = subOpcode
|
||||
_sendBuffer.asUByteArray()[6] = ContentEncoding.Raw.value
|
||||
|
||||
//Logger.i(TAG, "Encrypting message (opcode = ${opcode}, subOpcode = ${subOpcode}, size = ${HEADER_SIZE})")
|
||||
|
||||
val len = _cipherStatePair!!.sender.encryptWithAd(null, _sendBuffer, 0, _sendBufferEncrypted, 0, HEADER_SIZE)
|
||||
val len = _cipherStatePair!!.sender.encryptWithAd(null, _sendBuffer, 0, _sendBufferEncrypted, 4, HEADER_SIZE)
|
||||
//Logger.i(TAG, "Sending encrypted message (size = ${len})")
|
||||
|
||||
ByteBuffer.wrap(_sendBufferEncrypted, 0, 4).order(ByteOrder.LITTLE_ENDIAN).putInt(len)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue