... | ... |
@@ -237,7 +237,8 @@ struct rdata* get_record(char* name, int type) |
237 | 237 |
p+=2; |
238 | 238 |
/* check for type */ |
239 | 239 |
if (rtype!=type){ |
240 |
- LOG(L_WARN, "WARNING: get_record: wrong type in answer\n"); |
|
240 |
+ LOG(L_ERR, "WARNING: get_record: wrong type in answer (%d!=%d)\n", |
|
241 |
+ rtype, type); |
|
241 | 242 |
p+=rdlength; |
242 | 243 |
continue; |
243 | 244 |
} |
... | ... |
@@ -2,6 +2,11 @@ |
2 | 2 |
* $Id$ |
3 | 3 |
* |
4 | 4 |
* tests for ../resolver.c |
5 |
+ * |
|
6 |
+ * Compile with: |
|
7 |
+ * gcc -o dns_query2 dns_query.c ../resolve.o ../dprint.o ../mem/ *.o -lresolv |
|
8 |
+ * (and first compile ser with qm_malloc) |
|
9 |
+ * |
|
5 | 10 |
*/ |
6 | 11 |
|
7 | 12 |
#include <stdio.h> |
... | ... |
@@ -11,12 +16,16 @@ |
11 | 16 |
#include <unistd.h> |
12 | 17 |
|
13 | 18 |
#include "../resolve.h" |
19 |
+#include "../mem/q_malloc.h" |
|
14 | 20 |
|
15 | 21 |
/* symbols needed by dprint */ |
16 | 22 |
int log_stderr=1; |
17 | 23 |
int debug=0; |
18 | 24 |
int pids[1]; |
19 | 25 |
int process_no=0; |
26 |
+int shm_mem_size=0; |
|
27 |
+char mem_pool[1024*1024]; |
|
28 |
+struct qm_block* mem_block; |
|
20 | 29 |
|
21 | 30 |
|
22 | 31 |
static char* id="$Id$"; |
... | ... |
@@ -106,6 +115,8 @@ int main(int argc, char** argv) |
106 | 115 |
goto error; |
107 | 116 |
} |
108 | 117 |
} |
118 |
+ /* init mallocs*/ |
|
119 |
+ mem_block=qm_malloc_init(mem_pool, 1024*1024); |
|
109 | 120 |
printf("calling get_record...\n"); |
110 | 121 |
head=get_record(name, type); |
111 | 122 |
if (head==0) printf("no answer\n"); |