gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r2173 - GNUnet/src/applications/topology_f2f


From: grothoff
Subject: [GNUnet-SVN] r2173 - GNUnet/src/applications/topology_f2f
Date: Thu, 6 Oct 2005 14:32:54 -0700 (PDT)

Author: grothoff
Date: 2005-10-06 14:32:53 -0700 (Thu, 06 Oct 2005)
New Revision: 2173

Modified:
   GNUnet/src/applications/topology_f2f/topology.c
Log:
actually, the real answer to circularity is not to have it and use coreAPI'
'

Modified: GNUnet/src/applications/topology_f2f/topology.c
===================================================================
--- GNUnet/src/applications/topology_f2f/topology.c     2005-10-06 17:56:14 UTC 
(rev 2172)
+++ GNUnet/src/applications/topology_f2f/topology.c     2005-10-06 21:32:53 UTC 
(rev 2173)
@@ -35,7 +35,6 @@
 #include "gnunet_protocols.h"
 #include "gnunet_topology_service.h"
 #include "gnunet_identity_service.h"
-#include "gnunet_session_service.h"
 #include "gnunet_transport_service.h"
 #include "gnunet_pingpong_service.h"
 
@@ -94,23 +93,6 @@
 static PeerIdentity * friends;
 static unsigned int friendCount;
 
-/**
- * @brief Get the session service
- */
-static Session_ServiceAPI* getSession() {
-  static Session_ServiceAPI * session = NULL;
-  
-  /* We don't do that during init because that'd lead
-   * to a circular dependency */
-  if (!session) {
-    session = coreAPI->requestService("session");
-    if (!session)
-      LOG(LOG_ERROR, _("Module `%s' not loaded yet\n"), "session");
-  }
-  
-  return session;
-}
-
 static int allowConnection(const PeerIdentity * peer) {
   int i;
 
@@ -181,7 +163,6 @@
   IndexMatch indexMatch;
   cron_t now;
   EncName enc;
-  Session_ServiceAPI * session;
 
   cronTime(&now);
   indexMatch.index = index;
@@ -213,9 +194,10 @@
   LOG(LOG_DEBUG,
       "Topology: trying to connect to `%s'.\n",
       &enc);
-  session = getSession();
-  if (session)
-    session->tryConnect(&indexMatch.match);
+  coreAPI->unicast(&indexMatch.match,
+                  NULL,
+                  0,
+                  0);
   identity->blacklistHost(&indexMatch.match,
                          300 + (int) saturation * 600,
                          NO);
@@ -424,8 +406,6 @@
 }
 
 int release_module_topology_f2f() {
-  Session_ServiceAPI * session;
-  
   delCronJob(&cronCheckLiveness,
             LIVE_SCAN_FREQUENCY,
             NULL);
@@ -435,8 +415,6 @@
   identity = NULL;
   coreAPI->releaseService(transport);
   transport = NULL;
-  if ((session = getSession()))
-    coreAPI->releaseService(session);
   coreAPI->releaseService(pingpong);
   pingpong = NULL;
   coreAPI = NULL;





reply via email to

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