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:
23
lib/OpdsParser/OpdsStream.h
Normal file
23
lib/OpdsParser/OpdsStream.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <Stream.h>
|
||||
|
||||
#include "OpdsParser.h"
|
||||
|
||||
class OpdsParserStream : public Stream {
|
||||
public:
|
||||
explicit OpdsParserStream(OpdsParser& parser);
|
||||
|
||||
// That functions are not implimented for that stream
|
||||
int available() override;
|
||||
int peek() override;
|
||||
int read() override;
|
||||
|
||||
virtual size_t write(uint8_t c) override;
|
||||
virtual size_t write(const uint8_t* buffer, size_t size) override;
|
||||
|
||||
~OpdsParserStream() override;
|
||||
|
||||
private:
|
||||
OpdsParser& parser;
|
||||
};
|
||||
Reference in New Issue
Block a user