aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-07-11 15:04:18 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-07-11 15:04:18 +0000
commit84666aa70481bffbdfaf876181a11e058044ffe4 (patch)
treef8970ddc41fbb34a63e513dd1c44b9a47723d512 /src/transport/gnunet-service-transport.c
parent6e77f41b366cb4dcd83722500f87ed0b914bd882 (diff)
downloadgnunet-84666aa70481bffbdfaf876181a11e058044ffe4.tar.gz
gnunet-84666aa70481bffbdfaf876181a11e058044ffe4.zip
notify ATS about a session (used for for validation) if we receive payload from a remote peer on this session
Diffstat (limited to 'src/transport/gnunet-service-transport.c')
-rw-r--r--src/transport/gnunet-service-transport.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 14ed7393d..a972999d6 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -171,6 +171,8 @@ process_payload (const struct GNUNET_PeerIdentity *peer,
171 return ret; 171 return ret;
172 } 172 }
173 173
174 GST_ats_add_address ((struct GNUNET_HELLO_Address *) address, session);
175
174 if (do_forward != GNUNET_YES) 176 if (do_forward != GNUNET_YES)
175 return ret; 177 return ret;
176 im = (struct InboundMessage *) buf; 178 im = (struct InboundMessage *) buf;
@@ -400,8 +402,8 @@ plugin_env_address_to_type (void *cls,
400 * @param session the session 402 * @param session the session
401 */ 403 */
402void 404void
403GST_ats_add_address (struct GNUNET_HELLO_Address *address, 405GST_ats_add_address (const struct GNUNET_HELLO_Address *address,
404 void *session) 406 struct Session *session)
405{ 407{
406 struct GNUNET_TRANSPORT_PluginFunctions *papi; 408 struct GNUNET_TRANSPORT_PluginFunctions *papi;
407 struct GNUNET_ATS_Information ats; 409 struct GNUNET_ATS_Information ats;
@@ -420,7 +422,10 @@ GST_ats_add_address (struct GNUNET_HELLO_Address *address,
420 return; 422 return;
421 } 423 }
422 424
423 net = papi->get_network (NULL, session); 425 if (GNUNET_YES == GNUNET_ATS_session_known (GST_ats, address, session))
426 return;
427
428 net = papi->get_network (NULL, (void *) session);
424 if (GNUNET_ATS_NET_UNSPECIFIED == net) 429 if (GNUNET_ATS_NET_UNSPECIFIED == net)
425 { 430 {
426 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 431 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -458,6 +463,10 @@ GST_ats_update_metrics (const struct GNUNET_PeerIdentity *peer,
458 uint32_t ats_count) 463 uint32_t ats_count)
459{ 464{
460 struct GNUNET_ATS_Information *ats_new; 465 struct GNUNET_ATS_Information *ats_new;
466
467 if (GNUNET_NO == GNUNET_ATS_session_known (GST_ats, address, session))
468 return;
469
461 /* Call to manipulation to manipulate ATS information */ 470 /* Call to manipulation to manipulate ATS information */
462 ats_new = GST_manipulation_manipulate_metrics (peer, address, session, ats, ats_count); 471 ats_new = GST_manipulation_manipulate_metrics (peer, address, session, ats, ats_count);
463 if (NULL == ats_new) 472 if (NULL == ats_new)