[Freeciv-Dev] Re: (PR#12695) Server exit on bad packet (I think)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12695 >
On Tue, Mar 29, 2005 at 12:55:34PM -0800, Paul Zastoupil wrote:
>
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=12695 >
>
> civserver exited on pubserver with the following line:
> 0: The server you tried to connect is too old (1.12.0 or earlier).
> Please choose another server next time. Good bye.
>
> common/packets.c line 671 in function
> post_receive_packet_player_attribute_chunk
Hmmm a patch like the below MAY help. But since it is unknown what
caused the problem I can't be sure.
Raimar
--
email: i-freeciv-lists@xxxxxxxxxxxxx
"> WHY?! Isn't it better to put $(shell cat cscope.files) on the list of
I only have a yellow belt in makefile kungfu. These fancy gnu make things
are relatively new to some of us..."
-- Mark Frazer to Vassilii Khachaturov in linux-kernel
Index: common/packets.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets.c,v
retrieving revision 1.274
diff -u -u -r1.274 packets.c
--- common/packets.c 29 Mar 2005 17:46:48 -0000 1.274
+++ common/packets.c 30 Mar 2005 05:19:10 -0000
@@ -690,10 +690,20 @@
*/
if (packet->total_length <= 0
|| packet->total_length >= MAX_ATTRIBUTE_BLOCK) {
- freelog(LOG_FATAL, _("The server you tried to connect is too old "
- "(1.12.0 or earlier). Please choose another "
- "server next time. Good bye."));
- exit(EXIT_FAILURE);
+ if (is_server) {
+ CLOSE_FUN close_callback = close_socket_get_callback();
+
+ freelog(LOG_ERROR, "The packet stream is corrupt (2). The "
+ "connection will be closed now.");
+ assert(close_callback);
+ (*close_callback) (pc);
+ return;
+ } else {
+ freelog(LOG_FATAL, _("The server you tried to connect is too old "
+ "(1.12.0 or earlier). Please choose another "
+ "server next time. Good bye."));
+ exit(EXIT_FAILURE);
+ }
}
assert(packet->total_length > 0
&& packet->total_length < MAX_ATTRIBUTE_BLOCK);
- [Freeciv-Dev] Re: (PR#12695) Server exit on bad packet (I think),
Raimar Falke <=
|
|