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-8/src/ircd.c (file contents):
Revision 1176 by michael, Sun Aug 14 11:24:24 2011 UTC vs.
Revision 1302 by michael, Wed Mar 21 17:48:54 2012 UTC

# Line 29 | Line 29
29   #include "channel.h"
30   #include "channel_mode.h"
31   #include "client.h"
32 #include "common.h"
32   #include "event.h"
33   #include "fdlist.h"
34   #include "hash.h"
# Line 37 | Line 36
36   #include "ircd_signal.h"
37   #include "s_gline.h"
38   #include "motd.h"
40 #include "ircd_handler.h"
41 #include "msg.h"         /* msgtab */
39   #include "hostmask.h"
40   #include "numeric.h"
41   #include "packet.h"
# Line 63 | Line 60
60   #include "supported.h"
61   #include "watch.h"
62  
66 /* Try and find the correct name to use with getrlimit() for setting the max.
67 * number of files allowed to be open by this process.
68 */
63  
64   /* /quote set variables */
65   struct SetOptions GlobalSetOptions;
# Line 78 | Line 72 | struct server_info ServerInfo;
72   struct admin_info AdminInfo = { NULL, NULL, NULL };
73   struct Counter Count = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
74   struct ServerState_t server_state = { 0 };
75 < struct logging_entry ConfigLoggingEntry = { 1, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0} };
75 > struct logging_entry ConfigLoggingEntry = { 1, 1 };
76   struct ServerStatistics ServerStats;
77   struct timeval SystemTime;
78   struct Client me;             /* That's me */
# Line 184 | Line 178 | set_time(void)
178  
179    if (gettimeofday(&newtime, NULL) == -1)
180    {
181 <    ilog(L_ERROR, "Clock Failure (%s), TS can be corrupted",
181 >    ilog(LOG_TYPE_IRCD, "Clock Failure (%s), TS can be corrupted",
182           strerror(errno));
183      sendto_realops_flags(UMODE_ALL, L_ALL,
184                           "Clock Failure (%s), TS can be corrupted",
# Line 331 | Line 325 | initialize_server_capabs(void)
325    add_capability("QS", CAP_QS, 1);
326    add_capability("EOB", CAP_EOB, 1);
327    add_capability("TS6", CAP_TS6, 0);
334  add_capability("ZIP", CAP_ZIP, 0);
328    add_capability("CLUSTER", CAP_CLUSTER, 1);
329 +  add_capability("SVS", CAP_SVS, 1);
330   #ifdef HALFOPS
331    add_capability("HOPS", CAP_HOPS, 1);
332   #endif
# Line 356 | Line 350 | write_pidfile(const char *filename)
350      size_t nbytes = snprintf(buff, sizeof(buff), "%u\n", pid);
351  
352      if ((fbputs(buff, fb, nbytes) == -1))
353 <      ilog(L_ERROR, "Error writing %u to pid file %s (%s)",
353 >      ilog(LOG_TYPE_IRCD, "Error writing %u to pid file %s (%s)",
354             pid, filename, strerror(errno));
355  
356      fbclose(fb);
# Line 364 | Line 358 | write_pidfile(const char *filename)
358    }
359    else
360    {
361 <    ilog(L_ERROR, "Error opening pid file %s", filename);
361 >    ilog(LOG_TYPE_IRCD, "Error opening pid file %s", filename);
362    }
363   }
364  
# Line 453 | Line 447 | init_ssl(void)
447  
448      fprintf(stderr, "ERROR: Could not initialize the SSL context -- %s\n",
449              s = ERR_lib_error_string(ERR_get_error()));
450 <    ilog(L_CRIT, "ERROR: Could not initialize the SSL context -- %s\n", s);
450 >    ilog(LOG_TYPE_IRCD, "ERROR: Could not initialize the SSL context -- %s\n", s);
451    }
452  
453    SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv2);
# Line 475 | Line 469 | init_callbacks(void)
469   {
470    iorecv_cb = register_callback("iorecv", iorecv_default);
471    iosend_cb = register_callback("iosend", iosend_default);
478  iorecvctrl_cb = register_callback("iorecvctrl", NULL);
479  iosendctrl_cb = register_callback("iosendctrl", NULL);
472   }
473  
474   int
# Line 551 | Line 543 | main(int argc, char *argv[])
543    eventInit();
544    /* We need this to initialise the fd array before anything else */
545    fdlist_init();
546 <  init_log(logFileName);
546 >  log_add_file(LOG_TYPE_IRCD, 0, logFileName);
547    check_can_use_v6();
548    init_comm();         /* This needs to be setup early ! -- adrian */
549    /* Check if there is pidfile and daemon already running */
# Line 580 | Line 572 | main(int argc, char *argv[])
572  
573    if (EmptyString(ServerInfo.sid))
574    {
575 <    ilog(L_CRIT, "ERROR: No server id specified in serverinfo block.");
575 >    ilog(LOG_TYPE_IRCD, "ERROR: No server id specified in serverinfo block.");
576      exit(EXIT_FAILURE);
577    }
578  
# Line 588 | Line 580 | main(int argc, char *argv[])
580  
581    if (EmptyString(ServerInfo.name))
582    {
583 <    ilog(L_CRIT, "ERROR: No server name specified in serverinfo block.");
583 >    ilog(LOG_TYPE_IRCD, "ERROR: No server name specified in serverinfo block.");
584      exit(EXIT_FAILURE);
585    }
586  
# Line 597 | Line 589 | main(int argc, char *argv[])
589    /* serverinfo{} description must exist.  If not, error out.*/
590    if (EmptyString(ServerInfo.description))
591    {
592 <    ilog(L_CRIT, "ERROR: No server description specified in serverinfo block.");
592 >    ilog(LOG_TYPE_IRCD, "ERROR: No server description specified in serverinfo block.");
593      exit(EXIT_FAILURE);
594    }
595  
596    strlcpy(me.info, ServerInfo.description, sizeof(me.info));
597  
598 <  me.from     = &me;
599 <  me.servptr  = &me;
600 <  me.lasttime = me.since = me.firsttime = CurrentTime;
598 >  me.from                   = &me;
599 >  me.servptr                = &me;
600 >  me.localClient->lasttime  = CurrentTime;
601 >  me.localClient->since     = CurrentTime;
602 >  me.localClient->firsttime = CurrentTime;
603  
604    SetMe(&me);
605    make_server(&me);
# Line 618 | Line 612 | main(int argc, char *argv[])
612  
613    if (chdir(MODPATH))
614    {
615 <    ilog(L_CRIT, "Could not load core modules. Terminating!");
615 >    ilog(LOG_TYPE_IRCD, "Could not load core modules. Terminating!");
616      exit(EXIT_FAILURE);
617    }
618  
# Line 641 | Line 635 | main(int argc, char *argv[])
635  
636    write_pidfile(pidFileName);
637  
638 <  ilog(L_NOTICE, "Server Ready");
638 >  ilog(LOG_TYPE_IRCD, "Server Ready");
639  
640    eventAddIsh("cleanup_glines", cleanup_glines, NULL, CLEANUP_GLINES_TIME);
641    eventAddIsh("cleanup_tklines", cleanup_tklines, NULL, CLEANUP_TKLINES_TIME);
# Line 650 | Line 644 | main(int argc, char *argv[])
644    /* No, 'cause after a restart it would cause all sorts of nick collides */
645    eventAddIsh("try_connections", try_connections, NULL, STARTUP_CONNECTIONS_TIME);
646  
653  eventAddIsh("collect_zipstats", collect_zipstats, NULL, ZIPSTATS_TIME);
654
647    /* Setup the timeout check. I'll shift it later :)  -- adrian */
648    eventAddIsh("comm_checktimeouts", comm_checktimeouts, NULL, 1);
649  

Diff Legend

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