0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-19 03:13:47 +02:00

ircd:Ⓜ️:fed::well_known: Deduplicate requests sharing the same buffer only.

This commit is contained in:
Jason Volk 2023-02-24 20:10:17 -08:00
parent 56984d59e9
commit ab77a32dce

View file

@ -233,13 +233,20 @@ try
}; };
} }
// Ride any duplicate request already pending // Check for duplicate requests
for(const auto &req : request::list) for(const auto &req : request::list)
if(req->target == target) if(req->target == target)
{
//XXX: Support multiple result buffers.
if(data(req->out) != data(buf))
break;
// Ride any duplicate request already pending
return ctx::future<string_view> return ctx::future<string_view>
{ {
req->promise req->promise
}; };
}
// Synchronize modification of the request::list // Synchronize modification of the request::list
const std::lock_guard request_lock const std::lock_guard request_lock