diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-02 14:54:42 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-02 14:54:42 +0000 |
commit | f1f81d41ae55f0107d4f2ac752544b3dce7d2214 (patch) | |
tree | 6814283095415ef49ecdf7aac3d4f2ef9167973a /src/ats | |
parent | 2438c97cbbe2411bc5dd7c2d33f1adda284c4e2d (diff) | |
download | gnunet-f1f81d41ae55f0107d4f2ac752544b3dce7d2214.tar.gz gnunet-f1f81d41ae55f0107d4f2ac752544b3dce7d2214.zip |
added support for bulk operations
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/gnunet-service-ats-solver_mlp.c | 42 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats-solver_mlp.h | 18 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats-solver_proportional.c | 93 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_addresses.c | 7 |
4 files changed, 127 insertions, 33 deletions
diff --git a/src/ats/gnunet-service-ats-solver_mlp.c b/src/ats/gnunet-service-ats-solver_mlp.c index 27dcc21cf..5dbbee4e8 100644 --- a/src/ats/gnunet-service-ats-solver_mlp.c +++ b/src/ats/gnunet-service-ats-solver_mlp.c | |||
@@ -958,7 +958,7 @@ GAS_mlp_solve_problem (void *solver, struct GNUNET_CONTAINER_MultiHashMap * addr | |||
958 | LOG (GNUNET_ERROR_TYPE_DEBUG, "No changes to problem\n"); | 958 | LOG (GNUNET_ERROR_TYPE_DEBUG, "No changes to problem\n"); |
959 | return GNUNET_OK; | 959 | return GNUNET_OK; |
960 | } | 960 | } |
961 | 961 | mlp->addresses = addresses; | |
962 | if (GNUNET_YES == mlp->mlp_prob_changed) | 962 | if (GNUNET_YES == mlp->mlp_prob_changed) |
963 | { | 963 | { |
964 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Problem size changed, rebuilding\n"); | 964 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Problem size changed, rebuilding\n"); |
@@ -1061,7 +1061,7 @@ GAS_mlp_address_add (void *solver, | |||
1061 | GNUNET_assert (NULL != addresses); | 1061 | GNUNET_assert (NULL != addresses); |
1062 | GNUNET_assert (NULL != address); | 1062 | GNUNET_assert (NULL != address); |
1063 | 1063 | ||
1064 | 1064 | mlp->addresses = addresses; | |
1065 | if (NULL == address->solver_information) | 1065 | if (NULL == address->solver_information) |
1066 | { | 1066 | { |
1067 | address->solver_information = GNUNET_malloc (sizeof (struct MLP_information)); | 1067 | address->solver_information = GNUNET_malloc (sizeof (struct MLP_information)); |
@@ -1338,6 +1338,7 @@ GAS_mlp_address_update (void *solver, | |||
1338 | GNUNET_assert (NULL != address); | 1338 | GNUNET_assert (NULL != address); |
1339 | GNUNET_assert ((NULL != prev_atsi) || (0 == prev_atsi_count)); | 1339 | GNUNET_assert ((NULL != prev_atsi) || (0 == prev_atsi_count)); |
1340 | 1340 | ||
1341 | mlp->addresses = addresses; | ||
1341 | if (NULL == mlpi) | 1342 | if (NULL == mlpi) |
1342 | { | 1343 | { |
1343 | LOG (GNUNET_ERROR_TYPE_ERROR, _("Updating address for peer `%s' not added before\n"), GNUNET_i2s(&address->peer)); | 1344 | LOG (GNUNET_ERROR_TYPE_ERROR, _("Updating address for peer `%s' not added before\n"), GNUNET_i2s(&address->peer)); |
@@ -1386,7 +1387,7 @@ GAS_mlp_address_delete (void *solver, | |||
1386 | GNUNET_assert (NULL != address); | 1387 | GNUNET_assert (NULL != address); |
1387 | 1388 | ||
1388 | mlpi = address->solver_information; | 1389 | mlpi = address->solver_information; |
1389 | 1390 | mlp->addresses = addresses; | |
1390 | if (NULL != mlpi) | 1391 | if (NULL != mlpi) |
1391 | { | 1392 | { |
1392 | GNUNET_free (mlpi); | 1393 | GNUNET_free (mlpi); |
@@ -1480,7 +1481,7 @@ GAS_mlp_get_preferred_address (void *solver, | |||
1480 | 1481 | ||
1481 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Getting preferred address for `%s'\n", | 1482 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Getting preferred address for `%s'\n", |
1482 | GNUNET_i2s (peer)); | 1483 | GNUNET_i2s (peer)); |
1483 | 1484 | mlp->addresses = addresses; | |
1484 | /* Is this peer included in the problem? */ | 1485 | /* Is this peer included in the problem? */ |
1485 | if (NULL == (p = GNUNET_CONTAINER_multihashmap_get (mlp->peers, &peer->hashPubKey))) | 1486 | if (NULL == (p = GNUNET_CONTAINER_multihashmap_get (mlp->peers, &peer->hashPubKey))) |
1486 | { | 1487 | { |
@@ -1514,13 +1515,34 @@ GAS_mlp_get_preferred_address (void *solver, | |||
1514 | void | 1515 | void |
1515 | GAS_mlp_bulk_start (void *solver) | 1516 | GAS_mlp_bulk_start (void *solver) |
1516 | { | 1517 | { |
1518 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Locking solver for bulk operation ...\n"); | ||
1519 | struct GAS_MLP_Handle *s = (struct GAS_MLP_Handle *) solver; | ||
1520 | |||
1521 | GNUNET_assert (NULL != solver); | ||
1517 | 1522 | ||
1523 | s->bulk_lock ++; | ||
1518 | } | 1524 | } |
1519 | 1525 | ||
1520 | void | 1526 | void |
1521 | GAS_mlp_bulk_stop (void *solver) | 1527 | GAS_mlp_bulk_stop (void *solver) |
1522 | { | 1528 | { |
1529 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Unlocking solver from bulk operation ...\n"); | ||
1523 | 1530 | ||
1531 | struct GAS_MLP_Handle *s = (struct GAS_MLP_Handle *) solver; | ||
1532 | GNUNET_assert (NULL != solver); | ||
1533 | |||
1534 | if (s->bulk_lock < 1) | ||
1535 | { | ||
1536 | GNUNET_break (0); | ||
1537 | return; | ||
1538 | } | ||
1539 | s->bulk_lock --; | ||
1540 | |||
1541 | if (0 < s->bulk_changes) | ||
1542 | { | ||
1543 | GAS_mlp_solve_problem (solver, s->addresses); | ||
1544 | s->bulk_changes = 0; | ||
1545 | } | ||
1524 | } | 1546 | } |
1525 | 1547 | ||
1526 | 1548 | ||
@@ -1575,10 +1597,9 @@ GAS_mlp_address_change_preference (void *solver, | |||
1575 | GNUNET_i2s(peer)); | 1597 | GNUNET_i2s(peer)); |
1576 | 1598 | ||
1577 | GNUNET_STATISTICS_update (mlp->stats,"# LP address preference changes", 1, GNUNET_NO); | 1599 | GNUNET_STATISTICS_update (mlp->stats,"# LP address preference changes", 1, GNUNET_NO); |
1578 | 1600 | mlp->addresses = addresses; | |
1579 | /* Update the constraints with changed preferences */ | 1601 | /* Update the constraints with changed preferences */ |
1580 | 1602 | ||
1581 | |||
1582 | /* Update quality constraint c7 */ | 1603 | /* Update quality constraint c7 */ |
1583 | 1604 | ||
1584 | /* Update relativity constraint c9 */ | 1605 | /* Update relativity constraint c9 */ |
@@ -1588,11 +1609,16 @@ GAS_mlp_address_change_preference (void *solver, | |||
1588 | return; | 1609 | return; |
1589 | } | 1610 | } |
1590 | p->f = get_peer_pref_value (mlp, peer); | 1611 | p->f = get_peer_pref_value (mlp, peer); |
1591 | mlp_create_problem_set_value (&mlp->p, p->r_c9, mlp->p.c_r, -p->f, __LINE__); | 1612 | /* FXIME: cannot use set_value mlp_create_problem_set_value (&mlp->p, p->r_c9, mlp->p.c_r, -p->f, __LINE__);*/ |
1592 | |||
1593 | 1613 | ||
1594 | /* Problem size changed: new address for peer with pending request */ | 1614 | /* Problem size changed: new address for peer with pending request */ |
1595 | mlp->mlp_prob_updated = GNUNET_YES; | 1615 | mlp->mlp_prob_updated = GNUNET_YES; |
1616 | if (GNUNET_YES == mlp->bulk_lock) | ||
1617 | { | ||
1618 | mlp->bulk_changes++; | ||
1619 | return; | ||
1620 | } | ||
1621 | |||
1596 | if (GNUNET_YES == mlp->mlp_auto_solve) | 1622 | if (GNUNET_YES == mlp->mlp_auto_solve) |
1597 | GAS_mlp_solve_problem (solver, addresses); | 1623 | GAS_mlp_solve_problem (solver, addresses); |
1598 | return; | 1624 | return; |
diff --git a/src/ats/gnunet-service-ats-solver_mlp.h b/src/ats/gnunet-service-ats-solver_mlp.h index 3d762819d..efdd3d420 100644 --- a/src/ats/gnunet-service-ats-solver_mlp.h +++ b/src/ats/gnunet-service-ats-solver_mlp.h | |||
@@ -110,6 +110,7 @@ struct MLP_Problem | |||
110 | #else | 110 | #else |
111 | void *prob; | 111 | void *prob; |
112 | #endif | 112 | #endif |
113 | |||
113 | /* Number of addresses in problem */ | 114 | /* Number of addresses in problem */ |
114 | unsigned int num_addresses; | 115 | unsigned int num_addresses; |
115 | /* Number of peers in problem */ | 116 | /* Number of peers in problem */ |
@@ -150,6 +151,7 @@ struct MLP_Problem | |||
150 | int *ja; | 151 | int *ja; |
151 | /* Column index value */ | 152 | /* Column index value */ |
152 | double *ar; | 153 | double *ar; |
154 | |||
153 | }; | 155 | }; |
154 | 156 | ||
155 | struct MLP_Variables | 157 | struct MLP_Variables |
@@ -219,6 +221,11 @@ struct GAS_MLP_Handle | |||
219 | struct GNUNET_STATISTICS_Handle *stats; | 221 | struct GNUNET_STATISTICS_Handle *stats; |
220 | 222 | ||
221 | /** | 223 | /** |
224 | * Address hashmap for lookups | ||
225 | */ | ||
226 | struct GNUNET_CONTAINER_MultiHashMap *addresses; | ||
227 | |||
228 | /** | ||
222 | * Addresses' bandwidth changed callback | 229 | * Addresses' bandwidth changed callback |
223 | */ | 230 | */ |
224 | GAS_bandwidth_changed_cb bw_changed_cb; | 231 | GAS_bandwidth_changed_cb bw_changed_cb; |
@@ -239,6 +246,17 @@ struct GAS_MLP_Handle | |||
239 | struct MLP_Solution ps; | 246 | struct MLP_Solution ps; |
240 | 247 | ||
241 | /** | 248 | /** |
249 | * Bulk lock | ||
250 | */ | ||
251 | |||
252 | int bulk_lock; | ||
253 | |||
254 | /** | ||
255 | * Number of changes while solver was locked | ||
256 | */ | ||
257 | int bulk_changes; | ||
258 | |||
259 | /** | ||
242 | * GLPK LP control parameter | 260 | * GLPK LP control parameter |
243 | */ | 261 | */ |
244 | #if HAVE_LIBGLPK | 262 | #if HAVE_LIBGLPK |
diff --git a/src/ats/gnunet-service-ats-solver_proportional.c b/src/ats/gnunet-service-ats-solver_proportional.c index bafb55288..b9b0d9a4e 100644 --- a/src/ats/gnunet-service-ats-solver_proportional.c +++ b/src/ats/gnunet-service-ats-solver_proportional.c | |||
@@ -221,51 +221,59 @@ struct GAS_PROPORTIONAL_Handle | |||
221 | /** | 221 | /** |
222 | * Statistics handle | 222 | * Statistics handle |
223 | */ | 223 | */ |
224 | |||
225 | struct GNUNET_STATISTICS_Handle *stats; | 224 | struct GNUNET_STATISTICS_Handle *stats; |
226 | 225 | ||
227 | /** | 226 | /** |
228 | * Total number of addresses for solver | 227 | * Bandwidth changed callback |
229 | */ | 228 | */ |
230 | unsigned int total_addresses; | 229 | GAS_bandwidth_changed_cb bw_changed; |
231 | 230 | ||
232 | /** | 231 | /** |
233 | * Number of active addresses for solver | 232 | * Bandwidth changed callback cls |
234 | */ | 233 | */ |
235 | unsigned int active_addresses; | 234 | void *bw_changed_cls; |
236 | 235 | ||
237 | /** | 236 | /** |
238 | * Networks array | 237 | * ATS function to get preferences |
239 | */ | 238 | */ |
240 | struct Network *network_entries; | 239 | GAS_get_preferences get_preferences; |
241 | 240 | ||
242 | /** | 241 | /** |
243 | * Number of networks | 242 | * Closure for ATS function to get preferences |
244 | */ | 243 | */ |
245 | unsigned int networks; | 244 | void *get_preferences_cls; |
246 | 245 | ||
247 | /** | 246 | /** |
248 | * Callback | 247 | * Bulk lock |
249 | */ | 248 | */ |
250 | GAS_bandwidth_changed_cb bw_changed; | 249 | int bulk_lock; |
251 | 250 | ||
252 | /** | 251 | /** |
253 | * Callback cls | 252 | * Number of changes while solver was locked |
254 | */ | 253 | */ |
255 | void *bw_changed_cls; | 254 | int bulk_changes; |
255 | |||
256 | 256 | ||
257 | /** | 257 | /** |
258 | * ATS function to get preferences | 258 | * Total number of addresses for solver |
259 | */ | 259 | */ |
260 | GAS_get_preferences get_preferences; | 260 | unsigned int total_addresses; |
261 | 261 | ||
262 | /** | 262 | /** |
263 | * Closure for ATS function to get preferences | 263 | * Number of active addresses for solver |
264 | */ | 264 | */ |
265 | void *get_preferences_cls; | 265 | unsigned int active_addresses; |
266 | |||
267 | /** | ||
268 | * Networks array | ||
269 | */ | ||
270 | struct Network *network_entries; | ||
271 | |||
272 | /** | ||
273 | * Number of networks | ||
274 | */ | ||
275 | unsigned int networks; | ||
266 | 276 | ||
267 | struct PreferenceClient *pc_head; | ||
268 | struct PreferenceClient *pc_tail; | ||
269 | }; | 277 | }; |
270 | 278 | ||
271 | 279 | ||
@@ -856,7 +864,11 @@ GAS_proportional_address_change_preference (void *solver, | |||
856 | struct GAS_PROPORTIONAL_Handle *s = solver; | 864 | struct GAS_PROPORTIONAL_Handle *s = solver; |
857 | GNUNET_assert (NULL != solver); | 865 | GNUNET_assert (NULL != solver); |
858 | GNUNET_assert (NULL != peer); | 866 | GNUNET_assert (NULL != peer); |
859 | distribute_bandwidth_in_all_networks (s); | 867 | |
868 | if (GNUNET_NO == s->bulk_lock) | ||
869 | distribute_bandwidth_in_all_networks (s); | ||
870 | else | ||
871 | s->bulk_changes ++; | ||
860 | } | 872 | } |
861 | 873 | ||
862 | /** | 874 | /** |
@@ -922,7 +934,10 @@ GAS_proportional_get_preferred_address (void *solver, | |||
922 | s->bw_changed (s->bw_changed_cls, prev); /* notify about bw change, REQUIRED? */ | 934 | s->bw_changed (s->bw_changed_cls, prev); /* notify about bw change, REQUIRED? */ |
923 | if (GNUNET_SYSERR == addresse_decrement (s, net_prev, GNUNET_NO, GNUNET_YES)) | 935 | if (GNUNET_SYSERR == addresse_decrement (s, net_prev, GNUNET_NO, GNUNET_YES)) |
924 | GNUNET_break (0); | 936 | GNUNET_break (0); |
925 | distribute_bandwidth_in_network (s, net_prev, NULL); | 937 | if (GNUNET_NO == s->bulk_lock) |
938 | distribute_bandwidth_in_network (s, net_prev, NULL); | ||
939 | else | ||
940 | s->bulk_changes ++; | ||
926 | } | 941 | } |
927 | 942 | ||
928 | if (GNUNET_NO == (is_bandwidth_available_in_network (cur->solver_information))) | 943 | if (GNUNET_NO == (is_bandwidth_available_in_network (cur->solver_information))) |
@@ -933,7 +948,10 @@ GAS_proportional_get_preferred_address (void *solver, | |||
933 | 948 | ||
934 | cur->active = GNUNET_YES; | 949 | cur->active = GNUNET_YES; |
935 | addresse_increment(s, net_cur, GNUNET_NO, GNUNET_YES); | 950 | addresse_increment(s, net_cur, GNUNET_NO, GNUNET_YES); |
936 | distribute_bandwidth_in_network (s, net_cur, cur); | 951 | if (GNUNET_NO == s->bulk_lock) |
952 | distribute_bandwidth_in_network (s, net_cur, cur); | ||
953 | else | ||
954 | s->bulk_changes ++; | ||
937 | 955 | ||
938 | return cur; | 956 | return cur; |
939 | } | 957 | } |
@@ -1019,7 +1037,10 @@ GAS_proportional_address_delete (void *solver, | |||
1019 | address->active = GNUNET_NO; | 1037 | address->active = GNUNET_NO; |
1020 | if (GNUNET_SYSERR == addresse_decrement (s, net, GNUNET_NO, GNUNET_YES)) | 1038 | if (GNUNET_SYSERR == addresse_decrement (s, net, GNUNET_NO, GNUNET_YES)) |
1021 | GNUNET_break (0); | 1039 | GNUNET_break (0); |
1022 | distribute_bandwidth_in_network (s, net, NULL); | 1040 | if (GNUNET_NO == s->bulk_lock) |
1041 | distribute_bandwidth_in_network (s, net, NULL); | ||
1042 | else | ||
1043 | s->bulk_changes ++; | ||
1023 | } | 1044 | } |
1024 | LOG (GNUNET_ERROR_TYPE_DEBUG, "After deleting address now total %u and active %u addresses in network `%s'\n", | 1045 | LOG (GNUNET_ERROR_TYPE_DEBUG, "After deleting address now total %u and active %u addresses in network `%s'\n", |
1025 | net->total_addresses, | 1046 | net->total_addresses, |
@@ -1037,7 +1058,11 @@ GAS_proportional_address_delete (void *solver, | |||
1037 | void | 1058 | void |
1038 | GAS_proportional_bulk_start (void *solver) | 1059 | GAS_proportional_bulk_start (void *solver) |
1039 | { | 1060 | { |
1061 | LOG (GNUNET_ERROR_TYPE_ERROR, "Locking solver for bulk operation ...\n"); | ||
1062 | struct GAS_PROPORTIONAL_Handle *s = (struct GAS_PROPORTIONAL_Handle *) solver; | ||
1040 | 1063 | ||
1064 | GNUNET_assert (NULL != solver); | ||
1065 | s->bulk_lock ++; | ||
1041 | } | 1066 | } |
1042 | 1067 | ||
1043 | /** | 1068 | /** |
@@ -1046,7 +1071,23 @@ GAS_proportional_bulk_start (void *solver) | |||
1046 | void | 1071 | void |
1047 | GAS_proportional_bulk_stop (void *solver) | 1072 | GAS_proportional_bulk_stop (void *solver) |
1048 | { | 1073 | { |
1074 | LOG (GNUNET_ERROR_TYPE_ERROR, "Unlocking solver from bulk operation ...\n"); | ||
1075 | |||
1076 | struct GAS_PROPORTIONAL_Handle *s = (struct GAS_PROPORTIONAL_Handle *) solver; | ||
1077 | GNUNET_assert (NULL != solver); | ||
1049 | 1078 | ||
1079 | if (s->bulk_lock < 1) | ||
1080 | { | ||
1081 | GNUNET_break (0); | ||
1082 | return; | ||
1083 | } | ||
1084 | s->bulk_lock --; | ||
1085 | if ((0 == s->bulk_lock) && (s->bulk_changes)) | ||
1086 | { | ||
1087 | LOG (GNUNET_ERROR_TYPE_ERROR, "No lock pending, recalculating\n"); | ||
1088 | distribute_bandwidth_in_all_networks (s); | ||
1089 | s->bulk_changes = 0; | ||
1090 | } | ||
1050 | } | 1091 | } |
1051 | 1092 | ||
1052 | 1093 | ||
@@ -1153,7 +1194,10 @@ GAS_proportional_address_update (void *solver, | |||
1153 | /* Suggest updated address */ | 1194 | /* Suggest updated address */ |
1154 | address->active = GNUNET_YES; | 1195 | address->active = GNUNET_YES; |
1155 | addresse_increment (s, new_net, GNUNET_NO, GNUNET_YES); | 1196 | addresse_increment (s, new_net, GNUNET_NO, GNUNET_YES); |
1156 | distribute_bandwidth_in_network (solver, new_net, NULL); | 1197 | if (GNUNET_NO == s->bulk_lock) |
1198 | distribute_bandwidth_in_network (solver, new_net, NULL); | ||
1199 | else | ||
1200 | s->bulk_changes ++; | ||
1157 | } | 1201 | } |
1158 | else | 1202 | else |
1159 | { | 1203 | { |
@@ -1294,6 +1338,7 @@ GAS_proportional_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1294 | s->network_entries = GNUNET_malloc (dest_length * sizeof (struct Network)); | 1338 | s->network_entries = GNUNET_malloc (dest_length * sizeof (struct Network)); |
1295 | s->active_addresses = 0; | 1339 | s->active_addresses = 0; |
1296 | s->total_addresses = 0; | 1340 | s->total_addresses = 0; |
1341 | s->bulk_lock = GNUNET_NO; | ||
1297 | 1342 | ||
1298 | for (c = 0; c < dest_length; c++) | 1343 | for (c = 0; c < dest_length; c++) |
1299 | { | 1344 | { |
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index c446d19c7..4574383ab 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c | |||
@@ -819,7 +819,9 @@ GAS_addresses_add (struct GAS_Addresses_Handle *handle, | |||
819 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Added new address for peer `%s' session id %u, %p\n", | 819 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Added new address for peer `%s' session id %u, %p\n", |
820 | GNUNET_i2s (peer), session_id, aa); | 820 | GNUNET_i2s (peer), session_id, aa); |
821 | /* Tell solver about new address */ | 821 | /* Tell solver about new address */ |
822 | handle->s_bulk_start (handle->solver); | ||
822 | GAS_normalization_normalize_property (handle->addresses, aa, atsi, atsi_count); | 823 | GAS_normalization_normalize_property (handle->addresses, aa, atsi, atsi_count); |
824 | handle->s_bulk_stop (handle->solver); | ||
823 | handle->s_add (handle->solver, handle->addresses, aa, addr_net); | 825 | handle->s_add (handle->solver, handle->addresses, aa, addr_net); |
824 | /* Notify performance clients about new address */ | 826 | /* Notify performance clients about new address */ |
825 | GAS_performance_notify_all_clients (&aa->peer, | 827 | GAS_performance_notify_all_clients (&aa->peer, |
@@ -863,7 +865,9 @@ GAS_addresses_add (struct GAS_Addresses_Handle *handle, | |||
863 | } | 865 | } |
864 | 866 | ||
865 | /* Notify solver about update with atsi information and session */ | 867 | /* Notify solver about update with atsi information and session */ |
868 | handle->s_bulk_start (handle->solver); | ||
866 | GAS_normalization_normalize_property (handle->addresses, ea, atsi, atsi_count); | 869 | GAS_normalization_normalize_property (handle->addresses, ea, atsi, atsi_count); |
870 | handle->s_bulk_stop (handle->solver); | ||
867 | handle->s_update (handle->solver, handle->addresses, ea, session_id, ea->used, atsi_delta, atsi_delta_count); | 871 | handle->s_update (handle->solver, handle->addresses, ea, session_id, ea->used, atsi_delta, atsi_delta_count); |
868 | GNUNET_free_non_null (atsi_delta); | 872 | GNUNET_free_non_null (atsi_delta); |
869 | 873 | ||
@@ -1415,8 +1419,9 @@ GAS_addresses_change_preference (struct GAS_Addresses_Handle *handle, | |||
1415 | GNUNET_i2s (peer), client); | 1419 | GNUNET_i2s (peer), client); |
1416 | return; | 1420 | return; |
1417 | } | 1421 | } |
1418 | /* Tell normalization about change, normalization will call callback if preference changed */ | 1422 | |
1419 | handle->s_bulk_start (handle->solver); | 1423 | handle->s_bulk_start (handle->solver); |
1424 | /* Tell normalization about change, normalization will call callback if preference changed */ | ||
1420 | GAS_normalization_normalize_preference (client, peer, kind, score_abs); | 1425 | GAS_normalization_normalize_preference (client, peer, kind, score_abs); |
1421 | handle->s_bulk_stop (handle->solver); | 1426 | handle->s_bulk_stop (handle->solver); |
1422 | } | 1427 | } |