diff options
Diffstat (limited to 'src/monitor-gui.cc')
| -rw-r--r-- | src/monitor-gui.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/monitor-gui.cc b/src/monitor-gui.cc index 3301ada..eb1f34d 100644 --- a/src/monitor-gui.cc +++ b/src/monitor-gui.cc @@ -46,7 +46,8 @@ namespace { -size_t const MAX_DATA_SIZE = 65536; +// Max amount of bytes rendered in package / protocol dumps +size_t const MAX_DATA_SIZE = 16383; std::string const APP_TITLE = "TransparentProxy"; @@ -1020,6 +1021,12 @@ public: std::unique_ptr<AttributedText> text(AttributedText::create()); HexDump::write(text.get(), HexDump::ADDRESS | HexDump::CHARS, pkg.data, 0, MAX_DATA_SIZE); + if (pkg.data.size() > MAX_DATA_SIZE) { + char tmp[100]; + auto len = snprintf(tmp, sizeof(tmp), "\nAll %lu bytes not shown...", + static_cast<unsigned long>(pkg.data.size())); + text->append(tmp, len); + } main_->set_package(std::move(text)); has_related_ = pkg.related != PackageList::NONE; |
