Change fc::canceled_exceptions thrown due to a socket operation being canceled into regular fc::exceptions -- we're reserving canceled_exception for canceling async tasks
This commit is contained in:
parent
477d3397f6
commit
f8472af119
2 changed files with 10 additions and 4 deletions
10
src/asio.cpp
10
src/asio.cpp
|
|
@ -11,12 +11,15 @@ namespace fc {
|
||||||
else {
|
else {
|
||||||
// elog( "%s", boost::system::system_error(ec).what() );
|
// elog( "%s", boost::system::system_error(ec).what() );
|
||||||
// p->set_exception( fc::copy_exception( boost::system::system_error(ec) ) );
|
// p->set_exception( fc::copy_exception( boost::system::system_error(ec) ) );
|
||||||
|
#if 0
|
||||||
if( ec == boost::asio::error::operation_aborted )
|
if( ec == boost::asio::error::operation_aborted )
|
||||||
{
|
{
|
||||||
p->set_exception( fc::exception_ptr( new fc::canceled_exception(
|
p->set_exception( fc::exception_ptr( new fc::canceled_exception(
|
||||||
FC_LOG_MESSAGE( error, "${message} ", ("message", boost::system::system_error(ec).what())) ) ) );
|
FC_LOG_MESSAGE( error, "${message} ", ("message", boost::system::system_error(ec).what())) ) ) );
|
||||||
}
|
}
|
||||||
else if( ec == boost::asio::error::eof )
|
else
|
||||||
|
#endif
|
||||||
|
if( ec == boost::asio::error::eof )
|
||||||
{
|
{
|
||||||
p->set_exception( fc::exception_ptr( new fc::eof_exception(
|
p->set_exception( fc::exception_ptr( new fc::eof_exception(
|
||||||
FC_LOG_MESSAGE( error, "${message} ", ("message", boost::system::system_error(ec).what())) ) ) );
|
FC_LOG_MESSAGE( error, "${message} ", ("message", boost::system::system_error(ec).what())) ) ) );
|
||||||
|
|
@ -39,12 +42,15 @@ namespace fc {
|
||||||
p->set_value();
|
p->set_value();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
if( ec == boost::asio::error::operation_aborted )
|
if( ec == boost::asio::error::operation_aborted )
|
||||||
{
|
{
|
||||||
p->set_exception( fc::exception_ptr( new fc::canceled_exception(
|
p->set_exception( fc::exception_ptr( new fc::canceled_exception(
|
||||||
FC_LOG_MESSAGE( error, "${message} ", ("message", boost::system::system_error(ec).what())) ) ) );
|
FC_LOG_MESSAGE( error, "${message} ", ("message", boost::system::system_error(ec).what())) ) ) );
|
||||||
}
|
}
|
||||||
else if( ec == boost::asio::error::eof )
|
else
|
||||||
|
#endif
|
||||||
|
if( ec == boost::asio::error::eof )
|
||||||
{
|
{
|
||||||
p->set_exception( fc::exception_ptr( new fc::eof_exception(
|
p->set_exception( fc::exception_ptr( new fc::eof_exception(
|
||||||
FC_LOG_MESSAGE( error, "${message} ", ("message", boost::system::system_error(ec).what())) ) ) );
|
FC_LOG_MESSAGE( error, "${message} ", ("message", boost::system::system_error(ec).what())) ) ) );
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ namespace fc {
|
||||||
auto read_itr = _read_promises.find( udt_socket_id );
|
auto read_itr = _read_promises.find( udt_socket_id );
|
||||||
if( read_itr != _read_promises.end() )
|
if( read_itr != _read_promises.end() )
|
||||||
{
|
{
|
||||||
read_itr->second->set_exception( fc::copy_exception( fc::canceled_exception() ) );
|
read_itr->second->set_exception( fc::copy_exception( fc::exception() ) );
|
||||||
_read_promises.erase(read_itr);
|
_read_promises.erase(read_itr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -123,7 +123,7 @@ namespace fc {
|
||||||
auto write_itr = _write_promises.find( udt_socket_id );
|
auto write_itr = _write_promises.find( udt_socket_id );
|
||||||
if( write_itr != _write_promises.end() )
|
if( write_itr != _write_promises.end() )
|
||||||
{
|
{
|
||||||
write_itr->second->set_exception( fc::copy_exception( fc::canceled_exception() ) );
|
write_itr->second->set_exception( fc::copy_exception( fc::exception() ) );
|
||||||
_write_promises.erase(write_itr);
|
_write_promises.erase(write_itr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue