Handle cases where the session has a target_host by not tunnel_peer

git-svn-id: file:///home/svn/framework3/trunk@9052 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2010-04-11 22:11:31 +00:00
parent fd62a6e9a7
commit be7f2fdac8
1 changed files with 3 additions and 3 deletions

View File

@ -259,11 +259,11 @@ class FrameworkEventSubscriber
# Generic handler for session events
#
def session_event(name, session, opts={})
if session.respond_to? :peerhost
if session.respond_to? :peerhost and session.peerhost
address = session.peerhost
elsif session.respond_to? :tunnel_peer
elsif session.respond_to? :tunnel_peer and session.tunnel_peer
address = session.tunnel_peer[0, session.tunnel_peer.rindex(":") || session.tunnel_peer.length ]
elsif session.respond_to? :target_host
elsif session.respond_to? :target_host and session.target_host
address = session.target_host
else
elog("Session with no peerhost/tunnel_peer")