Browse files

error msg

  • Loading branch information...
1 parent 2fed613 commit d97537835656818e438783366ca35cccb8ca257b @RJ committed Jul 20, 2009
Showing with 9 additions and 6 deletions.
  1. +1 −1 CMakeLists.txt
  2. +6 −4 src/connection.cpp
  3. +2 −1 src/router.cpp
View
2 CMakeLists.txt
@@ -44,7 +44,7 @@ ENDIF(WIN32)
IF(NOT WIN32)
# removes operators like "and", "or" and "not"
- #ADD_DEFINITIONS(-Wall -ggdb)
+ ADD_DEFINITIONS(-Wall -ggdb)
ADD_DEFINITIONS(-g )
ADD_DEFINITIONS(-fno-operator-names)
ADD_DEFINITIONS(-fPIC)
View
10 src/connection.cpp
@@ -84,7 +84,8 @@ Connection::handle_read_header(const boost::system::error_code& e, message_ptr m
if( m_shuttingdown ) return;
if (e)
{
- std::cerr << "err handle_read_header" << std::endl;
+ std::cerr << "err " << e.value() << " handle_read_header: "
+ << e.message() << std::endl;
fin();
return;
}
@@ -116,7 +117,8 @@ Connection::handle_read_data(const boost::system::error_code& e, message_ptr msg
if( m_shuttingdown ) return;
if (e)
{
- std::cerr << "err handle_read_data" << std::endl;
+ std::cerr << "err " << e.value() << " handle_read_data: "
+ << e.message() << std::endl;
fin();
return;
}
@@ -156,8 +158,8 @@ Connection::do_async_write(const boost::system::error_code& e, message_ptr finis
if( m_shuttingdown ) return;
if( e )
{
- cerr << "Error in libf2f::do_async_write, terminating connection"
- << endl;
+ cerr << "Error in libf2f::do_async_write, terminating connection: "
+ << e.value() << ", " << e.message() << endl;
fin();
return;
}
View
3 src/router.cpp
@@ -133,8 +133,8 @@ Router::unregister_connection( connection_ptr conn )
connection_ptr
Router::get_connection_by_name( const std::string &name )
{
- boost::mutex::scoped_lock lk(m_connections_mutex);
vector<connection_ptr>::iterator it;
+ boost::mutex::scoped_lock lk(m_connections_mutex);
for( it=m_connections.begin() ; it < m_connections.end() ; ++it )
{
if( (*it)->name() == name )
@@ -163,6 +163,7 @@ vector<string>
Router::get_connected_names()
{
vector<string> v;
+ boost::mutex::scoped_lock lk(m_connections_mutex);
BOOST_FOREACH( connection_ptr conn, m_connections )
{
v.push_back( conn->name() );

0 comments on commit d975378

Please sign in to comment.