feat(libcurl): implement string lists and URL escaping #14429
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14429"
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 bipinkrish on 2026-11-01T12:35:47Z.
What
Implements
curl_slist_append,curl_slist_free_all,curl_free,curl_easy_escape,curl_easy_unescape,curl_escapeandcurl_unescapewith typed System V ABI declarations and the 16-byte LP64 list layout.Lists copy strings, retain insertion order, preserve the original list when allocation fails, and release both strings and nodes. Escaping uses ASCII unreserved bytes and uppercase percent encodings; unescaping preserves malformed escapes and literal plus signs, accepts binary data with explicit lengths, and reports decoded lengths including embedded NULs. Allocations and frees use the guest libc heap.
Signatures and behavior follow curl 8.10.1's public API and escape.c / slist.c, independently reimplemented without adding third-party code. The console version and behavior are unverified and recorded in
docs/dev/debt/libcurl.md. Null strings whose behavior differs between curl versions throw throughNotImplemented_nid_no_patch; negative lengths return null without reading input. Custom curl allocators remain unavailable becausecurl_global_init_memstill throws.Rebased onto main
28154f27a0after #14337 merged. Both string-comparison exports are preserved. The curl library CMake file registers bothguest_curlandguest_curl_strings; the debt inventory lists the 76 remaining unconditional stubs. The landing-order dependency is satisfied.Tested
Rebase validation at
257a1142daon 2026-11-07-Wall -Wextra -Werror.ctest --test-dir /tmp/anyps5-curl-check/build -R '^guest_curl' --output-on-failurepassed bothguest_curlandguest_curl_strings.git diff --checkand conventions againstupstream/mainpassed. The required--base origin/mainrun reports an existing upstream commit-subject violation ate62a0f2604. Checking unchangedupstream/mainagainst the same fork base reports the same error.Earlier validation before the rebase
Ubuntu 24.04.4, x86-64, GCC 13.3.0. No game, homebrew, PS5 system library, firmware dump or console was used.
71fc1c3f22376233ade2ce69215741677e504158: after removing the throw assertions, rebuilt and reranguest_curlin Release and under ASan/UBSan with leak detection; both passed. Strict compilation and conventions checks were also rerun successfully. The runtime implementation and debt notes are unchanged. Null strings with nonnegative lengths andcurl_slist_append(nullptr, nullptr)are deliberately not tested; implemented escaping, list ownership, negative-length, allocation-failure and allocation/output-length checks remain.BUILD_TESTING=ON; builtlibcurl,libc,libkernelandguest_curl_tests. Releasectest --test-dir build -R '^guest_curl$' --output-on-failure: passed.ANYPS5_ENABLE_ASAN=ONand-fsanitize=undefined; the same CTest passed withASAN_OPTIONS=detect_leaks=1andUBSAN_OPTIONS=halt_on_error=1. Leak detection ran outside the sandbox because it needs process inspection.g++ -std=c++20 -Wall -Wextra -Werror -Icore/libs -fsyntax-onlyon the changed implementation and new test: passed.python3 core/libs/tests/test_public_headers.py --audit-only: passed (399 libraries, 26,227 exports).python3 tools/check_conventions.py --base origin/main: zero errors; eight existing debt-length warnings in unrelated upstream files.git diff --check: passed.Original pre-rebase overlap check: ran
python3 tools/pr_overlap.py --branch codex/curl-lists-url-escaping --repo boykopovar/AnyPS5 --jobs 8against 1,666 open PR heads. No shared exports. It reports textual overlap with #14337 atExport.cpp:3anddocs/dev/debt/libcurl.md:5; merge ordering is declared above. The checker exits 2 because 12 existing PR branches conflict with main and sharecore/libs/CMakeLists.txt. I manually compared every flagged branch's diff from its merge base: #5021 changes macOS linker/rpath setup; #7275 adds render_override tests; #8650 adds VR tracker tests; #9156 adds pthread attribute tests; #9162 adds wait3/wait4 tests; #9293/#9297/#9302 add semaphore/message queue tests; #9383 adds rtld_printf tests; #12642 adds pthread suspend tests; #13253 adds dup tests; #13256 adds nanosleep tests. None touches the insertion beforeguest_vorbis_dec_tests, the curl target, or these curl exports.Not tested: Windows/macOS execution, any console comparison, strings larger than
INT_MAX, or the full repository test suite.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T13:45:46Z.
Review: COMMENTED
Reviewed — no blocking findings
The libcurl helpers are sound on the paths I read at head 71fc1c3f22376233ade2ce69215741677e504158; the new commit removes only test assertions for null-string behaviour, so the implementation is unchanged, but that behaviour is now untested.
What I ran
71fc1c3f22376233ade2ce69215741677e504158(one commit after the earlier headbe4515f708), base4768f0aeca680477597b2e42cba60ae49e48802c./usr/bin/python33.11.2, no build.python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14429 --output-dir /dev/shm/reviewer-run/precheck/14429bbe4515f7...71fc1c3f): one file,core/libs/tests/GuestCurl.cpp, 22 lines removed, no other file changed.python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 4768f0aeca680477597b2e42cba60ae49e48802c --head 71fc1c3f22376233ade2ce69215741677e504158 --json(exit 0; statuspassed; 0 findings; 85 symbols)core/libs/tests/GuestCurl.cppfrom a head extract: one literal-path registration heuristic; the registration is atcore/libs/CMakeLists.txtlines 1253-1262.Results
Precheck report, checks table, unedited (
/dev/shm/reviewer-run/precheck/14429b/report.md):The precheck deliberately does not configure, build, or compile AnyPS5.git diff --check 4768f0aeca680477597b2e42cba60ae49e48802c...71fc1c3f22376233ade2ce69215741677e504158/usr/bin/python3 tools/check_conventions.py --base 4768f0aeca680477597b2e42cba60ae49e48802c --head 71fc1c3f22376233ade2ce69215741677e504158 --title feat(libcurl): implement string lists and URL escaping --body /dev/shm/reviewer-run/precheck/14429b/pr-body.md/usr/bin/python3 tools/pr_abi_audit.py --base 4768f0aeca680477597b2e42cba60ae49e48802c --head 71fc1c3f22376233ade2ce69215741677e504158 --jsonNo changed Python implementation files.No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.No changed test_*.py files./usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14429 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14429b/stackNot run: C++ tests need exact-head binaries, which require a build; the precheck does not build./usr/bin/python3 /dev/shm/reviewer-run/precheck/14429b/head-71fc1c3f2237-be3c0b1f/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14429b/head-71fc1c3f2237-be3c0b1f --json core/libs/CMakeLists.txt core/libs/prx/libcurl/Export.cpp core/libs/prx/libcurl/include/Api.hpp core/libs/prx/libcurl/include/InventoryExports.hpp core/libs/prx/libcurl/libcurl.hpp core/libs/tests/GuestCurl.cpp docs/dev/debt/libcurl.mdNo changed Python test module in tools/ can be run as a no-build base-source control.Negative control
Not run. The PR's earlier negative controls (lowercase escaping and a second-allocation leak) are the author's report, from temporary copies.
Findings
Blocking: none.
Non-blocking:
curl_easy_escape,curl_escape,curl_easy_unescapeandcurl_unescapethrow for a null string with length 0 and 1, and thatcurl_slist_append(nullptr, nullptr)throws.Export.cppstill throws throughNotImplemented_nid_no_patchfor those inputs, so behaviour is unchanged, but nothing tests it at head. The PR body's Tested list still describes unsupported null strings as covered; that is stale. Either restore a test for the throw or update the body.Sources
github.com/boykopovar/AnyPS5@71fc1c3f22/core/libs/prx/libcurl/Export.cppgithub.com/boykopovar/AnyPS5@71fc1c3f22/core/libs/CMakeLists.txt (L1253-L1262)Not verified
guest_curlwas not built or run here. The author's Release, ASan and UBSan results are for the earlier head.escape.ccitation was not matched: a grep oflib/escape.cat tagcurl-8_10_1for the unreserved set returned no match.conventionswas cancelled at this head, andeligibility,labels,library-portabilityandreportwere queued.