mirror of
https://github.com/matrix-construct/construct
synced 2024-09-27 19:28:52 +02:00
modules/federation/send: Check for self-sends here.
This commit is contained in:
parent
bfa4d704cc
commit
11e14bbb37
1 changed files with 10 additions and 0 deletions
|
@ -130,6 +130,16 @@ handle_put(client &client,
|
||||||
pdu_failures.count()
|
pdu_failures.count()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Don't accept sends to ourself for whatever reason (i.e a 127.0.0.1
|
||||||
|
// leaked into the target list). This should be a 500 so it's not
|
||||||
|
// considered success or cached as failure by the sender's state.
|
||||||
|
if(unlikely(my_host(request.origin)))
|
||||||
|
throw m::error
|
||||||
|
{
|
||||||
|
"M_SEND_TO_SELF", "Tried to send %s from myself to myself.",
|
||||||
|
txn_id
|
||||||
|
};
|
||||||
|
|
||||||
for(const auto &pdu_failure : pdu_failures)
|
for(const auto &pdu_failure : pdu_failures)
|
||||||
handle_pdu_failure(client, request, txn_id, pdu_failure);
|
handle_pdu_failure(client, request, txn_id, pdu_failure);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue