summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2005-12-01 06:28:18 +0000
committerMatthew Newhook <matthew@zeroc.com>2005-12-01 06:28:18 +0000
commit53d5cb1d5a0b78d2f5dc46aeea0ebcb09e415495 (patch)
tree2ccc3568728b385ccb2d4f9877b2b7d71b757493 /cpp/src
parentPHP 5.1.1 compatibility (diff)
downloadice-53d5cb1d5a0b78d2f5dc46aeea0ebcb09e415495.tar.bz2
ice-53d5cb1d5a0b78d2f5dc46aeea0ebcb09e415495.tar.xz
ice-53d5cb1d5a0b78d2f5dc46aeea0ebcb09e415495.zip
http://wiki.zeroc.com/bugzilla/show_bug.cgi?id=690
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Glacier2/SessionRouterI.cpp17
-rw-r--r--cpp/src/Glacier2/SessionRouterI.h3
2 files changed, 14 insertions, 6 deletions
diff --git a/cpp/src/Glacier2/SessionRouterI.cpp b/cpp/src/Glacier2/SessionRouterI.cpp
index 61362c9ef85..8245baf3340 100644
--- a/cpp/src/Glacier2/SessionRouterI.cpp
+++ b/cpp/src/Glacier2/SessionRouterI.cpp
@@ -30,7 +30,7 @@ public:
virtual ObjectPtr
locate(const Current& current, LocalObjectPtr&)
{
- return _sessionRouter->getRouter(current.con)->getClientBlobject();
+ return _sessionRouter->getRouter(current.con, current.id)->getClientBlobject();
}
virtual void
@@ -85,6 +85,7 @@ Glacier2::SessionRouterI::SessionRouterI(const ObjectAdapterPtr& clientAdapter,
_properties(clientAdapter->getCommunicator()->getProperties()),
_logger(clientAdapter->getCommunicator()->getLogger()),
_sessionTraceLevel(_properties->getPropertyAsInt("Glacier2.Trace.Session")),
+ _rejectTraceLevel(_properties->getPropertyAsInt("Glacier2.Client.Trace.Reject")),
_clientAdapter(clientAdapter),
_serverAdapter(serverAdapter),
_verifier(verifier),
@@ -213,19 +214,19 @@ Glacier2::SessionRouterI::destroy()
ObjectPrx
Glacier2::SessionRouterI::getClientProxy(const Current& current) const
{
- return getRouter(current.con)->getClientProxy(current); // Forward to the per-client router.
+ return getRouter(current.con, current.id)->getClientProxy(current); // Forward to the per-client router.
}
ObjectPrx
Glacier2::SessionRouterI::getServerProxy(const Current& current) const
{
- return getRouter(current.con)->getServerProxy(current); // Forward to the per-client router.
+ return getRouter(current.con, current.id)->getServerProxy(current); // Forward to the per-client router.
}
void
Glacier2::SessionRouterI::addProxy(const ObjectPrx& proxy, const Current& current)
{
- getRouter(current.con)->addProxy(proxy, current); // Forward to the per-client router.
+ getRouter(current.con, current.id)->addProxy(proxy, current); // Forward to the per-client router.
}
SessionPrx
@@ -559,7 +560,7 @@ Glacier2::SessionRouterI::destroySession_async(const AMD_Router_destroySessionPt
}
RouterIPtr
-Glacier2::SessionRouterI::getRouter(const ConnectionPtr& connection) const
+Glacier2::SessionRouterI::getRouter(const ConnectionPtr& connection, const Ice::Identity& id) const
{
IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*this);
@@ -585,6 +586,12 @@ Glacier2::SessionRouterI::getRouter(const ConnectionPtr& connection) const
}
else
{
+ if(_rejectTraceLevel >= 1)
+ {
+ Trace out(_logger, "Glacier2");
+ out << "rejecting request. no session is associated with the connection.\n";
+ out << "identity: " << identityToString(id);
+ }
connection->close(true);
throw ObjectNotExistException(__FILE__, __LINE__);
}
diff --git a/cpp/src/Glacier2/SessionRouterI.h b/cpp/src/Glacier2/SessionRouterI.h
index f3de859ef78..a806ca1633a 100644
--- a/cpp/src/Glacier2/SessionRouterI.h
+++ b/cpp/src/Glacier2/SessionRouterI.h
@@ -41,7 +41,7 @@ public:
virtual SessionPrx createSession(const std::string&, const std::string&, const Ice::Current&);
virtual void destroySession_async(const AMD_Router_destroySessionPtr&, const ::Ice::Current&);
- RouterIPtr getRouter(const Ice::ConnectionPtr&) const;
+ RouterIPtr getRouter(const Ice::ConnectionPtr&, const Ice::Identity&) const;
RouterIPtr getRouter(const std::string&) const;
void expireSessions();
@@ -51,6 +51,7 @@ private:
const Ice::PropertiesPtr _properties;
const Ice::LoggerPtr _logger;
const int _sessionTraceLevel;
+ const int _rejectTraceLevel;
const Ice::ObjectAdapterPtr _clientAdapter;
const Ice::ObjectAdapterPtr _serverAdapter;
const PermissionsVerifierPrx _verifier;