diff --git a/src/crypto/elliptic.cpp b/src/crypto/elliptic.cpp index 87730a4..6db6b17 100644 --- a/src/crypto/elliptic.cpp +++ b/src/crypto/elliptic.cpp @@ -352,7 +352,7 @@ struct ssl_bignum (const unsigned char*)&digest, sizeof(digest), (unsigned char*)&sig, &buf_len, my->_key ) ) { - fprintf( stderr, "sign error\n"); + FC_THROW_EXCEPTION( exception, "signing error" ); } @@ -442,7 +442,7 @@ struct ssl_bignum { EC_KEY_set_conv_form( my->_key, POINT_CONVERSION_COMPRESSED ); nV -= 4; - fprintf( stderr, "compressed\n" ); +// fprintf( stderr, "compressed\n" ); } if (ECDSA_SIG_recover_key_GFp(my->_key, sig, (unsigned char*)&digest, sizeof(digest), nV - 27, 0) == 1) diff --git a/src/log/console_appender.cpp b/src/log/console_appender.cpp index c3c68f7..742acbc 100644 --- a/src/log/console_appender.cpp +++ b/src/log/console_appender.cpp @@ -73,7 +73,7 @@ namespace fc { /////////////// std::stringstream line; line << (m.get_context().get_timestamp().time_since_epoch().count() % (1000ll*1000ll*60ll*60))/1000 <<"ms "; - line << std::setw( 10 ) << m.get_context().get_thread_name().substr(0,9).c_str() <<" "< #include #include +#include namespace fc { @@ -25,7 +26,12 @@ namespace fc { void tcp_socket::flush() {} void tcp_socket::close() { - if( is_open() ) my->_sock.close(); + try { + if( is_open() ) + { + my->_sock.close(); + } + } FC_RETHROW_EXCEPTIONS( warn, "error closing tcp socket" ); } bool tcp_socket::eof()const { @@ -57,7 +63,13 @@ namespace fc { _accept( fc::asio::default_io_service(), boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(), port) ){ } ~impl(){ - _accept.close(); + try { + _accept.close(); + } + catch ( boost::system::system_error& e ) + { + wlog( "unexpected exception ${e}", ("e", fc::except_str()) ); + } } boost::asio::ip::tcp::acceptor _accept; diff --git a/src/thread/thread_d.hpp b/src/thread/thread_d.hpp index dbb877a..d6758d6 100644 --- a/src/thread/thread_d.hpp +++ b/src/thread/thread_d.hpp @@ -55,7 +55,7 @@ namespace fc { pt_head = temp; } */ - ilog(""); + //ilog(""); if (boost_thread) { boost_thread->detach();