diff options
Diffstat (limited to 'thirdparty/enet')
-rw-r--r-- | thirdparty/enet/LICENSE | 2 | ||||
-rw-r--r-- | thirdparty/enet/enet/enet.h | 13 | ||||
-rw-r--r-- | thirdparty/enet/protocol.c | 16 |
3 files changed, 26 insertions, 5 deletions
diff --git a/thirdparty/enet/LICENSE b/thirdparty/enet/LICENSE index 39af84a8f6..78d9dcf613 100644 --- a/thirdparty/enet/LICENSE +++ b/thirdparty/enet/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2002-2016 Lee Salzman +Copyright (c) 2002-2019 Lee Salzman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/thirdparty/enet/enet/enet.h b/thirdparty/enet/enet/enet.h index 246cbb0a62..966e3a465d 100644 --- a/thirdparty/enet/enet/enet.h +++ b/thirdparty/enet/enet/enet.h @@ -22,7 +22,7 @@ extern "C" #define ENET_VERSION_MAJOR 1 #define ENET_VERSION_MINOR 3 -#define ENET_VERSION_PATCH 13 +#define ENET_VERSION_PATCH 14 #define ENET_VERSION_CREATE(major, minor, patch) (((major)<<16) | ((minor)<<8) | (patch)) #define ENET_VERSION_GET_MAJOR(version) (((version)>>16)&0xFF) #define ENET_VERSION_GET_MINOR(version) (((version)>>8)&0xFF) @@ -507,6 +507,17 @@ ENET_API int enet_socketset_select (ENetSocket, ENetSocketSet *, ENetSock /** @defgroup Address ENet address functions @{ */ + +/** Attempts to parse the printable form of the IP address in the parameter hostName + and sets the host field in the address parameter if successful. + @param address destination to store the parsed IP address + @param hostName IP address to parse + @retval 0 on success + @retval < 0 on failure + @returns the address of the given hostName in address on success +*/ +ENET_API int enet_address_set_host_ip (ENetAddress * address, const char * hostName); + /** Attempts to resolve the host named by the parameter hostName and sets the host field in the address parameter if successful. @param address destination to store resolved address diff --git a/thirdparty/enet/protocol.c b/thirdparty/enet/protocol.c index ab26886de4..28ad5fc41c 100644 --- a/thirdparty/enet/protocol.c +++ b/thirdparty/enet/protocol.c @@ -163,7 +163,10 @@ enet_protocol_remove_sent_unreliable_commands (ENetPeer * peer) { ENetOutgoingCommand * outgoingCommand; - while (! enet_list_empty (& peer -> sentUnreliableCommands)) + if (enet_list_empty (& peer -> sentUnreliableCommands)) + return; + + do { outgoingCommand = (ENetOutgoingCommand *) enet_list_front (& peer -> sentUnreliableCommands); @@ -182,7 +185,13 @@ enet_protocol_remove_sent_unreliable_commands (ENetPeer * peer) } enet_free (outgoingCommand); - } + } while (! enet_list_empty (& peer -> sentUnreliableCommands)); + + if (peer -> state == ENET_PEER_STATE_DISCONNECT_LATER && + enet_list_empty (& peer -> outgoingReliableCommands) && + enet_list_empty (& peer -> outgoingUnreliableCommands) && + enet_list_empty (& peer -> sentReliableCommands)) + enet_peer_disconnect (peer, peer -> eventData); } static ENetProtocolCommand @@ -1405,7 +1414,8 @@ enet_protocol_send_unreliable_outgoing_commands (ENetHost * host, ENetPeer * pee if (peer -> state == ENET_PEER_STATE_DISCONNECT_LATER && enet_list_empty (& peer -> outgoingReliableCommands) && enet_list_empty (& peer -> outgoingUnreliableCommands) && - enet_list_empty (& peer -> sentReliableCommands)) + enet_list_empty (& peer -> sentReliableCommands) && + enet_list_empty (& peer -> sentUnreliableCommands)) enet_peer_disconnect (peer, peer -> eventData); } |