Fix empty query handling in HttpUriParse #764

Manually merged
github merged 4 commits from gh-pr/764/head into gh-pr/764/base 2026-11-26 09:32:01 +00:00
Owner

@⁠ElijaOwO on GitHub · 2026-09-22 09:00 UTC · original
ElijaOwO:fix-http-uri-parse-empty-query → main · +149 −3 · 3 files · 4 commits · merged 2026-09-27 12:07 UTC

HttpUriParse atm leaves query null when the URI has no query component.
Now it returns a pool-backed "" instead.
Also added regression coverage for URIs with/without query components + pool sizing.

Tests:
http_uri_parse_tests
kyty_emulator build

**@⁠ElijaOwO** on GitHub · 2026-09-22 09:00 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/764) `ElijaOwO:fix-http-uri-parse-empty-query` → `main` · +149 −3 · 3 files · 4 commits · merged 2026-09-27 12:07 UTC HttpUriParse atm leaves query null when the URI has no query component. Now it returns a pool-backed "" instead. Also added regression coverage for URIs with/without query components + pool sizing. Tests: http_uri_parse_tests kyty_emulator build
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:31:58 +00:00
github manually merged commit a73a82ebf5 into gh-pr/764/base 2026-11-26 09:32:01 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-22 09:06 UTC · original · edited 2026-09-22 16:49 UTC

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 0a08a864-2f4d-491a-8481-7365dc3bedc0

📥 Commits

Reviewing files that changed from the base of the PR and between 429d2452f6 and 7db1cbecd4.

📒 Files selected for processing (2)
  • src/libs/libNet.cpp
  • tests/HttpUriParseTests.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

HttpUriParse now allocates and initializes an empty query string when the URL has no query. The required pool size includes this string. A new ABI-aware test validates URLs with and without queries, including pool-backed output and "?foo=bar" preservation. CMake builds, registers, and aggregates the new test.

Suggested reviewers: nmzik

Priority: ⬇️ Low

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 7db1c

URIs without queries now consistently return an empty query value, including empty URIs, with matching pool sizing.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: it fixes empty query handling in HttpUriParse.
Description check ✅ Passed The description is directly related to the changes. It explains the empty query behavior and lists the added regression tests and validation steps.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-09-22 09:06 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/764#issuecomment-5773901650) · edited 2026-09-22 16:49 UTC <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/764"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=2" alt="Review in Change Stack →" width="220" height="32"></a> Navigate logical layers of code changes, visualize relationships, and explore their blast radius. <!-- review_stack_entry_end --> <!-- recent_review_start --> No actionable comments were generated in the recent review. 🎉 <details> <summary>ℹ️ Recent review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml **Review profile**: CHILL **Plan**: Advanced **Run ID**: `0a08a864-2f4d-491a-8481-7365dc3bedc0` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 429d2452f62b4297463061758939df8d835b1956 and 7db1cbecd486b42e053adb8b47e987c3da33b8e5. </details> <details> <summary>📒 Files selected for processing (2)</summary> * `src/libs/libNet.cpp` * `tests/HttpUriParseTests.cpp` </details> **Included review availability:** Your plan provides up to 10 included reviews per hour; 9 remain after this review. </details> --- <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## Walkthrough `HttpUriParse` now allocates and initializes an empty query string when the URL has no query. The required pool size includes this string. A new ABI-aware test validates URLs with and without queries, including pool-backed output and `"?foo=bar"` preservation. CMake builds, registers, and aggregates the new test. **Suggested reviewers:** `nmzik` </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ⬇️ Low <!-- change_assessment_commit:"7db1cbecd486b42e053adb8b47e987c3da33b8e5" --> **Change:** Bug fix <!-- change_assessment_end --> <!-- final_review_risk_start --> **Merge Risk:** _⚪ Minimal_ · up to `7db1c` <!-- final_review_risk_coverage:{"sourceCommitId":"7db1cbecd486b42e053adb8b47e987c3da33b8e5","coveredCommitId":"7db1cbecd486b42e053adb8b47e987c3da33b8e5","kind":"reviewed"} --> URIs without queries now consistently return an empty query value, including empty URIs, with matching pool sizing. <!-- final_review_risk_end --> <!-- pre_merge_checks_walkthrough_start --> <details> <summary>🚥 Pre-merge checks | ✅ 4 | ❌ 1</summary> ### ❌ Failed checks (1 warning) | Check name | Status | Explanation | Resolution | | :----------------: | :--------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ⚠️ Warning | Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 2 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary>✅ Passed checks (4 passed)</summary> | Check name | Status | Explanation | | :------------------------: | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------- | | Title check | ✅ Passed | The title clearly summarizes the main change: it fixes empty query handling in HttpUriParse. | | Description check | ✅ Passed | The description is directly related to the changes. It explains the empty query behavior and lists the added regression tests and validation steps. | | Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | </details> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- tips_start --> --- <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-22 09:06 UTC · original · reviewed

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Initialize query for empty URLs. · libNet.cpp:280

