mirror of
https://github.com/afska/gba-link-connection.git
synced 2026-04-25 16:23:41 -05:00
Fixing full buffer check in LinkWireless::send(...)
This commit is contained in:
parent
a11ed09bf0
commit
22c997a62a
|
|
@ -635,7 +635,7 @@ class LinkWireless {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!_canSend()) {
|
||||
if (!_canAddNewMessage()) {
|
||||
if (_author < 0)
|
||||
lastError = BUFFER_IS_FULL;
|
||||
return false;
|
||||
|
|
@ -733,13 +733,21 @@ class LinkWireless {
|
|||
[[nodiscard]] bool _hasActiveAsyncCommand() { return asyncCommand.isActive; }
|
||||
|
||||
/**
|
||||
* @brief Returns whether there's room for new outgoing messages or not.
|
||||
* @brief Returns whether there's room for sending messages or not.
|
||||
* \warning This is internal API!
|
||||
*/
|
||||
[[nodiscard]] bool _canSend() {
|
||||
return !sessionState.outgoingMessages.isFull();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns whether there's room for scheduling new messages or not.
|
||||
* \warning This is internal API!
|
||||
*/
|
||||
[[nodiscard]] bool _canAddNewMessage() {
|
||||
return !sessionState.newOutgoingMessages.isFull();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns the number of pending outgoing messages.
|
||||
* \warning This is internal API!
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user