1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/other-licenses/android/resolv_static.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,42 @@ 1.4 +/* 1.5 + * This version of this file is derived from Android 2.3 "Gingerbread", 1.6 + * which contains uncredited changes by Android/Google developers. It has 1.7 + * been modified in 2011 for use in the Android build of Mozilla Firefox by 1.8 + * Mozilla contributors (including Michael Edwards <m.k.edwards@gmail.com>, 1.9 + * and Steve Workman <sjhworkman@gmail.com>). 1.10 + * These changes are offered under the same license as the original NetBSD 1.11 + * file, whose copyright and license are unchanged above. 1.12 + */ 1.13 + 1.14 +#ifndef _RESOLV_STATIC_H 1.15 +#define _RESOLV_STATIC_H 1.16 + 1.17 +#include <netdb.h> 1.18 + 1.19 +/* this structure contains all the variables that were declared 1.20 + * 'static' in the original NetBSD resolver code. 1.21 + * 1.22 + * this caused vast amounts of crashes and memory corruptions 1.23 + * when the resolver was being used by multiple threads. 1.24 + * 1.25 + * (note: the OpenBSD/FreeBSD resolver has similar 'issues') 1.26 + */ 1.27 + 1.28 +#define MAXALIASES 35 1.29 +#define MAXADDRS 35 1.30 + 1.31 +typedef struct res_static { 1.32 + char* h_addr_ptrs[MAXADDRS + 1]; 1.33 + char* host_aliases[MAXALIASES]; 1.34 + char hostbuf[8*1024]; 1.35 + u_int32_t host_addr[16 / sizeof(u_int32_t)]; /* IPv4 or IPv6 */ 1.36 + FILE* hostf; 1.37 + int stayopen; 1.38 + const char* servent_ptr; 1.39 + struct servent servent; 1.40 + struct hostent host; 1.41 +} *res_static; 1.42 + 1.43 +extern res_static __res_get_static(void); 1.44 + 1.45 +#endif /* _RESOLV_STATIC_H */