[Freeciv-Dev] Re: [PATCH] bug in vnotify_conn_ex() (PR#1185)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Ross W. Wetmore wrote:
You still don't understand that ENOEVENT (-1,-1) is a perfectly valid
case, whether or not your topology allows (-1,-1) as a real tile. It
is required that this be passed on. There are other cases as well. The
value is used as a signal, independent of topology hardwired into lots
of code.
Thus you don't fix the original bug, but just kill the server at a
different point. The original problem was ENOEVENT (-1,-1) in a torus
world if you read the comments. They also explain ENOEVENT syntax.
(-1,-1) *is* a special case that *must* just be passed through. All
the asserts that specifically target this are dead wrong. This "fix"
is not only not required but breaks valid behaviour. In fact (-1,-1)
is the only unnormalized coordinate you absolutely *must* not touch.
Both Raimar and your zeal to stamp out unnormalized coordinates is
exemplary, but misplaced in this case. Leave this code out of your
targets!
I think you are misreading the code. (-1,-1) _is_ treated as a
special-case for a nonexistent tile. It fails the check and so is
passed through as (-1,-1) directly to the client.
The problem is that if (-1,-1) is passed in as a legitimate set of
coordinates, it will be treated as the special-case of no coordinates
associated with the event. Thus it is very important that we stamp out
non-normal coordinates being passed to this function! Of course, we
must allow (-1,-1) to be passed but if any _other_ non-normal
coordinates are passed in then we're in danger. This is a bug in the
calling code that can only be caught here.
jason
|
|