Ethereal-dev: [ethereal-dev] Capture dialog box defaults to previous # of packets captured

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

Date Next Thread Next
From: Guy Harris <guy@xxxxxxxxxx>
Date: Tue, 1 Jun 1999 14:49:20 -0700 (PDT)
If "cf.count" is not zero, the capture dialog box will put, as the two
items in the combo box for the capture count, "0 (Infinite)" and the
value of "cf.count"; it puts the value of "cf.count" first, so that's
what the combo box gets initialized to.

"wtap_dispatch_cb()" and "pcap_dispatch_cb()" increment "cf->count",
where "cf" is their "user data" argument, cast to a "capture_file *". 
That argument is set up by "load_capture_file()", which gets passed
"&cf" as an argument, so they're incrementing "cf->count".

This means that if you:

	do a capture;

	do another capture right after it;

the first capture causes "cf.count" to be set to the number of packets
captured when it's read in, so that the second capture will capture no
more than that many packets unless you set the capture count to 0.

The only place we appear to use "cf->count" when, or after, reading in a
capture is when we set the "packet number" column:

	file.c:    col_add_fstr(fdata, COL_NUMBER, "%d", cf->count);

Is it a feature that the combo box for the capture count has the number
of packets captured in the previous capture as one of its options?  (I
don't consider it a feature that it *defaults* to that value, as I've
*never* wanted that, and it often means my capture stops before the
packets I wanted to see.)

If not, perhaps we should remove that.

If so, we should probably put "0 (Infinite)" *first* in the combo box
list, so that it defaults to that.