[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c

2009-05-20 Thread Kalle Sommer Nielsen
kalle   Wed May 20 08:18:48 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   dns.c 
  Log:
  MFH: Fix Windows build, dns_get_record is defined in dns_win32.c, not here
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.21r2=1.70.2.7.2.5.2.22diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.21 
php-src/ext/standard/dns.c:1.70.2.7.2.5.2.22
--- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.21Tue May 19 11:12:20 2009
+++ php-src/ext/standard/dns.c  Wed May 20 08:18:48 2009
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: dns.c,v 1.70.2.7.2.5.2.21 2009/05/19 11:12:20 jani Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.5.2.22 2009/05/20 08:18:48 kalle Exp $ */
 
 /* {{{ includes */
 #include php.h
@@ -277,7 +277,7 @@
 # define PHP_DNS_ALL
(PHP_DNS_A|PHP_DNS_NS|PHP_DNS_CNAME|PHP_DNS_SOA|PHP_DNS_PTR|PHP_DNS_HINFO|PHP_DNS_MX|PHP_DNS_TXT|PHP_DNS_A6|PHP_DNS_SRV|PHP_DNS_NAPTR|PHP_DNS_)
 #endif /* HAVE_DNS_FUNCS || defined(PHP_WIN32) */
 
-#if defined(PHP_WIN32) || (HAVE_RES_SEARCH  !(defined(__BEOS__) || 
defined(NETWARE)))
+#if !defined(PHP_WIN32) || (HAVE_RES_SEARCH  !(defined(__BEOS__) || 
defined(NETWARE)))
 
 /* {{{ proto bool dns_check_record(string host [, string type])
Check DNS records corresponding to a given Internet host name or IP address 
*/



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c

2009-05-20 Thread Jani Taskinen
janiWed May 20 12:15:39 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   dns.c 
  Log:
  MFH: Fix non-windows builds
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.22r2=1.70.2.7.2.5.2.23diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.22 
php-src/ext/standard/dns.c:1.70.2.7.2.5.2.23
--- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.22Wed May 20 08:18:48 2009
+++ php-src/ext/standard/dns.c  Wed May 20 12:15:39 2009
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: dns.c,v 1.70.2.7.2.5.2.22 2009/05/20 08:18:48 kalle Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.5.2.23 2009/05/20 12:15:39 jani Exp $ */
 
 /* {{{ includes */
 #include php.h
@@ -277,7 +277,8 @@
 # define PHP_DNS_ALL
(PHP_DNS_A|PHP_DNS_NS|PHP_DNS_CNAME|PHP_DNS_SOA|PHP_DNS_PTR|PHP_DNS_HINFO|PHP_DNS_MX|PHP_DNS_TXT|PHP_DNS_A6|PHP_DNS_SRV|PHP_DNS_NAPTR|PHP_DNS_)
 #endif /* HAVE_DNS_FUNCS || defined(PHP_WIN32) */
 
-#if !defined(PHP_WIN32) || (HAVE_RES_SEARCH  !(defined(__BEOS__) || 
defined(NETWARE)))
+/* Note: These functions are defined in ext/standard/dns_win32.c for Windows! 
*/
+#if !defined(PHP_WIN32)  (HAVE_RES_SEARCH  !(defined(__BEOS__) || 
defined(NETWARE)))
 
 /* {{{ proto bool dns_check_record(string host [, string type])
Check DNS records corresponding to a given Internet host name or IP address 
*/
@@ -916,7 +917,7 @@
 }
 /* }}} */
 #endif /* HAVE_DN_SKIPNAME  HAVE_DN_EXPAND */
-#endif /* defined(PHP_WIN32) || (HAVE_RES_SEARCH  !(defined(__BEOS__) || 
defined(NETWARE))) */
+#endif /* defined(PHP_WIN32)  (HAVE_RES_SEARCH  !(defined(__BEOS__) || 
defined(NETWARE))) */
 
 #if HAVE_DNS_FUNCS || defined(PHP_WIN32)
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c

2009-05-20 Thread Jani Taskinen
janiWed May 20 12:44:19 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   dns.c 
  Log:
  - Sync with HEAD (thanks Hannes :)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.23r2=1.70.2.7.2.5.2.24diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.23 
php-src/ext/standard/dns.c:1.70.2.7.2.5.2.24
--- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.23Wed May 20 12:15:39 2009
+++ php-src/ext/standard/dns.c  Wed May 20 12:44:19 2009
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: dns.c,v 1.70.2.7.2.5.2.23 2009/05/20 12:15:39 jani Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.5.2.24 2009/05/20 12:44:19 jani Exp $ */
 
 /* {{{ includes */
 #include php.h
@@ -917,10 +917,9 @@
 }
 /* }}} */
 #endif /* HAVE_DN_SKIPNAME  HAVE_DN_EXPAND */
-#endif /* defined(PHP_WIN32)  (HAVE_RES_SEARCH  !(defined(__BEOS__) || 
defined(NETWARE))) */
+#endif /* !defined(PHP_WIN32)  (HAVE_RES_SEARCH  !(defined(__BEOS__) || 
defined(NETWARE))) */
 
 #if HAVE_DNS_FUNCS || defined(PHP_WIN32)
