Do not throw from destructors, fatal_assert() instead.
This commit is contained in:
@@ -41,6 +41,7 @@
|
|||||||
#include "byteorder.h"
|
#include "byteorder.h"
|
||||||
#include "crypto.h"
|
#include "crypto.h"
|
||||||
#include "base64.h"
|
#include "base64.h"
|
||||||
|
#include "fatal_assert.h"
|
||||||
#include "prng.h"
|
#include "prng.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@@ -171,9 +172,7 @@ Session::Session( Base64Key s_key )
|
|||||||
|
|
||||||
Session::~Session()
|
Session::~Session()
|
||||||
{
|
{
|
||||||
if ( ae_clear( ctx ) != AE_SUCCESS ) {
|
fatal_assert( ae_clear( ctx ) == AE_SUCCESS );
|
||||||
throw CryptoException( "Could not clear AES-OCB context." );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Nonce::Nonce( uint64_t val )
|
Nonce::Nonce( uint64_t val )
|
||||||
|
|||||||
@@ -639,9 +639,7 @@ uint64_t Connection::timeout( void ) const
|
|||||||
|
|
||||||
Connection::Socket::~Socket()
|
Connection::Socket::~Socket()
|
||||||
{
|
{
|
||||||
if ( close( _fd ) < 0 ) {
|
fatal_assert ( close( _fd ) == 0 );
|
||||||
throw NetworkException( "close", errno );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Connection::Socket::Socket( const Socket & other )
|
Connection::Socket::Socket( const Socket & other )
|
||||||
|
|||||||
Reference in New Issue
Block a user