gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated: do not recompute off if we


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: do not recompute off if we can just pass it in
Date: Tue, 31 Jan 2017 11:44:09 +0100

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

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 5198a0e5b do not recompute off if we can just pass it in
5198a0e5b is described below

commit 5198a0e5b21f8bd0d13f2817602be401f96b726d
Author: Christian Grothoff <address@hidden>
AuthorDate: Tue Jan 31 11:44:08 2017 +0100

    do not recompute off if we can just pass it in
---
 src/cadet/gnunet-service-cadet-new_connection.c | 12 +++++++-----
 src/cadet/gnunet-service-cadet-new_connection.h |  2 ++
 src/cadet/gnunet-service-cadet-new_paths.c      |  3 +++
 src/cadet/gnunet-service-cadet-new_tunnels.c    |  1 +
 4 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/cadet/gnunet-service-cadet-new_connection.c 
b/src/cadet/gnunet-service-cadet-new_connection.c
index 8536b638d..0ccfe8b45 100644
--- a/src/cadet/gnunet-service-cadet-new_connection.c
+++ b/src/cadet/gnunet-service-cadet-new_connection.c
@@ -778,6 +778,7 @@ manage_first_hop_mq (void *cls,
  *
  * @param destination where to go
  * @param path which path to take (may not be the full path)
+ * @param off offset of @a destination on @a path
  * @param options options for the connection
  * @param ct which tunnel uses this connection
  * @param init_state initial state for the connection
@@ -788,6 +789,7 @@ manage_first_hop_mq (void *cls,
 static struct CadetConnection *
 connection_create (struct CadetPeer *destination,
                    struct CadetPeerPath *path,
+                   unsigned int off,
                    enum GNUNET_CADET_ChannelOption options,
                    struct CadetTConnection *ct,
                    const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid,
@@ -797,11 +799,7 @@ connection_create (struct CadetPeer *destination,
 {
   struct CadetConnection *cc;
   struct CadetPeer *first_hop;
-  unsigned int off;
 
-  off = GCPP_find_peer (path,
-                        destination);
-  GNUNET_assert (UINT_MAX > off);
   cc = GNUNET_new (struct CadetConnection);
   cc->options = options;
   cc->state = init_state;
@@ -854,7 +852,7 @@ connection_create (struct CadetPeer *destination,
 struct CadetConnection *
 GCC_create_inbound (struct CadetPeer *destination,
                     struct CadetPeerPath *path,
-                   enum GNUNET_CADET_ChannelOption options,
+                    enum GNUNET_CADET_ChannelOption options,
                     struct CadetTConnection *ct,
                     const struct GNUNET_CADET_ConnectionTunnelIdentifier *cid,
                     GCC_ReadyCallback ready_cb,
@@ -910,6 +908,7 @@ GCC_create_inbound (struct CadetPeer *destination,
 
   return connection_create (destination,
                             path,
+                            off,
                             options,
                             ct,
                             cid,
@@ -925,6 +924,7 @@ GCC_create_inbound (struct CadetPeer *destination,
  *
  * @param destination where to go
  * @param path which path to take (may not be the full path)
+ * @param off offset of @a destination on @a path
  * @param options options for the connection
  * @param ct tunnel that uses the connection
  * @param ready_cb function to call when ready to transmit
@@ -934,6 +934,7 @@ GCC_create_inbound (struct CadetPeer *destination,
 struct CadetConnection *
 GCC_create (struct CadetPeer *destination,
             struct CadetPeerPath *path,
+            unsigned int off,
             enum GNUNET_CADET_ChannelOption options,
             struct CadetTConnection *ct,
             GCC_ReadyCallback ready_cb,
@@ -946,6 +947,7 @@ GCC_create (struct CadetPeer *destination,
                               sizeof (cid));
   return connection_create (destination,
                             path,
+                            off,
                             options,
                             ct,
                             &cid,
diff --git a/src/cadet/gnunet-service-cadet-new_connection.h 
b/src/cadet/gnunet-service-cadet-new_connection.h
index 61d9d5d78..73388be7f 100644
--- a/src/cadet/gnunet-service-cadet-new_connection.h
+++ b/src/cadet/gnunet-service-cadet-new_connection.h
@@ -78,6 +78,7 @@ GCC_destroy_without_tunnel (struct CadetConnection *cc);
  *
  * @param destination where to go
  * @param path which path to take (may not be the full path)
+ * @param off offset of @a destination on @a path
  * @param options options for the connection
  * @param ct which tunnel uses this connection
  * @param ready_cb function to call when ready to transmit
@@ -87,6 +88,7 @@ GCC_destroy_without_tunnel (struct CadetConnection *cc);
 struct CadetConnection *
 GCC_create (struct CadetPeer *destination,
             struct CadetPeerPath *path,
+            unsigned int off,
             enum GNUNET_CADET_ChannelOption options,
             struct CadetTConnection *ct,
             GCC_ReadyCallback ready_cb,
diff --git a/src/cadet/gnunet-service-cadet-new_paths.c 
b/src/cadet/gnunet-service-cadet-new_paths.c
index 4f2c0036f..28c43d1cf 100644
--- a/src/cadet/gnunet-service-cadet-new_paths.c
+++ b/src/cadet/gnunet-service-cadet-new_paths.c
@@ -478,6 +478,9 @@ GCPP_try_path_from_dht (const struct GNUNET_PeerIdentity 
*get_path,
 
   /* precompute 'cpath' so we can avoid doing the lookups lots of times */
   skip = 0;
+  memset (cpath,
+          0,
+          sizeof (cpath)); /* Just to trigger harder errors later. */
   total_len = get_path_length + put_path_length;
   for (unsigned int off=0;off<total_len;off++)
   {
diff --git a/src/cadet/gnunet-service-cadet-new_tunnels.c 
b/src/cadet/gnunet-service-cadet-new_tunnels.c
index a9f8dfffc..ee1502cab 100644
--- a/src/cadet/gnunet-service-cadet-new_tunnels.c
+++ b/src/cadet/gnunet-service-cadet-new_tunnels.c
@@ -2467,6 +2467,7 @@ consider_path_cb (void *cls,
   ct->t = t;
   ct->cc = GCC_create (t->destination,
                        path,
+                       off,
                        GNUNET_CADET_OPTION_DEFAULT, /* FIXME: set based on 
what channels want/need! */
                        ct,
                        &connection_ready_cb,

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



reply via email to

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