[ENet-discuss] Is this a bug?

Lee Salzman lsalzman1 at cox.net
Thu Jul 12 19:37:11 PDT 2007


That is indeed a bug. I have addressed this in CVS.

However, it's not a critical bug. In the worst case it maybe slows large 
file transfers down a tiny bit. So ENet users, don't worry. :)

Lee

Ray wrote:
> Hi every one:
> 	In function static ENetPeer *  enet_protocol_handle_connect, when calculate the windowSize
> 
>  if (host -> outgoingBandwidth == 0 &&
>         currentPeer -> incomingBandwidth == 0)
>       currentPeer -> windowSize = ENET_PROTOCOL_MAXIMUM_WINDOW_SIZE;
>     else
>       currentPeer -> windowSize = (ENET_MIN (host -> outgoingBandwidth, currentPeer -> incomingBandwidth) /
>                                     ENET_PEER_WINDOW_SIZE_SCALE) * 
>                                       ENET_PROTOCOL_MINIMUM_WINDOW_SIZE;
> 
>  if (currentPeer -> windowSize < ENET_PROTOCOL_MINIMUM_WINDOW_SIZE)
>       currentPeer -> windowSize = ENET_PROTOCOL_MINIMUM_WINDOW_SIZE;
>     else
>     if (currentPeer -> windowSize > ENET_PROTOCOL_MAXIMUM_WINDOW_SIZE)
>       currentPeer -> windowSize = ENET_PROTOCOL_MAXIMUM_WINDOW_SIZE;
> 
> if outgoingBandwidth is 0 but currentPeer->incomingBandwidth is not 0, then the windowSize will be ENET_PROTOCOL_MINIMUM_WINDOW_SIZE, is that the thing we want?
> 
> Best Regards!
> Ray



More information about the ENet-discuss mailing list