Difference for socket/init.c from version 1.47 to 1.48


version 1.47 version 1.48
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_init_c =   * static char *rcsid_init_c =
  *    "$Id: init.c,v 1.47 2006/03/14 17:12:28 ryo_saeba Exp $";   *    "$Id: init.c,v 1.48 2006/03/18 15:05:37 ryo_saeba Exp $";
  */   */
   
 /*  /*
Line 60
 
Line 60
 #include <newserver.h>  #include <newserver.h>
   
 Socket_Info socket_info;  Socket_Info socket_info;
 NewSocket *init_sockets;  socket_struct* init_sockets;
   
 /**  /**
  * Initializes a connection. Really, it just sets up the data structure,   * Initializes a connection. Really, it just sets up the data structure,
  * socket setup is handled elsewhere.  We do send a version to the   * socket setup is handled elsewhere.  We do send a version to the
  * client.   * client.
  */   */
 void InitConnection(NewSocket *ns, const char *from_ip)  void init_connection(socket_struct *ns, const char *from_ip)
 {  {
     SockList sl;      SockList sl;
     unsigned char buf[256];      unsigned char buf[256];
Line 79
 
Line 79
  int temp = 1;    int temp = 1;
   
  if(ioctlsocket(ns->fd, FIONBIO , &temp) == -1)   if(ioctlsocket(ns->fd, FIONBIO , &temp) == -1)
  LOG(llevError,"InitConnection:  Error on ioctlsocket.\n");   LOG(llevError,"init_connection:  Error on ioctlsocket.\n");
 #else   #else
     if (fcntl(ns->fd, F_SETFL, O_NONBLOCK)==-1) {      if (fcntl(ns->fd, F_SETFL, O_NONBLOCK)==-1) {
  LOG(llevError,"InitConnection:  Error on fcntl.\n");   LOG(llevError,"init_connection:  Error on fcntl.\n");
     }      }
 #endif /* end win32 */  #endif /* end win32 */
   
Line 93
 
Line 93
  LOG(llevDebug, "Default buffer size was %d bytes, will reset it to %d\n", oldbufsize, bufsize);   LOG(llevDebug, "Default buffer size was %d bytes, will reset it to %d\n", oldbufsize, bufsize);
 #endif  #endif
  if(setsockopt(ns->fd,SOL_SOCKET,SO_SNDBUF, (char*)&bufsize, sizeof(&bufsize))) {   if(setsockopt(ns->fd,SOL_SOCKET,SO_SNDBUF, (char*)&bufsize, sizeof(&bufsize))) {
      LOG(llevError,"InitConnection: setsockopt unable to set output buf size to %d\n", bufsize);       LOG(llevError,"init_connection: setsockopt unable to set output buf size to %d\n", bufsize);
  }   }
     }      }
     buflen=sizeof(oldbufsize);      buflen=sizeof(oldbufsize);
Line 133
 
Line 133
     ns->inbuf.len=0;      ns->inbuf.len=0;
     ns->inbuf.buf=malloc( sizeof( unsigned char ) * MAXSOCKBUF );      ns->inbuf.buf=malloc( sizeof( unsigned char ) * MAXSOCKBUF );
     /* Basic initialization. Needed because we do a check in      /* Basic initialization. Needed because we do a check in
      * HandleClient for oldsocketmode without checking the       * handle_client for oldsocketmode without checking the
      * length of data.       * length of data.
      */       */
     memset( ns->inbuf.buf, 0, sizeof( unsigned char ) * MAXSOCKBUF );      memset( ns->inbuf.buf, 0, sizeof( unsigned char ) * MAXSOCKBUF );
Line 207
 
Line 207
   
     LOG(llevDebug,"Initialize new client/server data\n");      LOG(llevDebug,"Initialize new client/server data\n");
     socket_info.nconns = 1;      socket_info.nconns = 1;
     init_sockets = malloc(sizeof(NewSocket));      init_sockets = malloc(sizeof(socket_struct));
     init_sockets[0].faces_sent = NULL; /* unused */      init_sockets[0].faces_sent = NULL; /* unused */
     socket_info.allocated_sockets=1;      socket_info.allocated_sockets=1;
   
Line 303
 
Line 303
  * update the list   * update the list
  */   */
   
 void free_newsocket(NewSocket *ns)  void free_newsocket(socket_struct *ns)
 {  {
 #ifdef WIN32 /* ***win32: closesocket in windows style */  #ifdef WIN32 /* ***win32: closesocket in windows style */
  shutdown(ns->fd,SD_BOTH);   shutdown(ns->fd,SD_BOTH);


Legend:
line(s) removed in v.1.47 
line(s) changed
 line(s) added in v.1.48

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