gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated (ec8163cd8 -> a08d1c815)


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated (ec8163cd8 -> a08d1c815)
Date: Mon, 23 Jan 2017 15:03:33 +0100

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

grothoff pushed a change to branch master
in repository gnunet.

    from ec8163cd8 more work on loopback, this time payload transmission (for 
now without flow control)
     new b25a64c10 handle case of MQM being already NULL
     new a08d1c815 do not send duplicate LOCAL_CHANNEL_CREATE message

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/gnunet-service-cadet-new.c            | 12 ++++++------
 src/cadet/gnunet-service-cadet-new_channel.c    | 13 -------------
 src/cadet/gnunet-service-cadet-new_connection.c |  9 ++++++---
 src/cadet/gnunet-service-cadet-new_core.c       |  3 +++
 src/cadet/test_cadet.c                          |  9 +++++++++
 5 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/src/cadet/gnunet-service-cadet-new.c 
b/src/cadet/gnunet-service-cadet-new.c
index ef0870158..441511e45 100644
--- a/src/cadet/gnunet-service-cadet-new.c
+++ b/src/cadet/gnunet-service-cadet-new.c
@@ -282,7 +282,7 @@ GSC_bind (struct CadetClient *c,
           uint32_t options)
 {
   struct GNUNET_MQ_Envelope *env;
-  struct GNUNET_CADET_LocalChannelCreateMessage *msg;
+  struct GNUNET_CADET_LocalChannelCreateMessage *cm;
   struct GNUNET_CADET_ClientChannelNumber ccn;
 
   ccn = client_get_next_ccn (c);
@@ -298,12 +298,12 @@ GSC_bind (struct CadetClient *c,
        GNUNET_h2s (port),
        ntohl (options));
   /* notify local client about incoming connection! */
-  env = GNUNET_MQ_msg (msg,
+  env = GNUNET_MQ_msg (cm,
                        GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE);
-  msg->ccn = ccn;
-  msg->port = *port;
-  msg->opt = htonl (options);
-  msg->peer = *GCP_get_id (dest);
+  cm->ccn = ccn;
+  cm->port = *port;
+  cm->opt = htonl (options);
+  cm->peer = *GCP_get_id (dest);
   GSC_send_to_client (c,
                       env);
   return ccn;
diff --git a/src/cadet/gnunet-service-cadet-new_channel.c 
b/src/cadet/gnunet-service-cadet-new_channel.c
index 673921458..45609107b 100644
--- a/src/cadet/gnunet-service-cadet-new_channel.c
+++ b/src/cadet/gnunet-service-cadet-new_channel.c
@@ -804,8 +804,6 @@ void
 GCCH_bind (struct CadetChannel *ch,
            struct CadetClient *c)
 {
-  struct GNUNET_MQ_Envelope *env;
-  struct GNUNET_CADET_LocalChannelCreateMessage *tcm;
   uint32_t options;
 
   LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -850,17 +848,6 @@ GCCH_bind (struct CadetChannel *ch,
                                   ch);
   }
   /* give client it's initial supply of ACKs */
-  env = GNUNET_MQ_msg (tcm,
-                       GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE);
-  tcm->ccn = ch->ccn_dest;
-  if (GNUNET_YES == ch->is_loopback)
-    tcm->peer = my_full_id;
-  else
-    tcm->peer = *GCP_get_id (GCT_get_destination (ch->t));
-  tcm->port = ch->port;
-  tcm->opt = htonl (options);
-  GSC_send_to_client (ch->dest,
-                      env);
   for (unsigned int i=0;i<ch->max_pending_messages;i++)
     send_ack_to_client (ch,
                         ch->dest);
diff --git a/src/cadet/gnunet-service-cadet-new_connection.c 
b/src/cadet/gnunet-service-cadet-new_connection.c
index c44511400..b365599bf 100644
--- a/src/cadet/gnunet-service-cadet-new_connection.c
+++ b/src/cadet/gnunet-service-cadet-new_connection.c
@@ -173,9 +173,12 @@ GCC_destroy (struct CadetConnection *cc)
                          GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY);
     destroy_msg->cid = cc->cid;
   }
-  GCP_request_mq_cancel (cc->mq_man,
-                         env);
-  cc->mq_man = NULL;
+  if (NULL != cc->mq_man)
+  {
+    GCP_request_mq_cancel (cc->mq_man,
+                           env);
+    cc->mq_man = NULL;
+  }
   if (NULL != cc->task)
   {
     GNUNET_SCHEDULER_cancel (cc->task);
diff --git a/src/cadet/gnunet-service-cadet-new_core.c 
b/src/cadet/gnunet-service-cadet-new_core.c
index 1e35a5102..8de780ce0 100644
--- a/src/cadet/gnunet-service-cadet-new_core.c
+++ b/src/cadet/gnunet-service-cadet-new_core.c
@@ -312,6 +312,8 @@ send_broken (struct RouteDirection *target,
   struct GNUNET_MQ_Envelope *env;
   struct GNUNET_CADET_ConnectionBrokenMessage *bm;
 
+  if (NULL == target->mqm)
+    return; /* Can't send notification, connection is down! */
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Notifying %s about BROKEN route at %s-%s of connection %s\n",
        GCP_2s (target->hop),
@@ -326,6 +328,7 @@ send_broken (struct RouteDirection *target,
     bm->peer1 = *peer1;
   if (NULL != peer2)
     bm->peer2 = *peer2;
+
   GCP_request_mq_cancel (target->mqm,
                          env);
   target->mqm = NULL;
diff --git a/src/cadet/test_cadet.c b/src/cadet/test_cadet.c
index 16466ca0d..ce0178bd5 100644
--- a/src/cadet/test_cadet.c
+++ b/src/cadet/test_cadet.c
@@ -787,7 +787,16 @@ incoming_channel (void *cls,
   ok++;
   GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
   if ((long) cls == peers_requested - 1)
+  {
+    if (NULL != incoming_ch)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                  "Duplicate incoming channel for client %lu\n",
+                  (long) cls);
+      GNUNET_break(0);
+    }
     incoming_ch = channel;
+  }
   else
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,

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



reply via email to

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