Skip to content

Commit

Permalink
add some missing parts
Browse files Browse the repository at this point in the history
  • Loading branch information
radkesvat committed May 27, 2024
1 parent ba77aba commit f48ea2c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 0 additions & 1 deletion tunnels/client/reverse/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ static void cleanup(reverse_client_con_state_t *cstate)
if (! cstate->idle_handle_removed)
{
reverse_client_state_t *state = STATE(cstate->self);

removeIdleItemByHash(cstate->u->tid, state->starved_connections, (hash_t) (cstate));
}
doneLineDownSide(cstate->u);
Expand Down
16 changes: 13 additions & 3 deletions tunnels/client/reverse/reverse_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ static void downStream(tunnel_t *self, context_t *c)
initiateConnect(self, tid, false);
atomic_fetch_add_explicit(&(state->reverse_cons), 1, memory_order_relaxed);

if (! ucstate->idle_handle_removed)
{
ucstate->idle_handle_removed = true;
reverse_client_state_t *state = STATE(ucstate->self);
removeIdleItemByHash(ucstate->u->tid, state->starved_connections, (hash_t) (ucstate));
}

ucstate->pair_connected = true;
lockLine(ucstate->d);
self->dw->downStream(self->dw, newInitContext(ucstate->d));
Expand Down Expand Up @@ -159,9 +166,12 @@ static void downStream(tunnel_t *self, context_t *c)
ucstate->established = true;
initiateConnect(self, tid, false);

idle_item_t *con_idle_item = newIdleItem(state->starved_connections, (hash_t) (ucstate), ucstate,
onStarvedConnectionExpire, c->line->tid, kConnectionStarvationTimeOut);
(void)con_idle_item;
idle_item_t *con_idle_item =
newIdleItem(state->starved_connections, (hash_t) (ucstate), ucstate, onStarvedConnectionExpire,
c->line->tid, kConnectionStarvationTimeOut);
ucstate->idle_handle_removed = false;

(void) con_idle_item;
destroyContext(c);
}
else
Expand Down

0 comments on commit f48ea2c

Please sign in to comment.