mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 16:05:19 +00:00
Process incoming fragments on message queue (#804)
Co-authored-by: jack <jackjackbits@users.noreply.github.com>
This commit is contained in:
@@ -2200,6 +2200,16 @@ extension BLEService {
|
||||
}
|
||||
|
||||
private func handleFragment(_ packet: BitchatPacket, from peerID: PeerID) {
|
||||
if DispatchQueue.getSpecific(key: messageQueueKey) != nil {
|
||||
_handleFragment(packet, from: peerID)
|
||||
} else {
|
||||
messageQueue.async(flags: .barrier) { [weak self] in
|
||||
self?._handleFragment(packet, from: peerID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func _handleFragment(_ packet: BitchatPacket, from peerID: PeerID) {
|
||||
// Don't process our own fragments
|
||||
if peerID == myPeerID {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user