diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-04-21 20:19:43 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-04-21 20:19:43 +0000 |
commit | 84e15afe4933ee2ca62e3e111ca261c3a986c157 (patch) | |
tree | 8a9cd9a06b723b940f6d11b0272f5eb395db39c4 /src/peerinfo/gnunet-service-peerinfo.c | |
parent | a06d7742d5a48229767c152f9466432d17e162de (diff) | |
download | gnunet-84e15afe4933ee2ca62e3e111ca261c3a986c157.tar.gz gnunet-84e15afe4933ee2ca62e3e111ca261c3a986c157.zip |
activating new peerinfo API
Diffstat (limited to 'src/peerinfo/gnunet-service-peerinfo.c')
-rw-r--r-- | src/peerinfo/gnunet-service-peerinfo.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c index 1802da959..e200eae2f 100644 --- a/src/peerinfo/gnunet-service-peerinfo.c +++ b/src/peerinfo/gnunet-service-peerinfo.c | |||
@@ -29,8 +29,6 @@ | |||
29 | * | 29 | * |
30 | * TODO: | 30 | * TODO: |
31 | * - HostEntries are never 'free'd (add expiration, upper bound?) | 31 | * - HostEntries are never 'free'd (add expiration, upper bound?) |
32 | * - AddPeer message is obsolete with NEW peerinfo API (remove handler, | ||
33 | * message struct and protocol) | ||
34 | */ | 32 | */ |
35 | 33 | ||
36 | #include "platform.h" | 34 | #include "platform.h" |
@@ -649,43 +647,6 @@ cron_clean_data_hosts (void *cls, | |||
649 | 647 | ||
650 | 648 | ||
651 | /** | 649 | /** |
652 | * Handle ADD-message. | ||
653 | * | ||
654 | * @param cls closure | ||
655 | * @param client identification of the client | ||
656 | * @param message the actual message | ||
657 | */ | ||
658 | static void | ||
659 | handle_add (void *cls, | ||
660 | struct GNUNET_SERVER_Client *client, | ||
661 | const struct GNUNET_MessageHeader *message) | ||
662 | { | ||
663 | const struct PeerAddMessage *pam; | ||
664 | const struct GNUNET_MessageHeader *hello; | ||
665 | uint16_t size; | ||
666 | |||
667 | size = ntohs (message->size); | ||
668 | if (size < | ||
669 | sizeof (struct PeerAddMessage) + sizeof (struct GNUNET_MessageHeader)) | ||
670 | { | ||
671 | GNUNET_break (0); | ||
672 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | ||
673 | return; | ||
674 | } | ||
675 | pam = (const struct PeerAddMessage *) message; | ||
676 | hello = (const struct GNUNET_MessageHeader *) &pam[1]; | ||
677 | if (size != sizeof (struct PeerAddMessage) + ntohs (hello->size)) | ||
678 | { | ||
679 | GNUNET_break (0); | ||
680 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | ||
681 | return; | ||
682 | } | ||
683 | bind_address (&pam->peer, (const struct GNUNET_HELLO_Message *) hello); | ||
684 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | ||
685 | } | ||
686 | |||
687 | |||
688 | /** | ||
689 | * Handle HELLO-message. | 650 | * Handle HELLO-message. |
690 | * | 651 | * |
691 | * @param cls closure | 652 | * @param cls closure |
@@ -787,7 +748,6 @@ handle_notify (void *cls, | |||
787 | */ | 748 | */ |
788 | static struct GNUNET_SERVER_MessageHandler handlers[] = { | 749 | static struct GNUNET_SERVER_MessageHandler handlers[] = { |
789 | {&handle_hello, NULL, GNUNET_MESSAGE_TYPE_HELLO, 0}, | 750 | {&handle_hello, NULL, GNUNET_MESSAGE_TYPE_HELLO, 0}, |
790 | {&handle_add, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_ADD, 0}, | ||
791 | {&handle_get, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_GET, | 751 | {&handle_get, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_GET, |
792 | sizeof (struct ListPeerMessage)}, | 752 | sizeof (struct ListPeerMessage)}, |
793 | {&handle_get_all, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_GET_ALL, | 753 | {&handle_get_all, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_GET_ALL, |