From f46fee0acc8e243b2b6910b09693f93c3aad775f Mon Sep 17 00:00:00 2001 From: "lsalzman@gmail.com" Date: Sat, 4 Jun 2016 18:12:24 -0400 Subject: [PATCH 01/24] typo fix --- include/enet/enet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/enet/enet.h b/include/enet/enet.h index 9389400..650b199 100644 --- a/include/enet/enet.h +++ b/include/enet/enet.h @@ -409,7 +409,7 @@ typedef enum _ENetEventType ENET_EVENT_TYPE_CONNECT = 1, /** a peer has disconnected. This event is generated on a successful - * completion of a disconnect initiated by enet_pper_disconnect, if + * completion of a disconnect initiated by enet_peer_disconnect, if * a peer has timed out, or if a connection request intialized by * enet_host_connect has timed out. The peer field contains the peer * which disconnected. The data field contains user supplied data From 3ae5af4548d4d0fbf9335f415d14897ce231a5a1 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sat, 6 May 2017 14:55:03 -0400 Subject: [PATCH 02/24] add portable enet_address_set_host_ip that can properly parse broadcast address --- include/enet/enet.h | 11 +++++++++++ unix.c | 22 ++++++++++++++-------- win32.c | 34 +++++++++++++++++++++++++++------- 3 files changed, 52 insertions(+), 15 deletions(-) diff --git a/include/enet/enet.h b/include/enet/enet.h index 650b199..c762453 100644 --- a/include/enet/enet.h +++ b/include/enet/enet.h @@ -509,6 +509,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/unix.c b/unix.c index b3cadd0..c36a082 100644 --- a/unix.c +++ b/unix.c @@ -101,6 +101,19 @@ enet_time_set (enet_uint32 newTimeBase) timeBase = timeVal.tv_sec * 1000 + timeVal.tv_usec / 1000 - newTimeBase; } +int +enet_address_set_host_ip (ENetAddress * address, const char * name) +{ +#ifdef HAS_INET_PTON + if (! inet_pton (AF_INET, name, & address -> host)) +#else + if (! inet_aton (name, (struct in_addr *) & address -> host)) +#endif + return -1; + + return 0; +} + int enet_address_set_host (ENetAddress * address, const char * name) { @@ -153,14 +166,7 @@ enet_address_set_host (ENetAddress * address, const char * name) } #endif -#ifdef HAS_INET_PTON - if (! inet_pton (AF_INET, name, & address -> host)) -#else - if (! inet_aton (name, (struct in_addr *) & address -> host)) -#endif - return -1; - - return 0; + return enet_address_set_host_ip (address, name); } int diff --git a/win32.c b/win32.c index 5cc1679..81175a4 100644 --- a/win32.c +++ b/win32.c @@ -59,6 +59,32 @@ enet_time_set (enet_uint32 newTimeBase) timeBase = (enet_uint32) timeGetTime () - newTimeBase; } +int +enet_address_set_host_ip (ENetAddress * address, const char * name) +{ + enet_uint8 vals [4] = { 0, 0, 0, 0 }; + int i; + + for (i = 0; i < 4; ++ i) + { + const char * next = name + 1; + if (* name != '0') + { + long val = strtol (name, (char **) & next, 10); + if (val < 0 || val > 255 || next == name || next - name > 3) + return -1; + vals [i] = (enet_uint8) val; + } + + if (* next != (i < 3 ? '.' : '\0')) + return -1; + name = next + 1; + } + + memcpy (& address -> host, vals, sizeof (enet_uint32)); + return 0; +} + int enet_address_set_host (ENetAddress * address, const char * name) { @@ -67,13 +93,7 @@ enet_address_set_host (ENetAddress * address, const char * name) hostEntry = gethostbyname (name); if (hostEntry == NULL || hostEntry -> h_addrtype != AF_INET) - { - unsigned long host = inet_addr (name); - if (host == INADDR_NONE) - return -1; - address -> host = host; - return 0; - } + return enet_address_set_host_ip (address, name); address -> host = * (enet_uint32 *) hostEntry -> h_addr_list [0]; From 5f5e977eefbd2522c6d85b70465e65c4ddaee05a Mon Sep 17 00:00:00 2001 From: Cong Date: Sun, 21 May 2017 20:05:56 +1000 Subject: [PATCH 03/24] MSVC only warn up to level 3 enet produces warnings at level 4, which can interrupt compiles if warnings are treated as errors. Turning down the warning level resolves the issue. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fe2f1b..c3c561a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,9 @@ check_struct_has_member("struct msghdr" "msg_flags" "sys/types.h;sys/socket.h" H set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h" "sys/socket.h") check_type_size("socklen_t" HAS_SOCKLEN_T BUILTIN_TYPES_ONLY) unset(CMAKE_EXTRA_INCLUDE_FILES) +if(MSVC) + add_definitions(-W3) +endif() if(HAS_FCNTL) add_definitions(-DHAS_FCNTL=1) From 90560cd471ed0a93ce52eae71996d8eeaa752f0c Mon Sep 17 00:00:00 2001 From: Cong Date: Mon, 22 May 2017 10:15:27 +1000 Subject: [PATCH 04/24] Don't treat warnings as errors When enet is included as a child CMake project in a parent that has warnings treated as errors, enet fails to build. This ensures that the compiler doesn't treat warnings as errors for enet. --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c3c561a..6c99c3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,8 @@ check_type_size("socklen_t" HAS_SOCKLEN_T BUILTIN_TYPES_ONLY) unset(CMAKE_EXTRA_INCLUDE_FILES) if(MSVC) add_definitions(-W3) +else() + add_definitions(-Wno-error) endif() if(HAS_FCNTL) From 6cc8cc8a26645681a6c38487316b130caac89402 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Wed, 12 Jul 2017 19:24:14 -0600 Subject: [PATCH 05/24] Fix mingw compilation In order to compile enet on mingw, you need to link against winmm and ws2_32. This explicitly makes those libraries required on mingw --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c99c3e..f1f9a01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,3 +68,7 @@ add_library(enet STATIC unix.c win32.c ) + +if (MINGW) + target_link_libraries(enet winmm ws2_32) +endif() \ No newline at end of file From 67f964c2ad49317fa57ba4ca556ded6bc3dad9cf Mon Sep 17 00:00:00 2001 From: Lukasz Fronc Date: Sun, 15 Oct 2017 11:02:29 +0200 Subject: [PATCH 06/24] CMake source groups added for cleaner VS solutions. --- CMakeLists.txt | 48 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f1f9a01..d3d4aa8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ if(MSVC) else() add_definitions(-Wno-error) endif() - + if(HAS_FCNTL) add_definitions(-DHAS_FCNTL=1) endif() @@ -54,21 +54,41 @@ endif() if(HAS_SOCKLEN_T) add_definitions(-DHAS_SOCKLEN_T=1) endif() - + include_directories(${PROJECT_SOURCE_DIR}/include) - + +set(INCLUDE_FILES_PREFIX include/enet) +set(INCLUDE_FILES + ${INCLUDE_FILES_PREFIX}/callbacks.h + ${INCLUDE_FILES_PREFIX}/enet.h + ${INCLUDE_FILES_PREFIX}/list.h + ${INCLUDE_FILES_PREFIX}/protocol.h + ${INCLUDE_FILES_PREFIX}/time.h + ${INCLUDE_FILES_PREFIX}/types.h + ${INCLUDE_FILES_PREFIX}/unix.h + ${INCLUDE_FILES_PREFIX}/utility.h + ${INCLUDE_FILES_PREFIX}/win32.h +) + +set(SOURCE_FILES + callbacks.c + compress.c + host.c + list.c + packet.c + peer.c + protocol.c + unix.c + win32.c) + +source_group(include FILES ${INCLUDE_FILES}) +source_group(source FILES ${SOURCE_FILES}) + add_library(enet STATIC - callbacks.c - compress.c - host.c - list.c - packet.c - peer.c - protocol.c - unix.c - win32.c - ) + ${INCLUDE_FILES} + ${SOURCE_FILES} +) if (MINGW) target_link_libraries(enet winmm ws2_32) -endif() \ No newline at end of file +endif() From 2e1c6bceeab0bc2b3d18fc7d7253f9b8bf6cb963 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sun, 19 Aug 2018 22:30:47 -0400 Subject: [PATCH 07/24] remove bandwidth limits from tutorial --- docs/tutorial.dox | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorial.dox b/docs/tutorial.dox index e91eae8..19a7a45 100644 --- a/docs/tutorial.dox +++ b/docs/tutorial.dox @@ -102,8 +102,8 @@ may be simultaneously open. client = enet_host_create (NULL /* create a client host */, 1 /* only allow 1 outgoing connection */, 2 /* allow up 2 channels to be used, 0 and 1 */, - 57600 / 8 /* 56K modem with 56 Kbps downstream bandwidth */, - 14400 / 8 /* 56K modem with 14 Kbps upstream bandwidth */); + 0 /* assume any amount of incoming bandwidth */, + 0 /* assume any amount of outgoing bandwidth */); if (client == NULL) { From 335715309c873cf528f477577f3ecf1c6f987350 Mon Sep 17 00:00:00 2001 From: Sebastian Valle Date: Mon, 10 Sep 2018 22:46:13 -0500 Subject: [PATCH 08/24] Use instead of in unix.c is the correct POSIX header according to the POSIX standard. Some targets (like homebrew for the Nintendo Switch) do not provide a so it makes compiling for them rather hard. --- unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix.c b/unix.c index c36a082..4fa6287 100644 --- a/unix.c +++ b/unix.c @@ -51,7 +51,7 @@ #endif #ifdef HAS_POLL -#include +#include #endif #ifndef HAS_SOCKLEN_T From 219c625c743c44153ba0926d8b84c69643bee720 Mon Sep 17 00:00:00 2001 From: Sebastian Valle Date: Mon, 10 Sep 2018 23:19:30 -0500 Subject: [PATCH 09/24] Add the include to unix.h. Some files were using ENET_HOST_TO_NET_32 and ENET_NET_TO_HOST_32 without having included the file beforehand, leading to compiler warnings about implicit declarations of ntohl and htonl. --- include/enet/unix.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/enet/unix.h b/include/enet/unix.h index a59e340..b55be33 100644 --- a/include/enet/unix.h +++ b/include/enet/unix.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include From cea2c5be9faa13a451d3c767601db95f7e0bff15 Mon Sep 17 00:00:00 2001 From: Sebastian Valle Date: Mon, 10 Sep 2018 23:21:55 -0500 Subject: [PATCH 10/24] Remove the now unneeded include in unix.c This is already included in unix.h --- unix.c | 1 - 1 file changed, 1 deletion(-) diff --git a/unix.c b/unix.c index c36a082..91dad72 100644 --- a/unix.c +++ b/unix.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include From b8713bdf88dba9a3e1ac75fc50923b7f23e00115 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sun, 27 Jan 2019 14:46:45 -0500 Subject: [PATCH 11/24] delay handling of DISCONNECT_LATER until in-flight unreliable packets are sent --- protocol.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/protocol.c b/protocol.c index 29d6487..eee7f88 100644 --- a/protocol.c +++ b/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 @@ -1406,7 +1415,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); } From 0eaf48eeb0d94a18d079378d8b76d588832ce838 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sun, 27 Jan 2019 15:00:06 -0500 Subject: [PATCH 12/24] enet 1.3.14 release prep --- ChangeLog | 4 ++++ Doxyfile | 2 +- LICENSE | 2 +- Makefile.am | 2 +- configure.ac | 2 +- docs/mainpage.dox | 2 +- include/enet/enet.h | 2 +- 7 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 663c7b7..7df3467 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ +ENet 1.3.14 (January 27, 2019): + +* bug fix for enet_peer_disconnect_later() * use getaddrinfo and getnameinfo where available +* miscellenous cleanups ENet 1.3.13 (April 30, 2015): diff --git a/Doxyfile b/Doxyfile index 597ef1a..ddb8b0a 100644 --- a/Doxyfile +++ b/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "ENet" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = v1.3.13 +PROJECT_NUMBER = v1.3.14 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/LICENSE b/LICENSE index 39af84a..78d9dcf 100644 --- a/LICENSE +++ b/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/Makefile.am b/Makefile.am index e839463..354deba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,7 +16,7 @@ enetinclude_HEADERS = \ lib_LTLIBRARIES = libenet.la libenet_la_SOURCES = callbacks.c compress.c host.c list.c packet.c peer.c protocol.c unix.c win32.c # see info '(libtool) Updating version info' before making a release -libenet_la_LDFLAGS = $(AM_LDFLAGS) -version-info 7:1:0 +libenet_la_LDFLAGS = $(AM_LDFLAGS) -version-info 7:2:0 AM_CPPFLAGS = -I$(top_srcdir)/include ACLOCAL_AMFLAGS = -Im4 diff --git a/configure.ac b/configure.ac index a4206db..7a3340b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([libenet], [1.3.13]) +AC_INIT([libenet], [1.3.14]) AC_CONFIG_SRCDIR([include/enet/enet.h]) AM_INIT_AUTOMAKE([foreign]) diff --git a/docs/mainpage.dox b/docs/mainpage.dox index 7fbbee1..68a83cd 100644 --- a/docs/mainpage.dox +++ b/docs/mainpage.dox @@ -36,7 +36,7 @@ portable, and easily embeddable. You can retrieve the source to ENet by downloading it in either .tar.gz form or accessing the github distribution directly. -The most recent stable release (1.3.13) can be downloaded here. +The most recent stable release (1.3.14) can be downloaded here. The last release that is protocol compatible with the 1.2 series or earlier (1.2.5) can be downloaded here. You can find the most recent ENet source at the github repository. diff --git a/include/enet/enet.h b/include/enet/enet.h index c762453..4a704ee 100644 --- a/include/enet/enet.h +++ b/include/enet/enet.h @@ -25,7 +25,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) From 6537dc81f36ff9c8d5c5a0f53950e4d39b374475 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Tue, 3 Mar 2020 15:34:06 -0500 Subject: [PATCH 13/24] make RTT calculations more TCP-like (contributed by Vladimir 'virtul' Ivannikov) --- protocol.c | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/protocol.c b/protocol.c index eee7f88..afdef99 100644 --- a/protocol.c +++ b/protocol.c @@ -851,24 +851,39 @@ enet_protocol_handle_acknowledge (ENetHost * host, ENetEvent * event, ENetPeer * if (ENET_TIME_LESS (host -> serviceTime, receivedSentTime)) return 0; - peer -> lastReceiveTime = host -> serviceTime; - peer -> earliestTimeout = 0; - roundTripTime = ENET_TIME_DIFFERENCE (host -> serviceTime, receivedSentTime); enet_peer_throttle (peer, roundTripTime); - peer -> roundTripTimeVariance -= peer -> roundTripTimeVariance / 4; - - if (roundTripTime >= peer -> roundTripTime) + if (peer -> lastReceiveTime > 0) { - peer -> roundTripTime += (roundTripTime - peer -> roundTripTime) / 8; - peer -> roundTripTimeVariance += (roundTripTime - peer -> roundTripTime) / 4; + if (roundTripTime >= peer -> roundTripTime) + { + enet_uint32 diff = roundTripTime - peer -> roundTripTime; + peer -> roundTripTimeVariance -= peer -> roundTripTimeVariance / 4; + peer -> roundTripTimeVariance += diff / 4; + peer -> roundTripTime += diff / 8; + } + else + { + enet_uint32 diff = peer -> roundTripTime - roundTripTime; + if (diff <= peer -> roundTripTimeVariance) + { + peer -> roundTripTimeVariance -= peer -> roundTripTimeVariance / 4; + peer -> roundTripTimeVariance += diff / 4; + } + else + { + peer -> roundTripTimeVariance -= peer -> roundTripTimeVariance / 32; + peer -> roundTripTimeVariance += diff / 32; + } + peer -> roundTripTime -= diff / 8; + } } else { - peer -> roundTripTime -= (peer -> roundTripTime - roundTripTime) / 8; - peer -> roundTripTimeVariance += (peer -> roundTripTime - roundTripTime) / 4; + peer -> roundTripTime = roundTripTime; + peer -> roundTripTimeVariance = roundTripTime / 2; } if (peer -> roundTripTime < peer -> lowestRoundTripTime) @@ -887,6 +902,9 @@ enet_protocol_handle_acknowledge (ENetHost * host, ENetEvent * event, ENetPeer * peer -> packetThrottleEpoch = host -> serviceTime; } + peer -> lastReceiveTime = ENET_MAX (host -> serviceTime, 1); + peer -> earliestTimeout = 0; + receivedReliableSequenceNumber = ENET_NET_TO_HOST_16 (command -> acknowledge.receivedReliableSequenceNumber); commandNumber = enet_protocol_remove_sent_reliable_command (peer, receivedReliableSequenceNumber, command -> header.channelID); From b4c427059aa39ce42ae4c82afcfe617dea255c4d Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Fri, 3 Apr 2020 03:48:38 -0400 Subject: [PATCH 14/24] clamp roundTripTime --- protocol.c | 1 + 1 file changed, 1 insertion(+) diff --git a/protocol.c b/protocol.c index afdef99..885bb72 100644 --- a/protocol.c +++ b/protocol.c @@ -852,6 +852,7 @@ enet_protocol_handle_acknowledge (ENetHost * host, ENetEvent * event, ENetPeer * return 0; roundTripTime = ENET_TIME_DIFFERENCE (host -> serviceTime, receivedSentTime); + roundTripTime = ENET_MAX (roundTripTime, 1); enet_peer_throttle (peer, roundTripTime); From 6991632abf1af161f332bf38bd8517c7c2834b58 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sat, 4 Apr 2020 12:30:54 -0400 Subject: [PATCH 15/24] accumulate fractional RTT values --- include/enet/enet.h | 11 +++++++++-- peer.c | 23 +++++++++++++---------- protocol.c | 39 +++++++++++++++++++++++---------------- 3 files changed, 45 insertions(+), 28 deletions(-) diff --git a/include/enet/enet.h b/include/enet/enet.h index 4a704ee..174e062 100644 --- a/include/enet/enet.h +++ b/include/enet/enet.h @@ -216,7 +216,7 @@ enum ENET_HOST_DEFAULT_MAXIMUM_PACKET_SIZE = 32 * 1024 * 1024, ENET_HOST_DEFAULT_MAXIMUM_WAITING_DATA = 32 * 1024 * 1024, - ENET_PEER_DEFAULT_ROUND_TRIP_TIME = 500, + ENET_PEER_DEFAULT_ROUND_TRIP_TIME = 350, ENET_PEER_DEFAULT_PACKET_THROTTLE = 32, ENET_PEER_PACKET_THROTTLE_SCALE = 32, ENET_PEER_PACKET_THROTTLE_COUNTER = 7, @@ -250,6 +250,11 @@ typedef struct _ENetChannel ENetList incomingUnreliableCommands; } ENetChannel; +typedef enum _ENetPeerFlag +{ + ENET_PEER_FLAG_NEEDS_DISPATCH = (1 << 0) +} ENetPeerFlag; + /** * An ENet peer which data packets may be sent or received from. * @@ -311,7 +316,9 @@ typedef struct _ENetPeer ENetList outgoingReliableCommands; ENetList outgoingUnreliableCommands; ENetList dispatchedCommands; - int needsDispatch; + enet_uint16 flags; + enet_uint8 roundTripTimeRemainder; + enet_uint8 roundTripTimeVarianceRemainder; enet_uint16 incomingUnsequencedGroup; enet_uint16 outgoingUnsequencedGroup; enet_uint32 unsequencedWindow [ENET_PEER_UNSEQUENCED_WINDOW_SIZE / 32]; diff --git a/peer.c b/peer.c index e2d0872..2f483a2 100644 --- a/peer.c +++ b/peer.c @@ -306,11 +306,11 @@ enet_peer_reset_queues (ENetPeer * peer) { ENetChannel * channel; - if (peer -> needsDispatch) + if (peer -> flags & ENET_PEER_FLAG_NEEDS_DISPATCH) { enet_list_remove (& peer -> dispatchList); - peer -> needsDispatch = 0; + peer -> flags &= ~ ENET_PEER_FLAG_NEEDS_DISPATCH; } while (! enet_list_empty (& peer -> acknowledgements)) @@ -418,6 +418,9 @@ enet_peer_reset (ENetPeer * peer) peer -> outgoingUnsequencedGroup = 0; peer -> eventData = 0; peer -> totalWaitingData = 0; + peer -> flags = 0; + peer -> roundTripTimeRemainder = 0; + peer -> roundTripTimeVarianceRemainder = 0; memset (peer -> unsequencedWindow, 0, sizeof (peer -> unsequencedWindow)); @@ -724,11 +727,11 @@ enet_peer_dispatch_incoming_unreliable_commands (ENetPeer * peer, ENetChannel * { enet_list_move (enet_list_end (& peer -> dispatchedCommands), startCommand, enet_list_previous (currentCommand)); - if (! peer -> needsDispatch) + if (! (peer -> flags & ENET_PEER_FLAG_NEEDS_DISPATCH)) { enet_list_insert (enet_list_end (& peer -> host -> dispatchQueue), & peer -> dispatchList); - peer -> needsDispatch = 1; + peer -> flags |= ENET_PEER_FLAG_NEEDS_DISPATCH; } droppedCommand = currentCommand; @@ -752,11 +755,11 @@ enet_peer_dispatch_incoming_unreliable_commands (ENetPeer * peer, ENetChannel * { enet_list_move (enet_list_end (& peer -> dispatchedCommands), startCommand, enet_list_previous (currentCommand)); - if (! peer -> needsDispatch) + if (! (peer -> flags & ENET_PEER_FLAG_NEEDS_DISPATCH)) { enet_list_insert (enet_list_end (& peer -> host -> dispatchQueue), & peer -> dispatchList); - peer -> needsDispatch = 1; + peer -> flags |= ENET_PEER_FLAG_NEEDS_DISPATCH; } } } @@ -768,11 +771,11 @@ enet_peer_dispatch_incoming_unreliable_commands (ENetPeer * peer, ENetChannel * { enet_list_move (enet_list_end (& peer -> dispatchedCommands), startCommand, enet_list_previous (currentCommand)); - if (! peer -> needsDispatch) + if (! (peer -> flags & ENET_PEER_FLAG_NEEDS_DISPATCH)) { enet_list_insert (enet_list_end (& peer -> host -> dispatchQueue), & peer -> dispatchList); - peer -> needsDispatch = 1; + peer -> flags |= ENET_PEER_FLAG_NEEDS_DISPATCH; } droppedCommand = currentCommand; @@ -809,11 +812,11 @@ enet_peer_dispatch_incoming_reliable_commands (ENetPeer * peer, ENetChannel * ch enet_list_move (enet_list_end (& peer -> dispatchedCommands), enet_list_begin (& channel -> incomingReliableCommands), enet_list_previous (currentCommand)); - if (! peer -> needsDispatch) + if (! (peer -> flags & ENET_PEER_FLAG_NEEDS_DISPATCH)) { enet_list_insert (enet_list_end (& peer -> host -> dispatchQueue), & peer -> dispatchList); - peer -> needsDispatch = 1; + peer -> flags |= ENET_PEER_FLAG_NEEDS_DISPATCH; } if (! enet_list_empty (& channel -> incomingUnreliableCommands)) diff --git a/protocol.c b/protocol.c index 885bb72..98ee51e 100644 --- a/protocol.c +++ b/protocol.c @@ -48,11 +48,11 @@ enet_protocol_dispatch_state (ENetHost * host, ENetPeer * peer, ENetPeerState st { enet_protocol_change_state (host, peer, state); - if (! peer -> needsDispatch) + if (! (peer -> flags & ENET_PEER_FLAG_NEEDS_DISPATCH)) { enet_list_insert (enet_list_end (& host -> dispatchQueue), & peer -> dispatchList); - peer -> needsDispatch = 1; + peer -> flags |= ENET_PEER_FLAG_NEEDS_DISPATCH; } } @@ -63,7 +63,7 @@ enet_protocol_dispatch_incoming_commands (ENetHost * host, ENetEvent * event) { ENetPeer * peer = (ENetPeer *) enet_list_remove (enet_list_begin (& host -> dispatchQueue)); - peer -> needsDispatch = 0; + peer -> flags &= ~ ENET_PEER_FLAG_NEEDS_DISPATCH; switch (peer -> state) { @@ -101,7 +101,7 @@ enet_protocol_dispatch_incoming_commands (ENetHost * host, ENetEvent * event) if (! enet_list_empty (& peer -> dispatchedCommands)) { - peer -> needsDispatch = 1; + peer -> flags |= ENET_PEER_FLAG_NEEDS_DISPATCH; enet_list_insert (enet_list_end (& host -> dispatchQueue), & peer -> dispatchList); } @@ -858,28 +858,35 @@ enet_protocol_handle_acknowledge (ENetHost * host, ENetEvent * event, ENetPeer * if (peer -> lastReceiveTime > 0) { - if (roundTripTime >= peer -> roundTripTime) + enet_uint32 accumRoundTripTime = (peer -> roundTripTime << 8) + peer -> roundTripTimeRemainder; + enet_uint32 accumRoundTripTimeVariance = (peer -> roundTripTimeVariance << 8) + peer -> roundTripTimeVarianceRemainder; + roundTripTime <<= 8; + if (roundTripTime >= accumRoundTripTime) { - enet_uint32 diff = roundTripTime - peer -> roundTripTime; - peer -> roundTripTimeVariance -= peer -> roundTripTimeVariance / 4; - peer -> roundTripTimeVariance += diff / 4; - peer -> roundTripTime += diff / 8; + enet_uint32 diff = roundTripTime - accumRoundTripTime; + accumRoundTripTimeVariance -= accumRoundTripTimeVariance / 4; + accumRoundTripTimeVariance += diff / 4; + accumRoundTripTime += diff / 8; } else { - enet_uint32 diff = peer -> roundTripTime - roundTripTime; - if (diff <= peer -> roundTripTimeVariance) + enet_uint32 diff = accumRoundTripTime - roundTripTime; + if (diff <= accumRoundTripTimeVariance) { - peer -> roundTripTimeVariance -= peer -> roundTripTimeVariance / 4; - peer -> roundTripTimeVariance += diff / 4; + accumRoundTripTimeVariance -= accumRoundTripTimeVariance / 4; + accumRoundTripTimeVariance += diff / 4; } else { - peer -> roundTripTimeVariance -= peer -> roundTripTimeVariance / 32; - peer -> roundTripTimeVariance += diff / 32; + accumRoundTripTimeVariance -= accumRoundTripTimeVariance / 32; + accumRoundTripTimeVariance += diff / 32; } - peer -> roundTripTime -= diff / 8; + accumRoundTripTime -= diff / 8; } + peer -> roundTripTime = accumRoundTripTime >> 8; + peer -> roundTripTimeRemainder = accumRoundTripTime & 0xFF; + peer -> roundTripTimeVariance = accumRoundTripTimeVariance >> 8; + peer -> roundTripTimeVarianceRemainder = accumRoundTripTimeVariance & 0xFF; } else { From 33c7d6903e843d450eb18769d5802e83de538825 Mon Sep 17 00:00:00 2001 From: Maxim <46995666+Vincenz099@users.noreply.github.com> Date: Tue, 7 Apr 2020 11:58:08 +0200 Subject: [PATCH 16/24] Return 0 instead of -1 on enet_protocol_receive_incoming_commands Return 0 instead of -1 on enet_protocol_receive_incoming_commands when nothing received. This allows the Service loop to continue running and not return an error when there is nothing to do with the socket receive. From debugging I found sometimes the enet_protocol_receive_incoming_commands returns -1 because simply nothing happened in the 256 for loop. Other functions like enet_protocol_send_outgoing_commands return 0 when nothing happened. --- protocol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol.c b/protocol.c index 98ee51e..a1d7ee1 100644 --- a/protocol.c +++ b/protocol.c @@ -1288,7 +1288,7 @@ enet_protocol_receive_incoming_commands (ENetHost * host, ENetEvent * event) } } - return -1; + return 0; } static void From 92bf2d8256a5b87e6de9f7305d26148642b68fd2 Mon Sep 17 00:00:00 2001 From: Maxim <46995666+Vincenz099@users.noreply.github.com> Date: Tue, 7 Apr 2020 12:33:26 +0200 Subject: [PATCH 17/24] Make recvLength = 0; In the rare case of it having bogus data. I noticed from testing this that this might be the source of it, I once had a package returned with length total bogus. like 982349829 or something like that, it crashed my game, I suspect this is the source. --- win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32.c b/win32.c index 81175a4..687aa9f 100644 --- a/win32.c +++ b/win32.c @@ -354,7 +354,7 @@ enet_socket_receive (ENetSocket socket, { INT sinLength = sizeof (struct sockaddr_in); DWORD flags = 0, - recvLength; + recvLength = 0; struct sockaddr_in sin; if (WSARecvFrom (socket, From 007b7d2a3f81505f615eda40f6795b95a2208bee Mon Sep 17 00:00:00 2001 From: Maxim <46995666+Vincenz099@users.noreply.github.com> Date: Tue, 7 Apr 2020 12:48:10 +0200 Subject: [PATCH 18/24] Se trecvLength = 0; --- unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix.c b/unix.c index a636f03..acb05c3 100644 --- a/unix.c +++ b/unix.c @@ -475,7 +475,7 @@ enet_socket_receive (ENetSocket socket, { struct msghdr msgHdr; struct sockaddr_in sin; - int recvLength; + int recvLength = 0; memset (& msgHdr, 0, sizeof (struct msghdr)); From 67cee4803a3338f0ee2e049ceac215925b9cd908 Mon Sep 17 00:00:00 2001 From: Maxim <46995666+Vincenz099@users.noreply.github.com> Date: Tue, 7 Apr 2020 13:02:48 +0200 Subject: [PATCH 19/24] Set DWORD sentLength = 0; Same case like receive, we should initialize this variable. --- unix.c | 2 +- win32.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unix.c b/unix.c index acb05c3..a636f03 100644 --- a/unix.c +++ b/unix.c @@ -475,7 +475,7 @@ enet_socket_receive (ENetSocket socket, { struct msghdr msgHdr; struct sockaddr_in sin; - int recvLength = 0; + int recvLength; memset (& msgHdr, 0, sizeof (struct msghdr)); diff --git a/win32.c b/win32.c index 687aa9f..eebdb03 100644 --- a/win32.c +++ b/win32.c @@ -316,7 +316,7 @@ enet_socket_send (ENetSocket socket, size_t bufferCount) { struct sockaddr_in sin; - DWORD sentLength; + DWORD sentLength = 0; if (address != NULL) { From f89e5986d06033f6b6421163444960f78dec99f8 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Mon, 13 Apr 2020 19:32:13 -0400 Subject: [PATCH 20/24] don't throttle on first RTT measurement --- include/enet/enet.h | 2 +- protocol.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/enet/enet.h b/include/enet/enet.h index 174e062..baea93a 100644 --- a/include/enet/enet.h +++ b/include/enet/enet.h @@ -216,7 +216,7 @@ enum ENET_HOST_DEFAULT_MAXIMUM_PACKET_SIZE = 32 * 1024 * 1024, ENET_HOST_DEFAULT_MAXIMUM_WAITING_DATA = 32 * 1024 * 1024, - ENET_PEER_DEFAULT_ROUND_TRIP_TIME = 350, + ENET_PEER_DEFAULT_ROUND_TRIP_TIME = 500, ENET_PEER_DEFAULT_PACKET_THROTTLE = 32, ENET_PEER_PACKET_THROTTLE_SCALE = 32, ENET_PEER_PACKET_THROTTLE_COUNTER = 7, diff --git a/protocol.c b/protocol.c index a1d7ee1..163ebca 100644 --- a/protocol.c +++ b/protocol.c @@ -854,12 +854,13 @@ enet_protocol_handle_acknowledge (ENetHost * host, ENetEvent * event, ENetPeer * roundTripTime = ENET_TIME_DIFFERENCE (host -> serviceTime, receivedSentTime); roundTripTime = ENET_MAX (roundTripTime, 1); - enet_peer_throttle (peer, roundTripTime); - if (peer -> lastReceiveTime > 0) { enet_uint32 accumRoundTripTime = (peer -> roundTripTime << 8) + peer -> roundTripTimeRemainder; enet_uint32 accumRoundTripTimeVariance = (peer -> roundTripTimeVariance << 8) + peer -> roundTripTimeVarianceRemainder; + + enet_peer_throttle (peer, roundTripTime); + roundTripTime <<= 8; if (roundTripTime >= accumRoundTripTime) { From c25b57b2c173308c1d6dd37f70d3058e143caf47 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Thu, 16 Apr 2020 00:15:18 -0400 Subject: [PATCH 21/24] stabilize packet throttle when RTT variance is low --- include/enet/utility.h | 1 + peer.c | 4 ++-- protocol.c | 43 +++++++----------------------------------- 3 files changed, 10 insertions(+), 38 deletions(-) diff --git a/include/enet/utility.h b/include/enet/utility.h index e48a476..b04bb7a 100644 --- a/include/enet/utility.h +++ b/include/enet/utility.h @@ -7,6 +7,7 @@ #define ENET_MAX(x, y) ((x) > (y) ? (x) : (y)) #define ENET_MIN(x, y) ((x) < (y) ? (x) : (y)) +#define ENET_DIFFERENCE(x, y) ((x) < (y) ? (y) - (x) : (x) - (y)) #endif /* __ENET_UTILITY_H__ */ diff --git a/peer.c b/peer.c index 2f483a2..1278b85 100644 --- a/peer.c +++ b/peer.c @@ -66,7 +66,7 @@ enet_peer_throttle (ENetPeer * peer, enet_uint32 rtt) peer -> packetThrottle = peer -> packetThrottleLimit; } else - if (rtt < peer -> lastRoundTripTime) + if (rtt <= peer -> lastRoundTripTime) { peer -> packetThrottle += peer -> packetThrottleAcceleration; @@ -76,7 +76,7 @@ enet_peer_throttle (ENetPeer * peer, enet_uint32 rtt) return 1; } else - if (rtt > peer -> lastRoundTripTime + 2 * peer -> lastRoundTripTimeVariance) + if (rtt >= peer -> lastRoundTripTime + 2 * peer -> lastRoundTripTimeVariance) { if (peer -> packetThrottle > peer -> packetThrottleDeceleration) peer -> packetThrottle -= peer -> packetThrottleDeceleration; diff --git a/protocol.c b/protocol.c index 163ebca..0a60253 100644 --- a/protocol.c +++ b/protocol.c @@ -862,28 +862,9 @@ enet_protocol_handle_acknowledge (ENetHost * host, ENetEvent * event, ENetPeer * enet_peer_throttle (peer, roundTripTime); roundTripTime <<= 8; - if (roundTripTime >= accumRoundTripTime) - { - enet_uint32 diff = roundTripTime - accumRoundTripTime; - accumRoundTripTimeVariance -= accumRoundTripTimeVariance / 4; - accumRoundTripTimeVariance += diff / 4; - accumRoundTripTime += diff / 8; - } - else - { - enet_uint32 diff = accumRoundTripTime - roundTripTime; - if (diff <= accumRoundTripTimeVariance) - { - accumRoundTripTimeVariance -= accumRoundTripTimeVariance / 4; - accumRoundTripTimeVariance += diff / 4; - } - else - { - accumRoundTripTimeVariance -= accumRoundTripTimeVariance / 32; - accumRoundTripTimeVariance += diff / 32; - } - accumRoundTripTime -= diff / 8; - } + accumRoundTripTimeVariance = (accumRoundTripTimeVariance * 3 + ENET_DIFFERENCE (roundTripTime, accumRoundTripTime)) / 4; + accumRoundTripTime = (accumRoundTripTime * 7 + roundTripTime) / 8; + peer -> roundTripTime = accumRoundTripTime >> 8; peer -> roundTripTimeRemainder = accumRoundTripTime & 0xFF; peer -> roundTripTimeVariance = accumRoundTripTimeVariance >> 8; @@ -892,7 +873,7 @@ enet_protocol_handle_acknowledge (ENetHost * host, ENetEvent * event, ENetPeer * else { peer -> roundTripTime = roundTripTime; - peer -> roundTripTimeVariance = roundTripTime / 2; + peer -> roundTripTimeVariance = (roundTripTime + 1) / 2; } if (peer -> roundTripTime < peer -> lowestRoundTripTime) @@ -905,7 +886,7 @@ enet_protocol_handle_acknowledge (ENetHost * host, ENetEvent * event, ENetPeer * ENET_TIME_DIFFERENCE (host -> serviceTime, peer -> packetThrottleEpoch) >= peer -> packetThrottleInterval) { peer -> lastRoundTripTime = peer -> lowestRoundTripTime; - peer -> lastRoundTripTimeVariance = peer -> highestRoundTripTimeVariance; + peer -> lastRoundTripTimeVariance = ENET_MAX (peer -> highestRoundTripTimeVariance, 2); peer -> lowestRoundTripTime = peer -> roundTripTime; peer -> highestRoundTripTimeVariance = peer -> roundTripTimeVariance; peer -> packetThrottleEpoch = host -> serviceTime; @@ -1691,19 +1672,9 @@ enet_protocol_send_outgoing_commands (ENetHost * host, ENetEvent * event, int ch #ifdef ENET_DEBUG printf ("peer %u: %f%%+-%f%% packet loss, %u+-%u ms round trip time, %f%% throttle, %u/%u outgoing, %u/%u incoming\n", currentPeer -> incomingPeerID, currentPeer -> packetLoss / (float) ENET_PEER_PACKET_LOSS_SCALE, currentPeer -> packetLossVariance / (float) ENET_PEER_PACKET_LOSS_SCALE, currentPeer -> roundTripTime, currentPeer -> roundTripTimeVariance, currentPeer -> packetThrottle / (float) ENET_PEER_PACKET_THROTTLE_SCALE, enet_list_size (& currentPeer -> outgoingReliableCommands), enet_list_size (& currentPeer -> outgoingUnreliableCommands), currentPeer -> channels != NULL ? enet_list_size (& currentPeer -> channels -> incomingReliableCommands) : 0, currentPeer -> channels != NULL ? enet_list_size (& currentPeer -> channels -> incomingUnreliableCommands) : 0); #endif - - currentPeer -> packetLossVariance -= currentPeer -> packetLossVariance / 4; - if (packetLoss >= currentPeer -> packetLoss) - { - currentPeer -> packetLoss += (packetLoss - currentPeer -> packetLoss) / 8; - currentPeer -> packetLossVariance += (packetLoss - currentPeer -> packetLoss) / 4; - } - else - { - currentPeer -> packetLoss -= (currentPeer -> packetLoss - packetLoss) / 8; - currentPeer -> packetLossVariance += (currentPeer -> packetLoss - packetLoss) / 4; - } + currentPeer -> packetLossVariance = (currentPeer -> packetLossVariance * 3 + ENET_DIFFERENCE (packetLoss, currentPeer -> packetLoss)) / 4; + currentPeer -> packetLoss = (currentPeer -> packetLoss * 7 + packetLoss) / 8; currentPeer -> packetLossEpoch = host -> serviceTime; currentPeer -> packetsSent = 0; From 5b93d08fa5e30fce3e3b1d922de6035dadd9e9af Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Thu, 16 Apr 2020 00:16:10 -0400 Subject: [PATCH 22/24] update license dates --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 78d9dcf..6906f8e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2002-2019 Lee Salzman +Copyright (c) 2002-2020 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: From 22272e29f9bd96b7cbd2bdd3c03ecee0717e3f07 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sun, 19 Apr 2020 19:40:37 -0400 Subject: [PATCH 23/24] enet 1.3.15 release prep --- ChangeLog | 7 +++++++ Doxyfile | 2 +- Makefile.am | 2 +- configure.ac | 2 +- docs/mainpage.dox | 2 +- include/enet/enet.h | 2 +- 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7df3467..67edefd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +ENet 1.3.15 (April 20, 2020): + +* quicker RTT initialization +* use fractional precision for RTT calculations +* fixes for packet throttle with low RTT variance +* miscellaneous socket bug fixes + ENet 1.3.14 (January 27, 2019): * bug fix for enet_peer_disconnect_later() diff --git a/Doxyfile b/Doxyfile index ddb8b0a..051279f 100644 --- a/Doxyfile +++ b/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "ENet" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = v1.3.14 +PROJECT_NUMBER = v1.3.15 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/Makefile.am b/Makefile.am index 354deba..d5f4bb7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,7 +16,7 @@ enetinclude_HEADERS = \ lib_LTLIBRARIES = libenet.la libenet_la_SOURCES = callbacks.c compress.c host.c list.c packet.c peer.c protocol.c unix.c win32.c # see info '(libtool) Updating version info' before making a release -libenet_la_LDFLAGS = $(AM_LDFLAGS) -version-info 7:2:0 +libenet_la_LDFLAGS = $(AM_LDFLAGS) -version-info 7:3:0 AM_CPPFLAGS = -I$(top_srcdir)/include ACLOCAL_AMFLAGS = -Im4 diff --git a/configure.ac b/configure.ac index 7a3340b..2f282bc 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([libenet], [1.3.14]) +AC_INIT([libenet], [1.3.15]) AC_CONFIG_SRCDIR([include/enet/enet.h]) AM_INIT_AUTOMAKE([foreign]) diff --git a/docs/mainpage.dox b/docs/mainpage.dox index 68a83cd..06d62dc 100644 --- a/docs/mainpage.dox +++ b/docs/mainpage.dox @@ -36,7 +36,7 @@ portable, and easily embeddable. You can retrieve the source to ENet by downloading it in either .tar.gz form or accessing the github distribution directly. -The most recent stable release (1.3.14) can be downloaded here. +The most recent stable release (1.3.15) can be downloaded here. The last release that is protocol compatible with the 1.2 series or earlier (1.2.5) can be downloaded here. You can find the most recent ENet source at the github repository. diff --git a/include/enet/enet.h b/include/enet/enet.h index baea93a..54d91b5 100644 --- a/include/enet/enet.h +++ b/include/enet/enet.h @@ -25,7 +25,7 @@ extern "C" #define ENET_VERSION_MAJOR 1 #define ENET_VERSION_MINOR 3 -#define ENET_VERSION_PATCH 14 +#define ENET_VERSION_PATCH 15 #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) From 224f31101fc60939c02f6bbe8e8fc810a7db306b Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Mon, 20 Apr 2020 22:16:53 -0400 Subject: [PATCH 24/24] fix doc license --- docs/license.dox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/license.dox b/docs/license.dox index 44876d3..9991a7f 100644 --- a/docs/license.dox +++ b/docs/license.dox @@ -1,7 +1,7 @@ /** @page License License -Copyright (c) 2002-2016 Lee Salzman +Copyright (c) 2002-2020 Lee Salzman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the