implement get_path_from_route
[oweals/gnunet.git] / src / cadet / gnunet-service-cadet-new_core.c
index a5d114b34e578a16511212885237b3a31fc58d22..26952f6160d4ed601ef21b74075a0dd19268468c 100644 (file)
 #include "gnunet_core_service.h"
 #include "cadet_protocol.h"
 
+
+#define LOG(level, ...) GNUNET_log_from(level,"cadet-cor",__VA_ARGS__)
+
+
 /**
  * Number of messages we are willing to buffer per route.
  */
@@ -423,7 +427,7 @@ handle_connection_create (void *cls,
       return;
     }
 
-    path = GCPP_get_path_from_route (path_length,
+    path = GCPP_get_path_from_route (path_length - 1,
                                      pids);
     origin = GCP_get (&pids[0],
                       GNUNET_YES);
@@ -477,7 +481,7 @@ handle_connection_create (void *cls,
  */
 static void
 handle_connection_create_ack (void *cls,
-                              const struct GNUNET_CADET_ConnectionCreateMessageAckMessage *msg)
+                              const struct GNUNET_CADET_ConnectionCreateAckMessage *msg)
 {
   struct CadetPeer *peer = cls;
   struct CadetConnection *cc;
@@ -498,7 +502,7 @@ handle_connection_create_ack (void *cls,
       GNUNET_break_op (0);
       return;
     }
-    GCC_handle_connection_ack (cc);
+    GCC_handle_connection_create_ack (cc);
     return;
   }
 
@@ -778,7 +782,7 @@ GCO_init (const struct GNUNET_CONFIGURATION_Handle *c)
                            NULL),
     GNUNET_MQ_hd_fixed_size (connection_create_ack,
                              GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE_ACK,
-                             struct GNUNET_CADET_ConnectionCreateMessageAckMessage,
+                             struct GNUNET_CADET_ConnectionCreateAckMessage,
                              NULL),
     GNUNET_MQ_hd_fixed_size (connection_broken,
                              GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN,