gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated (ac78538f4 -> ffbed5b37)


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated (ac78538f4 -> ffbed5b37)
Date: Sun, 22 Jan 2017 22:50:40 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a change to branch master
in repository gnunet.

    from ac78538f4 fix stray log calls that lagged the core-api prefix
     new d6142b7f5 API code cleanup
     new ffbed5b37 API documentation, logging

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/cadet/cadet_api.c                        | 34 ++++++++++++++++++++--------
 src/cadet/gnunet-service-cadet-new_channel.c | 25 ++++++++++++++++++++
 src/include/gnunet_cadet_service.h           |  7 +++++-
 3 files changed, 56 insertions(+), 10 deletions(-)

diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c
index 83ff2b3b7..1643f2095 100644
--- a/src/cadet/cadet_api.c
+++ b/src/cadet/cadet_api.c
@@ -432,29 +432,35 @@ create_channel (struct GNUNET_CADET_Handle *h,
  */
 // FIXME: simplify: call_cleaner is always #GNUNET_YES!!!
 static void
-destroy_channel (struct GNUNET_CADET_Channel *ch, int call_cleaner)
+destroy_channel (struct GNUNET_CADET_Channel *ch,
+                 int call_cleaner)
 {
   struct GNUNET_CADET_Handle *h;
   struct GNUNET_CADET_TransmitHandle *th;
   struct GNUNET_CADET_TransmitHandle *next;
 
-  LOG (GNUNET_ERROR_TYPE_DEBUG, " destroy_channel %X\n", ch->ccn);
-
   if (NULL == ch)
   {
     GNUNET_break (0);
     return;
   }
   h = ch->cadet;
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       " destroy_channel %X of %p\n",
+       ch->ccn,
+       h);
 
   GNUNET_CONTAINER_DLL_remove (h->channels_head,
                                h->channels_tail,
                                ch);
 
   /* signal channel destruction */
-  if ( (NULL != h->cleaner) && (0 != ch->peer) && (GNUNET_YES == call_cleaner) 
)
+  if ( (NULL != h->cleaner) &&
+       (0 != ch->peer) &&
+       (GNUNET_YES == call_cleaner) )
   {
-    LOG (GNUNET_ERROR_TYPE_DEBUG, " calling cleaner\n");
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+         " calling cleaner\n");
     h->cleaner (h->cls, ch, ch->ctx);
   }
 
@@ -781,7 +787,6 @@ handle_local_ack (void *cls,
   struct GNUNET_CADET_Channel *ch;
   struct GNUNET_CADET_ClientChannelNumber ccn;
 
-  LOG (GNUNET_ERROR_TYPE_DEBUG, "Got an ACK!\n");
   ccn = message->ccn;
   ch = retrieve_channel (h, ccn);
   if (NULL == ch)
@@ -792,7 +797,7 @@ handle_local_ack (void *cls,
     return;
   }
   LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "  on channel %X!\n",
+       "Got an ACK on channel %X!\n",
        ntohl (ch->ccn.channel_of_client));
   ch->allow_send = GNUNET_YES;
   if (0 < ch->packet_size)
@@ -1420,6 +1425,14 @@ GNUNET_CADET_connect (const struct 
GNUNET_CONFIGURATION_Handle *cfg,
 }
 
 
+/**
+ * Disconnect from the cadet service. All channels will be destroyed. All 
channel
+ * disconnect callbacks will be called on any still connected peers, notifying
+ * about their disconnection. The registered inbound channel cleaner will be
+ * called should any inbound channels still exist.
+ *
+ * @param handle connection to cadet to disconnect
+ */
 void
 GNUNET_CADET_disconnect (struct GNUNET_CADET_Handle *handle)
 {
@@ -1632,7 +1645,9 @@ GNUNET_CADET_channel_destroy (struct GNUNET_CADET_Channel 
*channel)
       {
         LOG (GNUNET_ERROR_TYPE_WARNING, "no meta-traffic should be queued\n");
       }
-      GNUNET_CONTAINER_DLL_remove (h->th_head, h->th_tail, th);
+      GNUNET_CONTAINER_DLL_remove (h->th_head,
+                                   h->th_tail,
+                                   th);
       GNUNET_CADET_notify_transmit_ready_cancel (th);
     }
   }
@@ -1643,7 +1658,8 @@ GNUNET_CADET_channel_destroy (struct GNUNET_CADET_Channel 
*channel)
   GNUNET_MQ_send (h->mq,
                   env);
 
-  destroy_channel (channel, GNUNET_YES);
+  destroy_channel (channel,
+                   GNUNET_YES);
 }
 
 
diff --git a/src/cadet/gnunet-service-cadet-new_channel.c 
b/src/cadet/gnunet-service-cadet-new_channel.c
index 08704152b..690b91f28 100644
--- a/src/cadet/gnunet-service-cadet-new_channel.c
+++ b/src/cadet/gnunet-service-cadet-new_channel.c
@@ -430,6 +430,11 @@ channel_open_sent_cb (void *cls)
   GNUNET_assert (NULL != ch->last_control_qe);
   ch->last_control_qe = NULL;
   ch->retry_time = GNUNET_TIME_STD_BACKOFF (ch->retry_time);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Sent CHANNEL_OPEN on %s, retrying in %s\n",
+       GCCH_2s (ch),
+       GNUNET_STRINGS_relative_time_to_string (ch->retry_time,
+                                               GNUNET_YES));
   ch->retry_control_task
     = GNUNET_SCHEDULER_add_delayed (ch->retry_time,
                                     &send_channel_open,
@@ -487,6 +492,9 @@ void
 GCCH_tunnel_up (struct CadetChannel *ch)
 {
   GNUNET_assert (NULL == ch->retry_control_task);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Tunnel up, sending CHANNEL_OPEN on %s now\n",
+       GCCH_2s (ch));
   ch->retry_control_task
     = GNUNET_SCHEDULER_add_now (&send_channel_open,
                                 ch);
@@ -716,6 +724,9 @@ GCCH_handle_duplicate_open (struct CadetChannel *ch)
          GCCH_2s (ch));
     return;
   }
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Retransmitting OPEN_ACK on channel %s\n",
+       GCCH_2s (ch));
   ch->retry_control_task
     = GNUNET_SCHEDULER_add_now (&send_open_ack,
                                 ch);
@@ -814,6 +825,9 @@ GCCH_bind (struct CadetChannel *ch,
 void
 GCCH_channel_local_destroy (struct CadetChannel *ch)
 {
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Local client asks for destruction of %s which it initiated\n",
+       GCCH_2s (ch));
   if (GNUNET_YES == ch->destroy)
   {
     /* other end already destroyed, with the local client gone, no need
@@ -845,6 +859,9 @@ GCCH_channel_local_destroy (struct CadetChannel *ch)
 void
 GCCH_channel_incoming_destroy (struct CadetChannel *ch)
 {
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Local client asks for destruction of %s which it accepted\n",
+       GCCH_2s (ch));
   if (GNUNET_YES == ch->destroy)
   {
     /* other end already destroyed, with the remote client gone, no need
@@ -1057,6 +1074,9 @@ GCCH_handle_channel_plaintext_data_ack (struct 
CadetChannel *ch,
   {
     /* ACK for message we already dropped, might have been a
        duplicate ACK? Ignore. */
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+         "Duplicate DATA_ACK on %s, ignoring\n",
+         GCCH_2s (ch));
     GNUNET_STATISTICS_update (stats,
                               "# duplicate DATA_ACKs",
                               1,
@@ -1069,6 +1089,11 @@ GCCH_handle_channel_plaintext_data_ack (struct 
CadetChannel *ch,
   ch->pending_messages--;
   GNUNET_free (crm);
   GNUNET_assert (ch->pending_messages < ch->max_pending_messages);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Received DATA_ACK on %s for message %u (%u ACKs pending)\n",
+       GCCH_2s (ch),
+       (unsigned int) ntohl (ack->mid.mid),
+       ch->pending_messages);
   send_ack_to_client (ch,
                       (NULL == ch->owner) ? ch->dest : ch->owner);
 }
diff --git a/src/include/gnunet_cadet_service.h 
b/src/include/gnunet_cadet_service.h
index 7090d4410..68d557d1c 100644
--- a/src/include/gnunet_cadet_service.h
+++ b/src/include/gnunet_cadet_service.h
@@ -497,7 +497,12 @@ struct GNUNET_CADET_ChannelTunnelNumber
 {
   /**
    * Which number does this channel have that uniquely identfies
-   * it within its tunnel?
+   * it within its tunnel, in network byte order.
+   *
+   * Given two peers, both may initiate channels over the same tunnel.
+   * The @e cn must be greater or equal to 0x80000000 (high-bit set)
+   * for tunnels initiated with the peer that has the larger peer
+   * identity as compared using #GNUNET_CRYPTO_cmp_peer_identity().
    */
   uint32_t cn GNUNET_PACKED;
 };

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]