fix: OPDS browser OOM#403
Conversation
|
@daveallie Can you please review PR? |
daveallie
left a comment
There was a problem hiding this comment.
Looks good, happy with this, just a small ask to bring it inline with the other stream based parsers we have.
lib/OpdsParser/OpdsParser.h
Outdated
| * @return true if parsing succeeded, false on error | ||
| */ | ||
| bool parse(const char* xmlData, size_t length); | ||
| void push(const char* xmlData, size_t length); |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
* 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)
## 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**_
## 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**_
## 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**_
Summary
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