Difference for socket/metaserver.c from version 1.7 to 1.8


version 1.7 version 1.8
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_metaserver_c =   * static char *rcsid_metaserver_c =
  *    "$Id: metaserver.c,v 1.7 2001/04/06 00:43:52 michtoen Exp $";   *    "$Id: metaserver.c,v 1.8 2001/04/06 19:08:13 michtoen Exp $";
  */   */
   
 /*  /*
Line 27
 
Line 27
 */  */
 #include <global.h>  #include <global.h>
   
 #ifndef WIN32 //---win32 exclude unix header files  #ifndef WIN32 /* ---win32 exclude unix header files */
 #include <sys/types.h>  #include <sys/types.h>
 #include <sys/socket.h>  #include <sys/socket.h>
 #include <netinet/in.h>  #include <netinet/in.h>
Line 35
 
Line 35
 #include <arpa/inet.h>  #include <arpa/inet.h>
   
 #include <version.h>  #include <version.h>
 #endif // end win32  #endif /* end win32 */
   
 static int metafd=-1;  static int metafd=-1;
 static struct sockaddr_in sock;  static struct sockaddr_in sock;
Line 48
 
Line 48
 void metaserver_init()  void metaserver_init()
 {  {
   
 #ifdef WIN32 // ***win32 metaserver_init(): init win32 socket  #ifdef WIN32 /* ***win32 metaserver_init(): init win32 socket */
  struct hostent *hostbn;   struct hostent *hostbn;
  int temp = 1;    int temp = 1;
 #endif  #endif
Line 68
 
Line 68
  }   }
  memcpy(&sock.sin_addr, hostbn->h_addr, hostbn->h_length);   memcpy(&sock.sin_addr, hostbn->h_addr, hostbn->h_length);
     }      }
 #ifdef WIN32 // ***win32 metaserver_init(): init win32 socket  #ifdef WIN32 /* ***win32 metaserver_init(): init win32 socket */
  ioctlsocket(metafd, FIONBIO , &temp);   ioctlsocket(metafd, FIONBIO , &temp);
 #else   #else
     fcntl(metafd, F_SETFL, O_NONBLOCK);      fcntl(metafd, F_SETFL, O_NONBLOCK);
Line 96
 
Line 96
      return;       return;
  }   }
   
 #ifdef WIN32 // ***win32 metaserver_init(): gethostbyname!  #ifdef WIN32 /* ***win32 metaserver_init(): gethostbyname! */
  hostbn = gethostbyname(hostname);   hostbn = gethostbyname(hostname);
  if (hostbn != (struct hostent *) NULL) // quick hack   if (hostbn != (struct hostent *) NULL) /* quick hack */
  memcpy(domain, hostbn->h_addr, hostbn->h_length);   memcpy(domain, hostbn->h_addr, hostbn->h_length);
   
  if (hostbn == (struct hostent *) NULL) {   if (hostbn == (struct hostent *) NULL) {
 #else  #else
  if (getdomainname(domain, MAX_BUF-1)) {   if (getdomainname(domain, MAX_BUF-1)) {
 #endif // win32  #endif /* win32 */
      LOG(llevDebug,"metaserver_init: getdomainname failed - will not report hostname\n");       LOG(llevDebug,"metaserver_init: getdomainname failed - will not report hostname\n");
      return;       return;
  }   }
Line 130
 
Line 130
   
     sprintf(data,"%s|%d|%s|%s", settings.meta_host, num_players, VERSION,       sprintf(data,"%s|%d|%s|%s", settings.meta_host, num_players, VERSION,
      settings.meta_comment);       settings.meta_comment);
 #ifdef WIN32 // ---win32 metaserver_init(): this removes a warning   #ifdef WIN32 /* ---win32 metaserver_init(): this removes a warning  */
     if (sendto(metafd, data, strlen(data), 0, (struct sockaddr *)&sock, sizeof(sock))<0) {      if (sendto(metafd, data, strlen(data), 0, (struct sockaddr *)&sock, sizeof(sock))<0) {
 #else  #else
     if (sendto(metafd, data, strlen(data), 0, &sock, sizeof(sock))<0) {      if (sendto(metafd, data, strlen(data), 0, &sock, sizeof(sock))<0) {


Legend:
line(s) removed in v.1.7 
line(s) changed
 line(s) added in v.1.8

File made using version 1.98 of cvs2html by leaf at 2011-07-21 19:36