<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39131 >

> [pepeto - Thu Nov 27 07:49:11 2008]:
> 
> Unfortunately, this patch wouldn't remove the useless
> warning "WARNING: trying to send data to the closed connection".
> 
> It needs also to check after "command_ok = handle_packet_input(pconn,
> packet.data, packet.type);" (sernet.c, sniff_packets), if the
> connection is still used or not to avoid to continue to send packet
> to it.

Or finish_processing_request() needs to check whether the passed
in connection is still valid. Version 2 adds this check.


-----------------------------------------------------------------------
死んでいるままでいなさい。
diff --git a/common/connection.c b/common/connection.c
index ded24e4..48fc429 100644
--- a/common/connection.c
+++ b/common/connection.c
@@ -630,6 +630,7 @@ void connection_common_init(struct connection *pconn)
 
 #ifdef USE_COMPRESSION
   byte_vector_init(&pconn->compression.queue);
+  pconn->compression.frozen_level = 0;
 #endif
 }
 
diff --git a/server/sernet.c b/server/sernet.c
index 3cc8e6b..81d6493 100644
--- a/server/sernet.c
+++ b/server/sernet.c
@@ -1015,6 +1015,9 @@ static void start_processing_request(struct connection *pconn,
 **************************************************************************/
 static void finish_processing_request(struct connection *pconn)
 {
+  if (!pconn || !pconn->used) {
+    return;
+  }
   assert(pconn->server.currently_processed_request_id);
   freelog(LOG_DEBUG, "finish processing packet %d from connection %d",
 	  pconn->server.currently_processed_request_id, pconn->id);
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to