mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Add debug_set_threshold() and thresholding of messages
This commit is contained in:
@ -51,6 +51,7 @@
|
||||
#include "polarssl/certs.h"
|
||||
#include "polarssl/x509.h"
|
||||
#include "polarssl/error.h"
|
||||
#include "polarssl/debug.h"
|
||||
|
||||
#if defined(POLARSSL_SSL_CACHE_C)
|
||||
#include "polarssl/ssl_cache.h"
|
||||
@ -137,11 +138,10 @@ struct options
|
||||
|
||||
static void my_debug( void *ctx, int level, const char *str )
|
||||
{
|
||||
if( level < opt.debug_level )
|
||||
{
|
||||
fprintf( (FILE *) ctx, "%s", str );
|
||||
fflush( (FILE *) ctx );
|
||||
}
|
||||
((void) level);
|
||||
|
||||
fprintf( (FILE *) ctx, "%s", str );
|
||||
fflush( (FILE *) ctx );
|
||||
}
|
||||
|
||||
/*
|
||||
@ -721,6 +721,10 @@ int main( int argc, char *argv[] )
|
||||
goto usage;
|
||||
}
|
||||
|
||||
#if defined(POLARSSL_DEBUG_C)
|
||||
debug_set_threshold( opt.debug_level );
|
||||
#endif
|
||||
|
||||
if( opt.force_ciphersuite[0] > 0 )
|
||||
{
|
||||
const ssl_ciphersuite_t *ciphersuite_info;
|
||||
|
Reference in New Issue
Block a user