[fix] fix send error when ice state change from ready to connected

This commit is contained in:
dijunkun
2024-08-09 16:53:48 +08:00
parent 10cb335779
commit 1626b482de
2 changed files with 66 additions and 40 deletions

View File

@@ -51,8 +51,8 @@ int IceAgent::CreateIceAgent(nice_cb_state_changed_t on_state_changed,
agent_ = nice_agent_new_full(
g_main_loop_get_context(gloop_), NICE_COMPATIBILITY_RFC5245,
(NiceAgentOption)(trickle_ice_ ? NICE_AGENT_OPTION_ICE_TRICKLE |
NICE_AGENT_OPTION_RELIABLE
: NICE_AGENT_OPTION_RELIABLE));
NICE_AGENT_OPTION_NONE
: NICE_AGENT_OPTION_NONE));
if (agent_ == nullptr) {
LOG_ERROR("Failed to create agent_");
@@ -250,6 +250,6 @@ int IceAgent::Send(const char *data, size_t size) {
// return -1;
// }
nice_agent_send(agent_, stream_id_, 1, size, data);
int ret = nice_agent_send(agent_, stream_id_, 1, size, data);
return 0;
}