Fix TCP concurrent sending problem

This commit is contained in:
jiangpeilong 2024-08-22 21:12:11 +08:00
commit 55ff684d09

View file

@ -312,6 +312,8 @@ socket_send_message (NiceSocket *sock,
if (priv->error)
return -1;
g_mutex_lock(&mutex);
message_len = output_message_get_size (message);
/* First try to send the data, don't send it later if it can be sent now
@ -353,6 +355,8 @@ socket_send_message (NiceSocket *sock,
}
}
g_mutex_unlock(&mutex);
return ret;
}