Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-bugs: [Wireshark-bugs] [Bug 8287] HTTP dissector: add timespan between req/res, add li

Date: Sat, 16 Feb 2013 02:07:44 +0000

Comment # 27 on bug 8287 from
we may have slightly different interpretations on how an assert() should be
used. To me it is a statement what my current code expects to be true, so it is
known to work. Thus I'm using that to either check parameter values (or
something derived from that) for sanity, or to check that changes I've made in
my code meet an invariant.

That said, certainly as of today these assert()s all hold true, but a future
developer might have an additional check that he has understood the underlying
assumption correctly if he wants to modify this code.

DISSECTOR_ASSERT(pinfo->fd->num > 0): Sure this is currently correctly set by
Wireshark. But a buggy dissector might set this variable to 0 and I'd like to
see a big error when it hits my code, than somehow failing otherwise.

DISSECTOR_ASSERT(! conv_data->req_res_tail): you're correct this one is
useless. It is a leftover from the code changes and should be removed.

DISSECTOR_ASSERT(req_res->prev->next == req_res): a sanity check that my double
linked list setup is correct. Again mainly done a a precaution for future
changes.

You're free to remove these asserts in your commit of this feature if you think
they don't provide any use.


You are receiving this mail because:
  • You are watching all bug changes.