mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 18:56:29 +00:00
expanding_report: make expandable for XML node generation
'generate(Xml_node node)', as used by the Sculpt manager, calls this function instead of the lambda version. The 'report' function of the 'Genode::Reporter' does not throw an exception in case there is not enough backing storage for the 'generate' request. Therefore, we have to check this condition in a loop and call '_increase_report_buffer' in case size limits are reached. Patch by Norman Feske. issue #4369
This commit is contained in:
parent
dd1596aa53
commit
300cdc435d
@ -203,14 +203,18 @@ class Genode::Expanding_reporter
|
||||
|
||||
void generate(Xml_node node)
|
||||
{
|
||||
retry<Xml_generator::Buffer_exceeded>(
|
||||
for (bool done = false; !done; ) {
|
||||
node.with_raw_node([&] (char const *start, size_t length) {
|
||||
if (length > _buffer_size)
|
||||
return;
|
||||
|
||||
[&] () {
|
||||
node.with_raw_node([&] (char const *start, size_t length) {
|
||||
_reporter->report(start, length); }); },
|
||||
_reporter->report(start, length);
|
||||
done = true;
|
||||
});
|
||||
|
||||
[&] () { _increase_report_buffer(); }
|
||||
);
|
||||
if (!done)
|
||||
_increase_report_buffer();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user