Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2000:
[Freeciv-Dev] Re: client goto & patrol
Home

[Freeciv-Dev] Re: client goto & patrol

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jeff Mallatt <jjm@xxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: client goto & patrol
From: Thue <thue@xxxxxxx>
Date: Sat, 21 Oct 2000 21:36:20 +0200
Reply-to: thue@xxxxxxx

On Sat, 21 Oct 2000 18:56:10 Jeff Mallatt wrote:
> At 2000/10/16 08:35 , Thue wrote:
> >Slightly updated patch can be found at
> >http://hjem.get2net.dk/thue_janus_kristensen/client_goto-final-2.diff.gz
> 
> I've taken a quick look at it.  Attach is a patch with a couple of changes,
> most important of which is the Xaw implementation of
> create_line_at_mouse_pos().  This patch must be applied after Thue's patch.
> 
> One thing I don't understand is the new argument ("result") for
> get_packet_from_connection().  It seems to have no effect, so I'd prefer it
> not to exist.

It is used in server.c:sniff_packets(). Since sniff_packets() broke from the
read loop once  get_packet_from_connection() returned a NULL packet, getting fx
the first part of a long goto_route packet would broke the loop
(receive_packet_goto_route returned a number of NULL packets). Then any packets 
that were in the
network cache at the time of the break would lay in there until a new packet was
put into the cache, and FD_ISSET(pconn->sock, &readfs) therefore returned true
again. (I don't know much of UNIX networking, this is what it seems happens).
Using presult we can return a NULL packet without the read loop exiting.
Thanks to kero for tracking down this problem for me...
BTW, I think the error return at the end of get_packet_from_connection() should
set presult to TRUE too, as else any following packets would have the same
problem. In the client_goto patch I still return presult=0 as that keeps the
behaviour identical to prepatch conditions.

The patch with jjm's changes applied and a comment added is now at
http://hjem.get2net.dk/thue_janus_kristensen/client_goto-final-3.diff.gz

-Thue



[Prev in Thread] Current Thread [Next in Thread]