diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-10-17 14:41:13 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-10-17 14:41:13 +0000 |
commit | b7d5f4d4402789b9cc82990220cc7738ed03755f (patch) | |
tree | 3fd0ae131feba0764622f6710c9e92a776c7bb3a /src/mesh | |
parent | 3e27090743da61293c9eb5c2c031146306cfe78a (diff) | |
download | gnunet-b7d5f4d4402789b9cc82990220cc7738ed03755f.tar.gz gnunet-b7d5f4d4402789b9cc82990220cc7738ed03755f.zip |
- unify payload, fixes
Diffstat (limited to 'src/mesh')
-rw-r--r-- | src/mesh/gnunet-service-mesh_connection.c | 45 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh_tunnel.c | 2 | ||||
-rw-r--r-- | src/mesh/mesh_common.c | 8 |
3 files changed, 28 insertions, 27 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--; |
diff --git a/src/mesh/gnunet-service-mesh_tunnel.c b/src/mesh/gnunet-service-mesh_tunnel.c index e2cf7db17..6a6a43943 100644 --- a/src/mesh/gnunet-service-mesh_tunnel.c +++ b/src/mesh/gnunet-service-mesh_tunnel.c | |||
@@ -1199,7 +1199,7 @@ GMT_send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
1199 | type = ntohs (message->type); | 1199 | type = ntohs (message->type); |
1200 | switch (type) | 1200 | switch (type) |
1201 | { | 1201 | { |
1202 | case GNUNET_MESSAGE_TYPE_MESH_ENCRYPTED: | 1202 | case GNUNET_MESSAGE_TYPE_MESH_DATA: |
1203 | case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_CREATE: | 1203 | case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_CREATE: |
1204 | case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_DESTROY: | 1204 | case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_DESTROY: |
1205 | case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_ACK: | 1205 | case GNUNET_MESSAGE_TYPE_MESH_CHANNEL_ACK: |
diff --git a/src/mesh/mesh_common.c b/src/mesh/mesh_common.c index 90f2e5299..0298a4e3a 100644 --- a/src/mesh/mesh_common.c +++ b/src/mesh/mesh_common.c | |||
@@ -83,20 +83,20 @@ GNUNET_MESH_DEBUG_M2S (uint16_t m) | |||
83 | /** | 83 | /** |
84 | * Transport data in the mesh (origin->end) unicast | 84 | * Transport data in the mesh (origin->end) unicast |
85 | */ | 85 | */ |
86 | case 260: return "GNUNET_MESSAGE_TYPE_MESH_UNICAST"; | 86 | case 260: return "GNUNET_MESSAGE_TYPE_MESH_DATA"; |
87 | 87 | ||
88 | /** | 88 | /** |
89 | * Transport data back in the mesh (end->origin) | 89 | * Transport data back in the mesh (end->origin) FIXME |
90 | */ | 90 | */ |
91 | case 262: return "GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN"; | 91 | case 262: return "GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN"; |
92 | 92 | ||
93 | /** | 93 | /** |
94 | * Send origin an ACK that UNICAST arrived | 94 | * Send origin an ACK that UNICAST arrived FIXME |
95 | */ | 95 | */ |
96 | case 263: return "GNUNET_MESSAGE_TYPE_MESH_UNICAST_ACK"; | 96 | case 263: return "GNUNET_MESSAGE_TYPE_MESH_UNICAST_ACK"; |
97 | 97 | ||
98 | /** | 98 | /** |
99 | * Send origin an ACK that TO_ORIGIN arrived | 99 | * Send origin an ACK that TO_ORIGIN arrived FIXME |
100 | */ | 100 | */ |
101 | case 264: return "GNUNET_MESSAGE_TYPE_MESH_TO_ORIG_ACK"; | 101 | case 264: return "GNUNET_MESSAGE_TYPE_MESH_TO_ORIG_ACK"; |
102 | 102 | ||