ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/ircd.c
(Generate patch)

Comparing:
ircd-hybrid/src/ircd.c (file contents), Revision 31 by knight, Sun Oct 2 20:34:05 2005 UTC vs.
ircd-hybrid-7.2/src/ircd.c (file contents), Revision 950 by michael, Tue Jul 21 23:07:52 2009 UTC

# Line 53 | Line 53
53   #include "s_log.h"
54   #include "s_misc.h"
55   #include "s_serv.h"      /* try_connections */
56 #include "s_stats.h"
56   #include "send.h"
57   #include "whowas.h"
58   #include "modules.h"
# Line 63 | Line 62
62   #include "balloc.h"
63   #include "motd.h"
64   #include "supported.h"
65 + #include "watch.h"
66  
67   /* Try and find the correct name to use with getrlimit() for setting the max.
68   * number of files allowed to be open by this process.
# Line 80 | Line 80 | struct admin_info AdminInfo = { NULL, NU
80   struct Counter Count = { 0, 0, 0, 0, 0, 0, 0, 0 };
81   struct ServerState_t server_state = { 0 };
82   struct logging_entry ConfigLoggingEntry = { 1, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0} };
83 + struct ServerStatistics ServerStats;
84   struct timeval SystemTime;
85   struct Client me;             /* That's me */
86   struct LocalUser meLocalUser; /* That's also part of me */
86 unsigned long connect_id = 0; /* unique connect ID */
87  
88   static unsigned long initialVMTop = 0;   /* top of virtual memory at init */
89   const char *logFileName = LPATH;
# Line 122 | Line 122 | unsigned int split_servers;
122  
123   int rehashed_klines = 0;
124  
125 /*
126 * get_vm_top - get the operating systems notion of the resident set size
127 */
128 #ifndef _WIN32
129 static unsigned long
130 get_vm_top(void)
131 {
132  /*
133   * NOTE: sbrk is not part of the ANSI C library or the POSIX.1 standard
134   * however it seems that everyone defines it. Calling sbrk with a 0
135   * argument will return a pointer to the top of the process virtual
136   * memory without changing the process size, so this call should be
137   * reasonably safe (sbrk returns the new value for the top of memory).
138   * This code relies on the notion that the address returned will be an
139   * offset from 0 (NULL), so the result of sbrk is cast to a size_t and
140   * returned. We really shouldn't be using it here but...
141   */
142
143  void *vptr = sbrk(0);
144  return((unsigned long)vptr);
145 }
125  
126 + #ifndef _WIN32
127   /*
128   * print_startup - print startup information
129   */
# Line 176 | Line 156 | make_daemon(void)
156   }
157   #endif
158  
179 /*
180 * get_maxrss - get the operating systems notion of the resident set size
181 */
182 unsigned long
183 get_maxrss(void)
184 {
185 #ifdef _WIN32
186  return (0);   /* FIXME */
187 #else
188  return (get_vm_top() - initialVMTop);
189 #endif
190 }
191
159   static int printVersion = 0;
160  
161   struct lgetopt myopts[] = {
# Line 281 | Line 248 | io_loop(void)
248        {
249          struct Client *client_p = ptr->data;
250          assert(client_p->localClient->list_task);
251 <        safe_list_channels(client_p, client_p->localClient->list_task, 0, 0);
251 >        safe_list_channels(client_p, client_p->localClient->list_task, 0);
252        }
253      }
254  
# Line 380 | Line 347 | static void
347   initialize_server_capabs(void)
348   {
349    add_capability("QS", CAP_QS, 1);
383  add_capability("LL", CAP_LL, 1);
350    add_capability("EOB", CAP_EOB, 1);
351 +
352    if (ServerInfo.sid != NULL)   /* only enable TS6 if we have an SID */
353      add_capability("TS6", CAP_TS6, 0);
354 +
355    add_capability("ZIP", CAP_ZIP, 0);
356    add_capability("CLUSTER", CAP_CLUSTER, 1);
357   #ifdef HALFOPS
# Line 529 | Line 497 | init_ssl(void)
497   static void
498   init_callbacks(void)
499   {
500 <  iorecv_cb = register_callback("iorecv", NULL);
501 <  iosend_cb = register_callback("iosend", NULL);
500 >  iorecv_cb = register_callback("iorecv", iorecv_default);
501 >  iosend_cb = register_callback("iosend", iosend_default);
502    iorecvctrl_cb = register_callback("iorecvctrl", NULL);
503    iosendctrl_cb = register_callback("iosendctrl", NULL);
504   }
# Line 550 | Line 518 | main(int argc, char *argv[])
518  
519    /* Setup corefile size immediately after boot -kre */
520    setup_corefile();
553
554  /* set initialVMTop before we allocate any memory */
555  initialVMTop = get_vm_top();
521   #endif
522  
523    /* save server boot time right away, so getrusage works correctly */
# Line 567 | Line 532 | main(int argc, char *argv[])
532                                                     of Client list */
533  
534    memset(&ServerInfo, 0, sizeof(ServerInfo));
535 +  memset(&ServerStats, 0, sizeof(ServerStats));
536  
537    /* Initialise the channel capability usage counts... */
538    init_chcap_usage_counts();
# Line 638 | Line 604 | main(int argc, char *argv[])
604    init_client();
605    init_class();
606    init_whowas();
607 <  init_stats();
607 >  watch_init();
608    read_conf_files(1);   /* cold start init conf files */
643  initServerMask();
609    me.id[0] = '\0';
610    init_uid();
611    init_auth();          /* Initialise the auth code */
# Line 656 | Line 621 | main(int argc, char *argv[])
621      ilog(L_CRIT, "No server name specified in serverinfo block.");
622      exit(EXIT_FAILURE);
623    }
624 +
625    strlcpy(me.name, ServerInfo.name, sizeof(me.name));
626  
627    /* serverinfo{} description must exist.  If not, error out.*/
# Line 665 | Line 631 | main(int argc, char *argv[])
631        "ERROR: No server description specified in serverinfo block.");
632      exit(EXIT_FAILURE);
633    }
634 +
635    strlcpy(me.info, ServerInfo.description, sizeof(me.info));
636  
637    me.from    = &me;
# Line 727 | Line 694 | main(int argc, char *argv[])
694      eventAddIsh("check_splitmode", check_splitmode, NULL, 60);
695  
696    io_loop();
697 <  return(0);
697 >  return 0;
698   }

Comparing:
ircd-hybrid/src/ircd.c (property svn:keywords), Revision 31 by knight, Sun Oct 2 20:34:05 2005 UTC vs.
ircd-hybrid-7.2/src/ircd.c (property svn:keywords), Revision 950 by michael, Tue Jul 21 23:07:52 2009 UTC

# Line 1 | Line 1
1 < "Id Revision"
1 > Id Revision

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)