diff options
author | Othmar Gsenger <otti@anytun.org> | 2008-12-22 01:42:26 +0000 |
---|---|---|
committer | Othmar Gsenger <otti@anytun.org> | 2008-12-22 01:42:26 +0000 |
commit | 32fd5e0d1f3e77a39cfc08ab077a5e001fb8c026 (patch) | |
tree | b940ac7dff36e30d2d1c05e259356ffb45bdba8b /src/anytun.cpp | |
parent | new routing system (diff) |
catching no route exceptions
Diffstat (limited to 'src/anytun.cpp')
-rw-r--r-- | src/anytun.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/anytun.cpp b/src/anytun.cpp index a235786..d8f2159 100644 --- a/src/anytun.cpp +++ b/src/anytun.cpp @@ -161,16 +161,24 @@ void sender(void* p) if(param->cl.empty()) continue; //std::cout << "got Packet for plain "<<plain_packet.getDstAddr().toString(); + ConnectionMap::iterator cit; #ifndef NOROUTING - mux = gRoutingTable.getRoute(plain_packet.getDstAddr()); - //std::cout << " -> "<<mux << std::endl; - ConnectionMap::iterator cit = param->cl.getConnection(mux); + try + { + mux = gRoutingTable.getRoute(plain_packet.getDstAddr()); + //std::cout << " -> "<<mux << std::endl; + cit = param->cl.getConnection(mux); + } + catch (std::exception& e) + { + continue; // no route + } #else - ConnectionMap::iterator cit = param->cl.getBegin(); + cit = param->cl.getBegin(); #endif if(cit==param->cl.getEnd()) - continue; + continue; //no connection ConnectionParam & conn = cit->second; if(conn.remote_end_ == emptyEndpoint) |