1
0
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:
Paul Bakker
2014-04-25 16:34:30 +02:00
parent 92478c37a6
commit c73079a78c
9 changed files with 107 additions and 34 deletions

View File

@ -29,6 +29,7 @@
#include <stdio.h>
#include "polarssl/net.h"
#include "polarssl/debug.h"
#include "polarssl/ssl.h"
#include "polarssl/entropy.h"
#include "polarssl/ctr_drbg.h"
@ -61,11 +62,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[] )
@ -82,6 +82,10 @@ int main( int argc, char *argv[] )
((void) argc);
((void) argv);
#if defined(POLARSSL_DEBUG_C)
debug_set_threshold( DEBUG_LEVEL );
#endif
/*
* 0. Initialize the RNG and the session data
*/