[PHP-DEV] CVS update: php3/functions From: sas (php-dev <email protected>)
Date: 02/27/99

Date: Saturday February 27, 1999 @ 12:03
Author: sas

Update of /repository/php3/functions
In directory asf:/u/temp/cvs-serv13278

Modified Files:
        dns.c
Log Message:
inet_addr is depracated
Index: php3/functions/dns.c
diff -c php3/functions/dns.c:1.52 php3/functions/dns.c:1.53
*** php3/functions/dns.c:1.52 Fri Jan 1 12:59:08 1999
--- php3/functions/dns.c Sat Feb 27 12:03:50 1999
***************
*** 28,34 ****
     +----------------------------------------------------------------------+
   */
  
! /* $Id: dns.c,v 1.52 1999/01/01 17:59:08 zeev Exp $ */
  
  #ifdef THREAD_SAFE
  #include "tls.h"
--- 28,34 ----
     +----------------------------------------------------------------------+
   */
  
! /* $Id: dns.c,v 1.53 1999/02/27 17:03:50 sas Exp $ */
  
  #ifdef THREAD_SAFE
  #include "tls.h"
***************
*** 88,103 ****
  
  char *_php3_gethostbyaddr(char *ip)
  {
- unsigned long addr;
          struct hostent *hp;
!
! if ((int) (addr = inet_addr(ip)) == -1) {
  #if DEBUG
                  php3_error(E_WARNING, "address not in a.b.c.d form");
  #endif
                  return estrdup(ip);
          }
! hp = gethostbyaddr((char *) &addr, sizeof(addr), AF_INET);
          if (!hp) {
  #if DEBUG
                  php3_error(E_WARNING, "Unable to resolve %s\n", ip);
--- 88,104 ----
  
  char *_php3_gethostbyaddr(char *ip)
  {
          struct hostent *hp;
! struct in_addr in;
!
!
! if (!inet_aton(ip, &in)) {
  #if DEBUG
                  php3_error(E_WARNING, "address not in a.b.c.d form");
  #endif
                  return estrdup(ip);
          }
! hp = gethostbyaddr((char *) &in, sizeof(in), AF_INET);
          if (!hp) {
  #if DEBUG
                  php3_error(E_WARNING, "Unable to resolve %s\n", ip);

--
PHP Development Mailing List   http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe <email protected>
For help: php-dev-help <email protected>