Difference for socket/metaserver.c from version 1.2 to 1.3


version 1.2 version 1.3
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_metaserver_c =   * static char *rcsid_metaserver_c =
  *    "$Id: metaserver.c,v 1.2 2000/11/17 05:07:45 cvs Exp $";   *    "$Id: metaserver.c,v 1.3 2000/11/18 04:27:49 cvs Exp $";
  */   */
   
 /*  /*
Line 35
 
Line 35
 #include <version.h>  #include <version.h>
 #include <patchlevel.h>  #include <patchlevel.h>
   
 #ifndef MSG_DONTWAIT  
 #define MSG_DONTWAIT O_NONBLOCK  
 #endif  
   
 static int metafd=-1;  static int metafd=-1;
 static struct sockaddr_in sock;  static struct sockaddr_in sock;
   
Line 65
 
Line 61
  }   }
  memcpy(&sock.sin_addr, hostbn->h_addr, hostbn->h_length);   memcpy(&sock.sin_addr, hostbn->h_addr, hostbn->h_length);
     }      }
       fcntl(metafd, F_SETFL, O_NONBLOCK);
     if ((metafd=socket(AF_INET, SOCK_DGRAM, 0))==-1) {      if ((metafd=socket(AF_INET, SOCK_DGRAM, 0))==-1) {
  LOG(llevDebug,"metaserver_init: Unable to create socket, err %d\n", errno);   LOG(llevDebug,"metaserver_init: Unable to create socket, err %d\n", errno);
  return;   return;
Line 73
 
Line 70
     sock.sin_port = htons(settings.meta_port);      sock.sin_port = htons(settings.meta_port);
     if (connect(metafd, &sock, sizeof(sock))<0) {      if (connect(metafd, &sock, sizeof(sock))<0) {
  LOG(llevDebug,"metaserver_init: Unable to connect to metaserver, err %d\n", errno);   LOG(llevDebug,"metaserver_init: Unable to connect to metaserver, err %d\n", errno);
  close(metafd);  
  metafd=-1;  
  return;  
     }      }
     /* No hostname specified, so lets try to figure one out */      /* No hostname specified, so lets try to figure one out */
     if (settings.meta_host[0]==0) {      if (settings.meta_host[0]==0) {
Line 110
 
Line 104
   
     sprintf(data,"%s|%d|%s%s|%s", settings.meta_host, num_players, VERSION, PATCH,       sprintf(data,"%s|%d|%s%s|%s", settings.meta_host, num_players, VERSION, PATCH,
      settings.meta_comment);       settings.meta_comment);
     if (sendto(metafd, data, strlen(data), MSG_DONTWAIT, &sock, sizeof(sock))<0) {      if (sendto(metafd, data, strlen(data), 0, &sock, sizeof(sock))<0) {
  LOG(llevDebug,"metaserver_update: sendto failed, err = %d\n", errno);   LOG(llevDebug,"metaserver_update: sendto failed, err = %d\n", errno);
     }      }
 }  }


Legend:
line(s) removed in v.1.2 
line(s) changed
 line(s) added in v.1.3

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