-
 PHP_MINIT_FUNCTION(dns) {
REGISTER_LONG_CONSTANT(DNS_A, PHP_DNS_A, CONST_CS | 
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT(DNS_NS,PHP_DNS_NS,CONST_CS | 
CONST_PERSISTENT);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c

2009-05-19 Thread Jani Taskinen
janiTue May 19 11:12:20 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   dns.c 
  Log:
  MFH: Unify macros
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.20r2=1.70.2.7.2.5.2.21diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.20 
php-src/ext/standard/dns.c:1.70.2.7.2.5.2.21
--- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.20Mon Jan 12 20:07:28 2009
+++ php-src/ext/standard/dns.c  Tue May 19 11:12:20 2009
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: dns.c,v 1.70.2.7.2.5.2.20 2009/01/12 20:07:28 felipe Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.5.2.21 2009/05/19 11:12:20 jani Exp $ */
 
 /* {{{ includes */
 #include php.h
@@ -277,7 +277,7 @@
 # define PHP_DNS_ALL
(PHP_DNS_A|PHP_DNS_NS|PHP_DNS_CNAME|PHP_DNS_SOA|PHP_DNS_PTR|PHP_DNS_HINFO|PHP_DNS_MX|PHP_DNS_TXT|PHP_DNS_A6|PHP_DNS_SRV|PHP_DNS_NAPTR|PHP_DNS_)
 #endif /* HAVE_DNS_FUNCS || defined(PHP_WIN32) */
 
-#if HAVE_RES_SEARCH  !(defined(__BEOS__)||defined(PHP_WIN32) || 
defined(NETWARE))
+#if defined(PHP_WIN32) || (HAVE_RES_SEARCH  !(defined(__BEOS__) || 
defined(NETWARE)))
 
 /* {{{ proto bool dns_check_record(string host [, string type])
Check DNS records corresponding to a given Internet host name or IP address 
*/
@@ -916,8 +916,7 @@
 }
 /* }}} */
 #endif /* HAVE_DN_SKIPNAME  HAVE_DN_EXPAND */
-#endif /* HAVE_RES_SEARCH  !(defined(__BEOS__)||defined(PHP_WIN32) || 
defined(NETWARE)) */
-
+#endif /* defined(PHP_WIN32) || (HAVE_RES_SEARCH  !(defined(__BEOS__) || 
defined(NETWARE))) */
 
 #if HAVE_DNS_FUNCS || defined(PHP_WIN32)
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c dns_win32.c

2009-01-12 Thread Felipe Pena
Em Dom, 2009-01-11 às 18:47 +, Felipe Pena escreveu:
 felipeSun Jan 11 18:47:17 2009 UTC
 
   Modified files:  (Branch: PHP_5_3)
 /php-src/ext/standard dns.c dns_win32.c 
   Log:
   MFH:
   - Improved fix for #47035 (win32 part by Henrique M. Decaria)
   [DOC] The TXT part needs be returned as an array of strings. 
 (dns_get_record())
   
   
Sorry, but ignores this [DOC]. NO BC! :þ

 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.17r2=1.70.2.7.2.5.2.18diff_format=u
 Index: php-src/ext/standard/dns.c
 diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.17 
 php-src/ext/standard/dns.c:1.70.2.7.2.5.2.18
 --- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.17  Thu Jan  8 17:19:50 2009
 +++ php-src/ext/standard/dns.cSun Jan 11 18:47:17 2009
 @@ -18,7 +18,7 @@
 +--+
   */
  
 -/* $Id: dns.c,v 1.70.2.7.2.5.2.17 2009/01/08 17:19:50 felipe Exp $ */
 +/* $Id: dns.c,v 1.70.2.7.2.5.2.18 2009/01/11 18:47:17 felipe Exp $ */
  
  /* {{{ includes */
  #include php.h
 @@ -456,20 +456,29 @@
   break;
   case DNS_T_TXT:
   {
 + zval *txtarray = NULL;
   int ll = 0;
 + char *txt = NULL;
  
   add_assoc_string(*subarray, type, TXT, 1);
   tp = emalloc(dlen + 1);
   
 + MAKE_STD_ZVAL(txtarray);
 + array_init(txtarray);
 + 
   while (ll  dlen) {
 + txt = tp + ll;
   n = cp[ll];
 - memcpy(tp + ll , cp + ll + 1, n);
 + memcpy(txt, cp + ll + 1, n);
   ll = ll + n + 1;
 + tp[ll] = '\0';
 + add_next_index_stringl(txtarray, txt, 
 n, 1);
   }
 - tp[dlen] = '\0';
 +
   cp += dlen;
  
 - add_assoc_stringl(*subarray, txt, tp, dlen - 
 1, 0);
 + add_assoc_zval(*subarray, txt, txtarray);
 + efree(tp);
   }
   break;
   case DNS_T_SOA:
 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns_win32.c?r1=1.1.2.4r2=1.1.2.5diff_format=u
 Index: php-src/ext/standard/dns_win32.c
 diff -u php-src/ext/standard/dns_win32.c:1.1.2.4 
 php-src/ext/standard/dns_win32.c:1.1.2.5
 --- php-src/ext/standard/dns_win32.c:1.1.2.4  Wed Jan  7 01:35:36 2009
 +++ php-src/ext/standard/dns_win32.c  Sun Jan 11 18:47:17 2009
 @@ -194,25 +194,24 @@
   int i = 0;
   DNS_TXT_DATA *data_txt = pRec-Data.TXT;
   DWORD count = data_txt-dwStringCount;
 - char *txt, *txt_dst;
 + char *txt;
   long txt_len;
 + zval *txtarray;
  
 - add_assoc_string(*subarray, type, TXT, 1);
 + MAKE_STD_ZVAL(txtarray);
 + array_init(txtarray);
  
 - txt_len = 0;
 - for (i = 0; i  count; i++) {
 - txt_len += 
 strlen(data_txt-pStringArray[i]) + 1;
 - }
 + add_assoc_string(*subarray, type, TXT, 1);
  
 - txt = ecalloc(txt_len * 2, 1);
 - txt_dst = txt;
   for (i = 0; i  count; i++) {
 - int len = 
 strlen(data_txt-pStringArray[i]);
 - memcpy(txt_dst, 
 data_txt-pStringArray[i], len);
 - txt_dst += len;
 + txt_len = 
 strlen(data_txt-pStringArray[i]);
 + txt = emalloc(txt_len + 1);
 + memcpy(txt, data_txt-pStringArray[i], 
 txt_len);
 + txt[txt_len] = '\0';
 + add_next_index_stringl(txtarray, txt, 
 txt_len, 0);
   }
  
 - add_assoc_string(*subarray, txt, txt, 0);
 + add_assoc_zval(*subarray, txt, txtarray);
   }
   break;
  
 
 
 
