- fix CADET-using services
[oweals/gnunet.git] / src / scalarproduct / gnunet-service-scalarproduct-ecc_bob.c
index fbdf62192a15adb66619f356b77787b269d6855a..7246fa6a034284548f3d6dbf975821dd4865dcd4 100644 (file)
@@ -891,7 +891,7 @@ static void *
 cb_channel_incoming (void *cls,
                      struct GNUNET_CADET_Channel *channel,
                      const struct GNUNET_PeerIdentity *initiator,
-                     uint32_t port,
+                     const struct GNUNET_HashCode *port,
                      enum GNUNET_CADET_ChannelOption options)
 {
   struct CadetIncomingSession *in;
@@ -1221,10 +1221,6 @@ run (void *cls,
       0},
     { NULL, 0, 0}
   };
-  static const uint32_t ports[] = {
-    GNUNET_APPLICATION_TYPE_SCALARPRODUCT_ECC,
-    0
-  };
 
   cfg = c;
   /* We don't really do DLOG, so we can setup with very minimal resources */
@@ -1241,10 +1237,8 @@ run (void *cls,
   cadet_sessions = GNUNET_CONTAINER_multihashmap_create (128,
                                                          GNUNET_YES);
   my_cadet = GNUNET_CADET_connect (cfg, NULL,
-                                   &cb_channel_incoming,
                                    &cb_channel_destruction,
-                                   cadet_handlers,
-                                   ports);
+                                   cadet_handlers);
   if (NULL == my_cadet)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -1252,6 +1246,9 @@ run (void *cls,
     GNUNET_SCHEDULER_shutdown ();
     return;
   }
+  GNUNET_CADET_open_port (my_cadet,
+                          GC_u2h (GNUNET_APPLICATION_TYPE_SCALARPRODUCT_ECC),
+                          &cb_channel_incoming, NULL);
   GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
                                 NULL);
 }