aboutsummaryrefslogtreecommitdiffhomepage
path: root/peer.c
diff options
context:
space:
mode:
Diffstat (limited to 'peer.c')
-rw-r--r--peer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/peer.c b/peer.c
index 9370ef4..32f9809 100644
--- a/peer.c
+++ b/peer.c
@@ -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);