-- 
Regards,
Felipe Pena


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c dns_win32.c

2009-01-12 Thread Felipe Pena
felipe  Mon Jan 12 20:07:28 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   dns.c dns_win32.c 
  Log:
  - Reverted my previous commit to avoid unnecessary BC.

  [DOC] Added new entry to the array returned by dns_get_record(), 'entries', 
which contains the separated value from TXT value. (so 'txt' kept the 
concatenated version) (Pierre)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.19r2=1.70.2.7.2.5.2.20diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.19 
php-src/ext/standard/dns.c:1.70.2.7.2.5.2.20
--- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.19Sun Jan 11 23:37:16 2009
+++ php-src/ext/standard/dns.c  Mon Jan 12 20:07:28 2009
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: dns.c,v 1.70.2.7.2.5.2.19 2009/01/11 23:37:16 scottmac Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.5.2.20 2009/01/12 20:07:28 felipe Exp $ */
 
 /* {{{ includes */
 #include php.h
@@ -456,29 +456,26 @@
break;
case DNS_T_TXT:
{
-   zval *txtarray = NULL;
int ll = 0;
-   char *txt = NULL;
+   zval *entries = NULL;
 
add_assoc_string(*subarray, type, TXT, 1);
tp = emalloc(dlen + 1);

-   MAKE_STD_ZVAL(txtarray);
-   array_init(txtarray);
+   MAKE_STD_ZVAL(entries);
+   array_init(entries);

while (ll  dlen) {
-   txt = tp + ll;
n = cp[ll];
-   memcpy(txt, cp + ll + 1, n);
+   memcpy(tp + ll , cp + ll + 1, n);
+   add_next_index_stringl(entries, cp + ll 
+ 1, n, 1);
ll = ll + n + 1;
-   tp[ll] = '\0';
-   add_next_index_stringl(txtarray, txt, 
n, 1);
}
-
+   tp[dlen] = '\0';
cp += dlen;
 
-   add_assoc_zval(*subarray, txt, txtarray);
-   efree(tp);
+   add_assoc_stringl(*subarray, txt, tp, dlen - 
1, 0);
+   add_assoc_zval(*subarray, entries, entries);
}
break;
case DNS_T_SOA:
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns_win32.c?r1=1.1.2.5r2=1.1.2.6diff_format=u
Index: php-src/ext/standard/dns_win32.c
diff -u php-src/ext/standard/dns_win32.c:1.1.2.5 
php-src/ext/standard/dns_win32.c:1.1.2.6
--- php-src/ext/standard/dns_win32.c:1.1.2.5Sun Jan 11 18:47:17 2009
+++ php-src/ext/standard/dns_win32.cMon Jan 12 20:07:28 2009
@@ -194,24 +194,30 @@
int i = 0;
DNS_TXT_DATA *data_txt = pRec-Data.TXT;
DWORD count = data_txt-dwStringCount;
-   char *txt;
-   long txt_len;
-   zval *txtarray;
-
-   MAKE_STD_ZVAL(txtarray);
-   array_init(txtarray);
+   char *txt, *txt_dst;
+   long txt_len = 0;
+   zval *entries;
 
add_assoc_string(*subarray, type, TXT, 1);
+   
+   ALLOC_INIT_ZVAL(entries);
+   array_init(entries);
+   
+   for (i = 0; i  count; i++) {
+   txt_len += 
strlen(data_txt-pStringArray[i]) + 1;
+   }
 
