aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_manipulation.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-01-13 16:59:57 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-01-13 16:59:57 +0000
commit1257490cb630ade315a196a724d0233e662afb2c (patch)
tree0d9c01593a1aa73d8f6490127b640d67da69b54c /src/transport/gnunet-service-transport_manipulation.c
parent35d79cb1941c9f9607195b8760d8a14d836e6397 (diff)
downloadgnunet-1257490cb630ade315a196a724d0233e662afb2c.tar.gz
gnunet-1257490cb630ade315a196a724d0233e662afb2c.zip
implementing 0003268 to inbound information in HELLO addresses
All transport plugin functions are modified to use HELLO addresses instead of peer,address,address_length All plugins are modified to use HELLO addresses internally This commit can break transport functionality: core tests on my system still pass, but transport tests may still fail, errors messages may occurs or crashs Will be fixed asap
Diffstat (limited to 'src/transport/gnunet-service-transport_manipulation.c')
-rw-r--r--src/transport/gnunet-service-transport_manipulation.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/transport/gnunet-service-transport_manipulation.c b/src/transport/gnunet-service-transport_manipulation.c
index 4521047c9..06171d306 100644
--- a/src/transport/gnunet-service-transport_manipulation.c
+++ b/src/transport/gnunet-service-transport_manipulation.c
@@ -529,9 +529,10 @@ GST_manipulation_manipulate_metrics(const struct GNUNET_PeerIdentity *peer,
529 * @return manipulated delay for next receive 529 * @return manipulated delay for next receive
530 */ 530 */
531struct GNUNET_TIME_Relative 531struct GNUNET_TIME_Relative
532GST_manipulation_recv(void *cls, const struct GNUNET_PeerIdentity *peer, 532GST_manipulation_recv (void *cls,
533 const struct GNUNET_MessageHeader *message, struct Session *session, 533 const struct GNUNET_HELLO_Address *address,
534 const char *sender_address, uint16_t sender_address_len) 534 struct Session *session,
535 const struct GNUNET_MessageHeader *message)
535{ 536{
536 struct TM_Peer *tmp; 537 struct TM_Peer *tmp;
537 uint32_t p_recv_delay; 538 uint32_t p_recv_delay;
@@ -547,7 +548,7 @@ GST_manipulation_recv(void *cls, const struct GNUNET_PeerIdentity *peer,
547 else 548 else
548 m_delay = GNUNET_TIME_UNIT_ZERO; 549 m_delay = GNUNET_TIME_UNIT_ZERO;
549 550
550 if (NULL != (tmp = GNUNET_CONTAINER_multipeermap_get(man_handle.peers, peer))) 551 if (NULL != (tmp = GNUNET_CONTAINER_multipeermap_get(man_handle.peers, &address->peer)))
551 { 552 {
552 /* Manipulate receive delay */ 553 /* Manipulate receive delay */
553 p_recv_delay = find_metric(tmp, GNUNET_ATS_QUALITY_NET_DELAY, TM_RECEIVE); 554 p_recv_delay = find_metric(tmp, GNUNET_ATS_QUALITY_NET_DELAY, TM_RECEIVE);
@@ -555,14 +556,15 @@ GST_manipulation_recv(void *cls, const struct GNUNET_PeerIdentity *peer,
555 m_delay.rel_value_us = p_recv_delay; /* Peer specific delay */ 556 m_delay.rel_value_us = p_recv_delay; /* Peer specific delay */
556 } 557 }
557 558
558 quota_delay = GST_receive_callback(cls, peer, message, session, 559 quota_delay = GST_receive_callback(cls, address, session, message);
559 sender_address, sender_address_len);
560 560
561 if (quota_delay.rel_value_us > m_delay.rel_value_us) 561 if (quota_delay.rel_value_us > m_delay.rel_value_us)
562 m_delay = quota_delay; 562 m_delay = quota_delay;
563 563
564 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 564 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
565 "Delaying next receive for peer `%s' for %s\n", GNUNET_i2s (peer), GNUNET_STRINGS_relative_time_to_string (m_delay, GNUNET_YES)); 565 "Delaying next receive for peer `%s' for %s\n",
566 GNUNET_i2s (&address->peer),
567 GNUNET_STRINGS_relative_time_to_string (m_delay, GNUNET_YES));
566 return m_delay; 568 return m_delay;
567 569
568} 570}