diff options
Diffstat (limited to 'src/plugins/peers/peers.c')
-rw-r--r-- | src/plugins/peers/peers.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/plugins/peers/peers.c b/src/plugins/peers/peers.c index b5877329..fe7621c3 100644 --- a/src/plugins/peers/peers.c +++ b/src/plugins/peers/peers.c | |||
@@ -70,6 +70,7 @@ static int collector(void * data, | |||
70 | char * haddress; | 70 | char * haddress; |
71 | char * hostname; | 71 | char * hostname; |
72 | cron_t now; | 72 | cron_t now; |
73 | int i; | ||
73 | int found; | 74 | int found; |
74 | 75 | ||
75 | hash2enc(&identity->hashPubKey, | 76 | hash2enc(&identity->hashPubKey, |
@@ -118,18 +119,20 @@ static int collector(void * data, | |||
118 | cc = strstr(cc, ".") + 1; | 119 | cc = strstr(cc, ".") + 1; |
119 | if (strstr(hostname, ".") == NULL) | 120 | if (strstr(hostname, ".") == NULL) |
120 | cc = NULL; | 121 | cc = NULL; |
121 | else if ( (0 == strcmp(cc, "edu")) || | 122 | else if ( (0 == strcasecmp(cc, "edu")) || |
122 | (0 == strcmp(cc, "com")) || | 123 | (0 == strcasecmp(cc, "com")) || |
123 | (0 == strcmp(cc, "net")) || | 124 | (0 == strcasecmp(cc, "net")) || |
124 | (0 == strcmp(cc, "org")) || | 125 | (0 == strcasecmp(cc, "org")) || |
125 | (0 == strcmp(cc, "gov")) || | 126 | (0 == strcasecmp(cc, "gov")) || |
126 | (0 == strcmp(cc, "mil")) ) | 127 | (0 == strcasecmp(cc, "mil")) ) |
127 | cc = "us"; | 128 | cc = "us"; |
128 | if ( (cc != NULL) && | 129 | if ( (cc != NULL) && |
129 | (strlen(cc) > 2) ) | 130 | (strlen(cc) > 2) ) |
130 | cc = NULL; | 131 | cc = NULL; |
131 | if (cc != NULL) { | 132 | if (cc != NULL) { |
132 | cc = STRDUP(cc); | 133 | cc = STRDUP(cc); |
134 | for (i=0;i<strlen(cc);i++) | ||
135 | cc[i] = tolower(cc[i]); | ||
133 | dir = os_get_installation_path(IPK_DATADIR); | 136 | dir = os_get_installation_path(IPK_DATADIR); |
134 | fn = MALLOC(strlen(dir) + 32); | 137 | fn = MALLOC(strlen(dir) + 32); |
135 | strcpy(fn, dir); | 138 | strcpy(fn, dir); |