From 0771cf73cd2d4111727555a83f5401aa768cb849 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 6 Apr 2019 19:42:23 -0700 Subject: Use a single wtap_rec and Buffer for an entire capture session. That way we aren't allocating memory, reading packets from a batch, and freeing the memory for each batch of packets delivered by dumpcap; we do the allocation when the capture starts and the freeing when it finishes. Change-Id: If012ab865f3a99d869535ad10827ad8680c1b10c Reviewed-on: https://code.wireshark.org/review/32766 Petri-Dish: Guy Harris Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- capchild/capture_session.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'capchild/capture_session.h') diff --git a/capchild/capture_session.h b/capchild/capture_session.h index 65a7d48fa0..93ddabb147 100644 --- a/capchild/capture_session.h +++ b/capchild/capture_session.h @@ -52,6 +52,8 @@ typedef struct _capture_session { guint32 count; /**< Total number of frames captured */ capture_options *capture_opts; /**< options for this capture */ capture_file *cf; /**< handle to cfile */ + wtap_rec rec; /**< record we're reading packet metadata into */ + Buffer buf; /**< Buffer we're reading packet data into */ struct wtap *wtap; /**< current wtap file */ struct _info_data *cap_data_info; /**< stats for this capture */ } capture_session; -- cgit v1.2.3