diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-06 09:00:14 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-06 09:00:14 +0000 |
commit | 170d5baeece2def099112c6a25287a95d2b28899 (patch) | |
tree | 5950b36e6c5fa5fe6b90c8c3efc68dcce50d931d /src/ats/gnunet-service-ats_addresses.c | |
parent | d9c8e8f14e77670c657ae42030ff3581ad060968 (diff) | |
download | gnunet-170d5baeece2def099112c6a25287a95d2b28899.tar.gz gnunet-170d5baeece2def099112c6a25287a95d2b28899.zip |
-use only one nc per client
Diffstat (limited to 'src/ats/gnunet-service-ats_addresses.c')
-rw-r--r-- | src/ats/gnunet-service-ats_addresses.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index 5715bfbbd..0c896e489 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c | |||
@@ -215,11 +215,6 @@ | |||
215 | */ | 215 | */ |
216 | struct GNUNET_CONTAINER_MultiPeerMap *GSA_addresses; | 216 | struct GNUNET_CONTAINER_MultiPeerMap *GSA_addresses; |
217 | 217 | ||
218 | /** | ||
219 | * Context for sending messages to performance clients without PIC. | ||
220 | */ | ||
221 | static struct GNUNET_SERVER_NotificationContext *nc; | ||
222 | |||
223 | 218 | ||
224 | /** | 219 | /** |
225 | * Update statistic on number of addresses. | 220 | * Update statistic on number of addresses. |
@@ -698,7 +693,6 @@ GAS_addresses_init (struct GNUNET_SERVER_Handle *server) | |||
698 | { | 693 | { |
699 | GSA_addresses = GNUNET_CONTAINER_multipeermap_create (128, GNUNET_NO); | 694 | GSA_addresses = GNUNET_CONTAINER_multipeermap_create (128, GNUNET_NO); |
700 | update_addresses_stat (); | 695 | update_addresses_stat (); |
701 | nc = GNUNET_SERVER_notification_context_create (server, 32); | ||
702 | } | 696 | } |
703 | 697 | ||
704 | 698 | ||
@@ -749,8 +743,6 @@ GAS_addresses_done () | |||
749 | GAS_addresses_destroy_all (); | 743 | GAS_addresses_destroy_all (); |
750 | GNUNET_CONTAINER_multipeermap_destroy (GSA_addresses); | 744 | GNUNET_CONTAINER_multipeermap_destroy (GSA_addresses); |
751 | GSA_addresses = NULL; | 745 | GSA_addresses = NULL; |
752 | GNUNET_SERVER_notification_context_destroy (nc); | ||
753 | nc = NULL; | ||
754 | } | 746 | } |
755 | 747 | ||
756 | 748 | ||
@@ -902,6 +894,7 @@ transmit_req_addr (struct AddressIteration *ai, | |||
902 | char *addrp; | 894 | char *addrp; |
903 | size_t plugin_name_length; | 895 | size_t plugin_name_length; |
904 | size_t msize; | 896 | size_t msize; |
897 | struct GNUNET_SERVER_NotificationContext *nc; | ||
905 | 898 | ||
906 | if (NULL != plugin_name) | 899 | if (NULL != plugin_name) |
907 | plugin_name_length = strlen (plugin_name) + 1; | 900 | plugin_name_length = strlen (plugin_name) + 1; |
@@ -937,6 +930,13 @@ transmit_req_addr (struct AddressIteration *ai, | |||
937 | memcpy (addrp, plugin_addr, plugin_addr_len); | 930 | memcpy (addrp, plugin_addr, plugin_addr_len); |
938 | if (NULL != plugin_name) | 931 | if (NULL != plugin_name) |
939 | strcpy (&addrp[plugin_addr_len], plugin_name); | 932 | strcpy (&addrp[plugin_addr_len], plugin_name); |
933 | nc = *GNUNET_SERVER_client_get_user_context (ai->client, | ||
934 | struct GNUNET_SERVER_NotificationContext *); | ||
935 | if (NULL == nc) | ||
936 | { | ||
937 | GNUNET_break (0); | ||
938 | return; | ||
939 | } | ||
940 | GNUNET_SERVER_notification_context_unicast (nc, | 940 | GNUNET_SERVER_notification_context_unicast (nc, |
941 | ai->client, | 941 | ai->client, |
942 | &msg->header, | 942 | &msg->header, |
@@ -1021,8 +1021,6 @@ GAS_handle_request_address_list (void *cls, | |||
1021 | const struct AddressListRequestMessage *alrm; | 1021 | const struct AddressListRequestMessage *alrm; |
1022 | struct GNUNET_PeerIdentity allzeros; | 1022 | struct GNUNET_PeerIdentity allzeros; |
1023 | 1023 | ||
1024 | GNUNET_SERVER_notification_context_add (nc, | ||
1025 | client); | ||
1026 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1024 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1027 | "Received ADDRESSLIST_REQUEST message\n"); | 1025 | "Received ADDRESSLIST_REQUEST message\n"); |
1028 | alrm = (const struct AddressListRequestMessage *) message; | 1026 | alrm = (const struct AddressListRequestMessage *) message; |