gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r371 - in GNUnet/src: applications applications/topology_de


From: grothoff
Subject: [GNUnet-SVN] r371 - in GNUnet/src: applications applications/topology_default include server
Date: Fri, 4 Mar 2005 22:50:15 -0800 (PST)

Author: grothoff
Date: 2005-03-04 22:50:15 -0800 (Fri, 04 Mar 2005)
New Revision: 371

Modified:
   GNUnet/src/applications/OVERVIEW
   GNUnet/src/applications/topology_default/topology.c
   GNUnet/src/include/gnunet_core.h
   GNUnet/src/server/connection.c
Log:
resolving cyclic dependency

Modified: GNUnet/src/applications/OVERVIEW
===================================================================
--- GNUnet/src/applications/OVERVIEW    2005-03-05 06:44:23 UTC (rev 370)
+++ GNUnet/src/applications/OVERVIEW    2005-03-05 06:50:15 UTC (rev 371)
@@ -18,12 +18,16 @@
 pingpong->identity
 pingpong->transport
 
-topology_default->bootstrap => bootstrap_http
+topology_default->bootstrap
 topology_default->identity
 topology_default->pingpong
 topology_default->transport
-topology_default->session
 
+topology_f2f->bootstrap
+topology_f2f->identity
+topology_f2f->pingpong
+topology_f2f->transport
+
 transport->identity
 
 

Modified: GNUnet/src/applications/topology_default/topology.c
===================================================================
--- GNUnet/src/applications/topology_default/topology.c 2005-03-05 06:44:23 UTC 
(rev 370)
+++ GNUnet/src/applications/topology_default/topology.c 2005-03-05 06:50:15 UTC 
(rev 371)
@@ -39,7 +39,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"
 
@@ -56,8 +55,6 @@
 
 static Transport_ServiceAPI * transport;
 
-static Session_ServiceAPI * session;
-
 static Pingpong_ServiceAPI * pingpong;
 
 /**
@@ -168,7 +165,10 @@
   LOG(LOG_DEBUG,
       "Topology: trying to connect to '%s'.\n",
       &enc);
-  session->tryConnect(&indexMatch.match);
+  coreAPI->unicast(&indexMatch.match,
+                  NULL,
+                  0,
+                  0);
   identity->blacklistHost(&indexMatch.match,
                          30 + (int) saturation * 60,
                          NO);
@@ -275,15 +275,6 @@
     identity = NULL;
     return NULL;
   }
-  session = capi->requestService("session");
-  if (session == NULL) {
-    BREAK();
-    capi->releaseService(identity);
-    identity = NULL;
-    capi->releaseService(transport);
-    transport = NULL;
-    return NULL;
-  }
   pingpong = capi->requestService("pingpong");
   if (pingpong == NULL) {
     BREAK();
@@ -291,8 +282,6 @@
     identity = NULL;
     capi->releaseService(transport);
     transport = NULL;
-    capi->releaseService(session);
-    session = NULL;
     return NULL;
   }
 
@@ -315,8 +304,6 @@
   identity = NULL;
   coreAPI->releaseService(transport);
   transport = NULL;
-  coreAPI->releaseService(session);
-  session = NULL;
   coreAPI->releaseService(pingpong);
   pingpong = NULL;
   coreAPI = NULL;

Modified: GNUnet/src/include/gnunet_core.h
===================================================================
--- GNUnet/src/include/gnunet_core.h    2005-03-05 06:44:23 UTC (rev 370)
+++ GNUnet/src/include/gnunet_core.h    2005-03-05 06:50:15 UTC (rev 371)
@@ -289,7 +289,8 @@
    * Send an encrypted message to another node.
    *
    * @param receiver the target node
-   * @param msg the message to send
+   * @param msg the message to send, NULL to tell
+   *   the core to try to establish a session
    * @param importance how important is the message?
    * @param maxdelay how long can the message be delayed?
    */

Modified: GNUnet/src/server/connection.c
===================================================================
--- GNUnet/src/server/connection.c      2005-03-05 06:44:23 UTC (rev 370)
+++ GNUnet/src/server/connection.c      2005-03-05 06:50:15 UTC (rev 371)
@@ -2661,7 +2661,8 @@
  * Send an encrypted message to another node.
  *
  * @param receiver the target node
- * @param msg the message to send
+ * @param msg the message to send, NULL to tell the
+ *   core to try to establish a session
  * @param importance how important is the message?
  * @param maxdelay how long can the message be delayed?
  */
@@ -2672,6 +2673,10 @@
   char * closure;
   unsigned short len;
 
+  if (msg == NULL) {
+    session->tryConnect(receiver);
+    return;
+  }
   len = ntohs(msg->size);
   if (len == 0)
     return;





reply via email to

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