/[jscoverage]/trunk/http-host.c
ViewVC logotype

Diff of /trunk/http-host.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 118 by siliconforks, Sat May 31 22:32:16 2008 UTC revision 125 by siliconforks, Mon Jun 2 17:52:38 2008 UTC
# Line 22  Line 22 
22  #include "http-server.h"  #include "http-server.h"
23    
24  #include <errno.h>  #include <errno.h>
 #include <netdb.h>  
25    
26  #include "util.h"  #include "util.h"
27    
28  int xgethostbyname(const char * host, struct in_addr * a) {  int xgethostbyname(const char * host, struct in_addr * a) {
29  #ifdef __CYGWIN__  #if defined(__CYGWIN__) || defined(__MINGW32__)
30    /* cygwin's gethostbyname is thread-safe */    /* gethostbyname is thread-safe */
31    struct hostent * p = gethostbyname(host);    struct hostent * p = gethostbyname(host);
32    if (p == NULL || p->h_addrtype != AF_INET) {    if (p == NULL || p->h_addrtype != AF_INET) {
33      return -1;      return -1;
# Line 58  Line 57 
57    return 0;    return 0;
58  #endif  #endif
59  }  }
60    
61    #ifndef HAVE_INET_ATON
62    int inet_aton(const char * name, struct in_addr * a) {
63      unsigned long result = inet_addr(name);
64      if (result == INADDR_NONE) {
65        return 0;
66      }
67      else {
68        a->s_addr = result;
69        return 1;
70      }
71    }
72    #endif

Legend:
Removed from v.118  
changed lines
  Added in v.125

  ViewVC Help
Powered by ViewVC 1.1.24