INNER CODE UNIT · Python
handled_pos
lebinh/ngxtop · ngxtop/ngxtop.py:309
if handled_pos == -1:
# Try to parse as pure JSON if no "handled request" prefix
json_start = line.find('{')
else:
# Find the first { after "handled request"
json_start = line.find('{', handled_pos + len('handled request'))
if json_start == -1:
continue
json_str = line[json_start:].strip()
# Basic check for complete JSON: should start with { and end with }
if not json_str.endswith('}'):
# Likely truncated line, skip it
continue
# Handle potential truncated JSON by trying to parse