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.c80
1 files changed, 37 insertions, 43 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index f01c64bb4..9691f55eb 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -2792,50 +2792,44 @@ add_peer_address (struct NeighbourList *neighbour,
2792 } 2792 }
2793 2793
2794 ret->ressources = GNUNET_malloc(available_ressources * sizeof (struct ATS_ressource_entry)); 2794 ret->ressources = GNUNET_malloc(available_ressources * sizeof (struct ATS_ressource_entry));
2795 int plugin;
2796 for (c=0; c<available_ressources; c++) 2795 for (c=0; c<available_ressources; c++)
2797 { 2796 {
2798 struct ATS_ressource_entry *r = ret->ressources; 2797 struct ATS_ressource_entry *r = ret->ressources;
2799 r[c].index = c; 2798 r[c].index = c;
2800 r[c].atis_index = ressources[c].atis_index; 2799 r[c].atis_index = ressources[c].atis_index;
2801 if (0 == strcmp(neighbour->plugins->plugin->short_name,"unix")) 2800 if (0 == strcmp(neighbour->plugins->plugin->short_name,"unix"))
2802 { 2801 {
2803 r[c].c = ressources[c].c_unix; 2802 r[c].c = ressources[c].c_unix;
2804 plugin = 1; 2803 }
2805 } 2804 else if (0 == strcmp(neighbour->plugins->plugin->short_name,"udp"))
2806 else if (0 == strcmp(neighbour->plugins->plugin->short_name,"udp")) 2805 {
2807 { 2806 r[c].c = ressources[c].c_udp;
2808 r[c].c = ressources[c].c_udp; 2807 }
2809 plugin = 2; 2808 else if (0 == strcmp(neighbour->plugins->plugin->short_name,"tcp"))
2810 } 2809 {
2811 else if (0 == strcmp(neighbour->plugins->plugin->short_name,"tcp")) 2810 r[c].c = ressources[c].c_tcp;
2812 { 2811 }
2813 r[c].c = ressources[c].c_tcp; 2812 else if (0 == strcmp(neighbour->plugins->plugin->short_name,"http"))
2814 plugin = 3; 2813 {
2815 } 2814 r[c].c = ressources[c].c_http;
2816 else if (0 == strcmp(neighbour->plugins->plugin->short_name,"http")) 2815 }
2817 { 2816 else if (0 == strcmp(neighbour->plugins->plugin->short_name,"https"))
2818 r[c].c = ressources[c].c_http; 2817 {
2819 plugin = 4; 2818 r[c].c = ressources[c].c_https;
2820 } 2819 }
2821 else if (0 == strcmp(neighbour->plugins->plugin->short_name,"https")) 2820 else if (0 == strcmp(neighbour->plugins->plugin->short_name,"wlan"))
2822 { 2821 {
2823 r[c].c = ressources[c].c_https; 2822 r[c].c = ressources[c].c_wlan;
2824 plugin = 5; 2823 }
2825 } 2824 else
2826 else if (0 == strcmp(neighbour->plugins->plugin->short_name,"wlan")) 2825 {
2827 { 2826 r[c].c = ressources[c].c_default;
2828 r[c].c = ressources[c].c_wlan; 2827 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
2829 plugin = 6; 2828 "Assigning default cost to peer `%s' addr plugin `%s'! This should not happen!\n",
2830 } 2829 GNUNET_i2s(&neighbour->peer),
2831 else 2830 neighbour->plugins->plugin->short_name);
2832 { 2831 }
2833 plugin = -1; 2832 }
2834 r[c].c = ressources[c].c_default;
2835 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,"Assigning default cost to peer `%s' addr plugin `%s'! This should not happen!",
2836 GNUNET_i2s(&neighbour->peer), neighbour->plugins->plugin->short_name);
2837 }
2838 }
2839 2833
2840 ret->quality = GNUNET_malloc (available_quality_metrics * sizeof (struct ATS_quality_entry)); 2834 ret->quality = GNUNET_malloc (available_quality_metrics * sizeof (struct ATS_quality_entry));
2841 ret->addrlen = addrlen; 2835 ret->addrlen = addrlen;