Added mbedtls_net_close and use it in ssl_fork_server to correctly
disassociate the client socket from the parent process and the server socket from the child process.
This commit is contained in:
parent
beec142010
commit
df8e511381
3 changed files with 22 additions and 1 deletions
|
@ -254,6 +254,7 @@ int main( void )
|
|||
if( pid != 0 )
|
||||
{
|
||||
mbedtls_printf( " ok\n" );
|
||||
mbedtls_net_close( &client_fd );
|
||||
|
||||
if( ( ret = mbedtls_ctr_drbg_reseed( &ctr_drbg,
|
||||
(const unsigned char *) "parent",
|
||||
|
@ -266,7 +267,7 @@ int main( void )
|
|||
continue;
|
||||
}
|
||||
|
||||
mbedtls_net_init( &listen_fd );
|
||||
mbedtls_net_close( &listen_fd );
|
||||
|
||||
pid = getpid();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue