diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-01-16 11:05:21 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-01-16 11:05:21 +0000 |
commit | 33ca6599024c899501e455bf53153788180c12ac (patch) | |
tree | 8a12c8b1fd00a36c1a7225c19ef110a49db94bbf /src/conversation | |
parent | b17c424ab9cee54f670e5381ec630a0e72d951c2 (diff) | |
download | gnunet-33ca6599024c899501e455bf53153788180c12ac.tar.gz gnunet-33ca6599024c899501e455bf53153788180c12ac.zip |
fix assertion violation if active call is cancelled
Diffstat (limited to 'src/conversation')
-rw-r--r-- | src/conversation/gnunet-conversation.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/conversation/gnunet-conversation.c b/src/conversation/gnunet-conversation.c index 920ff33d2..6c133966d 100644 --- a/src/conversation/gnunet-conversation.c +++ b/src/conversation/gnunet-conversation.c | |||
@@ -104,7 +104,6 @@ enum CallState | |||
104 | }; | 104 | }; |
105 | 105 | ||
106 | 106 | ||
107 | |||
108 | /** | 107 | /** |
109 | * List of incoming calls | 108 | * List of incoming calls |
110 | */ | 109 | */ |
@@ -152,6 +151,7 @@ static struct GNUNET_CONVERSATION_Call *call; | |||
152 | 151 | ||
153 | /** | 152 | /** |
154 | * Caller handle (for active incoming call). | 153 | * Caller handle (for active incoming call). |
154 | * This call handler is NOT in the #cl_head / #cl_tail list. | ||
155 | */ | 155 | */ |
156 | static struct CallList *cl_active; | 156 | static struct CallList *cl_active; |
157 | 157 | ||
@@ -282,6 +282,9 @@ phone_event_handler (void *cls, | |||
282 | for (cl = cl_head; NULL != cl; cl = cl->next) | 282 | for (cl = cl_head; NULL != cl; cl = cl->next) |
283 | if (caller == cl->caller) | 283 | if (caller == cl->caller) |
284 | break; | 284 | break; |
285 | if ( (NULL == cl) && | ||
286 | (caller == cl_active->caller) ) | ||
287 | cl = cl_active; | ||
285 | if (NULL == cl) | 288 | if (NULL == cl) |
286 | { | 289 | { |
287 | GNUNET_break (0); | 290 | GNUNET_break (0); |
@@ -290,14 +293,17 @@ phone_event_handler (void *cls, | |||
290 | FPRINTF (stdout, | 293 | FPRINTF (stdout, |
291 | _("Call from `%s' terminated\n"), | 294 | _("Call from `%s' terminated\n"), |
292 | GNUNET_GNSRECORD_pkey_to_zkey (&cl->caller_id)); | 295 | GNUNET_GNSRECORD_pkey_to_zkey (&cl->caller_id)); |
293 | GNUNET_CONTAINER_DLL_remove (cl_head, | ||
294 | cl_tail, | ||
295 | cl); | ||
296 | if (cl == cl_active) | 296 | if (cl == cl_active) |
297 | { | 297 | { |
298 | cl_active = NULL; | 298 | cl_active = NULL; |
299 | phone_state = PS_LISTEN; | 299 | phone_state = PS_LISTEN; |
300 | } | 300 | } |
301 | else | ||
302 | { | ||
303 | GNUNET_CONTAINER_DLL_remove (cl_head, | ||
304 | cl_tail, | ||
305 | cl); | ||
306 | } | ||
301 | GNUNET_free (cl); | 307 | GNUNET_free (cl); |
302 | break; | 308 | break; |
303 | } | 309 | } |