Fix how play_cmd() ensures connection close
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 22 Feb 2012 13:30:58 +0000 (14:30 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 25 Feb 2012 10:32:02 +0000 (11:32 +0100)
commit9b92ac633d8efd8e8b52c9287193066bcefd303d
tree7da4c8fe697e06680ea4c8b56952b7a6c5f529ed
parentce6454035007b66cfa50b0439362e7301aaf5937
Fix how play_cmd() ensures connection close

play_cmd() needs to return in a state that makes player_login() break
the login command loop.

play_cmd() assumes player_main() always returns in such a state:
connection's EOF indicator set.  Unfortunately, the assumption is
wrong.  Fortunately, play_cmd() checks it, oopses and recovers.

player_main() can return with neiter error nor EOF indicator set,
e.g. when the game is down.

player_main() can return with just the error indicator set.  For
instance, when the client dies, io_input() detects ECONNRESET, sets
the error indicator and fails.

Broken in commit 8549efbc.  Fix by setting the EOF indicator silently
(without oopsing) when necessary.
src/lib/player/login.c