Ethereal-dev: Re: [Ethereal-dev] [PATCH] ssl decrypt debug code

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

From: Paolo Abeni <paolo.abeni@xxxxxxxx>
Date: Thu, 09 Feb 2006 11:55:10 +0100
On Thu, 2006-02-09 at 10:27 +0100, Joerg Mayer wrote:
> Why do you do
> 
> -ssl_debug_printf("pcry_private_decrypt: can't decrypt key:%s\n",
> -            gcry_strerror(rc));
> +        if (ssl_debug_enabled())
> +            ssl_debug_printf("pcry_private_decrypt: can't decrypt key:%s\n",
> +                gcry_strerror(rc));
> 
> many many times instead of just patching ssl_debug_printf to start with the
> ssl_debug_enabled() test? Making it a runtime/environment configurable
> thing would be ok too, but that's just as you prefer it.

The idea was to keep the overhead of debug to the lowest level.  This
way, when debug is disable, we add only a few comparisons (the
ssl_debug_enabled() function is declared 'inline') to the required
dissection process.

Moving the test into the ssl_debug_printf function would deal to a much
more big code (if the function is inlined) or less efficent code (if not
inlined due to calling overhead with long parameter list). 

Ok, probably the performance difference is not so relevant, so if you
agree, I will move the test into the ssl_debug_printf and re-post the
patch.

Cheers,

Paolo

 
 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Cartucce, toner, ricariche...scegli a chi rivolgerti per la tua stampante. Clicca qui
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=4198&d=9-2