cataphract Fri, 08 Oct 2010 23:02:37 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=304212
Log:
- Added numeric record type and raw data for unknown DNS
record types.
Changed paths:
U php/php-src/trunk/ext/standard/dns.c
U php/php-src/trunk/ext/standard/dns_win32.c
Modified: php/php-src/trunk/ext/standard/dns.c
===================================================================
--- php/php-src/trunk/ext/standard/dns.c 2010-10-08 18:30:10 UTC (rev
304211)
+++ php/php-src/trunk/ext/standard/dns.c 2010-10-08 23:02:37 UTC (rev
304212)
@@ -679,7 +679,15 @@
add_assoc_string(*subarray, "replacement", name, 1);
break;
default:
- cp += dlen;
+ {
+ char buf[10]; /* max length of short +
sizeof(id #) */
+ snprintf(buf, 10, "id #%hu", type);
+ buf[10-1] = '\0';
+ add_assoc_string(*subarray, "type", buf, 1);
+ add_assoc_stringl(*subarray, "data", (char*)
cp, (uint) dlen, 1);
+ cp += dlen;
+ break;
+ }
}
add_assoc_string(*subarray, "class", "IN", 1);
Modified: php/php-src/trunk/ext/standard/dns_win32.c
===================================================================
--- php/php-src/trunk/ext/standard/dns_win32.c 2010-10-08 18:30:10 UTC (rev
304211)
+++ php/php-src/trunk/ext/standard/dns_win32.c 2010-10-08 23:02:37 UTC (rev
304212)
@@ -320,7 +320,14 @@
break;
default:
- break;
+ {
+ char buf[10]; /* max length of short +
sizeof(id #) */
+ snprintf(buf, 10, "id #%hu", (unsigned short)
type);
+ buf[10-1] = '\0';
+ add_assoc_string(*subarray, "type", buf, 1);
+ add_assoc_stringl(*subarray, "data", (char*)
&pRec->Data, (uint) pRec->wDataLength, 1);
+ break;
+ }
}
add_assoc_string(*subarray, "class", "IN", 1);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php