diff options
author | Christian Grothoff <christian@grothoff.org> | 2007-06-29 01:27:44 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2007-06-29 01:27:44 +0000 |
commit | 2633939239834f84d008aa620ecaedb441a69fce (patch) | |
tree | 8f7b11e569c855d9d6c3be4c22e74f0ced98eb95 | |
parent | 57224fb481c18b23081254a6d573caea46cb007e (diff) | |
download | gnunet-gtk-2633939239834f84d008aa620ecaedb441a69fce.tar.gz gnunet-gtk-2633939239834f84d008aa620ecaedb441a69fce.zip |
may get uppercase DNS replies
-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); |