aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-11-21 13:08:42 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-11-21 13:08:42 +0000
commitfee335752fd00c1d283718fb790db8ae39ed1b5f (patch)
treed9c658f233980ff3dbadf570834bc7d547b37f38 /src/transport
parent6c9cc21d06bc8bb97d0a0b7afb4043d74098d8d5 (diff)
downloadgnunet-fee335752fd00c1d283718fb790db8ae39ed1b5f.tar.gz
gnunet-fee335752fd00c1d283718fb790db8ae39ed1b5f.zip
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 3a5888734..e7fa7baf0 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -227,6 +227,7 @@ enum Address_State
227 FRESH, 227 FRESH,
228}; 228};
229 229
230
230/** 231/**
231 * Entry in neighbours. 232 * Entry in neighbours.
232 */ 233 */
@@ -246,11 +247,6 @@ struct NeighbourMapEntry
246 struct MessageQueue *messages_tail; 247 struct MessageQueue *messages_tail;
247 248
248 /** 249 /**
249 * Performance data for the peer.
250 */
251 //struct GNUNET_ATS_Information *ats;
252
253 /**
254 * Are we currently trying to send a message? If so, which one? 250 * Are we currently trying to send a message? If so, which one?
255 */ 251 */
256 struct MessageQueue *is_active; 252 struct MessageQueue *is_active;
@@ -329,6 +325,7 @@ struct NeighbourMapEntry
329 */ 325 */
330 GNUNET_SCHEDULER_TaskIdentifier state_reset; 326 GNUNET_SCHEDULER_TaskIdentifier state_reset;
331 327
328
332 /** 329 /**
333 * How often has the other peer (recently) violated the inbound 330 * How often has the other peer (recently) violated the inbound
334 * traffic limit? Incremented by 10 per violation, decremented by 1 331 * traffic limit? Incremented by 10 per violation, decremented by 1
@@ -455,6 +452,8 @@ static void
455reset_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 452reset_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
456{ 453{
457 struct NeighbourMapEntry *n = cls; 454 struct NeighbourMapEntry *n = cls;
455 if (n == NULL)
456 return;
458 457
459 n->state_reset = GNUNET_SCHEDULER_NO_TASK; 458 n->state_reset = GNUNET_SCHEDULER_NO_TASK;
460 if (n->state == S_CONNECTED) 459 if (n->state == S_CONNECTED)
@@ -471,8 +470,11 @@ reset_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
471 n->state = S_NOT_CONNECTED; 470 n->state = S_NOT_CONNECTED;
472 471
473 /* destroying address */ 472 /* destroying address */
474 GNUNET_assert (strlen(n->address->transport_name) > 0); 473 if (n->address != NULL)
475 GNUNET_ATS_address_destroyed (GST_ats, n->address, n->session); 474 {
475 GNUNET_assert (strlen(n->address->transport_name) > 0);
476 GNUNET_ATS_address_destroyed (GST_ats, n->address, n->session);
477 }
476 478
477 /* request new address */ 479 /* request new address */
478 if (n->ats_suggest != GNUNET_SCHEDULER_NO_TASK) 480 if (n->ats_suggest != GNUNET_SCHEDULER_NO_TASK)