Skip to content

Commit

Permalink
Add reco_debug_level to reduce debug output
Browse files Browse the repository at this point in the history
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
  • Loading branch information
yuhaoth committed Dec 1, 2022
1 parent c3902ac commit a693477
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions programs/ssl/ssl_server2.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,8 @@ int main( void )
" debug_level=%%d default: 0 (disabled)\n" \
" build_version=%%d default: none (disabled)\n" \
" option: 1 (print build version only and stop)\n" \
" reco_debug_level=%%d default: 0 (disabled)\n" \
" debug_level for 2nd flight.\n" \
" buffer_size=%%d default: 200 \n" \
" (minimum: 1)\n" \
" response_size=%%d default: about 152 (basic response)\n" \
Expand Down Expand Up @@ -592,6 +594,7 @@ struct options
const char *server_addr; /* address on which the ssl service runs */
const char *server_port; /* port on which the ssl service runs */
int debug_level; /* level of debugging */
int reco_debug_level; /* level of 2nd flight debugging */
int nbio; /* should I/O be blocking? */
int event; /* loop or event-driven IO? level or edge triggered? */
uint32_t read_timeout; /* timeout on mbedtls_ssl_read() in milliseconds */
Expand Down Expand Up @@ -1629,6 +1632,7 @@ int main( int argc, char *argv[] )
opt.server_addr = DFL_SERVER_ADDR;
opt.server_port = DFL_SERVER_PORT;
opt.debug_level = DFL_DEBUG_LEVEL;
opt.reco_debug_level = DFL_DEBUG_LEVEL;
opt.event = DFL_EVENT;
opt.response_size = DFL_RESPONSE_SIZE;
opt.nbio = DFL_NBIO;
Expand Down Expand Up @@ -1755,6 +1759,12 @@ int main( int argc, char *argv[] )
goto exit;
}
}
else if( strcmp( p, "reco_debug_level" ) == 0 )
{
opt.reco_debug_level = atoi( q );
if( opt.reco_debug_level < 0 || opt.reco_debug_level > 65535 )
goto usage;
}
else if( strcmp( p, "nbio" ) == 0 )
{
opt.nbio = atoi( q );
Expand Down Expand Up @@ -4284,6 +4294,11 @@ int main( int argc, char *argv[] )

mbedtls_printf( " done\n" );

#if defined(MBEDTLS_DEBUG_C)
if( opt.reco_debug_level )
mbedtls_debug_set_threshold( opt.reco_debug_level );
#endif

goto reset;

/*
Expand Down

0 comments on commit a693477

Please sign in to comment.