aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/gnunet-service-mesh_connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesh/gnunet-service-mesh_connection.c')
-rw-r--r--src/mesh/gnunet-service-mesh_connection.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c
index 3197255ef..8a83adc51 100644
--- a/src/mesh/gnunet-service-mesh_connection.c
+++ b/src/mesh/gnunet-service-mesh_connection.c
@@ -354,7 +354,7 @@ connection_change_state (struct MeshConnection* c,
354/** 354/**
355 * Callback called when a queued message is sent. 355 * Callback called when a queued message is sent.
356 * 356 *
357 * Calculates the average time 357 * Calculates the average time and connection packet tracking.
358 * 358 *
359 * @param cls Closure. 359 * @param cls Closure.
360 * @param c Connection this message was on. 360 * @param c Connection this message was on.
@@ -373,8 +373,29 @@ message_sent (void *cls,
373 struct MeshFlowControl *fc; 373 struct MeshFlowControl *fc;
374 double usecsperbyte; 374 double usecsperbyte;
375 375
376 fc = fwd ? &c->fwd_fc : &c->bck_fc;
377 LOG (GNUNET_ERROR_TYPE_DEBUG, "! Q_N- %p %u\n", fc, fc->queue_n);
378 fc->queue_n--;
379 c->pending_messages--;
380 if (GNUNET_YES == c->destroy && 0 == c->pending_messages)
381 {
382 LOG (GNUNET_ERROR_TYPE_DEBUG, "! destroying connection!\n");
383 GMC_destroy (c);
384 }
385 /* Send ACK if needed, after accounting for sent ID in fc->queue_n */
386 switch (type)
387 {
388 case GNUNET_MESSAGE_TYPE_MESH_ENCRYPTED:
389 fc->last_pid_sent++;
390 LOG (GNUNET_ERROR_TYPE_DEBUG, "! accounting pid %u\n", fc->last_pid_sent);
391// send_ack (c, ch, fwd);
392 break;
393 default:
394 break;
395 }
396
376 if (NULL == c->perf) 397 if (NULL == c->perf)
377 return; /* Only endpoints are interested in this. */ 398 return; /* Only endpoints are interested in timing. */
378 399
379 LOG (GNUNET_ERROR_TYPE_DEBUG, "! message sent!\n"); 400 LOG (GNUNET_ERROR_TYPE_DEBUG, "! message sent!\n");
380 p = c->perf; 401 p = c->perf;
@@ -397,26 +418,6 @@ message_sent (void *cls,
397 } 418 }
398 p->idx = (p->idx + 1) % AVG_MSGS; 419 p->idx = (p->idx + 1) % AVG_MSGS;
399 420
400 fc = fwd ? &c->fwd_fc : &c->bck_fc;
401 LOG (GNUNET_ERROR_TYPE_DEBUG, "! Q_N- %p %u\n", fc, fc->queue_n);
402 fc->queue_n--;
403 c->pending_messages--;
404 if (GNUNET_YES == c->destroy && 0 == c->pending_messages)
405 {
406 LOG (GNUNET_ERROR_TYPE_DEBUG, "! destroying connection!\n");
407 GMC_destroy (c);
408 }
409 /* Send ACK if needed, after accounting for sent ID in fc->queue_n */
410 switch (type)
411 {
412 case GNUNET_MESSAGE_TYPE_MESH_ENCRYPTED:
413 fc->last_pid_sent++;
414 LOG (GNUNET_ERROR_TYPE_DEBUG, "! accounting pid %u\n", fc->last_pid_sent);
415// send_ack (c, ch, fwd);
416 break;
417 default:
418 break;
419 }
420// if (NULL != c->t) 421// if (NULL != c->t)
421// { 422// {
422// c->t->pending_messages--; 423// c->t->pending_messages--;