mirror of
https://github.com/google/bumble.git
synced 2026-04-16 00:25:31 +00:00
Fixed bug where it's possible for tx_credit to goe negative
This commit is contained in:
@@ -671,7 +671,7 @@ class DLC(utils.EventEmitter):
|
||||
def process_tx(self) -> None:
|
||||
# Send anything we can (or an empty frame if we need to send rx credits)
|
||||
rx_credits_needed = self.rx_credits_needed()
|
||||
while (self.tx_buffer and self.tx_credits > 0) or rx_credits_needed > 0:
|
||||
while (self.tx_buffer and self.tx_credits > 0) or (rx_credits_needed > 0 and self.tx_credit > 0):
|
||||
# Get the next chunk, up to MTU size
|
||||
if rx_credits_needed > 0:
|
||||
chunk = bytes([rx_credits_needed]) + self.tx_buffer[: self.mtu - 1]
|
||||
|
||||
Reference in New Issue
Block a user