From ff83e8c89609b1e19db16e98c548cd3c35c04bf9 Mon Sep 17 00:00:00 2001 From: Katharine Chui Date: Thu, 16 Jul 2026 16:33:53 +0200 Subject: [PATCH] bump aemu_postoffice - Make GetPdpStat behave more like in P2P mode - Now fetches accumulated ready to be received amount of data instead of only the immediate to be received Pdp block - Make GetPtpStat behave more like in P2P mode - Now fetches accumulated ready to be received amount of data instead of the size of the next server send block - Make PtpRecv behave more like in P2P mode - Fix block like behavior where whole server send block has to be consumed before getting data from the next send block - Fix block like bahavior where sender sends in small PtpSend calls while receiver receive with less frequent but bigger buffer PtpRecv causes bloat(and eventually server kick) on relay --- Core/HLE/sceNetAdhoc.cpp | 23 +---------------------- ext/aemu_postoffice | 2 +- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/Core/HLE/sceNetAdhoc.cpp b/Core/HLE/sceNetAdhoc.cpp index e22d328a34..09c3c04c27 100644 --- a/Core/HLE/sceNetAdhoc.cpp +++ b/Core/HLE/sceNetAdhoc.cpp @@ -751,13 +751,6 @@ static int pdp_recv_postoffice(int idx, SceNetEtherAddr *saddr, uint16_t *sport, SceNetEtherAddr saddr_copy = {0}; int len_copy = *len; - if (len_copy > AEMU_POSTOFFICE_PDP_BLOCK_MAX) { - // trim, library limites pdp packets - // some games just provide amazingly huge buffer sizes during recv - // if a huge packet cannot be sent, it is logged on the sender side - len_copy = AEMU_POSTOFFICE_PDP_BLOCK_MAX; - } - int pdp_recv_status = pdp_recv(pdp_sock, (char *)&saddr_copy, &sport_copy, (char *)data, &len_copy, true); if (pdp_recv_status == AEMU_POSTOFFICE_CLIENT_SESSION_DEAD) { handle_relay_connect_failure(); @@ -768,10 +761,6 @@ static int pdp_recv_postoffice(int idx, SceNetEtherAddr *saddr, uint16_t *sport, if (pdp_recv_status == AEMU_POSTOFFICE_CLIENT_SESSION_WOULD_BLOCK) { return SOCKET_ERROR; } - if (pdp_recv_status == AEMU_POSTOFFICE_CLIENT_OUT_OF_MEMORY) { - // this is pretty critical - ERROR_LOG(Log::sceNet, "%s: critical: huge client buf %d what is going on please fix", __func__, *len); - } *len = len_copy; if (saddr != NULL) { @@ -1155,12 +1144,6 @@ static int ptp_recv_postoffice(int idx, void *data, int *len) { } int len_copy = *len; - if (len_copy > AEMU_POSTOFFICE_PTP_BLOCK_MAX) { - // trim, library limit - // some games just provide amazingly huge buffer sizes during recv - // if a huge burst cannot be sent, it is logged on the sender side - len_copy = AEMU_POSTOFFICE_PTP_BLOCK_MAX; - } int ptp_recv_status = ptp_recv(internal->postofficeHandle, (char *)data, &len_copy, true); if (ptp_recv_status == AEMU_POSTOFFICE_CLIENT_SESSION_DEAD) { @@ -1172,10 +1155,6 @@ static int ptp_recv_postoffice(int idx, void *data, int *len) { if (ptp_recv_status == AEMU_POSTOFFICE_CLIENT_SESSION_WOULD_BLOCK) { return SCE_NET_ADHOC_ERROR_WOULD_BLOCK; } - if (ptp_recv_status == AEMU_POSTOFFICE_CLIENT_OUT_OF_MEMORY) { - // this is pretty critical - ERROR_LOG(Log::sceNet, "%s: critical: huge client buf %d what is going on please fix", __func__, *len); - } // AEMU_POSTOFFICE_CLIENT_SESSION_DATA_TRUNC is okay, it just means it has data in it's user space buffer @@ -3944,7 +3923,7 @@ static int sceNetAdhocGetPdpStat(u32 structSize, u32 structAddr) { if (serverHasRelay) { void *postofficeHandle = pdp_postoffice_recover(j); if (postofficeHandle != NULL) { - sock->data.pdp.rcv_sb_cc = pdp_peek_next_size(postofficeHandle); + sock->data.pdp.rcv_sb_cc = pdp_buffered_data_size(postofficeHandle); } } else { sock->data.pdp.rcv_sb_cc = getAvailToRecv(sock->data.pdp.id, sock->buffer_size); diff --git a/ext/aemu_postoffice b/ext/aemu_postoffice index 530fee545c..498b527af9 160000 --- a/ext/aemu_postoffice +++ b/ext/aemu_postoffice @@ -1 +1 @@ -Subproject commit 530fee545c27ffb8524a8f496cbbcfdb687fe8c5 +Subproject commit 498b527af977265b356058b835abf1836f4c0971