diff --git a/modules/client/sync.cc b/modules/client/sync.cc index 2a942ec90..b8284c1e4 100644 --- a/modules/client/sync.cc +++ b/modules/client/sync.cc @@ -400,10 +400,10 @@ try log::debug { - log, "request %s linear last:%lu complete:%b @%lu", + log, "request %s linear last:%lu %s@%lu", loghead(data), last, - completed, + completed? "complete "_sv : string_view{}, next }; @@ -665,7 +665,7 @@ ircd::m::sync::longpoll::handle(data &data, log::debug { - log, "request %s longpoll got:%lu complete @%lu", + log, "request %s longpoll hit:%lu complete @%lu", loghead(data), event.event_idx, next diff --git a/modules/client/sync.h b/modules/client/sync.h index ea96172d0..3608086e2 100644 --- a/modules/client/sync.h +++ b/modules/client/sync.h @@ -34,36 +34,7 @@ namespace ircd::m::sync namespace ircd::m::sync::longpoll { - struct accepted - :m::event - { - json::strung strung; - std::string client_txnid; - event::idx event_idx; - - accepted(const m::vm::eval &eval) - :strung - { - *eval.event_ - } - ,client_txnid - { - eval.copts? - eval.copts->client_txnid: - string_view{} - } - ,event_idx - { - eval.sequence - } - { - const json::object object{this->strung}; - static_cast(*this) = m::event{object}; - } - - accepted(accepted &&) = default; - accepted(const accepted &) = delete; - }; + struct accepted; size_t polling {0}; std::deque queue; @@ -75,6 +46,37 @@ namespace ircd::m::sync::longpoll extern m::hookfn notified; } +struct ircd::m::sync::longpoll::accepted +:m::event +{ + json::strung strung; + std::string client_txnid; + event::idx event_idx; + + accepted(const m::vm::eval &eval) + :strung + { + *eval.event_ + } + ,client_txnid + { + eval.copts? + eval.copts->client_txnid: + string_view{} + } + ,event_idx + { + eval.sequence + } + { + const json::object object{this->strung}; + static_cast(*this) = m::event{object}; + } + + accepted(accepted &&) = default; + accepted(const accepted &) = delete; +}; + struct ircd::m::sync::args { static conf::item timeout_max;