Browse Source

Added debugging.

tags/v0.9.3
Michael Brown 19 years ago
parent
commit
1644238813
2 changed files with 9 additions and 2 deletions
  1. 8
    2
      src/core/resolv.c
  2. 1
    0
      src/include/resolv.h

+ 8
- 2
src/core/resolv.c View File

@@ -12,14 +12,20 @@ int resolv ( struct in_addr *address, const char *name ) {
12 12
 	struct resolver *resolver;
13 13
 
14 14
 	/* Check for a dotted quad IP address first */
15
-	if ( inet_aton ( name, address ) )
15
+	if ( inet_aton ( name, address ) ) {
16
+		DBG ( "RESOLV saw valid IP address %s\n", name );
16 17
 		return 1;
18
+	}
17 19
 
18 20
 	/* Try any compiled-in name resolution modules */
19 21
 	for ( resolver = resolvers ; resolver < resolvers_end ; resolver++ ) {
20
-		if ( resolver->resolv ( address, name ) )
22
+		if ( resolver->resolv ( address, name ) ) {
23
+			DBG ( "RESOLV resolved \"%s\" to %@ using %s\n",
24
+			      name, address->s_addr, resolver->name );
21 25
 			return 1;
26
+		}
22 27
 	}
23 28
 
29
+	DBG ( "RESOLV failed to resolve %s\n", name );
24 30
 	return 0;
25 31
 }

+ 1
- 0
src/include/resolv.h View File

@@ -5,6 +5,7 @@
5 5
 #include "tables.h"
6 6
 
7 7
 struct resolver {
8
+	const char *name;
8 9
 	int ( * resolv ) ( struct in_addr *address, const char *name );
9 10
 };
10 11
 

Loading…
Cancel
Save