Skip to content

Commit

Permalink
[C] Congestion control tidy up for channel length being size_t.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpt777 committed May 3, 2019
1 parent e6a7fd2 commit 6c38c45
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 7 additions & 2 deletions aeron-driver/src/main/c/aeron_congestion_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ aeron_congestion_control_strategy_supplier_func_t aeron_congestion_control_strat
#pragma GCC diagnostic ignored "-Wpedantic"
if ((func = (aeron_congestion_control_strategy_supplier_func_t)aeron_dlsym(RTLD_DEFAULT, strategy_name)) == NULL)
{
aeron_set_err(EINVAL, "could not find congestion control strategy %s: dlsym - %s", strategy_name, aeron_dlerror());
aeron_set_err(
EINVAL, "could not find congestion control strategy %s: dlsym - %s", strategy_name, aeron_dlerror());

return NULL;
}
#pragma GCC diagnostic pop
Expand Down Expand Up @@ -73,6 +75,7 @@ int32_t aeron_static_window_congestion_control_strategy_on_track_rebuild(
bool loss_occurred)
{
*should_force_sm = false;

return ((aeron_static_window_congestion_control_strategy_state_t *)state)->window_length;
}

Expand All @@ -85,12 +88,13 @@ int aeron_static_window_congestion_control_strategy_fini(aeron_congestion_contro
{
aeron_free(strategy->state);
aeron_free(strategy);

return 0;
}

int aeron_static_window_congestion_control_strategy_supplier(
aeron_congestion_control_strategy_t **strategy,
int32_t channel_length,
size_t channel_length,
const char *channel,
int32_t stream_id,
int32_t session_id,
Expand Down Expand Up @@ -121,5 +125,6 @@ int aeron_static_window_congestion_control_strategy_supplier(
state->window_length = max_window_for_term < initial_window_length ? max_window_for_term : initial_window_length;

*strategy = _strategy;

return 0;
}
3 changes: 1 addition & 2 deletions aeron-driver/src/main/c/aeron_congestion_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ typedef int32_t (*aeron_congestion_control_strategy_on_track_rebuild_func_t)(

typedef int32_t (*aeron_congestion_control_strategy_initial_window_length_func_t)(void *state);

typedef int (*aeron_congestion_control_strategy_fini_func_t)(
aeron_congestion_control_strategy_t *strategy);
typedef int (*aeron_congestion_control_strategy_fini_func_t)(aeron_congestion_control_strategy_t *strategy);

typedef struct aeron_congestion_control_strategy_stct
{
Expand Down

0 comments on commit 6c38c45

Please sign in to comment.