+   txt = ecalloc(txt_len * 2, 1);
+   txt_dst = txt;
for (i = 0; i  count; i++) {
-   txt_len = 
strlen(data_txt-pStringArray[i]);
-   txt = emalloc(txt_len + 1);
-   memcpy(txt, data_txt-pStringArray[i], 
txt_len);
-   txt[txt_len] = '\0';
-   add_next_index_stringl(txtarray, txt, 
txt_len, 0);
+   int len = 
strlen(data_txt-pStringArray[i]);
+ 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c dns_win32.c

2009-01-11 Thread Felipe Pena
felipe  Sun Jan 11 18:47:17 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   dns.c dns_win32.c 
  Log:
  MFH:
  - Improved fix for #47035 (win32 part by Henrique M. Decaria)
  [DOC] The TXT part needs be returned as an array of strings. 
(dns_get_record())
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.17r2=1.70.2.7.2.5.2.18diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.17 
php-src/ext/standard/dns.c:1.70.2.7.2.5.2.18
--- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.17Thu Jan  8 17:19:50 2009
+++ php-src/ext/standard/dns.c  Sun Jan 11 18:47:17 2009
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: dns.c,v 1.70.2.7.2.5.2.17 2009/01/08 17:19:50 felipe Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.5.2.18 2009/01/11 18:47:17 felipe Exp $ */
 
 /* {{{ includes */
 #include php.h
@@ -456,20 +456,29 @@
break;
case DNS_T_TXT:
{
+   zval *txtarray = NULL;
int ll = 0;
+   char *txt = NULL;
 
add_assoc_string(*subarray, type, TXT, 1);
tp = emalloc(dlen + 1);

+   MAKE_STD_ZVAL(txtarray);
+   array_init(txtarray);
+   
while (ll  dlen) {
+   txt = tp + ll;
n = cp[ll];
-   memcpy(tp + ll , cp + ll + 1, n);
+   memcpy(txt, cp + ll + 1, n);
ll = ll + n + 1;
+   tp[ll] = '\0';
+   add_next_index_stringl(txtarray, txt, 
n, 1);
}
-   tp[dlen] = '\0';
+
cp += dlen;
 
-   add_assoc_stringl(*subarray, txt, tp, dlen - 
1, 0);
+   add_assoc_zval(*subarray, txt, txtarray);
+   efree(tp);
}
break;
case DNS_T_SOA:
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns_win32.c?r1=1.1.2.4r2=1.1.2.5diff_format=u
Index: php-src/ext/standard/dns_win32.c
diff -u php-src/ext/standard/dns_win32.c:1.1.2.4 
php-src/ext/standard/dns_win32.c:1.1.2.5
--- php-src/ext/standard/dns_win32.c:1.1.2.4Wed Jan  7 01:35:36 2009
+++ php-src/ext/standard/dns_win32.cSun Jan 11 18:47:17 2009
@@ -194,25 +194,24 @@
int i = 0;
DNS_TXT_DATA *data_txt = pRec-Data.TXT;
DWORD count = data_txt-dwStringCount;
-   char *txt, *txt_dst;
+   char *txt;
long txt_len;
+   zval *txtarray;
 
-   add_assoc_string(*subarray, type, TXT, 1);
+   MAKE_STD_ZVAL(txtarray);
+   array_init(txtarray);
 
-   txt_len = 0;
-   for (i = 0; i  count; i++) {
-   txt_len += 
strlen(data_txt-pStringArray[i]) + 1;
-   }
+   add_assoc_string(*subarray, type, TXT, 1);
 
-   txt = ecalloc(txt_len * 2, 1);
-   txt_dst = txt;
for (i = 0; i  count; i++) {
-   int len = 
strlen(data_txt-pStringArray[i]);
-   memcpy(txt_dst, 
data_txt-pStringArray[i], len);
-   txt_dst += len;
+   txt_len = 
strlen(data_txt-pStringArray[i]);
+   txt = emalloc(txt_len + 1);
+   memcpy(txt, data_txt-pStringArray[i], 
txt_len);
+   txt[txt_len] = '\0';
+   add_next_index_stringl(txtarray, txt, 
txt_len, 0);
}
 
-   add_assoc_string(*subarray, txt, txt, 0);
+   add_assoc_zval(*subarray, txt, txtarray);
}
break;
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c

2009-01-08 Thread Felipe Pena
felipe  Thu Jan  8 17:19:50 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   dns.c 
  Log:
  - MFH: Fixed bug #47035 (dns_get_record returns a garbage byte at the end of 
a TXT record)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.16r2=1.70.2.7.2.5.2.17diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.16 
php-src/ext/standard/dns.c:1.70.2.7.2.5.2.17
--- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.16Wed Jan  7 13:49:53 2009
+++ php-src/ext/standard/dns.c  Thu Jan  8 17:19:50 2009
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: dns.c,v 1.70.2.7.2.5.2.16 2009/01/07 13:49:53 pajoye Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.5.2.17 2009/01/08 17:19:50 felipe Exp $ */
 
 /* {{{ includes */
 #include php.h
@@ -469,7 +469,7 @@
tp[dlen] = '\0';
cp += dlen;
 
-   add_assoc_stringl(*subarray, txt, tp, dlen, 
0);
+   add_assoc_stringl(*subarray, txt, tp, dlen - 
1, 0);
}
break;
case DNS_T_SOA:



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c

2009-01-07 Thread Pierre-Alain Joye
pajoye  Wed Jan  7 13:46:13 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   dns.c 
  Log:
  - fix parameter parsing options
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.14r2=1.70.2.7.2.5.2.15diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.14 
php-src/ext/standard/dns.c:1.70.2.7.2.5.2.15
--- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.14Tue Jan  6 23:37:28 2009
+++ php-src/ext/standard/dns.c  Wed Jan  7 13:46:13 2009
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: dns.c,v 1.70.2.7.2.5.2.14 2009/01/06 23:37:28 pajoye Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.5.2.15 2009/01/07 13:46:13 pajoye Exp $ */
 
 /* {{{ includes */
 #include php.h
@@ -670,7 +670,7 @@
int n, qd, an, ns = 0, ar = 0;
int type, first_query = 1, store_results = 1;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|lz!z!, 
hostname, hostname_len, type_param, authns, addtl) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|lzz, 
hostname, hostname_len, type_param, authns, addtl) == FAILURE) {
return;
}
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c

2009-01-06 Thread Pierre-Alain Joye
pajoye  Tue Jan  6 21:47:13 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   dns.c 
  Log:
  - fix build
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.12r2=1.70.2.7.2.5.2.13diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.12 
php-src/ext/standard/dns.c:1.70.2.7.2.5.2.13
--- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.12Tue Jan  6 20:48:20 2009
+++ php-src/ext/standard/dns.c  Tue Jan  6 21:47:13 2009
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: dns.c,v 1.70.2.7.2.5.2.12 2009/01/06 20:48:20 pajoye Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.5.2.13 2009/01/06 21:47:13 pajoye Exp $ */
 
 /* {{{ includes */
 #include php.h
@@ -310,6 +310,27 @@
 }
 /* }}} */
 
