Skip to content

feat(http): implement sceHttpParseStatusLine - #642

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
Celegans12:feat/http-parse-status-line
Oct 5, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
Celegans12:feat/http-parse-status-line

Conversation

@Celegans12

@Celegans12 Celegans12 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What

libSceHttp does not export sceHttpParseStatusLine, so PPSA26344's import of it does not resolve.

  • sceHttpParseStatusLine(statusLine, lineLen, httpMajorVer, httpMinorVer, responseCode, reasonPhrase, phraseLen) (Qq8SfuJJJqE, new src/Parse.cpp) parses HTTP/<major>.<minor> <code> and returns the number of bytes up to and including the first line feed. The phrase starts right after the code and ends before the line feed and one optional CR.
  • Errors: PARSE_HTTP_INVALID_RESPONSE (0x80432060) for a null statusLine, a malformed line or no line feed inside lineLen; PARSE_HTTP_INVALID_VALUE (0x804321FE) for a null output. A count above INT32_MAX throws.
  • Sources: the signature SharpProspero declares (Interop/Net/Http.cs; KytyPS5 lacks the function). Behaviour and error codes follow shadPS4's reverse-engineered PS4 libSceHttp (network/http.cpp, PS4 reference), except that no read goes past lineLen. Recorded under "Unknown function info" in TechnicalDebt.
  • PPSA26344 v1.008 calls it once, at 0xd5fa94, on the response header; a negative result skips the block.
  • feat(libs): Deathloop loading support (Ampr, NetCtlApDialog + stubs) #407 and feat(libs): implement C runtime re-exports for libSceAmpr #545 export Qq8SfuJJJqE as a throwing sceHttpParseStatusLine(void) stub; that stub should be dropped from them when they are rebased.

Tested

  • Windows 11, MinGW-w64 GCC 15.2.0, based on main 53dc19c: configure -DBUILD_TESTING=ON, full build, --target libs, ctest:
  • 284/284 tests pass (ctest --output-on-failure)
  • guest_http gains rows for CRLF and LF-only lines, no phrase, multi-digit versions and each error path, including a line feed just past lineLen; they do not link on main (undefined sceHttpParseStatusLine).
  • PPSA26344 v1.008: the import resolves; the call is reached only after sceHttpGetAllResponseHeaders succeeds, which it does not without network.
  • Not tested: Linux (CI), console behaviour.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
#407 sceHttpParseStatusLine
#545 sceHttpParseStatusLine
#691 docs/dev/TechnicalDebt.md L76

Titles import sceHttpParseStatusLine from libSceHttp to read the
status line of a response; without the export they fail at startup.
Parse the HTTP/x.y version, the three-digit code and the reason phrase
up to the line feed, and return the library's PARSE_HTTP error codes.
The seven-argument signature is the one SharpProspero declares; the
behaviour follows the shadPS4 reimplementation of the PS4 library,
except that no byte past lineLen is read. A consumed count above
INT32_MAX cannot be returned and throws. guest_http covers valid lines
and each error path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Celegans12
Celegans12 force-pushed the feat/http-parse-status-line branch from 1bbebc3 to d926e78 Compare October 5, 2026 15:51
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Progress report (e248f40 → d926e78)

📉 System libraries: 79.18% (-0.02%, +1 declared functions)

🆕 1 declared as stubs
Library Name
libSceHttp sceHttpParseStatusLine

@oneandonlydean
oneandonlydean merged commit 4b0c38f into boykopovar:main Oct 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants