Revision bdfb47bf

View differences:

src/topology.c
211 211
{
212 212
	if(t && id)
213 213
	{
214
		peerset_remove_peer(t->neighbourhood, id);
215
		peerset_remove_peer(t->swarm_bucket, id);
216
		peerset_remove_peer(t->locked_neighs, id);
214
		peerset_pop_peer(t->locked_neighs, id);
217 215
		psample_remove_peer(t->tc, id);
216
		peerset_remove_peer(t->neighbourhood, id);
217
		// peerset_remove_peer(t->swarm_bucket, id);
218 218
	}
219 219
}
220 220

  
src/transaction.c
71 71
void check_neighbor_status_list(struct service_times_element ** stl) {
72 72
	struct service_times_element *stl_iterator, *stl_aux;
73 73
	struct timeval current_time;
74
	bool something_got_removed;
75 74

  
76 75
	gettimeofday(&current_time, NULL);
77
	something_got_removed = false;
78 76
	
79 77
        dprintf("LIST: check trans_id list\n");
80 78
	
......
85 83
        
86 84
	// Start from the beginning of the list
87 85
	stl_iterator = *stl;
88
	stl_aux = *stl;
86
	stl_aux = stl_iterator->forward;
89 87
	// Iterate the list until you get the right element
90 88
	while (stl_iterator != NULL) {
91 89
		// If the element has been in the list for a period greater than the timeout, remove it
......
93 91
		if ( (current_time.tv_sec + current_time.tv_usec*1e-6 - stl_iterator->st.offer_sent_time) > TRANS_ID_MAX_LIFETIME) {
94 92
			 dprintf("LIST TIMEOUT: trans_id %d, offer_sent_time %f, accept_received_time %f\n", stl_iterator->st.trans_id, (double) ((current_time.tv_sec + current_time.tv_usec*1e-6) - stl_iterator->st.offer_sent_time  ), (double) ((current_time.tv_sec + current_time.tv_usec*1e-6) - stl_iterator->st.accept_received_time));
95 93
			 //fprintf(stderr, "LIST TIMEOUT: trans_id %d, offer_sent_time %f, accept_received_time %f\n", stl_iterator->st.trans_id, (double) ((current_time.tv_sec + current_time.tv_usec*1e-6) - stl_iterator->st.offer_sent_time  ), (double) ((current_time.tv_sec + current_time.tv_usec*1e-6) - stl_iterator->st.accept_received_time));
96
		_transaction_remove(stl, stl_iterator);
97
			something_got_removed = true;
98 94
#ifndef MONL
99 95
			timeout_reception_measure(stl_iterator->st.id);
100 96
#endif
97
		_transaction_remove(stl, stl_iterator);
101 98

  
102
			stl_aux = stl_iterator->forward;
103 99
			// Free the memory
104
			}
105
		if (something_got_removed) {
106
			stl_iterator = stl_aux;
107
			something_got_removed = false;
108
			}
109
		else
110
			stl_iterator = stl_iterator->forward;
111 100
		}
101
		stl_iterator = stl_aux;
102
		if (stl_iterator)
103
			stl_aux = stl_aux->forward;
104
	}
112 105
	return;
113 106
}
114 107

  

Also available in: Unified diff