+#if HAVE_DNS_FUNCS || defined(PHP_WIN32)
+# define PHP_DNS_NUM_TYPES 12  /* Number of DNS Types Supported by PHP 
currently */
+
+# define PHP_DNS_A  0x0001
+# define PHP_DNS_NS 0x0002
+# define PHP_DNS_CNAME  0x0010
+# define PHP_DNS_SOA0x0020
+# define PHP_DNS_PTR0x0800
+# define PHP_DNS_HINFO  0x1000
+# define PHP_DNS_MX 0x4000
+# define PHP_DNS_TXT0x8000
+# define PHP_DNS_A6 0x0100
+# define PHP_DNS_SRV0x0200
+# define PHP_DNS_NAPTR  0x0400
+# define PHP_DNS_   0x0800
+# define PHP_DNS_ANY0x1000
+# define PHP_DNS_ALL
(PHP_DNS_A|PHP_DNS_NS|PHP_DNS_CNAME|PHP_DNS_SOA|PHP_DNS_PTR|PHP_DNS_HINFO|PHP_DNS_MX|PHP_DNS_TXT|PHP_DNS_A6|PHP_DNS_SRV|PHP_DNS_NAPTR|PHP_DNS_)
+#endif /* HAVE_DNS_FUNCS || defined(PHP_WIN32) */
+
+
+
 #if HAVE_DNS_FUNCS
 
 #ifndef HFIXEDSZ
@@ -889,22 +910,6 @@
 
 
 #if HAVE_DNS_FUNCS || defined(PHP_WIN32)
-#define PHP_DNS_NUM_TYPES  12  /* Number of DNS Types Supported by PHP 
currently */
-
-#define PHP_DNS_A  0x0001
-#define PHP_DNS_NS 0x0002
-#define PHP_DNS_CNAME  0x0010
-#define PHP_DNS_SOA0x0020
-#define PHP_DNS_PTR0x0800
-#define PHP_DNS_HINFO  0x1000
-#define PHP_DNS_MX 0x4000
-#define PHP_DNS_TXT0x8000
-#define PHP_DNS_A6 0x0100
-#define PHP_DNS_SRV0x0200
-#define PHP_DNS_NAPTR  0x0400
-#define PHP_DNS_   0x0800
-#define PHP_DNS_ANY0x1000
-#define PHP_DNS_ALL
(PHP_DNS_A|PHP_DNS_NS|PHP_DNS_CNAME|PHP_DNS_SOA|PHP_DNS_PTR|PHP_DNS_HINFO|PHP_DNS_MX|PHP_DNS_TXT|PHP_DNS_A6|PHP_DNS_SRV|PHP_DNS_NAPTR|PHP_DNS_)
 
 PHP_MINIT_FUNCTION(dns) {
REGISTER_LONG_CONSTANT(DNS_A, PHP_DNS_A, CONST_CS | 
CONST_PERSISTENT);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c

2009-01-06 Thread Pierre-Alain Joye
pajoye  Tue Jan  6 23:37:28 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   dns.c 
  Log:
  - these ifdefs are a mess, fix build on win
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.13r2=1.70.2.7.2.5.2.14diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.13 
php-src/ext/standard/dns.c:1.70.2.7.2.5.2.14
--- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.13Tue Jan  6 21:47:13 2009
+++ php-src/ext/standard/dns.c  Tue Jan  6 23:37:28 2009
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: dns.c,v 1.70.2.7.2.5.2.13 2009/01/06 21:47:13 pajoye Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.5.2.14 2009/01/06 23:37:28 pajoye Exp $ */
 
 /* {{{ includes */
 #include php.h
@@ -258,6 +258,25 @@
 }
 /* }}} */
 
+#if HAVE_DNS_FUNCS || defined(PHP_WIN32)
+# define PHP_DNS_NUM_TYPES 12  /* Number of DNS Types Supported by PHP 
currently */
+
+# define PHP_DNS_A  0x0001
+# define PHP_DNS_NS 0x0002
+# define PHP_DNS_CNAME  0x0010
+# define PHP_DNS_SOA0x0020
+# define PHP_DNS_PTR0x0800
+# define PHP_DNS_HINFO  0x1000
+# define PHP_DNS_MX 0x4000
+# define PHP_DNS_TXT0x8000
+# define PHP_DNS_A6 0x0100
+# define PHP_DNS_SRV0x0200
+# define PHP_DNS_NAPTR  0x0400
+# define PHP_DNS_   0x0800
+# define PHP_DNS_ANY0x1000
+# define PHP_DNS_ALL
(PHP_DNS_A|PHP_DNS_NS|PHP_DNS_CNAME|PHP_DNS_SOA|PHP_DNS_PTR|PHP_DNS_HINFO|PHP_DNS_MX|PHP_DNS_TXT|PHP_DNS_A6|PHP_DNS_SRV|PHP_DNS_NAPTR|PHP_DNS_)
+#endif /* HAVE_DNS_FUNCS || defined(PHP_WIN32) */
+
 #if HAVE_RES_SEARCH  !(defined(__BEOS__)||defined(PHP_WIN32) || 
defined(NETWARE))
 
 /* {{{ proto bool dns_check_record(string host [, string type])
@@ -282,7 +301,7 @@
}
 
if (rectype) {
-if (!strcasecmp(A, rectype)) type = T_A;
+   if (!strcasecmp(A, rectype)) type = T_A;
else if (!strcasecmp(NS,rectype)) type = DNS_T_NS;
else if (!strcasecmp(MX,rectype)) type = DNS_T_MX;
else if (!strcasecmp(PTR,   rectype)) type = DNS_T_PTR;
@@ -310,27 +329,6 @@
 }
 /* }}} */
 
