gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r26022 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r26022 - gnunet/src/transport
Date: Tue, 5 Feb 2013 16:50:33 +0100

Author: wachs
Date: 2013-02-05 16:50:33 +0100 (Tue, 05 Feb 2013)
New Revision: 26022

Modified:
   gnunet/src/transport/gnunet-service-transport_manipulation.c
   gnunet/src/transport/test_transport_api_manipulation_send_tcp.c
Log:
fixes


Modified: gnunet/src/transport/gnunet-service-transport_manipulation.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_manipulation.c        
2013-02-05 15:35:32 UTC (rev 26021)
+++ gnunet/src/transport/gnunet-service-transport_manipulation.c        
2013-02-05 15:50:33 UTC (rev 26022)
@@ -263,9 +263,7 @@
                                        /* 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 @@
                                                        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,

Modified: gnunet/src/transport/test_transport_api_manipulation_send_tcp.c
===================================================================
--- gnunet/src/transport/test_transport_api_manipulation_send_tcp.c     
2013-02-05 15:35:32 UTC (rev 26021)
+++ gnunet/src/transport/test_transport_api_manipulation_send_tcp.c     
2013-02-05 15:50:33 UTC (rev 26022)
@@ -176,7 +176,7 @@
 
   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 @@
   {
        /* 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 @@
 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,11 +305,11 @@
   {
                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, 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);
 
-         GNUNET_TRANSPORT_set_traffic_metric (p2->th, &p1->id, TM_SEND, ats, 
2);
-
                start_delayed = GNUNET_TIME_absolute_get();
   }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]