Correctly implement proto_agent_stop(), call it

This commit is contained in:
Robert Schmidt
2018-11-07 10:54:34 +01:00
parent 920a4abb6d
commit 70f74777f3
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -73,6 +73,10 @@ void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
.remote_ipv4_address = RC.rrc[instance]->eth_params_s.remote_addr,
.remote_port = RC.rrc[instance]->eth_params_s.remote_portd
};
/* stop, then start the PROTO_AGENT. If it is already stopped, stopping it
* again will do nothing, therefore it is safe to call here.
* TODO: call proto_agent_stop() when CU_TASK is informed about conn release */
proto_agent_stop(instance);
AssertFatal(proto_agent_start(instance, &params) == 0,
"could not start PROTO_AGENT for F1U on instance %d!\n", instance);
}
@@ -137,7 +137,11 @@ error:
void proto_agent_stop(mod_id_t mod_id)
{
if (!proto_agent[mod_id].channel) return;
proto_agent_async_release(proto_agent[mod_id].channel);
proto_agent_destroy_channel(proto_agent[mod_id].channel->channel_id);
free(proto_agent[mod_id].channel);
proto_agent[mod_id].channel = NULL;
}
//void