-#if HAVE_DNS_FUNCS || defined(PHP_WIN32)
-# define PHP_DNS_NUM_TYPES 12  /* Number of DNS Types Supported by PHP 
currently */
-
-# define PHP_DNS_A  0x0001
-# define PHP_DNS_NS 0x0002
-# define PHP_DNS_CNAME  0x0010
-# define PHP_DNS_SOA0x0020
-# define PHP_DNS_PTR0x0800
-# define PHP_DNS_HINFO  0x1000
-# define PHP_DNS_MX 0x4000
-# define PHP_DNS_TXT0x8000
-# define PHP_DNS_A6 0x0100
-# define PHP_DNS_SRV0x0200
-# define PHP_DNS_NAPTR  0x0400
-# define PHP_DNS_   0x0800
-# define PHP_DNS_ANY0x1000
-# define PHP_DNS_ALL
(PHP_DNS_A|PHP_DNS_NS|PHP_DNS_CNAME|PHP_DNS_SOA|PHP_DNS_PTR|PHP_DNS_HINFO|PHP_DNS_MX|PHP_DNS_TXT|PHP_DNS_A6|PHP_DNS_SRV|PHP_DNS_NAPTR|PHP_DNS_)
-#endif /* HAVE_DNS_FUNCS || defined(PHP_WIN32) */
-
-
-
 #if HAVE_DNS_FUNCS
 
 #ifndef HFIXEDSZ



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c

2008-12-31 Thread Antony Dovgal
tony2001Wed Dec 31 15:48:18 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   dns.c 
  Log:
  MFH: don't use WRONG_PARAM_COUNT with new param parsing API
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.10r2=1.70.2.7.2.5.2.11diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.10 
php-src/ext/standard/dns.c:1.70.2.7.2.5.2.11
--- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.10Wed Dec 31 14:30:37 2008
+++ php-src/ext/standard/dns.c  Wed Dec 31 15:48:18 2008
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: dns.c,v 1.70.2.7.2.5.2.10 2008/12/31 14:30:37 iliaa Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.5.2.11 2008/12/31 15:48:18 tony2001 Exp $ */
 
 /* {{{ includes */
 #include php.h
@@ -115,7 +115,7 @@
char buf[4096];
 
if (zend_parse_parameters_none() == FAILURE) {
-   WRONG_PARAM_COUNT;
+   return;
}
 
if (gethostname(buf, sizeof(buf) - 1)) {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c

2008-11-03 Thread Felipe Pena
felipe  Mon Nov  3 11:35:11 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   dns.c 
  Log:
  - MFH: Fixed bug #42855 (dns_get_record() doesn't return all text from TXT 
record)
patch by: misc at e2007 dot cynergi dot com
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.7r2=1.70.2.7.2.5.2.8diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.7 
php-src/ext/standard/dns.c:1.70.2.7.2.5.2.8
--- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.7 Sat Aug 23 19:22:08 2008
+++ php-src/ext/standard/dns.c  Mon Nov  3 11:35:11 2008
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: dns.c,v 1.70.2.7.2.5.2.7 2008/08/23 19:22:08 pajoye Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.5.2.8 2008/11/03 11:35:11 felipe Exp $ */
 
 /* {{{ includes */
 #include php.h
@@ -446,13 +446,22 @@
cp += n;
break;
case DNS_T_TXT:
-   add_assoc_string(*subarray, type, TXT, 1);
-   n = cp[0];
-   tp = emalloc(n + 1);
-   memcpy(tp, cp + 1, n);
-   tp[n] = '\0';
-   cp += dlen;
-   add_assoc_stringl(*subarray, txt, (char*)tp, n, 0);
+   {
+   int ll = 0;
+
+   add_assoc_string(*subarray, type, TXT, 1);
+   tp = emalloc(dlen + 1);
+   
+   while (ll  dlen) {
+   n = cp[ll];
+   memcpy(tp + ll , cp + ll + 1, n);
+   ll = ll + n + 1;
+   }
+   tp[dlen] = '\0';
+   cp += dlen;
+
+   add_assoc_stringl(*subarray, txt, tp, dlen, 
0);
+   }
break;
case DNS_T_SOA:
add_assoc_string(*subarray, type, SOA, 1);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c

2008-05-23 Thread Matt Wilmas
mattwil Fri May 23 09:40:44 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   dns.c 
  Log:
  MFH: Fixed Windows build now that HAVE_INET_PTON is defined
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.5r2=1.70.2.7.2.5.2.6diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.5 
php-src/ext/standard/dns.c:1.70.2.7.2.5.2.6
--- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.5 Mon Apr 14 16:50:11 2008
+++ php-src/ext/standard/dns.c  Fri May 23 09:40:44 2008
@@ -18,10 +18,11 @@
+--+
  */
 
-/* $Id: dns.c,v 1.70.2.7.2.5.2.5 2008/04/14 16:50:11 colder Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.5.2.6 2008/05/23 09:40:44 mattwil Exp $ */
 
 /* {{{ includes */
 #include php.h
+#include php_network.h
 
 #if HAVE_SYS_SOCKET_H
 #include sys/socket.h



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c

2008-04-14 Thread Etienne Kneuss
colder  Mon Apr 14 16:50:11 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   dns.c 
  Log:
  MFH: Fix dns_check_proto (related to #44723)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.4r2=1.70.2.7.2.5.2.5diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.4 
php-src/ext/standard/dns.c:1.70.2.7.2.5.2.5
--- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.4 Thu Jan 17 14:12:12 2008
+++ php-src/ext/standard/dns.c  Mon Apr 14 16:50:11 2008
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: dns.c,v 1.70.2.7.2.5.2.4 2008/01/17 14:12:12 iliaa Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.5.2.5 2008/04/14 16:50:11 colder Exp $ */
 
 /* {{{ includes */
 #include php.h
@@ -247,7 +247,7 @@
 
 #if HAVE_RES_SEARCH  !(defined(__BEOS__)||defined(PHP_WIN32) || 
defined(NETWARE))
 
