aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-09-13 08:35:03 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-09-13 08:35:03 +0000
commit95d42fdcb47eedcf2747614a22dacd676bc7faae (patch)
tree2b7e7302846503021a61e5315724946c0a4d7cd0
parentf85132b0f28334dd463a17a6a8baf7230274c66d (diff)
downloadgnunet-95d42fdcb47eedcf2747614a22dacd676bc7faae.tar.gz
gnunet-95d42fdcb47eedcf2747614a22dacd676bc7faae.zip
fixes: resolve on canceling address request
-rw-r--r--src/ats/gnunet-service-ats-solver_mlp.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/ats/gnunet-service-ats-solver_mlp.c b/src/ats/gnunet-service-ats-solver_mlp.c
index 6154acf7b..77535e6ac 100644
--- a/src/ats/gnunet-service-ats-solver_mlp.c
+++ b/src/ats/gnunet-service-ats-solver_mlp.c
@@ -1047,10 +1047,7 @@ GAS_mlp_solve_problem (void *solver)
1047 } 1047 }
1048 1048
1049 if (0 == GNUNET_CONTAINER_multihashmap_size(mlp->requested_peers)) 1049 if (0 == GNUNET_CONTAINER_multihashmap_size(mlp->requested_peers))
1050 { 1050 return GNUNET_OK; /* No pending requests */
1051 GNUNET_break (0);
1052 return GNUNET_OK;
1053 }
1054 if (0 == GNUNET_CONTAINER_multihashmap_size(mlp->addresses)) 1051 if (0 == GNUNET_CONTAINER_multihashmap_size(mlp->addresses))
1055 return GNUNET_OK; /* No addresses available */ 1052 return GNUNET_OK; /* No addresses available */
1056 1053
@@ -1424,6 +1421,7 @@ GAS_mlp_address_delete (void *solver,
1424 GNUNET_free (mlpi); 1421 GNUNET_free (mlpi);
1425 address->solver_information = NULL; 1422 address->solver_information = NULL;
1426 } 1423 }
1424 address->active = GNUNET_NO;
1427 1425
1428 /* Is this peer included in the problem? */ 1426 /* Is this peer included in the problem? */
1429 if (NULL == (p = GNUNET_CONTAINER_multihashmap_get (mlp->requested_peers, &address->peer.hashPubKey))) 1427 if (NULL == (p = GNUNET_CONTAINER_multihashmap_get (mlp->requested_peers, &address->peer.hashPubKey)))
@@ -1440,7 +1438,9 @@ GAS_mlp_address_delete (void *solver,
1440 /* Problem size changed: new address for peer with pending request */ 1438 /* Problem size changed: new address for peer with pending request */
1441 mlp->mlp_prob_changed = GNUNET_YES; 1439 mlp->mlp_prob_changed = GNUNET_YES;
1442 if (GNUNET_YES == mlp->mlp_auto_solve) 1440 if (GNUNET_YES == mlp->mlp_auto_solve)
1441 {
1443 GAS_mlp_solve_problem (solver); 1442 GAS_mlp_solve_problem (solver);
1443 }
1444 return; 1444 return;
1445} 1445}
1446 1446
@@ -1602,11 +1602,16 @@ GAS_mlp_stop_get_preferred_address (void *solver,
1602 1602
1603 GNUNET_assert (NULL != solver); 1603 GNUNET_assert (NULL != solver);
1604 GNUNET_assert (NULL != peer); 1604 GNUNET_assert (NULL != peer);
1605
1606 if (NULL != (p = GNUNET_CONTAINER_multihashmap_get (mlp->requested_peers, &peer->hashPubKey))) 1605 if (NULL != (p = GNUNET_CONTAINER_multihashmap_get (mlp->requested_peers, &peer->hashPubKey)))
1607 { 1606 {
1608 GNUNET_CONTAINER_multihashmap_remove (mlp->requested_peers, &peer->hashPubKey, p); 1607 GNUNET_CONTAINER_multihashmap_remove (mlp->requested_peers, &peer->hashPubKey, p);
1609 GNUNET_free (p); 1608 GNUNET_free (p);
1609
1610 mlp->mlp_prob_changed = GNUNET_YES;
1611 if (GNUNET_YES == mlp->mlp_auto_solve)
1612 {
1613 GAS_mlp_solve_problem (solver);
1614 }
1610 } 1615 }
1611} 1616}
1612 1617