]> git.pond.sub.org Git - empserver/commit - include/empio.h
Fix idle timeout during execute
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 29 Jan 2012 07:52:30 +0000 (08:52 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 21 Feb 2012 17:10:52 +0000 (18:10 +0100)
commitca7578f1b80ca46bc4e7d31bb30f39e0f4ee3632
treead01b405e1e778adc8b316e48bad1b02cd4463aa
parentd78d9cac1d844412da4b8a9b44f61d0f7ad81f80
Fix idle timeout during execute

Timeout during execute gets handled just like an EOF cookie: end the
batch file, resume reading normal commands.  That's wrong, we need to
close the connection.

A real EOF is recorded in the player's connection's EOF indicator.
Let's use that for all "connection needs to be closed" conditions, so
they all work the same.  Create io_set_eof() to provide access.

Make recvclient() set the player connection's EOF indicator on
timeout.  This makes the timeout "stick".  Record receipt of an EOF
cookie in new struct player member got_ctld.  Also abort the command,
as before.  This leaves further interpretation of the EOF cookie to
the command loops.

Make player_main() set the player connection's EOF indicator on
got_ctld.  Player connection gets closed on on EOF cookie, as before.

Change execute() to break the batch command loop when got_ctld is set,
then reset it.  Ends the batch file on EOF cookie, as before.

Change status() back to checking EOF and error indicators (partial
revert of commit 9c5854c8, v4.3.16), and drop struct player member
eof.
include/empio.h
include/player.h
src/lib/empthread/io.c
src/lib/player/player.c
src/lib/player/recvclient.c