Ethereal-dev: Re: [Ethereal-dev] Some problems with dissect_rpc_opaque_data

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

From: Guy Harris <guy@xxxxxxxxxx>
Date: Tue, 20 May 2003 21:20:56 -0700
On Tue, May 20, 2003 at 09:05:27PM -0700, Richard Sharpe wrote:
> Does anyone object if I simplify it?

Or possibly just remove it.

The code might be simpler if, for example, it were cut-and-pasted into
the places that called it, with the arguments replaced by the values
passed in, and then optimized by removing dead code (e.g.

	if (TRUE) {
		XXX
	} else {
		YYY
	}

being replaced by

	XXX

).  There's a lot of

	if (fixed_length) {
		XXX
	} else {
		YYY
	}

stuff, for example.

Getting rid of the truncation checks, and just letting exceptions be
thrown as data is fetched, might simplify it further.