1 (edited by Apprentice Sheng 2009-08-07 17:18:22)

Topic: [BUG] sendto errors aren't handled properly

Hello,
I've found another bug in the network stack which lead to a corruption
in the game source.

The sendto function doesnt report the exact error on it's own. It returns
just -1 in error case. A further pull on the global errno variable is required
on unix systems in this case.

The teal corruption happens because the server doesnt report the client
lose properly. Thus the game mode thinks the client is still online even if
it is not the case. Thuse if a new client try connect on that socket, a double
allocation on that client ID occurs in the game mode source whichs leads to
a assert and after that the server will shutdown itself.

The patch submitted here fixes this issue by recognizing the error properly
and the function conn_flush in e_network_conn.c will set the connection into
an error state which lead into a clean disconnect of the client and will free
the clientID.

This patch has been tested on unix only and i'm pretty sure it will compile only
on unix systems.

sendto_error_fix.diff

This patch should fix the issue. Due to the nature of the bug I can't really test it.

Yet another lich...

2

Re: [BUG] sendto errors aren't handled properly

wow, great! thanks!

3 (edited by MertenNor 2009-08-07 19:07:21)

Re: [BUG] sendto errors aren't handled properly

this happens to me sometimes.. my N Race server just randomly quits... xD

I am on a intel Mac...

I added it to the N Race server now... and hope it works ^_^

Thanks..

MertenNor

->My 24/7 servers: [NOR] Norwegian HUB <- Back Online !! big_smile
( My grammar is getting better ! smile I think.. )
-Norway

4

Re: [BUG] sendto errors aren't handled properly

Thanks for the report and the patch, I will look into it and merge it to the next release, whenever it is smile.