- fix coverity
[oweals/gnunet.git] / src / cadet / gnunet-service-cadet_channel.c
index d7fe82d207a1176e9bf622e68af6b2d8cd0f9b69..d4f9754da2315743d3dd0d75fa35502240eae61b 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2013 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -721,11 +721,9 @@ send_client_nack (struct CadetChannel *ch)
  * We haven't received an ACK after a certain time: restransmit the message.
  *
  * @param cls Closure (CadetChannelReliability with the message to restransmit)
- * @param tc TaskContext.
  */
 static void
-channel_retransmit_message (void *cls,
-                            const struct GNUNET_SCHEDULER_TaskContext *tc)
+channel_retransmit_message (void *cls)
 {
   struct CadetChannelReliability *rel = cls;
   struct CadetReliableMessage *copy;
@@ -734,9 +732,6 @@ channel_retransmit_message (void *cls,
   int fwd;
 
   rel->retry_task = NULL;
-  if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
-    return;
-
   ch = rel->ch;
   copy = rel->head_sent;
   if (NULL == copy)
@@ -760,19 +755,16 @@ channel_retransmit_message (void *cls,
  * We haven't received an Channel ACK after a certain time: resend the CREATE.
  *
  * @param cls Closure (CadetChannelReliability of the channel to recreate)
- * @param tc TaskContext.
  */
 static void
-channel_recreate (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+channel_recreate (void *cls)
 {
   struct CadetChannelReliability *rel = cls;
 
   rel->retry_task = NULL;
-  if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
-    return;
-
   LOG (GNUNET_ERROR_TYPE_DEBUG, "RE-CREATE\n");
-  GNUNET_STATISTICS_update (stats, "# data retransmitted", 1, GNUNET_NO);
+  GNUNET_STATISTICS_update (stats,
+                           "# data retransmitted", 1, GNUNET_NO);
 
   if (rel == rel->ch->root_rel)
   {
@@ -786,7 +778,6 @@ channel_recreate (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   {
     GNUNET_break (0);
   }
-
 }
 
 
@@ -2011,8 +2002,8 @@ GCCH_handle_data (struct CadetChannel *ch,
     {
       GNUNET_break_op (0);
       LOG (GNUNET_ERROR_TYPE_INFO,
-          "MID %u on channel %s not expected (window: %u - %u). Dropping!\n",
-          mid, GCCH_2s (ch), rel->mid_recv, rel->mid_recv + 63);
+           "MID %u on channel %s not expected (window: %u - %u). Dropping!\n",
+           mid, GCCH_2s (ch), rel->mid_recv, rel->mid_recv + 63);
     }
     else
     {
@@ -2022,8 +2013,8 @@ GCCH_handle_data (struct CadetChannel *ch,
       if (NULL != rel->uniq)
       {
         LOG (GNUNET_ERROR_TYPE_WARNING,
-            "We are trying to send an ACK, but don't seem have the "
-            "bandwidth. Try to increase your [ats] QUOTA in you config file\n");
+             "We are trying to send an ACK, but don't seem have the "
+             "bandwidth. Have you set enough [ats] QUOTA in your config?\n");
       }
 
     }
@@ -2473,7 +2464,7 @@ GCCH_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
         LOG (GNUNET_ERROR_TYPE_DEBUG, "  new chq: %p\n", chq);
         chq->copy->chq = chq;
         chq->tq = GCT_send_prebuilt_message (message, ch->t, NULL,
-                                             NULL != existing_copy,
+                                             GNUNET_YES,
                                              &ch_message_sent, chq);
         /* q itself is stored in copy */
         GNUNET_assert (NULL != chq->tq || GNUNET_NO != ch->destroy);