Process incoming fragments on message queue (#804)

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
This commit is contained in:
jack
2025-10-14 12:20:39 +02:00
committed by GitHub
co-authored by jack
parent 987ba2e694
commit e3149fa098
+10
View File
@@ -2200,6 +2200,16 @@ extension BLEService {
} }
private func handleFragment(_ packet: BitchatPacket, from peerID: PeerID) { 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 // Don't process our own fragments
if peerID == myPeerID { if peerID == myPeerID {
return return