diff options
Diffstat (limited to 'src/plugins/peers/peers.c')
-rw-r--r-- | src/plugins/peers/peers.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/plugins/peers/peers.c b/src/plugins/peers/peers.c index 09c133b6..c224adca 100644 --- a/src/plugins/peers/peers.c +++ b/src/plugins/peers/peers.c | |||
@@ -52,7 +52,8 @@ static GdkPixbuf * black; | |||
52 | 52 | ||
53 | static int collector(void * data, | 53 | static int collector(void * data, |
54 | const PeerIdentity * identity, | 54 | const PeerIdentity * identity, |
55 | const char * address, | 55 | const void * address, |
56 | unsigned int addr_len, | ||
56 | cron_t last_message, | 57 | cron_t last_message, |
57 | unsigned int trust, | 58 | unsigned int trust, |
58 | unsigned int bpmFromPeer) { | 59 | unsigned int bpmFromPeer) { |
@@ -67,6 +68,7 @@ static int collector(void * data, | |||
67 | char * prefix; | 68 | char * prefix; |
68 | char * have; | 69 | char * have; |
69 | char * haddress; | 70 | char * haddress; |
71 | char * hostname; | ||
70 | cron_t now; | 72 | cron_t now; |
71 | int found; | 73 | int found; |
72 | 74 | ||
@@ -99,19 +101,21 @@ static int collector(void * data, | |||
99 | &iter)) ); | 101 | &iter)) ); |
100 | } | 102 | } |
101 | 103 | ||
102 | 104 | hostname = network_get_ip_as_string(address, | |
105 | addr_len, | ||
106 | YES); | ||
103 | /* get flag */ | 107 | /* get flag */ |
104 | flagBuf = NULL; | 108 | flagBuf = NULL; |
105 | ledBuf = NULL; | 109 | ledBuf = NULL; |
106 | cc = NULL; | 110 | cc = NULL; |
107 | if (address != NULL) { | 111 | if (hostname != NULL) { |
108 | prefix = STRDUP(address); | 112 | prefix = STRDUP(hostname); |
109 | if (strstr(prefix, " ") != NULL) | 113 | if (strstr(prefix, " ") != NULL) |
110 | *strstr(prefix, " ") = '\0'; | 114 | *strstr(prefix, " ") = '\0'; |
111 | cc = prefix; | 115 | cc = prefix; |
112 | while (strstr(cc, ".") != NULL) | 116 | while (strstr(cc, ".") != NULL) |
113 | cc = strstr(cc, ".") + 1; | 117 | cc = strstr(cc, ".") + 1; |
114 | if (strstr(address, ".") == NULL) | 118 | if (strstr(hostname, ".") == NULL) |
115 | cc = NULL; | 119 | cc = NULL; |
116 | else if ( (0 == strcmp(cc, "edu")) || | 120 | else if ( (0 == strcmp(cc, "edu")) || |
117 | (0 == strcmp(cc, "com")) || | 121 | (0 == strcmp(cc, "com")) || |
@@ -161,7 +165,7 @@ static int collector(void * data, | |||
161 | &iter); | 165 | &iter); |
162 | gtk_list_store_set(model, | 166 | gtk_list_store_set(model, |
163 | &iter, | 167 | &iter, |
164 | 0, address, | 168 | 0, hostname, |
165 | 1, trust, | 169 | 1, trust, |
166 | 2, bpmFromPeer, | 170 | 2, bpmFromPeer, |
167 | 3, (const char*) &enc, | 171 | 3, (const char*) &enc, |