1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-10 10:03:13 +02:00

*nix resolver for Windows

This commit is contained in:
codemastr
2003-08-21 16:11:08 +00:00
parent bf156f47b6
commit a450522052
13 changed files with 411 additions and 452 deletions
-4
View File
@@ -371,11 +371,7 @@ extern void add_client_to_list(aClient *);
extern void checklist();
extern void remove_client_from_list(aClient *);
extern void initlists();
#ifndef _WIN32
extern struct hostent *get_res(char *);
#else
extern struct hostent *get_res(char *, long);
#endif
extern struct hostent *gethost_byaddr(char *, Link *);
extern struct hostent *gethost_byname(char *, Link *);
extern void flush_cache();
-9
View File
@@ -39,22 +39,13 @@ typedef struct reslist {
char *name;
struct reslist *next;
Link cinfo;
#ifndef _WIN32
struct hent he;
#else
struct hostent *he;
char locked;
#endif
} ResRQ;
typedef struct cache {
time_t expireat;
time_t ttl;
#ifndef _WIN32
struct hostent he;
#else
struct hostent *he;
#endif
struct cache *hname_next, *hnum_next, *list_next;
} aCache;
+6
View File
@@ -215,7 +215,12 @@ static const struct in6_addr in6addr_any = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
#define P_ECONNABORTED ECONNABORTED
#define P_ECONNRESET ECONNRESET
#define P_ENOTCONN ENOTCONN
#define P_EMSGSIZE EMSGSIZE
#else
/* WIN32 */
#define NETDB_INTERNAL -1 /* see errno */
#define NETDB_SUCCESS 0 /* no problem */
/* IO and Error portability macros */
#define READ_SOCK(fd, buf, len) recv((fd), (buf), (len), 0)
@@ -239,6 +244,7 @@ static const struct in6_addr in6addr_any = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
#define P_ECONNABORTED WSAECONNABORTED
#define P_ECONNRESET WSAECONNRESET
#define P_ENOTCONN WSAENOTCONN
#define P_EMSGSIZE WSAEMSGSIZE
#endif
#endif /* __sys_include__ */