-/* {{{ proto int dns_check_record(string host [, string type])
+/* {{{ proto bool dns_check_record(string host [, string type])
Check DNS records corresponding to a given Internet host name or IP address 
*/
 PHP_FUNCTION(dns_check_record)
 {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c

2008-01-17 Thread Ilia Alshanetsky
iliaa   Thu Jan 17 14:12:13 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   dns.c 
  Log:
  
  Fixed bug #43871 (crash inside dns_get_record)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.3r2=1.70.2.7.2.5.2.4diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.3 
php-src/ext/standard/dns.c:1.70.2.7.2.5.2.4
--- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.3 Mon Dec 31 07:17:14 2007
+++ php-src/ext/standard/dns.c  Thu Jan 17 14:12:12 2008
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: dns.c,v 1.70.2.7.2.5.2.3 2007/12/31 07:17:14 sebastian Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.5.2.4 2008/01/17 14:12:12 iliaa Exp $ */
 
 /* {{{ includes */
 #include php.h
@@ -654,7 +654,7 @@
char *hostname;
int hostname_len;
long type_param = PHP_DNS_ANY;
-   zval *authns, *addtl;
+   zval *authns = NULL, *addtl = NULL;
int addtl_recs = 0;
int type_to_fetch;
struct __res_state res;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c

2008-01-17 Thread Antony Dovgal
No commit to 5_2 ?

On 17.01.2008 17:12, Ilia Alshanetsky wrote:
 iliaa Thu Jan 17 14:12:13 2008 UTC
 
   Modified files:  (Branch: PHP_5_3)
 /php-src/ext/standard dns.c 
   Log:
   
   Fixed bug #43871 (crash inside dns_get_record)
   
   
 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.3r2=1.70.2.7.2.5.2.4diff_format=u
 Index: php-src/ext/standard/dns.c
 diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.3 
 php-src/ext/standard/dns.c:1.70.2.7.2.5.2.4
 --- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.3   Mon Dec 31 07:17:14 2007
 +++ php-src/ext/standard/dns.cThu Jan 17 14:12:12 2008
 @@ -18,7 +18,7 @@
 +--+
   */
  
 -/* $Id: dns.c,v 1.70.2.7.2.5.2.3 2007/12/31 07:17:14 sebastian Exp $ */
 +/* $Id: dns.c,v 1.70.2.7.2.5.2.4 2008/01/17 14:12:12 iliaa Exp $ */
  
  /* {{{ includes */
  #include php.h
 @@ -654,7 +654,7 @@
   char *hostname;
   int hostname_len;
   long type_param = PHP_DNS_ANY;
 - zval *authns, *addtl;
 + zval *authns = NULL, *addtl = NULL;
   int addtl_recs = 0;
   int type_to_fetch;
   struct __res_state res;
 


-- 
Wbr, 
Antony Dovgal

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c

2008-01-17 Thread Ilia Alshanetsky
The crash is in new code introduced into 5.3+, the 5.2 branch is not  
affected by the bug.



On 17-Jan-08, at 4:25 PM, Antony Dovgal wrote:


No commit to 5_2 ?

On 17.01.2008 17:12, Ilia Alshanetsky wrote:

iliaa   Thu Jan 17 14:12:13 2008 UTC

 Modified files:  (Branch: PHP_5_3)
   /php-src/ext/standarddns.c
 Log:

 Fixed bug #43871 (crash inside dns_get_record)


http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.3r2=1.70.2.7.2.5.2.4diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.3 php-src/ext/ 
standard/dns.c:1.70.2.7.2.5.2.4
--- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.3	Mon Dec 31 07:17:14  
2007

+++ php-src/ext/standard/dns.c  Thu Jan 17 14:12:12 2008
@@ -18,7 +18,7 @@

+ 
--+

 */

-/* $Id: dns.c,v 1.70.2.7.2.5.2.3 2007/12/31 07:17:14 sebastian Exp  
$ */

+/* $Id: dns.c,v 1.70.2.7.2.5.2.4 2008/01/17 14:12:12 iliaa Exp $ */

/* {{{ includes */
#include php.h
@@ -654,7 +654,7 @@
char *hostname;
int hostname_len;
long type_param = PHP_DNS_ANY;
-   zval *authns, *addtl;
+   zval *authns = NULL, *addtl = NULL;
int addtl_recs = 0;
int type_to_fetch;
struct __res_state res;




--
Wbr,
Antony Dovgal

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Ilia Alshanetsky

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c /ext/standard/tests/network getmxrr.phpt

2007-11-22 Thread Derick Rethans
derick  Thu Nov 22 10:20:09 2007 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/network getmxrr.phpt 

  Modified files:  
/php-src/ext/standard   dns.c 
  Log:
  - MFH: Fixed weights array, which was broken with:
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.80r2=1.81
and merged to head with:

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5r2=1.70.2.7.2.5.2.1
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.1r2=1.70.2.7.2.5.2.2diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.1 
php-src/ext/standard/dns.c:1.70.2.7.2.5.2.2
--- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.1 Mon Nov  5 13:42:33 2007
+++ php-src/ext/standard/dns.c  Thu Nov 22 10:20:09 2007
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: dns.c,v 1.70.2.7.2.5.2.1 2007/11/05 13:42:33 jani Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.5.2.2 2007/11/22 10:20:09 derick Exp $ */
 
 /* {{{ includes */
 #include php.h
@@ -836,7 +836,6 @@
char *hostname;
int hostname_len;
zval *mx_list, *weight_list = NULL;
-   int need_weight = 0;
int count, qdc;
u_short type, weight;
u_char ans[MAXPACKET];
@@ -891,7 +890,7 @@
}
cp += i;
add_next_index_string(mx_list, buf, 1);
-   if (need_weight) {
+   if (weight_list) {
add_next_index_long(weight_list, weight);
}
}

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/network/getmxrr.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/network/getmxrr.phpt
+++ php-src/ext/standard/tests/network/getmxrr.phpt
--TEST--
dns_check_record() segfault with empty host
--FILE--
?php
$domains = array( 'php.net', 'ez.no' );
foreach ( $domains as $domain )
{
if ( getmxrr( $domain, $hosts, $weights ) )
{
echo Hosts:  . count( $hosts ) . , weights:  . count( $weights ) . 
\n;
}
}
?
--EXPECT--
Hosts: 2, weights: 2
Hosts: 1, weights: 1

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dns.c

2007-11-05 Thread Jani Taskinen
janiMon Nov  5 13:42:33 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   dns.c 
  Log:
  MFH: Sync
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5r2=1.70.2.7.2.5.2.1diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5 
php-src/ext/standard/dns.c:1.70.2.7.2.5.2.1
--- php-src/ext/standard/dns.c:1.70.2.7.2.5 Tue Jun 26 11:04:55 2007
+++ php-src/ext/standard/dns.c  Mon Nov  5 13:42:33 2007
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: dns.c,v 1.70.2.7.2.5 2007/06/26 11:04:55 tony2001 Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.5.2.1 2007/11/05 13:42:33 jani Exp $ */
 
 /* {{{ includes */
 #include php.h
@@ -33,7 +33,7 @@
 #define WINNT 1
 #endif
 /* located in www.php.net/extra/bindlib.zip */
-#if HAVE_ARPA_INET_H 
+#if HAVE_ARPA_INET_H
 #include arpa/inet.h
 #endif
 #include netdb.h
@@ -123,18 +123,17 @@
Get the Internet host name corresponding to a given IP address */
 PHP_FUNCTION(gethostbyaddr)
 {
-   zval **arg;
-   char *addr; 
-   
-   if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, arg) == FAILURE) 
{
-   ZEND_WRONG_PARAM_COUNT();
+   char *addr;
+   int addr_len;
+   char *hostname;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, addr, 
addr_len) == FAILURE) {
+   return;
}
 
-   convert_to_string_ex(arg);
-   
-   addr = php_gethostbyaddr(Z_STRVAL_PP(arg));
+   hostname = php_gethostbyaddr(addr);
 
-   if (addr == NULL) {
+   if (hostname == NULL) {
 #if HAVE_IPV6  HAVE_INET_PTON
php_error_docref(NULL TSRMLS_CC, E_WARNING, Address is not a 
valid IPv4 or IPv6 address);
 #else
@@ -142,7 +141,7 @@
 #endif
RETVAL_FALSE;
} else {
-   RETVAL_STRING(addr, 0);
+   RETVAL_STRING(hostname, 0);
}
 }
 /* }}} */
@@ -186,15 +185,17 @@
Get the IP address corresponding to a given Internet host name */
 PHP_FUNCTION(gethostbyname)
 {
-   zval **arg;
-   
-   if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, arg) == FAILURE) 
{
-   ZEND_WRONG_PARAM_COUNT();
+   char *hostname;
+   int hostname_len;
+   char *addr;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, hostname, 
hostname_len) == FAILURE) {
+   return;
}
 
-   convert_to_string_ex(arg);
+   addr = php_gethostbyname(hostname);
 
-   RETVAL_STRING(php_gethostbyname(Z_STRVAL_PP(arg)), 0);
+   RETVAL_STRING(addr, 0);
 }
 /* }}} */
 
@@ -202,17 +203,17 @@
Return a list of IP addresses that a given hostname resolves to. */
 PHP_FUNCTION(gethostbynamel)
 {
-   zval **arg;
+   char *hostname;
+   int hostname_len;
struct hostent *hp;
struct in_addr in;
int i;
 
-   if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, arg) == FAILURE) 
{
-   ZEND_WRONG_PARAM_COUNT();
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, hostname, 
hostname_len) == FAILURE) {
+   return;
}
-   convert_to_string_ex(arg);
 
-   hp = gethostbyname(Z_STRVAL_PP(arg));
+   hp = gethostbyname(hostname);
if (hp == NULL || hp-h_addr_list == NULL) {
RETURN_FALSE;
}
@@ -250,62 +251,43 @@
Check DNS records corresponding to a given Internet host name or IP address 
*/
 PHP_FUNCTION(dns_check_record)
 {
-   zval **arg1, **arg2;
-   int type, i;
 #ifndef MAXPACKET
 #define MAXPACKET  8192 /* max packet size used internally by BIND */
 #endif
u_char ans[MAXPACKET];
-   
-   switch (ZEND_NUM_ARGS()) {
-   case 1:
-   if (zend_get_parameters_ex(1, arg1) == FAILURE) {
-   WRONG_PARAM_COUNT;
-   }
-   type = T_MX;
-   convert_to_string_ex(arg1);
-   
-   if (Z_STRLEN_PP(arg1) == 0) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Host cannot be empty);
-   RETURN_FALSE;
-   }
-   break;
+   char *hostname, *rectype = NULL;
+   int hostname_len, rectype_len = 0;
+   int type = T_MX, i;
 
-   case 2:
-   if (zend_get_parameters_ex(2, arg1, arg2) == FAILURE) 
{
-   WRONG_PARAM_COUNT;
-   }
-   convert_to_string_ex(arg1);
-   convert_to_string_ex(arg2);
-
-   if (Z_STRLEN_PP(arg1) == 0 || Z_STRLEN_PP(arg2) == 0) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Host and type cannot be empty);
-   RETURN_FALSE;
-