|
|
@ -9,14 +9,14 @@
|
|
|
|
#include <winsock2.h>
|
|
|
|
#include <winsock2.h>
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
static stralloc data = {0};
|
|
|
|
static stralloc data;
|
|
|
|
|
|
|
|
|
|
|
|
static int init(stralloc *rules)
|
|
|
|
static int init(stralloc *rules)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
char host[256];
|
|
|
|
char host[256];
|
|
|
|
const char *x;
|
|
|
|
const char *x;
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
int j;
|
|
|
|
unsigned long j;
|
|
|
|
int k;
|
|
|
|
int k;
|
|
|
|
|
|
|
|
|
|
|
|
if (!stralloc_copys(rules,"")) return -1;
|
|
|
|
if (!stralloc_copys(rules,"")) return -1;
|
|
|
@ -75,7 +75,7 @@ static int init(stralloc *rules)
|
|
|
|
if (byte_equal("search ",7,data.s + i) || byte_equal("search\t",7,data.s + i) || byte_equal("domain ",7,data.s + i) || byte_equal("domain\t",7,data.s + i)) {
|
|
|
|
if (byte_equal("search ",7,data.s + i) || byte_equal("search\t",7,data.s + i) || byte_equal("domain ",7,data.s + i) || byte_equal("domain\t",7,data.s + i)) {
|
|
|
|
if (!stralloc_copys(rules,"?:")) return -1;
|
|
|
|
if (!stralloc_copys(rules,"?:")) return -1;
|
|
|
|
i += 7;
|
|
|
|
i += 7;
|
|
|
|
while (i < j) {
|
|
|
|
while ((unsigned long)i < j) {
|
|
|
|
k = byte_chr(data.s + i,j - i,' ');
|
|
|
|
k = byte_chr(data.s + i,j - i,' ');
|
|
|
|
k = byte_chr(data.s + i,k,'\t');
|
|
|
|
k = byte_chr(data.s + i,k,'\t');
|
|
|
|
if (!k) { ++i; continue; }
|
|
|
|
if (!k) { ++i; continue; }
|
|
|
@ -107,10 +107,10 @@ static int init(stralloc *rules)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int ok = 0;
|
|
|
|
static int ok;
|
|
|
|
static unsigned int uses;
|
|
|
|
static unsigned int uses;
|
|
|
|
static struct taia deadline;
|
|
|
|
static struct taia deadline;
|
|
|
|
static stralloc rules = {0}; /* defined if ok */
|
|
|
|
static stralloc rules; /* defined if ok */
|
|
|
|
|
|
|
|
|
|
|
|
int dns_resolvconfrewrite(stralloc *out)
|
|
|
|
int dns_resolvconfrewrite(stralloc *out)
|
|
|
|
{
|
|
|
|
{
|
|
|
|