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:
parent
56984d59e9
commit
ab77a32dce
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue