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.c | |
parent | 780d7ad09f353ded264b11d29d910ba22afae916 (diff) | |
download | gnunet-733f76af45ad94bd39a81a8cf4a49f5fe60eaba1.tar.gz gnunet-733f76af45ad94bd39a81a8cf4a49f5fe60eaba1.zip |
eliminate REQUEST_CONNECT handlers
Diffstat (limited to 'src/core/gnunet-service-core.c')
-rw-r--r-- | src/core/gnunet-service-core.c | 49 |
1 files changed, 0 insertions, 49 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 | */ | ||
2979 | static void | ||
2980 | handle_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; |