diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-12-01 19:08:28 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-12-01 19:08:28 +0000 |
commit | c9d39f9f18b5db46d38b74bb1a3c5d0d45a53af7 (patch) | |
tree | a7d39157e069997e0d8e087f4c0255bf428d77f5 /src/transport/transport_api.c | |
parent | d4be8ac1581999d563cdefafc555cc0cb1dbf272 (diff) | |
download | gnunet-c9d39f9f18b5db46d38b74bb1a3c5d0d45a53af7.tar.gz gnunet-c9d39f9f18b5db46d38b74bb1a3c5d0d45a53af7.zip |
minor style fixes
Diffstat (limited to 'src/transport/transport_api.c')
-rw-r--r-- | src/transport/transport_api.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index 0ab92659b..4e62660fd 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c | |||
@@ -456,6 +456,7 @@ try_schedule_transmission (void *cls, | |||
456 | struct GNUNET_TIME_Relative duration; | 456 | struct GNUNET_TIME_Relative duration; |
457 | GNUNET_CONNECTION_TransmitReadyNotify notify; | 457 | GNUNET_CONNECTION_TransmitReadyNotify notify; |
458 | struct GNUNET_TRANSPORT_TransmitHandle *th; | 458 | struct GNUNET_TRANSPORT_TransmitHandle *th; |
459 | struct GNUNET_TIME_Absolute duration_abs; | ||
459 | 460 | ||
460 | if (n->transmit_stage != TS_QUEUED) | 461 | if (n->transmit_stage != TS_QUEUED) |
461 | return GNUNET_YES; /* not eligible, keep iterating */ | 462 | return GNUNET_YES; /* not eligible, keep iterating */ |
@@ -467,7 +468,7 @@ try_schedule_transmission (void *cls, | |||
467 | /* check outgoing quota */ | 468 | /* check outgoing quota */ |
468 | duration = GNUNET_BANDWIDTH_tracker_get_delay (&n->out_tracker, | 469 | duration = GNUNET_BANDWIDTH_tracker_get_delay (&n->out_tracker, |
469 | th->notify_size - sizeof (struct OutboundMessage)); | 470 | th->notify_size - sizeof (struct OutboundMessage)); |
470 | struct GNUNET_TIME_Absolute duration_abs = GNUNET_TIME_relative_to_absolute (duration); | 471 | duration_abs = GNUNET_TIME_relative_to_absolute (duration); |
471 | if (th->timeout.abs_value < duration_abs.abs_value) | 472 | if (th->timeout.abs_value < duration_abs.abs_value) |
472 | { | 473 | { |
473 | /* signal timeout! */ | 474 | /* signal timeout! */ |
@@ -498,7 +499,7 @@ try_schedule_transmission (void *cls, | |||
498 | (unsigned int) n->out_tracker.available_bytes_per_s__, | 499 | (unsigned int) n->out_tracker.available_bytes_per_s__, |
499 | (unsigned int) th->notify_size - sizeof (struct OutboundMessage), | 500 | (unsigned int) th->notify_size - sizeof (struct OutboundMessage), |
500 | GNUNET_i2s (&n->id), | 501 | GNUNET_i2s (&n->id), |
501 | duration.rel_value); | 502 | (unsigned long long) duration.rel_value); |
502 | #endif | 503 | #endif |
503 | try_transmit_ctx->retry_time = GNUNET_TIME_relative_min (try_transmit_ctx->retry_time, | 504 | try_transmit_ctx->retry_time = GNUNET_TIME_relative_min (try_transmit_ctx->retry_time, |
504 | duration); | 505 | duration); |
@@ -517,6 +518,7 @@ try_schedule_transmission (void *cls, | |||
517 | return GNUNET_YES; | 518 | return GNUNET_YES; |
518 | } | 519 | } |
519 | 520 | ||
521 | |||
520 | /** | 522 | /** |
521 | * Figure out which transmission to a peer can be done right now. | 523 | * Figure out which transmission to a peer can be done right now. |
522 | * If none can, schedule a task to call 'schedule_transmission' | 524 | * If none can, schedule a task to call 'schedule_transmission' |
@@ -530,7 +532,6 @@ try_schedule_transmission (void *cls, | |||
530 | static struct GNUNET_TRANSPORT_TransmitHandle * | 532 | static struct GNUNET_TRANSPORT_TransmitHandle * |
531 | schedule_peer_transmission (struct GNUNET_TRANSPORT_Handle *h) | 533 | schedule_peer_transmission (struct GNUNET_TRANSPORT_Handle *h) |
532 | { | 534 | { |
533 | |||
534 | struct TryTransmitContext try_transmit_ctx; | 535 | struct TryTransmitContext try_transmit_ctx; |
535 | 536 | ||
536 | if (h->quota_task != GNUNET_SCHEDULER_NO_TASK) | 537 | if (h->quota_task != GNUNET_SCHEDULER_NO_TASK) |
@@ -540,8 +541,9 @@ schedule_peer_transmission (struct GNUNET_TRANSPORT_Handle *h) | |||
540 | } | 541 | } |
541 | memset(&try_transmit_ctx, 0, sizeof(struct TryTransmitContext)); | 542 | memset(&try_transmit_ctx, 0, sizeof(struct TryTransmitContext)); |
542 | try_transmit_ctx.retry_time = GNUNET_TIME_UNIT_FOREVER_REL; | 543 | try_transmit_ctx.retry_time = GNUNET_TIME_UNIT_FOREVER_REL; |
543 | GNUNET_CONTAINER_multihashmap_iterate(h->neighbours, &try_schedule_transmission, &try_transmit_ctx); | 544 | GNUNET_CONTAINER_multihashmap_iterate(h->neighbours, |
544 | 545 | &try_schedule_transmission, | |
546 | &try_transmit_ctx); | ||
545 | if (try_transmit_ctx.ret == NULL) | 547 | if (try_transmit_ctx.ret == NULL) |
546 | h->quota_task = GNUNET_SCHEDULER_add_delayed (try_transmit_ctx.retry_time, | 548 | h->quota_task = GNUNET_SCHEDULER_add_delayed (try_transmit_ctx.retry_time, |
547 | "a_transmit_ready, | 549 | "a_transmit_ready, |