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

Comparing ircd-hybrid/src/ircd.c (file contents):
Revision 398 by michael, Tue Feb 7 12:00:21 2006 UTC vs.
Revision 515 by michael, Sun Mar 5 09:26:04 2006 UTC

# Line 45 | Line 45
45   #include "s_conf.h"
46   #include "parse_aline.h"
47   #include "s_serv.h"
48 #include "s_stats.h"
48   #include "send.h"
49   #include "whowas.h"
50 < #include "modules.h"
50 > #include "conf/modules.h"
51   #include "ircd_getopt.h"
52   #include "motd.h"
53   #include "supported.h"
# Line 60 | Line 59
59  
60   /* /quote set variables */
61   struct SetOptions GlobalSetOptions;
62 <
62 > struct ServerStatistics ServerStats;
63   /* configuration set from ircd.conf */
64   struct config_file_entry ConfigFileEntry;
65   /* server info set from ircd.conf */
# Line 83 | Line 82 | char ircd_platform[PLATFORMLEN];
82  
83   int dorehash = 0;
84   int doremotd = 0;
86 time_t nextconnect = 1;       /* time for next try_connections call */
85  
86   /* Set to zero because it should be initialized later using
87   * initialize_server_capabs
# Line 132 | Line 130 | get_vm_top(void)
130     */
131  
132    void *vptr = sbrk(0);
133 <  return((unsigned long)vptr);
133 >  return (unsigned long)vptr;
134   }
135  
136   /*
# Line 250 | Line 248 | io_loop(void)
248        rehash(1);
249        dorehash = 0;
250      }
251 +
252      if (doremotd)
253      {
254        read_message_file(&ConfigFileEntry.motd);
# Line 298 | Line 297 | initialize_global_set_options(void)
297    GlobalSetOptions.ident_timeout = IDENT_TIMEOUT;
298    GlobalSetOptions.idletime = ConfigFileEntry.idletime;
299    GlobalSetOptions.maxlisters = 10; /* XXX ya ya ya - db */
301  /* End of global set options */
300   }
301  
302   /* initialize_message_files()
# Line 362 | Line 360 | write_pidfile(const char *filename)
360             pid, filename, strerror(errno));
361  
362      fbclose(fb);
365    return;
363    }
364    else
365    {
# Line 448 | Line 445 | static void
445   init_ssl(void)
446   {
447   #ifdef HAVE_LIBCRYPTO
448 +  SSL_library_init();
449    SSL_load_error_strings();
452  SSLeay_add_ssl_algorithms();
450  
451    ServerInfo.ctx = SSL_CTX_new(SSLv23_server_method());
452 +
453    if (!ServerInfo.ctx)
454    {
455      const char *s;
# Line 515 | Line 513 | changing_fdlimit(va_list args)
513   EXTERN int
514   main(int argc, char *argv[])
515   {
516 <  /* Check to see if the user is running
517 <   * us as root, which is a nono
516 >  /*
517 >   * Check to see if the user is running us as root, which is a nono
518     */
519   #ifndef _WIN32
520    if (geteuid() == 0)
# Line 533 | Line 531 | main(int argc, char *argv[])
531   #endif
532  
533    memset(&ServerInfo, 0, sizeof(ServerInfo));
534 +  memset(&ServerStats, 0, sizeof(ServerStats));
535  
536    ConfigFileEntry.dpath      = DPATH;
537    ConfigFileEntry.configfile = CPATH;  /* Server configuration file */
# Line 583 | Line 582 | main(int argc, char *argv[])
582    /* make_dlink_node() cannot be called until after libio_init() */
583    memset(&me, 0, sizeof(me));
584    memset(&meLocalUser, 0, sizeof(meLocalUser));
585 +
586    me.localClient = &meLocalUser;
587    me.from = me.servptr = &me;
588    me.lasttime = me.since = me.firsttime = CurrentTime;
# Line 601 | Line 601 | main(int argc, char *argv[])
601    init_client();
602    init_class();
603    init_whowas();
604  init_stats();
604    init_auth();          /* Initialise the auth code */
605    init_channels();
606    init_channel_modes();
# Line 613 | Line 612 | main(int argc, char *argv[])
612  
613    if (ServerInfo.name == NULL)
614    {
615 <    ilog(L_CRIT, "No server name specified in serverinfo block.");
615 >    ilog(L_CRIT, "ERROR: No server name specified in serverinfo block.");
616      exit(EXIT_FAILURE);
617    }
618 +
619    strlcpy(me.name, ServerInfo.name, sizeof(me.name));
620  
621    /* serverinfo{} description must exist.  If not, error out.*/
# Line 625 | Line 625 | main(int argc, char *argv[])
625        "ERROR: No server description specified in serverinfo block.");
626      exit(EXIT_FAILURE);
627    }
628 +
629    strlcpy(me.info, ServerInfo.description, sizeof(me.info));
630  
631    hash_add_client(&me);
# Line 639 | Line 640 | main(int argc, char *argv[])
640      exit(EXIT_FAILURE);
641    }
642  
643 <  load_all_modules(1);
643 <  load_conf_modules();
644 <  load_core_modules(1);
643 >  boot_modules(1);
644  
645    /* Go back to DPATH after checking to see if we can chdir to MODPATH */
646    chdir(ConfigFileEntry.dpath);
# Line 680 | Line 679 | main(int argc, char *argv[])
679      eventAddIsh("check_splitmode", check_splitmode, NULL, 60);
680  
681    io_loop();
682 <  return(0);
682 >  return 0;
683   }
684  
685   #else

Diff Legend

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