From 15f29baef45e38424240503af228ca46cd95235c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 20 Dec 2013 21:36:24 +0000 Subject: [PATCH] -this should fix #3228 (communicate conversation/reconnect errors to client) --- src/conversation/conversation_api_call.c | 6 +++++- src/conversation/gnunet-conversation.c | 5 +++++ src/include/gnunet_conversation_service.h | 9 ++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/conversation/conversation_api_call.c b/src/conversation/conversation_api_call.c index 418af0b73..16173a4fb 100644 --- a/src/conversation/conversation_api_call.c +++ b/src/conversation/conversation_api_call.c @@ -416,6 +416,8 @@ handle_gns_response (void *cls, struct GNUNET_MQ_Envelope *e; struct ClientCallMessage *ccm; + GNUNET_break (NULL != call->gns_lookup); + GNUNET_break (CS_LOOKUP == call->gns_lookup); call->gns_lookup = NULL; for (i=0;istate = CS_SHUTDOWN; call->client = GNUNET_CLIENT_connect ("conversation", call->cfg); - if (NULL == call->client) + if (NULL == call->client); return; + call->event_handler (call->event_handler_cls, + GNUNET_CONVERSATION_EC_CALL_ERROR); call->mq = GNUNET_MQ_queue_for_connection_client (call->client, handlers, &call_error_handler, diff --git a/src/conversation/gnunet-conversation.c b/src/conversation/gnunet-conversation.c index b81743933..a042629cc 100644 --- a/src/conversation/gnunet-conversation.c +++ b/src/conversation/gnunet-conversation.c @@ -411,6 +411,11 @@ call_event_handler (void *cls, _("Connection to `%s' resumed (by other user)\n"), peer_name); break; + case GNUNET_CONVERSATION_EC_CALL_ERROR: + FPRINTF (stdout, + _("Error with the call, restarting it\n")); + call_state = CS_RESOLVING; + break; } } diff --git a/src/include/gnunet_conversation_service.h b/src/include/gnunet_conversation_service.h index cfe4a64ba..c610dd0bd 100644 --- a/src/include/gnunet_conversation_service.h +++ b/src/include/gnunet_conversation_service.h @@ -333,7 +333,14 @@ enum GNUNET_CONVERSATION_CallEventCode * both sides can independently suspend and resume calls; a call is * only "working" of both sides are active. */ - GNUNET_CONVERSATION_EC_CALL_RESUMED + GNUNET_CONVERSATION_EC_CALL_RESUMED, + + /** + * We had an error handing the call, and are now restarting it + * (back to lookup). This happens, for example, if the peer + * is restarted during a call. + */ + GNUNET_CONVERSATION_EC_CALL_ERROR }; -- 2.25.1