diff options
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/gnunet-service-transport_clients.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/transport/gnunet-service-transport_clients.c b/src/transport/gnunet-service-transport_clients.c index 3533b5f6d..12a5dc557 100644 --- a/src/transport/gnunet-service-transport_clients.c +++ b/src/transport/gnunet-service-transport_clients.c | |||
@@ -688,6 +688,11 @@ struct SendTransmitContinuationContext | |||
688 | * Peer that was the target. | 688 | * Peer that was the target. |
689 | */ | 689 | */ |
690 | struct GNUNET_PeerIdentity target; | 690 | struct GNUNET_PeerIdentity target; |
691 | |||
692 | /** | ||
693 | * At what time did we receive the message? | ||
694 | */ | ||
695 | struct GNUNET_TIME_Absolute send_time; | ||
691 | }; | 696 | }; |
692 | 697 | ||
693 | 698 | ||
@@ -708,6 +713,27 @@ handle_send_transmit_continuation (void *cls, | |||
708 | { | 713 | { |
709 | struct SendTransmitContinuationContext *stcc = cls; | 714 | struct SendTransmitContinuationContext *stcc = cls; |
710 | struct SendOkMessage send_ok_msg; | 715 | struct SendOkMessage send_ok_msg; |
716 | struct GNUNET_TIME_Relative delay; | ||
717 | |||
718 | delay = GNUNET_TIME_absolute_get_duration (stcc->send_time); | ||
719 | if (delay.rel_value_us > GNUNET_CONSTANTS_LATENCY_WARN.rel_value_us) | ||
720 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
721 | "It took us %s to send %u/%u bytes to %s (%d)\n", | ||
722 | GNUNET_STRINGS_relative_time_to_string (delay, | ||
723 | GNUNET_YES), | ||
724 | (unsigned int) bytes_payload, | ||
725 | (unsigned int) bytes_on_wire, | ||
726 | GNUNET_i2s (&stcc->target), | ||
727 | success); | ||
728 | else | ||
729 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
730 | "It took us %s to send %u/%u bytes to %s (%d)\n", | ||
731 | GNUNET_STRINGS_relative_time_to_string (delay, | ||
732 | GNUNET_YES), | ||
733 | (unsigned int) bytes_payload, | ||
734 | (unsigned int) bytes_on_wire, | ||
735 | GNUNET_i2s (&stcc->target), | ||
736 | success); | ||
711 | 737 | ||
712 | if (GST_neighbours_test_connected (&stcc->target)) | 738 | if (GST_neighbours_test_connected (&stcc->target)) |
713 | { | 739 | { |
@@ -800,6 +826,7 @@ clients_handle_send (void *cls, | |||
800 | stcc = GNUNET_new (struct SendTransmitContinuationContext); | 826 | stcc = GNUNET_new (struct SendTransmitContinuationContext); |
801 | stcc->target = obm->peer; | 827 | stcc->target = obm->peer; |
802 | stcc->client = client; | 828 | stcc->client = client; |
829 | stcc->send_time = GNUNET_TIME_absolute_get (); | ||
803 | GNUNET_SERVER_client_keep (client); | 830 | GNUNET_SERVER_client_keep (client); |
804 | GST_manipulation_send (&obm->peer, | 831 | GST_manipulation_send (&obm->peer, |
805 | obmm, | 832 | obmm, |