aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/cadet_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-01-24 21:56:42 +0100
committerChristian Grothoff <christian@grothoff.org>2017-01-24 21:59:28 +0100
commit2a4ba82b872fb7957093c450990854afa261d55c (patch)
tree1630aa1fc408ad652efa5b76af1026f24a54b71d /src/cadet/cadet_api.c
parent33fccc1e9f5fde308fc6f2ee39b3340ab06aa715 (diff)
downloadgnunet-2a4ba82b872fb7957093c450990854afa261d55c.tar.gz
gnunet-2a4ba82b872fb7957093c450990854afa261d55c.zip
bitch and continue if we do not have a handler for a message
Diffstat (limited to 'src/cadet/cadet_api.c')
-rw-r--r--src/cadet/cadet_api.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c
index a3b23d913..72b7b692d 100644
--- a/src/cadet/cadet_api.c
+++ b/src/cadet/cadet_api.c
@@ -489,7 +489,9 @@ static void
489add_to_queue (struct GNUNET_CADET_Handle *h, 489add_to_queue (struct GNUNET_CADET_Handle *h,
490 struct GNUNET_CADET_TransmitHandle *th) 490 struct GNUNET_CADET_TransmitHandle *th)
491{ 491{
492 GNUNET_CONTAINER_DLL_insert_tail (h->th_head, h->th_tail, th); 492 GNUNET_CONTAINER_DLL_insert_tail (h->th_head,
493 h->th_tail,
494 th);
493} 495}
494 496
495 497
@@ -554,6 +556,7 @@ request_data (void *cls)
554 th->size, 556 th->size,
555 &msg[1]); 557 &msg[1]);
556 GNUNET_assert (osize == th->size); 558 GNUNET_assert (osize == th->size);
559
557 GNUNET_MQ_send (th->channel->cadet->mq, 560 GNUNET_MQ_send (th->channel->cadet->mq,
558 env); 561 env);
559 GNUNET_free (th); 562 GNUNET_free (th);
@@ -706,7 +709,6 @@ handle_local_data (void *cls,
706 const struct GNUNET_MessageHeader *payload; 709 const struct GNUNET_MessageHeader *payload;
707 const struct GNUNET_CADET_MessageHandler *handler; 710 const struct GNUNET_CADET_MessageHandler *handler;
708 struct GNUNET_CADET_Channel *ch; 711 struct GNUNET_CADET_Channel *ch;
709 unsigned int i;
710 uint16_t type; 712 uint16_t type;
711 713
712 ch = retrieve_channel (h, 714 ch = retrieve_channel (h,
@@ -723,8 +725,7 @@ handle_local_data (void *cls,
723 ntohl (message->ccn.channel_of_client), 725 ntohl (message->ccn.channel_of_client),
724 GC_m2s (type), 726 GC_m2s (type),
725 type); 727 type);
726 728 for (unsigned i=0;i<h->n_handlers;i++)
727 for (i = 0; i < h->n_handlers; i++)
728 { 729 {
729 handler = &h->message_handlers[i]; 730 handler = &h->message_handlers[i];
730 if (handler->type == type) 731 if (handler->type == type)
@@ -738,11 +739,14 @@ handle_local_data (void *cls,
738 LOG (GNUNET_ERROR_TYPE_DEBUG, 739 LOG (GNUNET_ERROR_TYPE_DEBUG,
739 "callback caused disconnection\n"); 740 "callback caused disconnection\n");
740 GNUNET_CADET_channel_destroy (ch); 741 GNUNET_CADET_channel_destroy (ch);
741 break; 742 return;
742 } 743 }
743 break; 744 return;
744 } 745 }
745 } 746 }
747 /* Other peer sent message we do not comprehend. */
748 GNUNET_break_op (0);
749 GNUNET_CADET_receive_done (ch);
746} 750}
747 751
748 752