diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2022-10-24 21:22:01 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2022-10-30 22:13:07 +0100 |
commit | 805aef5de8b127e58ceae2e6f5c946dba7af569d (patch) | |
tree | 689ad520dfb68e318d79d0f92f878d1277092636 /dependencies | |
parent | 2d14509f047ded824c1141b2355c5b9daba30c1e (diff) |
Increased network buffer size to 33792 bytes.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'dependencies')
-rw-r--r-- | dependencies/nDPIsrvd.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/dependencies/nDPIsrvd.py b/dependencies/nDPIsrvd.py index aa395bf06..cfb8fa44e 100644 --- a/dependencies/nDPIsrvd.py +++ b/dependencies/nDPIsrvd.py @@ -21,7 +21,7 @@ DEFAULT_PORT = 7000 DEFAULT_UNIX = '/tmp/ndpid-distributor.sock' NETWORK_BUFFER_MIN_SIZE = 6 # NETWORK_BUFFER_LENGTH_DIGITS + 1 -NETWORK_BUFFER_MAX_SIZE = 32768 # Please keep this value in sync with the one in config.h +NETWORK_BUFFER_MAX_SIZE = 33792 # Please keep this value in sync with the one in config.h PKT_TYPE_ETH_IP4 = 0x0800 PKT_TYPE_ETH_IP6 = 0x86DD @@ -417,7 +417,13 @@ class nDPIsrvdSocket: index = 0 for received_line in self.lines: - json_dict = json.loads(received_line[0].decode('ascii', errors='replace'), strict=True) + try: + json_dict = json.loads(received_line[0].decode('ascii', errors='replace'), strict=True) + except json.decoder.JSONDecodeError as err: + sys.stderr.write('\nFATAL: JSON decode failed at line "{}"\n'.format(received_line[0].decode('ascii', errors='replace'))) + sys.stderr.write('\n{}\n'.format(str(err))) + retval = False + instance = self.flow_mgr.getInstance(json_dict) if instance is None: retval = False @@ -474,7 +480,7 @@ def validateAddress(args): address = None if args.host is None: - address_tcpip = (DEFAULT_HOST, DEFAULT_PORT) + address_tcpip = (DEFAULT_HOST, args.port) else: address_tcpip = (args.host, args.port) tcp_addr_set = True |