Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

signal.c File Reference

#include "services.h"
#include "hash.h"
#include "nickserv.h"
#include "memoserv.h"
#include "infoserv.h"
#include "db.h"
#include "log.h"

Go to the source code of this file.

Functions

void flushLogs (char *)
 Flush services logs.

void checkTusers (char *)
 Check total number of users.

void writeServicesTotals ()
 Write out services.totals.

void sshutdown (int type)
 Shuts down services.

void handler (int sig)
 Signal handler.


Variables

char myname [255]
 Name of services.

char mypass [33]
 Password of services' N-line.

char hostname [255]
 Hostname of services' uplink.

int port
 IRC Port of services' uplink.

int server
 File descriptor of services' connection with the uplink.

Service services [NUMSERVS]
 Array of services and their data... see above for Service struct.

database db
 Database files.

SLogfileoperlog
 Services Log handlers.

SLogfilenicklog
 Services Log handlers.

SLogfilechanlog
 Services Log handlers.

FILE * corelog
 Logfile to record system errors/debug information.

u_long totalusers
 Total online users.

u_long mostusers = 0 mostnicks = 0 mostchans = 0 mostmemos = 0
 Maximum concurrent users.

unsigned long top_akill_stamp
 Highest akill stamp in use.

long startup
 Time services started (now or first time).

long firstup
 Time services started (now or first time).

char * OperServ
 Services nickname constants.

char * NickServ
 Services nickname constants.

char * ChanServ
 Services nickname constants.

char * MemoServ
 Services nickname constants.

char * InfoServ
 Services nickname constants.

char * GameServ
 Services nickname constants.

char * MassServ
char coreBuffer [IRCBUF]
 Used for printing core messages.

u_int AccessLimit = 3 OpLimit = 25 AkickLimit = 30 ChanLimit = 10 NickLimit = 5
 Limits set in services.conf.

time_t CTime
 Current time (UTC), keep this in mind...

time_t nextNsync
 Times (UTC) of next syncs.

time_t nextCsync
 Times (UTC) of next syncs.

time_t nextMsync
 Times (UTC) of next syncs.


Detailed Description

Signal and other handlers

Definition in file signal.c.


Function Documentation

void checkTusers char *   ) 
 

Check total number of users.

Checks the total number of users to see if a change to the network PLUS-L-CHANNEL mode is necessary to take into account a new maximum number of concurrent connections.

Definition at line 122 of file signal.c.

References checkTusers(), mostusers, OperServ, sSend(), and timer().

Referenced by checkTusers(), and parseLine().

void flushLogs char *   ) 
 

Flush services logs.

Performs a 'flush' on the log files resulting in any new services log messages being written to disk

Definition at line 103 of file signal.c.

References corelog, SLogfile::flush(), flushLogs(), and timer().

Referenced by ConnectToServer(), and parseLine().

void handler int  sig  ) 
 

Signal handler.

Bug:
XXXMLG probably not QUITE right

Definition at line 216 of file signal.c.

References coreBuffer, corelog, dlogDump(), logDump(), sSend(), sshutdown(), and timed_akill_queue().

Referenced by main().

void sshutdown int  type  ) 
 

Shuts down services.

Parameters:
type specifies type of shutdown (fatal error, normal exit, etc)

Bug:
XXXMLG This needs to be done better... I suggest #defines for the various things we want this function to do (save data, send message, etc) and then use something like: sshutdown(SHUTDOWN_SAVE | SHUTDOWN_MSG, "This is the message");

Definition at line 165 of file signal.c.

References saveakills(), saveInfoData(), saveMemoData(), saveNickData(), sSend(), syncChanData(), timed_akill_queue(), VERSION_NUM, and writeServicesTotals().

Referenced by breakLine(), ConnectToServer(), handler(), main(), oalloc(), parseLine(), readChanData(), readConf(), readInfoData(), readMemoData(), readNickData(), sSend(), and unexpected_eof().

void writeServicesTotals  ) 
 

Write out services.totals.

Save services' statistical/total info Also, save top serial numbers and other important info

Definition at line 142 of file signal.c.

References mostchans, mostmemos, mostnicks, mostusers, and top_akill_stamp.

Referenced by sshutdown(), and sync_cfg().


Variable Documentation

unsigned long top_akill_stamp
 

Highest akill stamp in use.

Todo:
Highest stamp should save to services.totals

Definition at line 85 of file signal.c.

Referenced by addakill(), loadakills(), main(), and writeServicesTotals().


Generated at Sat Oct 25 20:56:12 2003 for Services using Doxygen.
Services Copyr. 1996-2001 Chip Norkus, Max Byrd, Greg Poma, Michael Graff, James Hess, Dafydd James. All rights reserved See LICENSE for licensing information.