aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-18 17:31:14 +0000
committerChristian Grothoff <christian@grothoff.org>2015-01-18 17:31:14 +0000
commitbb720291e7a5a71e9139865f97025bfa179cd3a3 (patch)
tree09d1184ae8155aa7906a6823e4b9b432a4bfb7ec /src/transport/gnunet-service-transport.c
parentc5f60b28bfafd0b8196eb110e7cb3a8a1b12aa0f (diff)
downloadgnunet-bb720291e7a5a71e9139865f97025bfa179cd3a3.tar.gz
gnunet-bb720291e7a5a71e9139865f97025bfa179cd3a3.zip
-remarking on things to fix
Diffstat (limited to 'src/transport/gnunet-service-transport.c')
-rw-r--r--src/transport/gnunet-service-transport.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 330382604..01ca2fc67 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -188,6 +188,7 @@ process_hello_update (void *cls, const struct GNUNET_MessageHeader *hello)
188 GST_neighbours_iterate (&transmit_our_hello, (void *) hello); 188 GST_neighbours_iterate (&transmit_our_hello, (void *) hello);
189} 189}
190 190
191
191/** 192/**
192 * We received some payload. Prepare to pass it on to our clients. 193 * We received some payload. Prepare to pass it on to our clients.
193 * 194 *
@@ -211,7 +212,7 @@ process_payload (const struct GNUNET_PeerIdentity *peer,
211 212
212 do_forward = GNUNET_SYSERR; 213 do_forward = GNUNET_SYSERR;
213 ret = GST_neighbours_calculate_receive_delay (peer, msg_size, &do_forward); 214 ret = GST_neighbours_calculate_receive_delay (peer, msg_size, &do_forward);
214 if (!GST_neighbours_test_connected (peer)) 215 if (! GST_neighbours_test_connected (peer))
215 { 216 {
216 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 217 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
217 "Discarded %u bytes type %u payload from peer `%s'\n", msg_size, 218 "Discarded %u bytes type %u payload from peer `%s'\n", msg_size,
@@ -222,6 +223,7 @@ process_payload (const struct GNUNET_PeerIdentity *peer,
222 return ret; 223 return ret;
223 } 224 }
224 225
226 // FIXME: why is this call here?
225 GST_ats_add_address (address, session, NULL, 0); 227 GST_ats_add_address (address, session, NULL, 0);
226 228
227 if (GNUNET_YES != do_forward) 229 if (GNUNET_YES != do_forward)
@@ -357,6 +359,7 @@ connect_bl_check_cont (void *cls,
357 GNUNET_free (blctx); 359 GNUNET_free (blctx);
358} 360}
359 361
362
360/** 363/**
361 * Black list check result for try_connect call 364 * Black list check result for try_connect call
362 * If connection to the peer is allowed request adddress and 365 * If connection to the peer is allowed request adddress and
@@ -377,7 +380,9 @@ connect_transport_bl_check_cont (void *cls,
377 if (GNUNET_OK == result) 380 if (GNUNET_OK == result)
378 { 381 {
379 /* Blacklist allows to speak to this transport */ 382 /* Blacklist allows to speak to this transport */
380 GST_ats_add_address(blctx->address, blctx->session, blctx->ats, blctx->ats_count); 383 GST_ats_add_address (blctx->address,
384 blctx->session,
385 blctx->ats, blctx->ats_count);
381 } 386 }
382 387
383 if (NULL != blctx->address) 388 if (NULL != blctx->address)
@@ -671,8 +676,9 @@ plugin_env_address_to_type (void *cls,
671 */ 676 */
672void 677void
673GST_ats_add_address (const struct GNUNET_HELLO_Address *address, 678GST_ats_add_address (const struct GNUNET_HELLO_Address *address,
674 struct Session *session, const struct GNUNET_ATS_Information *ats, 679 struct Session *session,
675 uint32_t ats_count) 680 const struct GNUNET_ATS_Information *ats,
681 uint32_t ats_count)
676{ 682{
677 struct GNUNET_TRANSPORT_PluginFunctions *papi; 683 struct GNUNET_TRANSPORT_PluginFunctions *papi;
678 struct GNUNET_ATS_Information ats2[ats_count + 1]; 684 struct GNUNET_ATS_Information ats2[ats_count + 1];
@@ -710,14 +716,19 @@ GST_ats_add_address (const struct GNUNET_HELLO_Address *address,
710 ats2[0].type = htonl (GNUNET_ATS_NETWORK_TYPE); 716 ats2[0].type = htonl (GNUNET_ATS_NETWORK_TYPE);
711 ats2[0].value = htonl (net); 717 ats2[0].value = htonl (net);
712 memcpy (&ats2[1], ats, sizeof(struct GNUNET_ATS_Information) * ats_count); 718 memcpy (&ats2[1], ats, sizeof(struct GNUNET_ATS_Information) * ats_count);
713 GNUNET_log(GNUNET_ERROR_TYPE_INFO, 719 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
714 "Notifying ATS about peer `%s''s new address `%s' session %p in network %s\n", 720 "Notifying ATS about peer `%s''s new address `%s' session %p in network %s\n",
715 GNUNET_i2s (&address->peer), 721 GNUNET_i2s (&address->peer),
716 (0 == address->address_length) ? "<inbound>" : GST_plugins_a2s (address), 722 (0 == address->address_length)
717 session, GNUNET_ATS_print_network_type (net)); 723 ? "<inbound>"
718 GNUNET_ATS_address_add (GST_ats, address, session, ats2, ats_count + 1); 724 : GST_plugins_a2s (address),
725 session,
726 GNUNET_ATS_print_network_type (net));
727 GNUNET_ATS_address_add (GST_ats, address, session,
728 ats2, ats_count + 1);
719} 729}
720 730
731
721/** 732/**
722 * Notify ATS about property changes to an address 733 * Notify ATS about property changes to an address
723 * 734 *