Skip to content

Commit

Permalink
Remove subscriberIsHostedOnRelay parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone committed Jan 13, 2025
1 parent bc09db2 commit 03deed7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 17 deletions.
8 changes: 2 additions & 6 deletions cpp/src/DataStorm/Contract.ice
Original file line number Diff line number Diff line change
Expand Up @@ -410,21 +410,17 @@ module DataStormContract
/// reader.
/// - The publisher node has previously sent a initiateCreateSession request.
///
/// The publisher node dispatching this request would send a confirmCreateSession request to the subscriber node
/// The publisher node dispatching this request then sends a confirmCreateSession request to the subscriber node
/// to continue session establishment. If an active session already exists with the subscriber node, the
/// request is ignored.
///
/// @param subscriber The subscriber node initiating the session. This proxy is never null.
/// @param session The subscriber session being created. This proxy is never null.
/// @param fromRelay Indicates whether the session is being created from a relay node.
/// @param subscriberIsHostedOnRelay Specifies if the relay is hosting a forwarder for the subscriber. If the
/// subscriber has endpoints or an adapter ID, the relay does not host a forwarder, and the publisher is
/// expected to send requests directly to the subscriber node instead of going through a forwarder.
void createSession(
Node* subscriber,
SubscriberSession* session,
bool fromRelay,
optional(1) bool subscriberIsHostedOnRelay);
bool fromRelay);

/// Confirm the creation of a publisher session with a node.
///
Expand Down
4 changes: 1 addition & 3 deletions cpp/src/DataStorm/NodeI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ NodeI::createSession(
optional<NodePrx> subscriber,
optional<SubscriberSessionPrx> subscriberSession,
bool fromRelay,
optional<bool> subscriberIsHostedOnRelay,
const Current& current)
{
checkNotNull(subscriber, __FILE__, __LINE__, current);
Expand All @@ -158,7 +157,7 @@ NodeI::createSession(
try
{
NodePrx s = *subscriber;
if (fromRelay && !subscriberIsHostedOnRelay.value_or(false))
if (fromRelay && subscriberSession->ice_getIdentity().category == "s")
{
// If the request originates from a relay and the relay does not host a forwarder for the subscriber node,
// check if there is an existing connection to the subscriber node and reuse it if available. Otherwise,
Expand Down Expand Up @@ -362,7 +361,6 @@ NodeI::createPublisherSession(
self->_proxy,
uncheckedCast<SubscriberSessionPrx>(session->getProxy()),
false,
false,
nullptr,
[=](exception_ptr ex) { self->removeSubscriberSession(publisher, session, ex); });
}
Expand Down
1 change: 0 additions & 1 deletion cpp/src/DataStorm/NodeI.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ namespace DataStormI
std::optional<DataStormContract::NodePrx>,
std::optional<DataStormContract::SubscriberSessionPrx>,
bool,
std::optional<bool>,
const Ice::Current&) final;

void confirmCreateSession(
Expand Down
8 changes: 1 addition & 7 deletions cpp/src/DataStorm/NodeSessionI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ namespace
optional<NodePrx> subscriber,
optional<SubscriberSessionPrx> subscriberSession,
bool /* fromRelay */,
optional<bool> /*subscriberIsHostedOnRelay*/,
const Current& current) final
{
checkNotNull(subscriber, __FILE__, __LINE__, current);
Expand All @@ -79,12 +78,7 @@ namespace
subscriberIsHostedOnRelay ? subscriberSession->ice_fixed(current.con) : *subscriberSession);

// Forward the call to the target Node object, don't need to wait for the result.
_node->createSessionAsync(
subscriber,
subscriberSessionForwarder,
true,
subscriberIsHostedOnRelay,
nullptr);
_node->createSessionAsync(subscriber, subscriberSessionForwarder, true, nullptr);
}
catch (const CommunicatorDestroyedException&)
{
Expand Down

0 comments on commit 03deed7

Please sign in to comment.