fix(nfproxy): prevent O(N²) memory growth from nested history snapshots

Objects archived in the history deques no longer carry their own
_history snapshot, breaking the recursive chain where each historical
entry held copies of all prior entries. The .history property on
archived objects now returns an empty HttpHistory([], []) instead.
This commit is contained in:
Sogoss 2026-07-21 15:19:30 +02:00
parent c71ad7c199
commit 9e4f93455b

View File

@ -728,13 +728,9 @@ class InternalBasicHttpMetaClass:
if msg.message_complete and not msg.added_to_history:
msg.added_to_history = True
if internal_data.current_pkt.is_input:
full_req = HttpFullRequest(parser, msg)
full_req._history = history_snapshot
req_history_deque.append(full_req)
req_history_deque.append(HttpFullRequest(parser, msg))
else:
full_resp = HttpFullResponse(parser, msg)
full_resp._history = history_snapshot
resp_history_deque.append(full_resp)
resp_history_deque.append(HttpFullResponse(parser, msg))
if len(built_instances) == 1:
res = built_instances[0]