]> git.pond.sub.org Git - empserver/commit
Factor out code to read mailboxes, and make read more robust
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 8 Feb 2009 10:13:25 +0000 (11:13 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 8 Feb 2009 13:21:15 +0000 (14:21 +0100)
commit4238323d630a3c5eb69c7ac796ee3d823ee623e5
treef64f75035624c5d88f6b9b114085c3e493a1b646
parent6f1e669bea96e19aa69925ae2017d0acc4f58d4d
Factor out code to read mailboxes, and make read more robust

New tel_read_header(), tel_read_body().  Use them in rea(),
show_first_tel(), copy_and_expire().

rea() now stops when it encounters a corrupt telegram, and logs the
problem.  Before, error detection was incomplete, and errors were not
logged.  Corrupt mailboxes could make it crash.

show_first_tel() and copy_and_expire() can now cope with telegrams of
arbitrary length, like rea(), and sanity-check the header fields they
don't actually use.
include/tel.h
src/lib/commands/rea.c
src/lib/common/mailbox.c
src/lib/player/player.c
src/lib/update/anno.c