Show
Ignore:
Timestamp:
10/16/08 08:43:46 (5 years ago)
Author:
tokuhirom
Message:

oops. why i commit this code yesterday?

Location:
lang/cplusplus/llv8call/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/cplusplus/llv8call/trunk/ext/socket/socket.cc

    r21397 r21401  
    281281    struct hostent * ent = gethostbyname(*hostname); 
    282282    if (ent) { 
    283         if (ent->h_length) { 
    284             return String::New( ent->h_addr_list[0] ); 
     283        if (ent->h_addr_list[0] != NULL) { 
     284            struct in_addr * addr = (in_addr*)ent->h_addr_list[0]; 
     285            return String::New( inet_ntoa(*addr) ); 
    285286        } else { 
    286287            return Undefined(); 
  • lang/cplusplus/llv8call/trunk/t/100_socket/08_gethostbyname.js

    r21397 r21401  
    55check_lib("org.coderepos.socket", 'Socket'); 
    66 
    7 is(Socket.gethostbyname('localhost'), '127.0.0.1'); 
     7is(Socket.gethostbyname('example.com'), '208.77.188.166'); 
    88