Skip to content

Commit

Permalink
[C]: avoid name collission on interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmontgomery committed Nov 26, 2019
1 parent cc95ad4 commit 4e6d5bb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions aeron-driver/src/main/c/media/aeron_udp_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,12 @@ int aeron_udp_channel_parse(size_t uri_length, const char *uri, aeron_udp_channe
}

if (aeron_find_multicast_interface(
endpoint_addr.ss_family, _channel->uri.params.udp.interface, &interface_addr, &interface_index) < 0)
endpoint_addr.ss_family, _channel->uri.params.udp.interface_key, &interface_addr, &interface_index) < 0)
{
aeron_set_err(
-AERON_ERROR_CODE_INVALID_CHANNEL,
"could not find interface=(%s): %s",
_channel->uri.params.udp.interface, aeron_errmsg());
-AERON_ERROR_CODE_INVALID_CHANNEL,
"could not find interface=(%s): %s",
_channel->uri.params.udp.interface_key, aeron_errmsg());
goto error_cleanup;
}

Expand Down Expand Up @@ -347,7 +347,7 @@ int aeron_udp_channel_parse(size_t uri_length, const char *uri, aeron_udp_channe
else
{
if (aeron_find_unicast_interface(
endpoint_addr.ss_family, _channel->uri.params.udp.interface, &interface_addr, &interface_index) < 0)
endpoint_addr.ss_family, _channel->uri.params.udp.interface_key, &interface_addr, &interface_index) < 0)
{
goto error_cleanup;
}
Expand Down
4 changes: 2 additions & 2 deletions aeron-driver/src/main/c/uri/aeron_uri.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static int aeron_udp_uri_params_func(void *clientd, const char *key, const char
}
else if (strcmp(key, AERON_UDP_CHANNEL_INTERFACE_KEY) == 0)
{
params->interface = value;
params->interface_key = value;
}
else if (strcmp(key, AERON_UDP_CHANNEL_TTL_KEY) == 0)
{
Expand Down Expand Up @@ -184,7 +184,7 @@ int aeron_udp_uri_parse(char *uri, aeron_udp_channel_params_t *params)
params->additional_params.length = 0;
params->additional_params.array = NULL;
params->endpoint = NULL;
params->interface = NULL;
params->interface_key = NULL;
params->ttl = NULL;
params->control = NULL;
params->channel_tag = NULL;
Expand Down
2 changes: 1 addition & 1 deletion aeron-driver/src/main/c/uri/aeron_uri.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ aeron_uri_subscription_params_t;
typedef struct aeron_udp_channel_params_stct
{
const char *endpoint;
const char *interface;
const char *interface_key;
const char *control;
const char *control_mode;
const char *channel_tag;
Expand Down
2 changes: 1 addition & 1 deletion aeron-driver/src/test/c/aeron_uri_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ TEST_F(UriTest, shouldParseWithMultipleParams)
EXPECT_EQ(AERON_URI_PARSE("aeron:udp?endpoint=224.10.9.8|port=4567|interface=192.168.0.3|ttl=16", &m_uri), 0);
ASSERT_EQ(m_uri.type, AERON_URI_UDP);
EXPECT_EQ(std::string(m_uri.params.udp.endpoint), "224.10.9.8");
EXPECT_EQ(std::string(m_uri.params.udp.interface), "192.168.0.3");
EXPECT_EQ(std::string(m_uri.params.udp.interface_key), "192.168.0.3");
EXPECT_EQ(std::string(m_uri.params.udp.ttl), "16");
EXPECT_EQ(m_uri.params.udp.additional_params.length, 1u);
EXPECT_EQ(std::string(m_uri.params.udp.additional_params.array[0].key), "port");
Expand Down

0 comments on commit 4e6d5bb

Please sign in to comment.