mirror of
https://github.com/lsalzman/enet
synced 2024-11-21 06:25:59 -07:00
bound totalWaitingData decrement
Some checks failed
CMake / CMake ${{ matrix.os }} ${{ matrix.build_type }} (Debug, macos-latest) (push) Has been cancelled
CMake / CMake ${{ matrix.os }} ${{ matrix.build_type }} (Debug, ubuntu-latest) (push) Has been cancelled
CMake / CMake ${{ matrix.os }} ${{ matrix.build_type }} (Debug, windows-latest) (push) Has been cancelled
CMake / CMake ${{ matrix.os }} ${{ matrix.build_type }} (Release, macos-latest) (push) Has been cancelled
CMake / CMake ${{ matrix.os }} ${{ matrix.build_type }} (Release, ubuntu-latest) (push) Has been cancelled
CMake / CMake ${{ matrix.os }} ${{ matrix.build_type }} (Release, windows-latest) (push) Has been cancelled
Some checks failed
CMake / CMake ${{ matrix.os }} ${{ matrix.build_type }} (Debug, macos-latest) (push) Has been cancelled
CMake / CMake ${{ matrix.os }} ${{ matrix.build_type }} (Debug, ubuntu-latest) (push) Has been cancelled
CMake / CMake ${{ matrix.os }} ${{ matrix.build_type }} (Debug, windows-latest) (push) Has been cancelled
CMake / CMake ${{ matrix.os }} ${{ matrix.build_type }} (Release, macos-latest) (push) Has been cancelled
CMake / CMake ${{ matrix.os }} ${{ matrix.build_type }} (Release, ubuntu-latest) (push) Has been cancelled
CMake / CMake ${{ matrix.os }} ${{ matrix.build_type }} (Release, windows-latest) (push) Has been cancelled
This commit is contained in:
parent
a52811ef27
commit
1e80a78f48
1 changed files with 3 additions and 2 deletions
5
peer.c
5
peer.c
|
@ -4,6 +4,7 @@
|
||||||
*/
|
*/
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#define ENET_BUILDING_LIB 1
|
#define ENET_BUILDING_LIB 1
|
||||||
|
#include "enet/utility.h"
|
||||||
#include "enet/enet.h"
|
#include "enet/enet.h"
|
||||||
|
|
||||||
/** @defgroup peer ENet peer functions
|
/** @defgroup peer ENet peer functions
|
||||||
|
@ -249,7 +250,7 @@ enet_peer_receive (ENetPeer * peer, enet_uint8 * channelID)
|
||||||
|
|
||||||
enet_free (incomingCommand);
|
enet_free (incomingCommand);
|
||||||
|
|
||||||
peer -> totalWaitingData -= packet -> dataLength;
|
peer -> totalWaitingData -= ENET_MIN (peer -> totalWaitingData, packet -> dataLength);
|
||||||
|
|
||||||
return packet;
|
return packet;
|
||||||
}
|
}
|
||||||
|
@ -295,7 +296,7 @@ enet_peer_remove_incoming_commands (ENetPeer * peer, ENetList * queue, ENetListI
|
||||||
{
|
{
|
||||||
-- incomingCommand -> packet -> referenceCount;
|
-- incomingCommand -> packet -> referenceCount;
|
||||||
|
|
||||||
peer -> totalWaitingData -= incomingCommand -> packet -> dataLength;
|
peer -> totalWaitingData -= ENET_MIN (peer -> totalWaitingData, incomingCommand -> packet -> dataLength);
|
||||||
|
|
||||||
if (incomingCommand -> packet -> referenceCount == 0)
|
if (incomingCommand -> packet -> referenceCount == 0)
|
||||||
enet_packet_destroy (incomingCommand -> packet);
|
enet_packet_destroy (incomingCommand -> packet);
|
||||||
|
|
Loading…
Reference in a new issue