feat(libSceRtc): accept RFC 2822 and return parse errors in sceRtcParseDateTime #816
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/816"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by ebosido444-ai on 2026-10-06T06:21:34Z.
What
sceRtcParseDateTimethrewNotImplemented_nid_no_patchon any input outside its ISO 8601 subset and did not accept the RFC 2822 shape at all. Sourced behaviour now:[weekday, ]DD Mon YYYY HH:MM:SS ±HHMM(two-digit day, case-sensitive month names, four-digit zone without a colon) is accepted after the ISO subset: PPSSPP parses both shapes for the PSP predecessor and applies the zone offset, and shadPS4 emits that shape fromsceRtcFormatRFC2822and reads it back in itssceRtcParseDateTimefor PS4 titles.SCE_RTC_ERROR_BAD_PARSEwith the output tick left unchanged, as the siblingsceRtcParseRFC3339already does and as PPSSPP returns -1 with the output unchanged. Previously: thrown exception.docs/dev/TechnicalDebt.mdentry for the function.Tested
Windows 11, GCC 16.2 (w64devkit):
core/libs/tests/GuestRtc.cppcompiled againstcore/libs/prx/libSceRtc/Export.cppand executed — passes. All previous assertions are unchanged; the "unparseable input throws" block became "returnsSCE_RTC_ERROR_BAD_PARSEwith the tick unchanged" (mirroring the existingsceRtcParseRFC3339test style), RFC 2822 successes added including a cross-check againstsceRtcParseRFC3339("Tue, 01 Jul 2003 10:52:37 +0200"=="2003-07-01T08:52:37Z"), plus RFC 2822 shape rejections (one-digit day, missing space after the comma, missing zone,±HH:MMzone). The full CMake build was not run.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-06T07:35:59Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceRtc/Export.cppL160, L330-333, L336-337core/libs/tests/GuestRtc.cppL152-153, L158docs/dev/TechnicalDebt.mdL36core/libs/tests/GuestRtc.cppL5-6Imported from boykopovar/AnyPS5. Originally posted by ebosido444-ai on 2026-10-06T07:38:02Z.
Closing in favour of #782, which covers the same function as a strict superset (RFC 2822 incl. the GMT form and asctime) and came first. The one piece it does not have — returning SCE_RTC_ERROR_BAD_PARSE with the output tick unchanged instead of throwing, as PPSSPP does with -1 and the sibling sceRtcParseRFC3339 does with this code — is worth revisiting only with hardware evidence; the throw there matches the exact-or-throw rule while console behaviour is unverified. Sorry for the duplicate-checklist miss.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T09:27:48Z.
Thanks for this. #782 already does the same thing for
sceRtcParseDateTime. It was opened a few hours before this one, I've reviewed it and it has since been rebased. The two conflict inExport.cpp,GuestRtc.cppandTechnicalDebt.md, so only one of them can land. I'd suggest closing this one in favour of #782, for these reasons:sceRtcParseDateTimeaccepts. shadPS4 also parses asctime, for example. ReturningSCE_RTC_ERROR_BAD_PARSEfor a shape we don't recognise would quietly reject input the console may accept.sceRtcParseRFC3339can return the parse error because its grammar is fixed. PPSSPP's-1is PPSSPP's own choice for the PSP, so it isn't evidence of what libSceRtc does.parseRfc2822skips any run of characters up to the comma, soXyz, 29 Feb 2024 ...,2024, 29 Feb 2024 ...and, 29 Feb 2024 ...(an empty weekday) are all accepted. The TechnicalDebt line says the weekday is optional ([weekday, ]), but the code requires the comma, so29 Feb 2024 12:34:56 +0000is rejected. #782 checks the name against the seven weekdays.±HHMMisn't range-checked, so+9999is applied as 6039 minutes.GMTand the zone-less form, which shadPS4 accepts, are rejected.sceRtcParseDateTimesubtracts it (ticks -= offsetUs), as the PR description says.The PR also carries the
nid_names.pycommit from #811. Please keep each PR to one topic and leave that change in #811.Your cross-check of the RFC 2822 path against
sceRtcParseRFC3339is a good test idea. If you'd like it in, suggesting it on #782 would be the place.Pull request closed