Skip to content

Commit

Permalink
Fixes [ZMQCollectorInterface.cpp:475] ERROR: Uncompress error [-5][le…
Browse files Browse the repository at this point in the history
…n: 2123]
  • Loading branch information
lucaderi committed Aug 29, 2024
1 parent 49a8f68 commit eaf488d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/ntop_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,7 @@ extern NtopngLuaContext* getUserdata(struct lua_State *vm);
#define MAX_CHECKPOINT_COMPRESSION_BUFFER_SIZE 1024

/* Keep in sync with nProbe */
#define MAX_ZMQ_FLOW_BUF 16384
#define MAX_ZMQ_FLOW_BUF 131072
#define DEFAULT_ZMQ_TCP_KEEPALIVE 1 /* Keepalive ON */
#define DEFAULT_ZMQ_TCP_KEEPALIVE_IDLE 30 /* Keepalive after 30 seconds */
#define DEFAULT_ZMQ_TCP_KEEPALIVE_CNT 3 /* Keepalive send 3 probes */
Expand Down
6 changes: 5 additions & 1 deletion src/ZMQCollectorInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,11 @@ void ZMQCollectorInterface::collect_flows() {
uncompressed = (char *)malloc(uncompressed_len + 1);
if ((err = uncompress((Bytef *)uncompressed, &uLen,
(Bytef *)&payload[1], size - 1)) != Z_OK) {
ntop->getTrace()->traceEvent(TRACE_ERROR, "[topic: %s] Uncompress error %d [compressed len: %u]", h->url, err, size);
ntop->getTrace()->traceEvent(TRACE_ERROR, "[topic: %s] Uncompress error %d [compressed len: %u][max decompress len: %u]",
h->url, err, size, uncompressed_len);

if(err == Z_BUF_ERROR)
ntop->getTrace()->traceEvent(TRACE_ERROR, "Internal error: decompression buffer too short");
continue;
}

Expand Down

0 comments on commit eaf488d

Please sign in to comment.