diff options
author | wachs <wachs@140774ce-b5e7-0310-ab8b-a85725594a96> | 2013-02-05 15:50:33 +0000 |
---|---|---|
committer | wachs <wachs@140774ce-b5e7-0310-ab8b-a85725594a96> | 2013-02-05 15:50:33 +0000 |
commit | 8bbb476e9d33e6b51891a8aa21bfe722afc50786 (patch) | |
tree | fcbd95e4c2f6e229e3dafa16d4a846b2dd8b4d9d | |
parent | 2a5db3c16e7aef2c46c86bef672b2c76c91e6e52 (diff) |
fixes
git-svn-id: https://gnunet.org/svn/gnunet@26022 140774ce-b5e7-0310-ab8b-a85725594a96
-rw-r--r-- | src/transport/gnunet-service-transport_manipulation.c | 5 | ||||
-rw-r--r-- | src/transport/test_transport_api_manipulation_send_tcp.c | 14 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/transport/gnunet-service-transport_manipulation.c b/src/transport/gnunet-service-transport_manipulation.c index 74f903c98c..c00d2b64e8 100644 --- a/src/transport/gnunet-service-transport_manipulation.c +++ b/src/transport/gnunet-service-transport_manipulation.c @@ -263,9 +263,7 @@ GST_manipulation_recv (void *cls, const struct GNUNET_PeerIdentity *peer, /* Set distance */ if ((ntohl(ats[d].type) == GNUNET_ATS_QUALITY_NET_DISTANCE) && (UINT32_MAX != tmp->metrics[TM_RECEIVE][DISTANCE])) - { ats_new[d].value = htonl(tmp->metrics[TM_RECEIVE][DISTANCE]); - } } /* Manipulate receive delay */ if (UINT32_MAX != tmp->metrics[TM_RECEIVE][DELAY]) @@ -283,6 +281,9 @@ GST_manipulation_recv (void *cls, const struct GNUNET_PeerIdentity *peer, return m_delay; } } + else + return GST_receive_callback (cls, peer, message, &ats_new[0], ats_count, + session, sender_address, sender_address_len); } return GST_receive_callback (cls, peer, message, ats, ats_count, diff --git a/src/transport/test_transport_api_manipulation_send_tcp.c b/src/transport/test_transport_api_manipulation_send_tcp.c index cdef9921b0..6e8489e6e3 100644 --- a/src/transport/test_transport_api_manipulation_send_tcp.c +++ b/src/transport/test_transport_api_manipulation_send_tcp.c @@ -176,7 +176,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, char *ps = GNUNET_strdup (GNUNET_i2s (&p->id)); - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer %u (`%4s') received message of type %d and size %u size from peer %u (`%4s')!\n", p->no, ps, ntohs (message->type), ntohs (message->size), t->no, GNUNET_i2s (&t->id)); @@ -210,7 +210,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, { /* Received manipulated message */ dur_delayed = GNUNET_TIME_absolute_get_duration(start_delayed); - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received delayed message %u after %llu\n", messages_recv, (long long unsigned int) dur_delayed.rel_value); @@ -284,7 +284,7 @@ notify_ready (void *cls, size_t size, void *buf) static void sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - struct GNUNET_ATS_Information ats[2]; + struct GNUNET_ATS_Information ats[1]; send_task = GNUNET_SCHEDULER_NO_TASK; if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) @@ -305,10 +305,10 @@ sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { ats[0].type = htonl (GNUNET_ATS_QUALITY_NET_DELAY); ats[0].value = htonl (1000); - ats[1].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE); - ats[1].value = htonl (10); - - GNUNET_TRANSPORT_set_traffic_metric (p2->th, &p1->id, TM_SEND, ats, 2); + GNUNET_TRANSPORT_set_traffic_metric (p2->th, &p1->id, TM_SEND, ats, 1); + ats[0].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE); + ats[0].value = htonl (10); + GNUNET_TRANSPORT_set_traffic_metric (p1->th, &p2->id, TM_BOTH, ats, 1); start_delayed = GNUNET_TIME_absolute_get(); } |