numdots++;
}
}
-
- /* if we don't have 3 dots, it is illegal
+
+ /* if we don't have 3 dots, it is illegal
* (although inet_addr doesn't think so).
*/
if (numdots != 3)
int ares_gethostbyname_file(ares_channel channel, const char *name,
int family, struct hostent **host)
{
+ int result;
+
/* We only take the channel to ensure that ares_init() been called. */
if(channel == NULL)
{
*host = NULL;
return ARES_ENOTFOUND;
}
-
+
/* Just chain to the internal implementation we use here; it's exactly
- * what we want.
+ * what we want.
*/
- const int result = file_lookup(name, family, host);
+ result = file_lookup(name, family, host);
if(result != ARES_SUCCESS)
{
/* We guarantee a NULL hostent on failure. */
return ARES_SUCCESS;
}
-short ares__generate_new_id(rc4_key* key)
+unsigned short ares__generate_new_id(rc4_key* key)
{
- short r=0;
+ unsigned short r=0;
ares__rc4(key, (unsigned char *)&r, sizeof(r));
return r;
}
int ares__get_hostent(FILE *fp, int family, struct hostent **host);
int ares__read_line(FILE *fp, char **buf, int *bufsize);
void ares__free_query(struct query *query);
-short ares__generate_new_id(rc4_key* key);
+unsigned short ares__generate_new_id(rc4_key* key);
struct timeval ares__tvnow(void);
#if 0 /* Not used */
long ares__tvdiff(struct timeval t1, struct timeval t2);
key->y = y;
}
-static struct query* find_query_by_id(ares_channel channel, int id)
+static struct query* find_query_by_id(ares_channel channel, unsigned short id)
{
unsigned short qid;
struct list_node* list_head;
*/
static unsigned short generate_unique_id(ares_channel channel)
{
- short id;
+ unsigned short id;
do {
- id = ares__generate_new_id(&channel->id_key);
- } while (find_query_by_id(channel,id));
+ id = ares__generate_new_id(&channel->id_key);
+ } while (find_query_by_id(channel, id));
return (unsigned short)id;
}