10 Commits

Author SHA1 Message Date
Cameron Gutman 3fcb07f723 fix RTO limit being exceeded 2021-05-14 18:48:47 -05:00
Lee Salzman cf735e639e fix minimum cmake version 2021-04-26 00:01:11 -04:00
Lee Salzman e8dbb360fb better socklen_t detection 2021-04-25 23:50:39 -04:00
Lee Salzman 0286dcdb34 silence some MSVC warnings 2021-04-25 23:44:51 -04:00
Lee Salzman e3ada4ed75 implement mulberry32 for PRNG 2021-01-13 01:39:14 -05:00
Lee Salzman 2cc0e7c780 fix more changelog typos 2020-12-19 00:21:42 -05:00
Lee Salzman b64793fa5e fix typo in changelog 2020-12-19 00:20:16 -05:00
Lee Salzman e0e7045b7e 1.3.17 release prep 2020-11-15 12:40:57 -05:00
Lee Salzman 4de13a2c2e avoid sending packets in unacknowledged window 2020-11-13 00:11:34 -05:00
Lee Salzman 0d1fb32ee8 fix for sending getting too far ahead of receiver 2020-10-19 20:21:04 -04:00
12 changed files with 34 additions and 14 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 2.8.12)
project(enet)
+5 -1
View File
@@ -1,3 +1,7 @@
ENet 1.3.17 (November 15, 2020):
* fixes for sender getting too far ahead of receiver that can cause instability with reliable packets
ENet 1.3.16 (September 8, 2020):
* fix bug in unreliable fragment queuing
@@ -15,7 +19,7 @@ ENet 1.3.14 (January 27, 2019):
* bug fix for enet_peer_disconnect_later()
* use getaddrinfo and getnameinfo where available
* miscellenous cleanups
* miscellaneous cleanups
ENet 1.3.13 (April 30, 2015):
+1 -1
View File
@@ -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.16
PROJECT_NUMBER = v1.3.17
# 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
+1 -1
View File
@@ -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:4:0
libenet_la_LDFLAGS = $(AM_LDFLAGS) -version-info 7:5:0
AM_CPPFLAGS = -I$(top_srcdir)/include
ACLOCAL_AMFLAGS = -Im4
+1 -1
View File
@@ -1,4 +1,4 @@
AC_INIT([libenet], [1.3.16])
AC_INIT([libenet], [1.3.17])
AC_CONFIG_SRCDIR([include/enet/enet.h])
AM_INIT_AUTOMAKE([foreign])
+1 -1
View File
@@ -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.16) can be downloaded <a class="el" href="download/enet-1.3.16.tar.gz">here</a>.
The most recent stable release (1.3.17) can be downloaded <a class="el" href="download/enet-1.3.17.tar.gz">here</a>.
The last release that is protocol compatible with the 1.2 series or earlier (1.2.5) can be downloaded <a class="el" href="download/enet-1.2.5.tar.gz">here</a>.
You can find the most recent ENet source at <a class="el" href="https://github.com/lsalzman/enet">the github repository</a>.
+11 -1
View File
@@ -160,6 +160,16 @@ enet_host_destroy (ENetHost * host)
enet_free (host);
}
enet_uint32
enet_host_random (ENetHost * host)
{
/* Mulberry32 by Tommy Ettinger */
enet_uint32 n = (host -> randomSeed += 0x6D2B79F5U);
n = (n ^ (n >> 15)) * (n | 1U);
n ^= n + (n ^ (n >> 7)) * (n | 61U);
return n ^ (n >> 14);
}
/** Initiates a connection to a foreign host.
@param host host seeking the connection
@param address destination for the connection
@@ -199,7 +209,7 @@ enet_host_connect (ENetHost * host, const ENetAddress * address, size_t channelC
currentPeer -> channelCount = channelCount;
currentPeer -> state = ENET_PEER_STATE_CONNECTING;
currentPeer -> address = * address;
currentPeer -> connectID = ++ host -> randomSeed;
currentPeer -> connectID = enet_host_random (host);
if (host -> outgoingBandwidth == 0)
currentPeer -> windowSize = ENET_PROTOCOL_MAXIMUM_WINDOW_SIZE;
+2 -1
View File
@@ -25,7 +25,7 @@ extern "C"
#define ENET_VERSION_MAJOR 1
#define ENET_VERSION_MINOR 3
#define ENET_VERSION_PATCH 16
#define ENET_VERSION_PATCH 17
#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)
@@ -575,6 +575,7 @@ ENET_API void enet_host_channel_limit (ENetHost *, size_t);
ENET_API void enet_host_bandwidth_limit (ENetHost *, enet_uint32, enet_uint32);
extern void enet_host_bandwidth_throttle (ENetHost *);
extern enet_uint32 enet_host_random_seed (void);
extern enet_uint32 enet_host_random (ENetHost *);
ENET_API int enet_peer_send (ENetPeer *, enet_uint8, ENetPacket *);
ENET_API ENetPacket * enet_peer_receive (ENetPeer *, enet_uint8 * channelID);
+2
View File
@@ -11,6 +11,8 @@
#pragma warning (disable: 4244) // 64bit to 32bit int
#pragma warning (disable: 4018) // signed/unsigned mismatch
#pragma warning (disable: 4146) // unary minus operator applied to unsigned type
#define _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_WARNINGS
#endif
#endif
+2 -1
View File
@@ -99,7 +99,7 @@ enet_peer_throttle (ENetPeer * peer, enet_uint32 rtt)
int
enet_peer_send (ENetPeer * peer, enet_uint8 channelID, ENetPacket * packet)
{
ENetChannel * channel = & peer -> channels [channelID];
ENetChannel * channel;
ENetProtocol command;
size_t fragmentLength;
@@ -108,6 +108,7 @@ enet_peer_send (ENetPeer * peer, enet_uint8 channelID, ENetPacket * packet)
packet -> dataLength > peer -> host -> maximumPacketSize)
return -1;
channel = & peer -> channels [channelID];
fragmentLength = peer -> mtu - sizeof (ENetProtocolHeader) - sizeof (ENetProtocolSendFragment);
if (peer -> host -> checksum != NULL)
fragmentLength -= sizeof(enet_uint32);
+6 -4
View File
@@ -1368,6 +1368,8 @@ enet_protocol_check_timeouts (ENetHost * host, ENetPeer * peer, ENetEvent * even
++ peer -> packetsLost;
outgoingCommand -> roundTripTimeout *= 2;
if (outgoingCommand -> roundTripTimeout > outgoingCommand -> roundTripTimeoutLimit)
outgoingCommand -> roundTripTimeout = outgoingCommand -> roundTripTimeoutLimit;
enet_list_insert (insertPosition, enet_list_remove (& outgoingCommand -> outgoingCommandList));
@@ -1390,8 +1392,8 @@ enet_protocol_check_outgoing_commands (ENetHost * host, ENetPeer * peer)
ENetBuffer * buffer = & host -> buffers [host -> bufferCount];
ENetOutgoingCommand * outgoingCommand;
ENetListIterator currentCommand;
ENetChannel *channel;
enet_uint16 reliableWindow;
ENetChannel *channel = NULL;
enet_uint16 reliableWindow = 0;
size_t commandSize;
int windowExceeded = 0, windowWrap = 0, canPing = 1;
@@ -1411,8 +1413,8 @@ enet_protocol_check_outgoing_commands (ENetHost * host, ENetPeer * peer)
outgoingCommand -> sendAttempts < 1 &&
! (outgoingCommand -> reliableSequenceNumber % ENET_PEER_RELIABLE_WINDOW_SIZE) &&
(channel -> reliableWindows [(reliableWindow + ENET_PEER_RELIABLE_WINDOWS - 1) % ENET_PEER_RELIABLE_WINDOWS] >= ENET_PEER_RELIABLE_WINDOW_SIZE ||
channel -> usedReliableWindows & ((((1 << ENET_PEER_FREE_RELIABLE_WINDOWS) - 1) << reliableWindow) |
(((1 << ENET_PEER_FREE_RELIABLE_WINDOWS) - 1) >> (ENET_PEER_RELIABLE_WINDOWS - reliableWindow)))))
channel -> usedReliableWindows & ((((1 << (ENET_PEER_FREE_RELIABLE_WINDOWS + 2)) - 1) << reliableWindow) |
(((1 << (ENET_PEER_FREE_RELIABLE_WINDOWS + 2)) - 1) >> (ENET_PEER_RELIABLE_WINDOWS - reliableWindow)))))
windowWrap = 1;
if (windowWrap)
{
+1 -1
View File
@@ -53,7 +53,7 @@
#include <poll.h>
#endif
#ifndef HAS_SOCKLEN_T
#if !defined(HAS_SOCKLEN_T) && !defined(__socklen_t_defined)
typedef int socklen_t;
#endif