Repository navigation
refactor(http): drop errno saves around guest copies - #26188
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mihiii1337
left a comment
There was a problem hiding this comment.
I ran a focused native Windows GCC 15.2 A/B test on 709342e and 6f10424 with the real libc guest-memory hooks deliberately overwriting errno. Both revisions passed with 56 read and 41 write hook calls. A cached client read to a read-only output threw without moving the client offset or changing errno, and retrying into writable memory returned the same first two bytes. The status-line parser preserved errno both on success and on rejecting a read-only status-code output. URI escaping and the local cookie set/get and stats paths also returned the expected results without leaking hook errno.
The client cache was seeded in the fixture, so the test opened no connections. It built the changed HTTP sources against cached libc whose checked-copy and guest-hook sources match both revisions.
AI-assisted: yes
What
Same change as #25937, #25944 and #25945, for
libSceHttp.GuestCopyIn_nid_no_patch,GuestCopyOut_nid_no_patchandGuestWritable_nid_no_patchrestoreerrnothemselves since #21243 (RestoreErrnoinlibc/src/General.cpp), so saving and restoringerrnoaround them does nothing.Client.cpp,Cookies.cpp,Parse.cpp,Uri.cppandGuestAccess.hpp.HttpGuest::CopyInandHttpGuest::CopyOutinGuestAccess.hpp, andWriteGuestBytesinUri.cpp, only wrapped the copy in such a save. They are removed, and their callers inGuestAccess.hpp,Cookies.cppandUri.cppcall the copy function directly, with the same arguments.HttpGuest::CopyTextand the typed helpers stay.61 lines removed and 16 added.
Export.cppis left out because #9834, #11134 and #24528 change it.No change in behaviour.
Tested
Windows 11 (10.0.26300), WinLibs GCC 15.2.0 r7, Release.
ctest -R 'http', with its 34 build outputs fromtools/select_tests.py targets: 50 of 50 onmain709342e209and 50 of 50 with this change applied to it.tools/check_conventions.pypasses.tools/pr_overlap.py --branchfinds no overlap with the 2547 open pull requests.Not run: Linux and macOS.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)