Commit 450390a0 authored by Guillaume Roguez's avatar Guillaume Roguez Committed by gerrit2

ringaccount: fix non-handled exception

RingAccount::handlePendingCall may throw exception and was not
catched by the handlePendingCallList loop.
This leds to non-handled pending calls (all after the failing one).

This patch fixes that by catch all exception and drop bad guys.

Change-Id: Ic62e115bf32b467e04a19f2ae077d8256a69d90e
Tuleap: #106
parent 0592f9d5
......@@ -584,8 +584,16 @@ RingAccount::handlePendingCallList()
auto pc_iter = std::begin(pending_calls);
while (pc_iter != std::end(pending_calls)) {
bool incoming = pc_iter->call_key == invalid_hash; // do it now, handlePendingCall may invalidate pc data
bool handled;
if (handlePendingCall(*pc_iter, incoming)) {
try {
handled = handlePendingCall(*pc_iter, incoming);
} catch (const std::exception& e) {
RING_ERR("[DHT] exception during pending call handling: %s", e.what());
handled = true; // drop from pending list
if (handled) {
// Cancel pending listen (outgoing call)
if (not incoming)
dht_.cancelListen(pc_iter->call_key, pc_iter->listen_key.get());
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