gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r17217 - in gnunet/src: core include


From: gnunet
Subject: [GNUnet-SVN] r17217 - in gnunet/src: core include
Date: Wed, 5 Oct 2011 15:36:14 +0200

Author: grothoff
Date: 2011-10-05 15:36:14 +0200 (Wed, 05 Oct 2011)
New Revision: 17217

Modified:
   gnunet/src/core/gnunet-service-core.c
   gnunet/src/core/gnunet-service-core_clients.c
   gnunet/src/include/gnunet_protocols.h
Log:
eliminate REQUEST_CONNECT handlers

Modified: gnunet/src/core/gnunet-service-core.c
===================================================================
--- gnunet/src/core/gnunet-service-core.c       2011-10-05 13:35:37 UTC (rev 
17216)
+++ gnunet/src/core/gnunet-service-core.c       2011-10-05 13:36:14 UTC (rev 
17217)
@@ -2970,52 +2970,6 @@
 
 
 /**
- * Handle CORE_REQUEST_CONNECT request.
- *
- * @param cls unused
- * @param client the client issuing the request
- * @param message the "struct ConnectMessage"
- */
-static void
-handle_client_request_connect (void *cls, struct GNUNET_SERVER_Client *client,
-                               const struct GNUNET_MessageHeader *message)
-{
-  const struct ConnectMessage *cm = (const struct ConnectMessage *) message;
-  struct Neighbour *n;
-
-  if (0 ==
-      memcmp (&cm->peer, &my_identity, sizeof (struct GNUNET_PeerIdentity)))
-  {
-    /* In this case a client has asked us to connect to ourselves, not really 
an error! */
-    GNUNET_SERVER_receive_done (client, GNUNET_OK);
-    return;
-  }
-  GNUNET_break (ntohl (cm->reserved) == 0);
-#if DEBUG_CORE
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Core received `%s' request for `%4s', will try to establish 
connection\n",
-              "REQUEST_CONNECT", GNUNET_i2s (&cm->peer));
-#endif
-  GNUNET_STATISTICS_update (stats,
-                            gettext_noop ("# connection requests received"), 1,
-                            GNUNET_NO);
-  GNUNET_SERVER_receive_done (client, GNUNET_OK);
-  n = find_neighbour (&cm->peer);
-  if ((n == NULL) || (GNUNET_YES != n->is_connected))
-  {
-    GNUNET_TRANSPORT_try_connect (transport, &cm->peer);
-  }
-  else
-  {
-    GNUNET_STATISTICS_update (stats,
-                              gettext_noop
-                              ("# connection requests ignored (already 
connected)"),
-                              1, GNUNET_NO);
-  }
-}
-
-
-/**
  * PEERINFO is giving us a HELLO for a peer.  Add the public key to
  * the neighbour's struct and retry send_key.  Or, if we did not get a
  * HELLO, just do nothing.
@@ -4587,9 +4541,6 @@
      sizeof (struct SendMessageRequest)},
     {&handle_client_send, NULL,
      GNUNET_MESSAGE_TYPE_CORE_SEND, 0},
-    {&handle_client_request_connect, NULL,
-     GNUNET_MESSAGE_TYPE_CORE_REQUEST_CONNECT,
-     sizeof (struct ConnectMessage)},
     {NULL, NULL, 0, 0}
   };
   char *keyfile;

Modified: gnunet/src/core/gnunet-service-core_clients.c
===================================================================
--- gnunet/src/core/gnunet-service-core_clients.c       2011-10-05 13:35:37 UTC 
(rev 17216)
+++ gnunet/src/core/gnunet-service-core_clients.c       2011-10-05 13:36:14 UTC 
(rev 17217)
@@ -633,53 +633,6 @@
 
 
 /**
- * Handle CORE_REQUEST_CONNECT request.
- *
- * @param cls unused
- * @param client the client issuing the request
- * @param message the "struct ConnectMessage"
- */
-static void
-handle_client_request_connect (void *cls, struct GNUNET_SERVER_Client *client,
-                               const struct GNUNET_MessageHeader *message)
-{
-  const struct ConnectMessage *cm = (const struct ConnectMessage *) message;
-  struct Neighbour *n;
-
-  if (0 ==
-      memcmp (&cm->peer, &my_identity, sizeof (struct GNUNET_PeerIdentity)))
-  {
-    /* In this case a client has asked us to connect to ourselves, not really 
an error! */
-    GNUNET_SERVER_receive_done (client, GNUNET_OK);
-    return;
-  }
-  GNUNET_break (ntohl (cm->reserved) == 0);
-#if DEBUG_CORE
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Core received `%s' request for `%4s', will try to establish 
connection\n",
-              "REQUEST_CONNECT", GNUNET_i2s (&cm->peer));
-#endif
-  GNUNET_STATISTICS_update (stats,
-                            gettext_noop ("# connection requests received"), 1,
-                            GNUNET_NO);
-  GNUNET_SERVER_receive_done (client, GNUNET_OK);
-  n = find_neighbour (&cm->peer);
-  if ((n == NULL) || (GNUNET_YES != n->is_connected))
-  {
-    GNUNET_TRANSPORT_try_connect (transport, &cm->peer);
-  }
-  else
-  {
-    GNUNET_STATISTICS_update (stats,
-                              gettext_noop
-                              ("# connection requests ignored (already 
connected)"),
-                              1, GNUNET_NO);
-  }
-}
-
-
-
-/**
  * Helper function for handle_client_iterate_peers.
  *
  * @param cls the 'struct GNUNET_SERVER_TransmitContext' to queue replies
@@ -1069,9 +1022,6 @@
      sizeof (struct SendMessageRequest)},
     {&handle_client_send, NULL,
      GNUNET_MESSAGE_TYPE_CORE_SEND, 0},
-    {&handle_client_request_connect, NULL,
-     GNUNET_MESSAGE_TYPE_CORE_REQUEST_CONNECT,
-     sizeof (struct ConnectMessage)},
     {NULL, NULL, 0, 0}
   };
 

Modified: gnunet/src/include/gnunet_protocols.h
===================================================================
--- gnunet/src/include/gnunet_protocols.h       2011-10-05 13:35:37 UTC (rev 
17216)
+++ gnunet/src/include/gnunet_protocols.h       2011-10-05 13:36:14 UTC (rev 
17217)
@@ -208,11 +208,6 @@
  */
 #define GNUNET_MESSAGE_TYPE_TRANSPORT_PONG 33
 
-/**
- * Message for transport service from a client asking that a
- * connection be initiated with another peer.
- */
-#define GNUNET_MESSAGE_TYPE_TRANSPORT_REQUEST_CONNECT 34
 
 /**
  * Transport CONNECT message exchanged between transport services to




reply via email to

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