[1803] in BarnOwl Developers
Re: Review of kcr/zsig branch.
daemon@ATHENA.MIT.EDU (Anders Kaseorg)
Thu Oct 29 18:22:23 2009
Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
X-Original-To: nelhage@lunatique.mit.edu
Date: Sat, 17 Oct 2009 17:50:50 -0400 (EDT)
From: Anders Kaseorg <andersk@MIT.EDU>
To: kcr@mit.edu
cc: barnowl-dev@mit.edu
In-Reply-To: <20091017204203.GB21998@mit.edu>
- if (!defined($zsigs)) {
+ if (!defined($zsigs) || _zsigs_need_reloaded()) {
This is a bit sloppy: _zsigs_need_reloaded is not called from the very=20
first random_zephyr_signature call, so $loaded_mtime does not get=20
initialized until the second call, and the reload will not be avoided=20
until the third call.
If you had a ~/.zsigs file but then you delete it, _zsigs_need_reloaded=20
will return 0 and it will keep using the deleted .zsigs.
I think it doesn=E2=80=99t make sense for _zsigs_need_reloaded to be a sepa=
rate=20
function from reload_zephyr_signatures. If you were to call=20
_zsigs_need_reloaded without calling reload_zephyr_signatures, the state=20
would be reset to =E2=80=9Creload not needed=E2=80=9D anyway.
open(ZSIGS, $random_zsig_file) should be open(ZSIGS, '<',=20
$random_zsig_file).
return $old_mtime !=3D $loaded_mtime; is indented too far.
Anders