diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-10-05 13:36:14 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-10-05 13:36:14 +0000 |
commit | 733f76af45ad94bd39a81a8cf4a49f5fe60eaba1 (patch) | |
tree | 20fac82ac6c27e851a9ae57ff13f1fea2904a196 /src/core/gnunet-service-core_clients.c | |
parent | 780d7ad09f353ded264b11d29d910ba22afae916 (diff) | |
download | gnunet-733f76af45ad94bd39a81a8cf4a49f5fe60eaba1.tar.gz gnunet-733f76af45ad94bd39a81a8cf4a49f5fe60eaba1.zip |
eliminate REQUEST_CONNECT handlers
Diffstat (limited to 'src/core/gnunet-service-core_clients.c')
-rw-r--r-- | src/core/gnunet-service-core_clients.c | 50 |
1 files changed, 0 insertions, 50 deletions
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 | */ | ||
642 | static void | ||
643 | handle_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 | ||