aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-12-25 16:14:57 +0100
committerChristian Grothoff <christian@grothoff.org>2019-12-25 16:14:57 +0100
commit64d6551e3c6608afcd5dfd5ebdf6ad9bbac0b9f5 (patch)
tree54b7297c6a6c7ffe5b7c9fcce09c520037339ee5 /src/transport
parentd1dea55be8b970f9ecfec06695d03b0ccfcb9c2d (diff)
downloadgnunet-64d6551e3c6608afcd5dfd5ebdf6ad9bbac0b9f5.tar.gz
gnunet-64d6551e3c6608afcd5dfd5ebdf6ad9bbac0b9f5.zip
replace expensive function call with macro for trivial calculation
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/transport_api2_communication.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/transport/transport_api2_communication.c b/src/transport/transport_api2_communication.c
index de5b42c3f..9df9424da 100644
--- a/src/transport/transport_api2_communication.c
+++ b/src/transport/transport_api2_communication.c
@@ -872,7 +872,7 @@ GNUNET_TRANSPORT_communicator_receive (
872 { 872 {
873 GNUNET_log ( 873 GNUNET_log (
874 GNUNET_ERROR_TYPE_WARNING, 874 GNUNET_ERROR_TYPE_WARNING,
875 "Dropping message: transprot is too slow, queue length %llu exceeded\n", 875 "Dropping message: transport is too slow, queue length %llu exceeded\n",
876 ch->max_queue_length); 876 ch->max_queue_length);
877 return GNUNET_NO; 877 return GNUNET_NO;
878 } 878 }
@@ -888,6 +888,10 @@ GNUNET_TRANSPORT_communicator_receive (
888 im->expected_address_validity = 888 im->expected_address_validity =
889 GNUNET_TIME_relative_hton (expected_addr_validity); 889 GNUNET_TIME_relative_hton (expected_addr_validity);
890 im->sender = *sender; 890 im->sender = *sender;
891 // FIXME: this is expensive, would be better if we would
892 // re-design the API to allow us to create the envelope first,
893 // and then have the application fill in the body so we do
894 // not have to memcpy()
891 memcpy (&im[1], msg, msize); 895 memcpy (&im[1], msg, msize);
892 if (NULL != cb) 896 if (NULL != cb)
893 { 897 {