Wireshark

  • Riverbed Technology
  • WinPcap
the world's foremost network protocol analyzer
  • Wireshark
    • About
    • Download
    • Blog
  • Get Help
    • Ask a Question
    • FAQs
    • Documentation
    • Mailing Lists
    • Online Tools
    • Wiki
    • Bug Tracker
  • Develop
    • Get Involved
    • Developer's Guide
    • Browse the Code
    • Latest Builds

Wireshark-dev: Re: [Wireshark-dev] Small performance improvements to packet-http.c

Date Index Thread Index Other Months All Mailing Lists
Date Prev Date Next Thread Prev Thread Next


From: Stephen Fisher <stephentfisher@xxxxxxxxx>
Date: Wed, 7 Nov 2007 17:23:39 -0700

On Thu, Nov 08, 2007 at 12:54:14AM +0100, Didier wrote:
> Hi,
> 
> On Wed, 7 Nov 2007 11:58:24 +0200, Kaul wrote
> > Attached please find a version which reverts back the erroneous printf() changes. Sorry.
> 
> There's a bug
> conv_data->request_method = ep_strndup("POST", 4);
> should be
> se_strndup

Right, because conv_data is allocated with as seasonal (se_).  BTW, with
a standard NULL terminated string, [se|ep]_strdup() is safe to use
because it checks the string length and allocates that much space at the
pointer it returns.

> Or better:
> stat_info->request_method = "POST"
> conv_data->request_method ="POST"
> 
> And you can precompute 
> (headers[i].namelen - 1)

But the memory still needs to be allocated...


Steve


  • References:
    • [Wireshark-dev] Small performance improvements to packet-http.c
      • From: Kaul
    • Re: [Wireshark-dev] Small performance improvements to packet-http.c
      • From: Kaul
    • Re: [Wireshark-dev] Small performance improvements to packet-http.c
      • From: Andreas Fink
    • Re: [Wireshark-dev] Small performance improvements to packet-http.c
      • From: Kaul
    • Re: [Wireshark-dev] Small performance improvements to packet-http.c
      • From: Kaul
    • Re: [Wireshark-dev] Small performance improvements to packet-http.c
      • From: Didier
  • Prev by Date: Re: [Wireshark-dev] Small performance improvements to packet-http.c
  • Next by Date: Re: [Wireshark-dev] [Wireshark-commits] rev 23395: /trunk/ /trunk/epan/: prefs.c prefs.h /trunk/gtk/: layout_prefs.c toolbar.c
  • Previous by thread: Re: [Wireshark-dev] Small performance improvements to packet-http.c
  • Next by thread: Re: [Wireshark-dev] Small performance improvements to packet-http.c
  • Index(es):
    • Date
    • Thread

Wireshark and the "fin" logo are registered trademarks of the Wireshark Foundation