summaryrefslogtreecommitdiff
path: root/src/ats/plugin_ats_ril.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-02-06 14:25:50 +0000
committerChristian Grothoff <christian@grothoff.org>2015-02-06 14:25:50 +0000
commit936db3ddce41de5f16e931d1a995c0be0135ac73 (patch)
tree3fd5cdf164b49a0fe5a567c60d982fc3d23257cf /src/ats/plugin_ats_ril.c
parent34206679446e053b674a4fbdaabdd8c463ad70e2 (diff)
downloadgnunet-936db3ddce41de5f16e931d1a995c0be0135ac73.tar.gz
gnunet-936db3ddce41de5f16e931d1a995c0be0135ac73.zip
test ATS tests to pass again
Diffstat (limited to 'src/ats/plugin_ats_ril.c')
-rw-r--r--src/ats/plugin_ats_ril.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/ats/plugin_ats_ril.c b/src/ats/plugin_ats_ril.c
index 6be8ef4f6..3ab2335f8 100644
--- a/src/ats/plugin_ats_ril.c
+++ b/src/ats/plugin_ats_ril.c
@@ -807,7 +807,7 @@ ril_get_max_bw (struct RIL_Scope *net)
807 * @param new_address the address which is to be used 807 * @param new_address the address which is to be used
808 * @param new_bw_in the new amount of inbound bandwidth set for this address 808 * @param new_bw_in the new amount of inbound bandwidth set for this address
809 * @param new_bw_out the new amount of outbound bandwidth set for this address 809 * @param new_bw_out the new amount of outbound bandwidth set for this address
810 * @param silent disables invocation of the bw_changed callback, if GNUNET_YES 810 * @param silent disables invocation of the bw_changed callback, if #GNUNET_YES
811 */ 811 */
812static void 812static void
813envi_set_active_suggestion (struct GAS_RIL_Handle *solver, 813envi_set_active_suggestion (struct GAS_RIL_Handle *solver,
@@ -1930,7 +1930,7 @@ ril_step (struct GAS_RIL_Handle *solver)
1930 1930
1931 ril_networks_update_state (solver); 1931 ril_networks_update_state (solver);
1932 1932
1933 solver->step_count += 1; 1933 solver->step_count++;
1934 ril_step_schedule_next (solver); 1934 ril_step_schedule_next (solver);
1935 1935
1936 ril_inform (solver, GAS_OP_SOLVE_STOP, GAS_STAT_SUCCESS); 1936 ril_inform (solver, GAS_OP_SOLVE_STOP, GAS_STAT_SUCCESS);
@@ -2265,7 +2265,6 @@ GAS_ril_address_delete (void *solver,
2265 struct GAS_RIL_Handle *s = solver; 2265 struct GAS_RIL_Handle *s = solver;
2266 struct RIL_Peer_Agent *agent; 2266 struct RIL_Peer_Agent *agent;
2267 struct RIL_Address_Wrapped *address_wrapped; 2267 struct RIL_Address_Wrapped *address_wrapped;
2268 int address_was_used;
2269 int address_index; 2268 int address_index;
2270 unsigned int m_new; 2269 unsigned int m_new;
2271 unsigned int n_new; 2270 unsigned int n_new;
@@ -2305,17 +2304,6 @@ GAS_ril_address_delete (void *solver,
2305 agent->addresses_tail, 2304 agent->addresses_tail,
2306 address_wrapped); 2305 address_wrapped);
2307 GNUNET_free (address_wrapped); 2306 GNUNET_free (address_wrapped);
2308 address_was_used = GNUNET_NO;
2309 if (agent->suggestion_address == address)
2310 {
2311 agent->suggestion_issue = GNUNET_NO;
2312 agent->suggestion_address = NULL;
2313 }
2314 if (agent->address_inuse == address)
2315 {
2316 address_was_used = GNUNET_YES;
2317 }
2318
2319 2307
2320 //decrease W 2308 //decrease W
2321 m_new = agent->m - ((s->parameters.rbf_divisor+1) * (s->parameters.rbf_divisor+1)); 2309 m_new = agent->m - ((s->parameters.rbf_divisor+1) * (s->parameters.rbf_divisor+1));
@@ -2352,7 +2340,7 @@ GAS_ril_address_delete (void *solver,
2352 agent->m = m_new; 2340 agent->m = m_new;
2353 agent->n = n_new; 2341 agent->n = n_new;
2354 2342
2355 if (address_was_used) 2343 if (agent->address_inuse == address)
2356 { 2344 {
2357 if (NULL != agent->addresses_head) //if peer has an address left, use it 2345 if (NULL != agent->addresses_head) //if peer has an address left, use it
2358 { 2346 {
@@ -2372,10 +2360,16 @@ GAS_ril_address_delete (void *solver,
2372 envi_set_active_suggestion (s, agent, NULL, 0, 0, GNUNET_NO); 2360 envi_set_active_suggestion (s, agent, NULL, 0, 0, GNUNET_NO);
2373 } 2361 }
2374 } 2362 }
2375
2376 ril_step (solver); 2363 ril_step (solver);
2364 if (agent->suggestion_address == address)
2365 {
2366 agent->suggestion_issue = GNUNET_NO;
2367 agent->suggestion_address = NULL;
2368 }
2369 GNUNET_assert (agent->address_inuse != address);
2377} 2370}
2378 2371
2372
2379/** 2373/**
2380 * Update the properties of an address in the solver 2374 * Update the properties of an address in the solver
2381 * 2375 *