[ENet-discuss] Framented packet bug ?

Benoit Germain bgermain at ubisoft.fr
Thu Dec 9 08:27:00 PST 2004


Hello.

I have a client connected to a server, and I make the client send a 32K text
to the server.
Upon receiving the first fragment, the server crashes. The callstack is as
follows:

 	TestTravelStuff.exe!enet_peer_queue_incoming_command(_ENetPeer *
peer=0x003a11b8, const ENetProtocol * command=0x00abf964, _ENetPacket *
packet=0x003a5b80, unsigned int fragmentCount=25)  Line 559	C
 	TestTravelStuff.exe!enet_protocol_handle_send_fragment(_ENetHost *
host=0x003a4190, _ENetPeer * peer=0x003a11b8, const ENetProtocol *
command=0x003a4a68)  Line 414 + 0x25	C
>	TestTravelStuff.exe!enet_protocol_handle_incoming_commands(_ENetHost
* host=0x003a4190, _ENetEvent * event=0x00abfe70)  Line 748 + 0x11	C
 
TestTravelStuff.exe!enet_protocol_receive_incoming_commands(_ENetHost *
host=0x003a4190, _ENetEvent * event=0x00abfe70)  Line 816 + 0xd	C
 	TestTravelStuff.exe!enet_host_service(_ENetHost * host=0x003a4190,
_ENetEvent * event=0x00abfe70, unsigned int timeout=285188939)  Line 1267 +
0xd	C
 	TestTravelStuff.exe!CTravelServer::Tick(float _date=285188.94)  Line
1101 + 0x12	C++
 	TestTravelStuff.exe!threadProc(void * _lpParameter=0x0012fec8)  Line
463 + 0x17	C++
 	kernel32.dll!77e5d28e() 	

The packet that the server receives is a
ENET_PROTOCOL_COMMAND_SEND_FRAGMENT, but in
enet_peer_queue_incoming_command, there is a switch that captures only
ENET_PROTOCOL_COMMAND_SEND_RELIABLE, ENET_PROTOCOL_COMMAND_SEND_UNRELIABLE,
and ENET_PROTOCOL_COMMAND_SEND_UNSEQUENCED. This causes the function to
destroy the packet that was created to receive the reunited fragments, and
to return NULL. Then, enet_protocol_handle_send_fragment crashes, because it
didn't expect that.

I suppose that ENet needs to handle properly the
ENET_PROTOCOL_COMMAND_SEND_FRAGMENT command. But then, what should be the
proper handling here ?



__________________________________
Benoit Germain
mailto:bgermain at ubisoft.fr <mailto:bgermain at ubisoft.fr> 

Person who says it cannot be done should not interrupt person doing it.
-- Chinese Proverb

People who think they're smart annoy those of us who are.
-- double-U's Proverb ?
__________________________________

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.puremagic.com/pipermail/enet-discuss/attachments/20041209/eaeb11d9/attachment.html


More information about the ENet-discuss mailing list