WORKAROUND: temp. disable session resource limits while we work out issues

merge-requests/60/head
bunnei 2021-05-11 10:51:39 +07:00
parent f2c26443f8
commit fc086f93b2
4 changed files with 11 additions and 11 deletions

@ -150,8 +150,8 @@ public:
if (context->Session()->IsDomain()) { if (context->Session()->IsDomain()) {
context->AddDomainObject(std::move(iface)); context->AddDomainObject(std::move(iface));
} else { } else {
kernel.CurrentProcess()->GetResourceLimit()->Reserve( // kernel.CurrentProcess()->GetResourceLimit()->Reserve(
Kernel::LimitableResource::Sessions, 1); // Kernel::LimitableResource::Sessions, 1);
auto* session = Kernel::KSession::Create(kernel); auto* session = Kernel::KSession::Create(kernel);
session->Initialize(nullptr, iface->GetServiceName()); session->Initialize(nullptr, iface->GetServiceName());

@ -58,9 +58,9 @@ bool KClientPort::IsSignaled() const {
ResultCode KClientPort::CreateSession(KClientSession** out) { ResultCode KClientPort::CreateSession(KClientSession** out) {
// Reserve a new session from the resource limit. // Reserve a new session from the resource limit.
KScopedResourceReservation session_reservation(kernel.CurrentProcess()->GetResourceLimit(), // KScopedResourceReservation session_reservation(kernel.CurrentProcess()->GetResourceLimit(),
LimitableResource::Sessions); // LimitableResource::Sessions);
R_UNLESS(session_reservation.Succeeded(), ResultLimitReached); // R_UNLESS(session_reservation.Succeeded(), ResultLimitReached);
// Update the session counts. // Update the session counts.
{ {
@ -104,7 +104,7 @@ ResultCode KClientPort::CreateSession(KClientSession** out) {
session->Initialize(this, parent->GetName()); session->Initialize(this, parent->GetName());
// Commit the session reservation. // Commit the session reservation.
session_reservation.Commit(); // session_reservation.Commit();
// Register the session. // Register the session.
KSession::Register(kernel, session); KSession::Register(kernel, session);

@ -78,7 +78,7 @@ void KSession::OnClientClosed() {
void KSession::PostDestroy(uintptr_t arg) { void KSession::PostDestroy(uintptr_t arg) {
// Release the session count resource the owner process holds. // Release the session count resource the owner process holds.
KProcess* owner = reinterpret_cast<KProcess*>(arg); KProcess* owner = reinterpret_cast<KProcess*>(arg);
owner->GetResourceLimit()->Release(LimitableResource::Sessions, 1); // owner->GetResourceLimit()->Release(LimitableResource::Sessions, 1);
owner->Close(); owner->Close();
} }

@ -158,15 +158,15 @@ ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(Kernel::HLERequestContext&
auto* port = result.Unwrap(); auto* port = result.Unwrap();
Kernel::KScopedResourceReservation session_reservation( // Kernel::KScopedResourceReservation session_reservation(
kernel.CurrentProcess()->GetResourceLimit(), Kernel::LimitableResource::Sessions); // kernel.CurrentProcess()->GetResourceLimit(), Kernel::LimitableResource::Sessions);
R_UNLESS(session_reservation.Succeeded(), Kernel::ResultLimitReached); // R_UNLESS(session_reservation.Succeeded(), Kernel::ResultLimitReached);
auto* session = Kernel::KSession::Create(kernel); auto* session = Kernel::KSession::Create(kernel);
session->Initialize(&port->GetClientPort(), std::move(name)); session->Initialize(&port->GetClientPort(), std::move(name));
// Commit the session reservation. // Commit the session reservation.
session_reservation.Commit(); // session_reservation.Commit();
if (port->GetServerPort().GetHLEHandler()) { if (port->GetServerPort().GetHLEHandler()) {
port->GetServerPort().GetHLEHandler()->ClientConnected(&session->GetServerSession()); port->GetServerPort().GetHLEHandler()->ClientConnected(&session->GetServerSession());