aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/gnunet-service-transport.c')
-rw-r--r--src/transport/gnunet-service-transport.c33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 5840eec5e..efbd67619 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -743,18 +743,17 @@ plugin_env_session_start_bl_check_cont (void *cls,
743 * @param cls unused 743 * @param cls unused
744 * @param address the address 744 * @param address the address
745 * @param session the new session 745 * @param session the new session
746 * @param ats ats information 746 * @param scope network scope information
747 * @param ats_count number of @a ats information
748 */ 747 */
749static void 748static void
750plugin_env_session_start (void *cls, 749plugin_env_session_start (void *cls,
751 const struct GNUNET_HELLO_Address *address, 750 const struct GNUNET_HELLO_Address *address,
752 struct Session *session, 751 struct Session *session,
753 const struct GNUNET_ATS_Information *ats, 752 enum GNUNET_ATS_Network_Type scope)
754 uint32_t ats_count)
755{ 753{
756 struct BlacklistCheckContext *blctx; 754 struct BlacklistCheckContext *blctx;
757 struct GST_BlacklistCheck *blc; 755 struct GST_BlacklistCheck *blc;
756 struct GNUNET_ATS_Properties prop;
758 757
759 if (NULL == address) 758 if (NULL == address)
760 { 759 {
@@ -767,9 +766,8 @@ plugin_env_session_start (void *cls,
767 return; 766 return;
768 } 767 }
769 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 768 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
770 "Notification from plugin `%s' about new session %p from peer `%s' address `%s'\n", 769 "Notification from plugin `%s' about new session from peer `%s' address `%s'\n",
771 address->transport_name, 770 address->transport_name,
772 session,
773 GNUNET_i2s (&address->peer), 771 GNUNET_i2s (&address->peer),
774 GST_plugins_a2s (address)); 772 GST_plugins_a2s (address));
775 if (GNUNET_YES == 773 if (GNUNET_YES ==
@@ -779,22 +777,12 @@ plugin_env_session_start (void *cls,
779 /* inbound is always new, but outbound MAY already be known, but 777 /* inbound is always new, but outbound MAY already be known, but
780 for example for UNIX, we have symmetric connections and thus we 778 for example for UNIX, we have symmetric connections and thus we
781 may not know the address yet; add if necessary! */ 779 may not know the address yet; add if necessary! */
780 /* FIXME: maybe change API here so we just pass scope? */
781 memset (&prop, 0, sizeof (prop));
782 prop.scope = scope;
782 GST_ats_add_inbound_address (address, 783 GST_ats_add_inbound_address (address,
783 session, 784 session,
784 ats, 785 &prop);
785 ats_count);
786 }
787 else
788 {
789 if (GNUNET_YES ==
790 GST_ats_is_known (address,
791 session))
792 {
793 GST_ats_update_metrics (address,
794 session,
795 ats,
796 ats_count);
797 }
798 } 786 }
799 /* Do blacklist check if communication with this peer is allowed */ 787 /* Do blacklist check if communication with this peer is allowed */
800 blctx = GNUNET_new (struct BlacklistCheckContext); 788 blctx = GNUNET_new (struct BlacklistCheckContext);
@@ -1034,7 +1022,7 @@ run (void *cls,
1034 &ats_request_address_change, 1022 &ats_request_address_change,
1035 NULL); 1023 NULL);
1036 GST_ats_init (); 1024 GST_ats_init ();
1037 GST_manipulation_init (GST_cfg); 1025 GST_manipulation_init ();
1038 GST_plugins_load (&GST_manipulation_recv, 1026 GST_plugins_load (&GST_manipulation_recv,
1039 &plugin_env_address_change_notification, 1027 &plugin_env_address_change_notification,
1040 &plugin_env_session_start, 1028 &plugin_env_session_start,
@@ -1053,7 +1041,8 @@ run (void *cls,
1053 * @return 0 ok, 1 on error 1041 * @return 0 ok, 1 on error
1054 */ 1042 */
1055int 1043int
1056main (int argc, char * const *argv) 1044main (int argc,
1045 char * const *argv)
1057{ 1046{
1058 return 1047 return
1059 (GNUNET_OK 1048 (GNUNET_OK