0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-29 12:18:54 +02:00

modules/federation/sender: Consistent origin from node::id; fix curtxn assignment.

This commit is contained in:
Jason Volk 2018-03-21 16:35:30 -07:00
parent df7b6f0ca9
commit 1846dd379d
2 changed files with 11 additions and 2 deletions

View file

@ -195,6 +195,7 @@ try
txns.emplace_back(*this, std::move(content), std::move(opts));
const unwind::nominal::assertion na;
curtxn = &txns.back();
q.clear();
recv_action.notify_one();
return true;
@ -404,8 +405,11 @@ recv_timeout(txn &txn,
void
remove_node(const node &node)
{
const string_view &id{node.id};
const auto it{nodes.find(id)};
const auto it
{
nodes.find(node.origin())
};
assert(it != end(nodes));
nodes.erase(it);
}

View file

@ -80,6 +80,11 @@ struct node
txn *curtxn {nullptr};
bool err {false};
string_view origin() const
{
return id.host();
};
bool flush();
void push(std::shared_ptr<unit>);