Ethereal-dev: Re: [Ethereal-dev] Enhancement request to http dissector

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

From: "Ulf Lamping" <[email protected]>
Date: Tue, 13 Jul 2004 15:06:19 +0200
Ethereal development <[email protected]> schrieb am 13.07.04 13:55:01:

As I don't know the SSL stuff, some more general tips.

> (1) Move the zillion #define's in packet-ssl.c to packet-ssl.h (a good 
> practice anyway?)

It's not necessarily a good pratice to put all defines into the corresponding header files.

If you want to provide an API type header file, it's not a good idea to put all define's into it.
It should only contain the defines needed by the API user, otherwise it makes usage of the API much more difficult.

And you will find the definitions and usage of them in the same file, which makes working with the code faster.

> (2) COPY the above mentioned functions from packet-ssl.c to 
> packet-http.c and use it them (and include packet-ssl.h for the 
> definitions).

Copying code is generally a very bad idea, unless you need to modify the copied parts heavily (if you only need a "skeleton" to start with).

In the end, there are several places where slightly the same code is used, so fixing a bug or adding new features will become a nightmare.

I've found several places in the Ethereal sources where this is true, and bringing this parts of the code back together to one place is really hard and ugly work.

Of course, this is only my personal taste (and only a general guideline), other's will have a different point of view.

Regards, ULFL

Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt neu bei WEB.DE FreeMail: