fix: OPDS browser OOM (#403)
## 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**_
This commit is contained in:
15
lib/OpdsParser/OpdsStream.cpp
Normal file
15
lib/OpdsParser/OpdsStream.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "OpdsStream.h"
|
||||
|
||||
OpdsParserStream::OpdsParserStream(OpdsParser& parser) : parser(parser) {}
|
||||
|
||||
int OpdsParserStream::available() { return 0; }
|
||||
|
||||
int OpdsParserStream::peek() { abort(); }
|
||||
|
||||
int OpdsParserStream::read() { abort(); }
|
||||
|
||||
size_t OpdsParserStream::write(uint8_t c) { return parser.write(c); }
|
||||
|
||||
size_t OpdsParserStream::write(const uint8_t* buffer, size_t size) { return parser.write(buffer, size); }
|
||||
|
||||
OpdsParserStream::~OpdsParserStream() { parser.flush(); }
|
||||
Reference in New Issue
Block a user