Fix build to monero master branch

This commit is contained in:
Lee *!* Clagett
2021-08-19 17:08:50 -04:00
parent f009e76874
commit dbbdee6fd4

View File

@@ -35,6 +35,7 @@
namespace namespace
{ {
constexpr const unsigned flush_threshold = 100; constexpr const unsigned flush_threshold = 100;
constexpr const unsigned max_buffer = 4096;
} }
namespace wire namespace wire
@@ -44,7 +45,7 @@ namespace wire
void json_writer::check_flush() void json_writer::check_flush()
{ {
if (needs_flush_ && (bytes_.increase_size() < flush_threshold || bytes_.increase_size() - flush_threshold < bytes_.size())) if (needs_flush_ && (max_buffer < bytes_.size() || bytes_.available() < flush_threshold))
flush(); flush();
} }