aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-12-20 21:36:24 +0000
committerChristian Grothoff <christian@grothoff.org>2013-12-20 21:36:24 +0000
commit15f29baef45e38424240503af228ca46cd95235c (patch)
tree4c613cef8e10efa18e49476fa8685008e74e65c1 /src
parentc56383042a5948c39c1cc84520d584cf166fad30 (diff)
downloadgnunet-15f29baef45e38424240503af228ca46cd95235c.tar.gz
gnunet-15f29baef45e38424240503af228ca46cd95235c.zip
-this should fix #3228 (communicate conversation/reconnect errors to client)
Diffstat (limited to 'src')
-rw-r--r--src/conversation/conversation_api_call.c6
-rw-r--r--src/conversation/gnunet-conversation.c5
-rw-r--r--src/include/gnunet_conversation_service.h9
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,
416 struct GNUNET_MQ_Envelope *e; 416 struct GNUNET_MQ_Envelope *e;
417 struct ClientCallMessage *ccm; 417 struct ClientCallMessage *ccm;
418 418
419 GNUNET_break (NULL != call->gns_lookup);
420 GNUNET_break (CS_LOOKUP == call->gns_lookup);
419 call->gns_lookup = NULL; 421 call->gns_lookup = NULL;
420 for (i=0;i<rd_count;i++) 422 for (i=0;i<rd_count;i++)
421 { 423 {
@@ -516,8 +518,10 @@ reconnect_call (struct GNUNET_CONVERSATION_Call *call)
516 } 518 }
517 call->state = CS_SHUTDOWN; 519 call->state = CS_SHUTDOWN;
518 call->client = GNUNET_CLIENT_connect ("conversation", call->cfg); 520 call->client = GNUNET_CLIENT_connect ("conversation", call->cfg);
519 if (NULL == call->client) 521 if (NULL == call->client);
520 return; 522 return;
523 call->event_handler (call->event_handler_cls,
524 GNUNET_CONVERSATION_EC_CALL_ERROR);
521 call->mq = GNUNET_MQ_queue_for_connection_client (call->client, 525 call->mq = GNUNET_MQ_queue_for_connection_client (call->client,
522 handlers, 526 handlers,
523 &call_error_handler, 527 &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,
411 _("Connection to `%s' resumed (by other user)\n"), 411 _("Connection to `%s' resumed (by other user)\n"),
412 peer_name); 412 peer_name);
413 break; 413 break;
414 case GNUNET_CONVERSATION_EC_CALL_ERROR:
415 FPRINTF (stdout,
416 _("Error with the call, restarting it\n"));
417 call_state = CS_RESOLVING;
418 break;
414 } 419 }
415} 420}
416 421
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
333 * both sides can independently suspend and resume calls; a call is 333 * both sides can independently suspend and resume calls; a call is
334 * only "working" of both sides are active. 334 * only "working" of both sides are active.
335 */ 335 */
336 GNUNET_CONVERSATION_EC_CALL_RESUMED 336 GNUNET_CONVERSATION_EC_CALL_RESUMED,
337
338 /**
339 * We had an error handing the call, and are now restarting it
340 * (back to lookup). This happens, for example, if the peer
341 * is restarted during a call.
342 */
343 GNUNET_CONVERSATION_EC_CALL_ERROR
337 344
338}; 345};
339 346