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
1 changed files with 8 additions and 1 deletions

View File

@ -233,13 +233,20 @@ try
};
}
// Ride any duplicate request already pending
// Check for duplicate requests
for(const auto &req : request::list)
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>
{
req->promise
};
}
// Synchronize modification of the request::list
const std::lock_guard request_lock