src/libs/libNet.cpp:280
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Initialize query for empty URLs.

HttpUriParse routes an empty src_url to ParseEmptyUri. That helper reserves and initializes only scheme, hostname, and path. It still returns out->query == nullptr.

Reserve one more byte and set out->query to a pool-backed empty string. This makes the no-query contract consistent for empty and non-empty URLs.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: e45894bd-994e-46fe-8a5e-8d8c3c5205e8

📥 Commits

Reviewing files that changed from the base of the PR and between 8b095caefe and 429d2452f6.

📒 Files selected for processing (3)
  • CMakeLists.txt
  • src/libs/libNet.cpp
  • tests/HttpUriParseTests.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

**@⁠coderabbitai[bot]** on GitHub · 2026-09-22 09:06 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/764#pullrequestreview-5276077889) · **reviewed** > [!CAUTION] > Some comments are outside the diff and can’t be posted inline due to GitHub limitations. > > **⚠️ Outside diff range comments (1)** > > <details> > <summary><em>🟡 Minor</em> · Initialize <code>query</code> for empty URLs. · <code>libNet.cpp:280</code></summary><blockquote> > > `src/libs/libNet.cpp:280` > _🎯 Functional Correctness_ | _🟡 Minor_ | _⚡ Quick win_ > > **Initialize `query` for empty URLs.** > > `HttpUriParse` routes an empty `src_url` to `ParseEmptyUri`. That helper reserves and initializes only `scheme`, `hostname`, and `path`. It still returns `out->query == nullptr`. > > Reserve one more byte and set `out->query` to a pool-backed empty string. This makes the no-query contract consistent for empty and non-empty URLs. > > <!-- cr-comment:v1:6aa50fb3ad771e922efd8db1 --> > > </blockquote></details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml **Review profile**: CHILL **Plan**: Advanced **Run ID**: `e45894bd-994e-46fe-8a5e-8d8c3c5205e8` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 8b095caefecc2b0066b1b66425d24fd90f29a609 and 429d2452f62b4297463061758939df8d835b1956. </details> <details> <summary>📒 Files selected for processing (3)</summary> * `CMakeLists.txt` * `src/libs/libNet.cpp` * `tests/HttpUriParseTests.cpp` </details> **Included review availability:** Your plan provides up to 10 included reviews per hour; 9 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Author
Owner

@⁠Nmzik on GitHub · 2026-09-25 22:01 UTC · original · edited 2026-09-25 22:04 UTC

@⁠ElijaOwO which game passes such params? Is it based on real ps5 runtime behaviour? We try not to implement speculative behavior

**@⁠Nmzik** on GitHub · 2026-09-25 22:01 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/764#issuecomment-5840266732) · edited 2026-09-25 22:04 UTC @⁠ElijaOwO which game passes such params? Is it based on real ps5 runtime behaviour? We try not to implement speculative behavior
Author
Owner

@⁠ElijaOwO on GitHub · 2026-09-26 18:14 UTC · original

@⁠Nmzik Hey, The last of us Part 1. Based on emulator crash while booting up the game. Had some other fixes to get the first like 10 frames but they are not nearly fininshed so i thought i should publish some finished stuff.

**@⁠ElijaOwO** on GitHub · 2026-09-26 18:14 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/764#issuecomment-5848646615) @⁠Nmzik Hey, The last of us Part 1. Based on emulator crash while booting up the game. Had some other fixes to get the first like 10 frames but they are not nearly fininshed so i thought i should publish some finished stuff.
Author
Owner

@⁠ElijaOwO on GitHub · 2026-09-26 18:17 UTC · original

Actually looked up the code again and thought wtf i was doing but after a close lookup its actually fine XD
If u need anything write me

**@⁠ElijaOwO** on GitHub · 2026-09-26 18:17 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/764#issuecomment-5848667801) Actually looked up the code again and thought wtf i was doing but after a close lookup its actually fine XD If u need anything write me
Author
Owner

@⁠Nmzik on GitHub · 2026-09-27 12:04 UTC · original

@⁠ElijaOwO All good! :) Next time, please mention the game you’re trying to push fixes for. Thanks for the quick response! Approved

**@⁠Nmzik** on GitHub · 2026-09-27 12:04 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/764#issuecomment-5855658138) @⁠ElijaOwO All good! :) Next time, please mention the game you’re trying to push fixes for. Thanks for the quick response! Approved
This discussion has been locked. Commenting is limited to contributors.
No description provided.