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:
@ -40,6 +40,7 @@
|
||||
#include "polarssl/ssl.h"
|
||||
#include "polarssl/net.h"
|
||||
#include "polarssl/error.h"
|
||||
#include "polarssl/debug.h"
|
||||
|
||||
#if defined(POLARSSL_SSL_CACHE_C)
|
||||
#include "polarssl/ssl_cache.h"
|
||||
@ -73,11 +74,10 @@ int main( int argc, char *argv[] )
|
||||
|
||||
static void my_debug( void *ctx, int level, const char *str )
|
||||
{
|
||||
if( level < DEBUG_LEVEL )
|
||||
{
|
||||
fprintf( (FILE *) ctx, "%s", str );
|
||||
fflush( (FILE *) ctx );
|
||||
}
|
||||
((void) level);
|
||||
|
||||
fprintf( (FILE *) ctx, "%s", str );
|
||||
fflush( (FILE *) ctx );
|
||||
}
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
@ -108,6 +108,10 @@ int main( int argc, char *argv[] )
|
||||
pk_init( &pkey );
|
||||
entropy_init( &entropy );
|
||||
|
||||
#if defined(POLARSSL_DEBUG_C)
|
||||
debug_set_threshold( DEBUG_LEVEL );
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 1. Load the certificates and private RSA key
|
||||
*/
|
||||
|
Reference in New Issue
Block a user