mirror of
https://github.com/matrix-construct/construct
synced 2024-09-29 20:28:52 +02:00
modules/federation/sender: Consistent origin from node::id; fix curtxn assignment.
This commit is contained in:
parent
df7b6f0ca9
commit
1846dd379d
2 changed files with 11 additions and 2 deletions
|
@ -195,6 +195,7 @@ try
|
||||||
|
|
||||||
txns.emplace_back(*this, std::move(content), std::move(opts));
|
txns.emplace_back(*this, std::move(content), std::move(opts));
|
||||||
const unwind::nominal::assertion na;
|
const unwind::nominal::assertion na;
|
||||||
|
curtxn = &txns.back();
|
||||||
q.clear();
|
q.clear();
|
||||||
recv_action.notify_one();
|
recv_action.notify_one();
|
||||||
return true;
|
return true;
|
||||||
|
@ -404,8 +405,11 @@ recv_timeout(txn &txn,
|
||||||
void
|
void
|
||||||
remove_node(const node &node)
|
remove_node(const node &node)
|
||||||
{
|
{
|
||||||
const string_view &id{node.id};
|
const auto it
|
||||||
const auto it{nodes.find(id)};
|
{
|
||||||
|
nodes.find(node.origin())
|
||||||
|
};
|
||||||
|
|
||||||
assert(it != end(nodes));
|
assert(it != end(nodes));
|
||||||
nodes.erase(it);
|
nodes.erase(it);
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,6 +80,11 @@ struct node
|
||||||
txn *curtxn {nullptr};
|
txn *curtxn {nullptr};
|
||||||
bool err {false};
|
bool err {false};
|
||||||
|
|
||||||
|
string_view origin() const
|
||||||
|
{
|
||||||
|
return id.host();
|
||||||
|
};
|
||||||
|
|
||||||
bool flush();
|
bool flush();
|
||||||
void push(std::shared_ptr<unit>);
|
void push(std::shared_ptr<unit>);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue