transport_con_set_address(con, NULL);
// Connections to remote domains assume the same connection
- // attributes apply.
+ // attributes apply, minus the domain.
transport_con_connect(con, client->port, client->username, client->password);
return con;
transport_con* con;
- if (strstr(receiver, "opensrf:client")) {
+ if (strstr(receiver, "opensrf:client") || strstr(receiver, "opensrf:router")) {
// We may be talking to a worker that runs on a remote domain.
// Find or create a connection to the domain.
my $msg_json = $msg->to_json;
my $con = $self->primary_connection;
- if ($recipient =~ /^opensrf:client/o) {
+ if ($recipient =~ /^opensrf:client/o || $recipient =~ /^opensrf:router/o) {
# Clients may be lurking on remote nodes.
# Make sure we have a connection to said node.
# opensrf:client:domain:...
my (undef, undef, $domain) = split(/:/, $recipient);
- my $con = $self->get_connection($domain);
+ $con = $self->get_connection($domain);
if (!$con) {
$logger->error("Cannot send message to node $domain: $msg_json");
return;