0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-01-14 00:34:18 +01:00

ircd:Ⓜ️:vm: Add distinct phase for unique check; reorder phase enum.

This commit is contained in:
Jason Volk 2020-12-10 01:49:27 -08:00
parent a7edf142c7
commit f8ad44b16a
3 changed files with 8 additions and 6 deletions

View file

@ -23,10 +23,11 @@ enum ircd::m::vm::phase
:uint
{
NONE, ///< No phase; not entered.
DUPCHK, ///< Duplicate check & hold.
EXECUTE, ///< Execution entered.
ISSUE, ///< Issue phase.
CONFORM, ///< Conformity check phase.
DUPWAIT, ///< Duplicate eval check & hold
DUPCHK, ///< Duplicate existence check
ISSUE, ///< Issue phase.
ACCESS, ///< Access control phase.
VERIFY, ///< Signature verification.
FETCH_AUTH, ///< Authentication events fetch phase.

View file

@ -131,10 +131,11 @@ ircd::m::vm::reflect(const enum phase &code)
switch(code)
{
case phase::NONE: return "NONE";
case phase::DUPCHK: return "DUPCHK";
case phase::EXECUTE: return "EXECUTE";
case phase::ISSUE: return "ISSUE";
case phase::CONFORM: return "CONFORM";
case phase::DUPWAIT: return "DUPWAIT";
case phase::DUPCHK: return "DUPCHK";
case phase::ISSUE: return "ISSUE";
case phase::ACCESS: return "ACCESS";
case phase::VERIFY: return "VERIFY";
case phase::FETCH_AUTH: return "FETCH_AUTH";

View file

@ -436,11 +436,11 @@ try
event::id::buf{}
};
if(likely(opts.phase[phase::DUPCHK]) && eval.event_id)
if(likely(opts.phase[phase::DUPWAIT]) && eval.event_id)
{
const scope_restore eval_phase
{
eval.phase, phase::DUPCHK
eval.phase, phase::DUPWAIT
};
// Prevent more than one event with the same event_id from