Commit 4463ed9e authored by Sébastien Blin's avatar Sébastien Blin

ice: better handling for connection errors

First, on_connect_complete dropped the connection errors but it
must be handled for restarting failed check if necessary.
Then, a problematic case was detected when the controlling agent
got only a few active checks to do, but a passive will succeed.
In the previous version the controlling was failing as soon as
all active checks were checked. Now, if all active are failing
the controlling agent will let some time for passive agents and
then will decide to set the negotiation as failed.

Change-Id: Ica728f55083a34496b031c859ed73b576e1eef26
GitLab: #411
parent 546698a9
This diff is collapsed.
......@@ -251,7 +251,12 @@ ConnectionManager::Impl::connectDeviceStartIce(const DeviceId& deviceId, const d
account.dht()->putEncrypted(dht::InfoHash::get(PeerConnectionRequest::key_prefix
+ deviceId.toString()),
deviceId,
value);
value,
[this, deviceId](bool ok) {
if (!ok)
JAMI_ERR("Tried to send request to %s, but put failed",
deviceId.to_c_str());
});
// Wait for call to onResponse() operated by DHT
if (isDestroying_)
return; // This avoid to wait new negotiation when destroying
......@@ -578,10 +583,15 @@ ConnectionManager::Impl::answerTo(IceTransport& ice, const dht::Value::Id& id, c
value->user_type = "peer_request";
JAMI_DBG() << account << "[CNX] connection accepted, DHT reply to " << from;
account.dht()->putEncrypted(dht::InfoHash::get(PeerConnectionRequest::key_prefix
+ from.toString()),
from,
value);
account.dht()->putEncrypted(
dht::InfoHash::get(PeerConnectionRequest::key_prefix + from.toString()),
from,
value,
[this, from](bool ok) {
if (!ok)
JAMI_ERR("Tried to answer to connection request from %s, but put failed",
from.to_c_str());
});
}
void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment