aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/gnunet-service-core.c49
-rw-r--r--src/core/gnunet-service-core_clients.c50
-rw-r--r--src/include/gnunet_protocols.h5
3 files changed, 0 insertions, 104 deletions
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c
index 76cb486bb..76ed02d2f 100644
--- a/src/core/gnunet-service-core.c
+++ b/src/core/gnunet-service-core.c
@@ -2970,52 +2970,6 @@ handle_client_send (void *cls, struct GNUNET_SERVER_Client *client,
2970 2970
2971 2971
2972/** 2972/**
2973 * Handle CORE_REQUEST_CONNECT request.
2974 *
2975 * @param cls unused
2976 * @param client the client issuing the request
2977 * @param message the "struct ConnectMessage"
2978 */
2979static void
2980handle_client_request_connect (void *cls, struct GNUNET_SERVER_Client *client,
2981 const struct GNUNET_MessageHeader *message)
2982{
2983 const struct ConnectMessage *cm = (const struct ConnectMessage *) message;
2984 struct Neighbour *n;
2985
2986 if (0 ==
2987 memcmp (&cm->peer, &my_identity, sizeof (struct GNUNET_PeerIdentity)))
2988 {
2989 /* In this case a client has asked us to connect to ourselves, not really an error! */
2990 GNUNET_SERVER_receive_done (client, GNUNET_OK);
2991 return;
2992 }
2993 GNUNET_break (ntohl (cm->reserved) == 0);
2994#if DEBUG_CORE
2995 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2996 "Core received `%s' request for `%4s', will try to establish connection\n",
2997 "REQUEST_CONNECT", GNUNET_i2s (&cm->peer));
2998#endif
2999 GNUNET_STATISTICS_update (stats,
3000 gettext_noop ("# connection requests received"), 1,
3001 GNUNET_NO);
3002 GNUNET_SERVER_receive_done (client, GNUNET_OK);
3003 n = find_neighbour (&cm->peer);
3004 if ((n == NULL) || (GNUNET_YES != n->is_connected))
3005 {
3006 GNUNET_TRANSPORT_try_connect (transport, &cm->peer);
3007 }
3008 else
3009 {
3010 GNUNET_STATISTICS_update (stats,
3011 gettext_noop
3012 ("# connection requests ignored (already connected)"),
3013 1, GNUNET_NO);
3014 }
3015}
3016
3017
3018/**
3019 * PEERINFO is giving us a HELLO for a peer. Add the public key to 2973 * PEERINFO is giving us a HELLO for a peer. Add the public key to
3020 * the neighbour's struct and retry send_key. Or, if we did not get a 2974 * the neighbour's struct and retry send_key. Or, if we did not get a
3021 * HELLO, just do nothing. 2975 * HELLO, just do nothing.
@@ -4587,9 +4541,6 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
4587 sizeof (struct SendMessageRequest)}, 4541 sizeof (struct SendMessageRequest)},
4588 {&handle_client_send, NULL, 4542 {&handle_client_send, NULL,
4589 GNUNET_MESSAGE_TYPE_CORE_SEND, 0}, 4543 GNUNET_MESSAGE_TYPE_CORE_SEND, 0},
4590 {&handle_client_request_connect, NULL,
4591 GNUNET_MESSAGE_TYPE_CORE_REQUEST_CONNECT,
4592 sizeof (struct ConnectMessage)},
4593 {NULL, NULL, 0, 0} 4544 {NULL, NULL, 0, 0}
4594 }; 4545 };
4595 char *keyfile; 4546 char *keyfile;
diff --git a/src/core/gnunet-service-core_clients.c b/src/core/gnunet-service-core_clients.c
index ffd6d294f..8eee8ff4a 100644
--- a/src/core/gnunet-service-core_clients.c
+++ b/src/core/gnunet-service-core_clients.c
@@ -633,53 +633,6 @@ handle_client_send (void *cls, struct GNUNET_SERVER_Client *client,
633 633
634 634
635/** 635/**
636 * Handle CORE_REQUEST_CONNECT request.
637 *
638 * @param cls unused
639 * @param client the client issuing the request
640 * @param message the "struct ConnectMessage"
641 */
642static void
643handle_client_request_connect (void *cls, struct GNUNET_SERVER_Client *client,
644 const struct GNUNET_MessageHeader *message)
645{
646 const struct ConnectMessage *cm = (const struct ConnectMessage *) message;
647 struct Neighbour *n;
648
649 if (0 ==
650 memcmp (&cm->peer, &my_identity, sizeof (struct GNUNET_PeerIdentity)))
651 {
652 /* In this case a client has asked us to connect to ourselves, not really an error! */
653 GNUNET_SERVER_receive_done (client, GNUNET_OK);
654 return;
655 }
656 GNUNET_break (ntohl (cm->reserved) == 0);
657#if DEBUG_CORE
658 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
659 "Core received `%s' request for `%4s', will try to establish connection\n",
660 "REQUEST_CONNECT", GNUNET_i2s (&cm->peer));
661#endif
662 GNUNET_STATISTICS_update (stats,
663 gettext_noop ("# connection requests received"), 1,
664 GNUNET_NO);
665 GNUNET_SERVER_receive_done (client, GNUNET_OK);
666 n = find_neighbour (&cm->peer);
667 if ((n == NULL) || (GNUNET_YES != n->is_connected))
668 {
669 GNUNET_TRANSPORT_try_connect (transport, &cm->peer);
670 }
671 else
672 {
673 GNUNET_STATISTICS_update (stats,
674 gettext_noop
675 ("# connection requests ignored (already connected)"),
676 1, GNUNET_NO);
677 }
678}
679
680
681
682/**
683 * Helper function for handle_client_iterate_peers. 636 * Helper function for handle_client_iterate_peers.
684 * 637 *
685 * @param cls the 'struct GNUNET_SERVER_TransmitContext' to queue replies 638 * @param cls the 'struct GNUNET_SERVER_TransmitContext' to queue replies
@@ -1069,9 +1022,6 @@ GSC_CLIENTS_init (struct GNUNET_SERVER_Handle *server)
1069 sizeof (struct SendMessageRequest)}, 1022 sizeof (struct SendMessageRequest)},
1070 {&handle_client_send, NULL, 1023 {&handle_client_send, NULL,
1071 GNUNET_MESSAGE_TYPE_CORE_SEND, 0}, 1024 GNUNET_MESSAGE_TYPE_CORE_SEND, 0},
1072 {&handle_client_request_connect, NULL,
1073 GNUNET_MESSAGE_TYPE_CORE_REQUEST_CONNECT,
1074 sizeof (struct ConnectMessage)},
1075 {NULL, NULL, 0, 0} 1025 {NULL, NULL, 0, 0}
1076 }; 1026 };
1077 1027
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index 68e78b5bb..f0c8df7ad 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -208,11 +208,6 @@ extern "C"
208 */ 208 */
209#define GNUNET_MESSAGE_TYPE_TRANSPORT_PONG 33 209#define GNUNET_MESSAGE_TYPE_TRANSPORT_PONG 33
210 210
211/**
212 * Message for transport service from a client asking that a
213 * connection be initiated with another peer.
214 */
215#define GNUNET_MESSAGE_TYPE_TRANSPORT_REQUEST_CONNECT 34
216 211
217/** 212/**
218 * Transport CONNECT message exchanged between transport services to 213 * Transport CONNECT message exchanged between transport services to