Skip to content

fix: OPDS browser OOM#403

Merged
daveallie merged 8 commits intocrosspoint-reader:masterfrom
KasyanDiGris:master
Jan 21, 2026
Merged

fix: OPDS browser OOM#403
daveallie merged 8 commits intocrosspoint-reader:masterfrom
KasyanDiGris:master

Conversation

@KasyanDiGris
Copy link
Copy Markdown
Contributor

Summary

  • Rewrite OpdsParser to stream parsing instead of full content
  • Fix OOM due to big http xml response

Closes #385


AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? NO

@KasyanDiGris KasyanDiGris changed the title Fix OPDS browser OOM fix: OPDS browser OOM Jan 16, 2026
@KasyanDiGris
Copy link
Copy Markdown
Contributor Author

@daveallie Can you please review PR?

Copy link
Copy Markdown
Member

@daveallie daveallie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, happy with this, just a small ask to bring it inline with the other stream based parsers we have.

* @return true if parsing succeeded, false on error
*/
bool parse(const char* xmlData, size_t length);
void push(const char* xmlData, size_t length);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this push method, and a completely separate OpdsStream class, let's subclass OpdsParser off Print (like we do for ContentOpfParser) and then implement write directly in this class.

* }
*/
class OpdsParser {
class OpdsParser final : public Print {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it's worthwhile to go all the way and just subclass Stream? Including the stubs for available, peek, and read in here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a mistake in the HttpClient library, because the implementation of the writeToStream method requires the Printer class, not the Stream class. But I don't want to make patches.
In addition, all other parsers are subclasses of Printer, and that's right, because they're all designed to be write-only streams.

@daveallie daveallie merged commit 47ef92e into crosspoint-reader:master Jan 21, 2026
1 check passed
jdk2pq added a commit to jdk2pq/crosspoint-reader that referenced this pull request Jan 23, 2026
* master:
  chore: Cut release 0.15.0
  fix: OPDS browser OOM (crosspoint-reader#403)
  docs: Add detailed webserver documentation (crosspoint-reader#446)
  feat: invalidate cache on web uploads and opds downloads and add Clear Cache action (crosspoint-reader#393)
  fix: hard reset via RTS pin after flashing firmware (crosspoint-reader#437)
  fix: Skip negative screen coordinates only after we read the bitmap row. (crosspoint-reader#431)
  Reclaim space if we don't show battery Percentage (crosspoint-reader#352)
  feat: Include superscripts and subscripts in fonts (crosspoint-reader#463)
  My Library: Tab bar w/ Recent Books + File Browser (crosspoint-reader#250)
  feat: adding categories to settings screen (crosspoint-reader#331)
yingirene pushed a commit to yingirene/crosspoint-reader that referenced this pull request Jan 25, 2026
## Summary

- Rewrite OpdsParser to stream parsing instead of full content
- Fix OOM due to big http xml response

Closes crosspoint-reader#385 

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**NO**_
Unintendedsideeffects pushed a commit to Unintendedsideeffects/crosspoint-reader that referenced this pull request Feb 17, 2026
## Summary

- Rewrite OpdsParser to stream parsing instead of full content
- Fix OOM due to big http xml response

Closes crosspoint-reader#385 

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**NO**_
whale-n pushed a commit to whale-n/njwiv-xt that referenced this pull request Mar 17, 2026
## Summary

- Rewrite OpdsParser to stream parsing instead of full content
- Fix OOM due to big http xml response

Closes crosspoint-reader#385 

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**NO**_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OPDS Navigation crashes with many items

2 participants