From 882eee4c13f7ca265fd6fd8a57e609559a16ddf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 29 Oct 2026 09:09:45 +0100 Subject: [PATCH] sceNetAdhocMatching: A denied P2P request goes back to a known peer CancelTarget on an incoming P2P request marked the peer timed out. It only escaped a TIMEOUT if one of its hellos came in before the next timeout check, which it no longer does now that timeouts are checked all the time. On a PSP it's a peer known from its hellos again, with no TIMEOUT (pspautotests net/adhoc/pair/matching3). Co-Authored-By: Claude Opus 5.5 --- Core/HLE/sceNetAdhocMatching.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Core/HLE/sceNetAdhocMatching.cpp b/Core/HLE/sceNetAdhocMatching.cpp index 34f1d8cef0..21d55ddb1a 100644 --- a/Core/HLE/sceNetAdhocMatching.cpp +++ b/Core/HLE/sceNetAdhocMatching.cpp @@ -2188,6 +2188,16 @@ int NetAdhocMatching_CancelTargetWithOpt(int matchingId, const char* macAddress, { const bool notifyDeath = context->mode == PSP_ADHOC_MATCHING_MODE_PARENT && peer->state == PSP_ADHOC_MATCHING_PEER_CHILD && countConnectedPeers(context) > 1; + // A P2P peer whose request is denied goes back to one known from its hellos: no TIMEOUT, and it + // can ask again (pspautotests net/adhoc/pair/matching3). + if (context->mode == PSP_ADHOC_MATCHING_MODE_P2P && peer->state == PSP_ADHOC_MATCHING_PEER_INCOMING_REQUEST) { + sendCancelMessage(context, peer, optLen, opt); + peer->state = PSP_ADHOC_MATCHING_PEER_OFFER; + peer->lastping = CoreTiming::GetGlobalTimeUsScaled(); + hleEatCycles(adhocDefaultDelay); + return hleLogDebug(Log::sceNet, 0); + } + // Mark Peer as Canceled peer->state = PSP_ADHOC_MATCHING_PEER_CANCEL_IN_PROGRESS;